Skip to content

Commit

Permalink
Re pjsip#2054: When setting CXXCFLAGS manually, make sure it's applie…
Browse files Browse the repository at this point in the history
…d correctly.

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5679 74dad513-b988-da41-8d7b-12977e46ad98
  • Loading branch information
trengginas committed Nov 1, 2017
1 parent 8438c3e commit eb4d878
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
18 changes: 13 additions & 5 deletions aconfigure
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
Expand Down Expand Up @@ -882,6 +883,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
Expand Down Expand Up @@ -1134,6 +1136,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;

-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;

-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
Expand Down Expand Up @@ -1271,7 +1282,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
Expand Down Expand Up @@ -1424,6 +1435,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
Expand Down Expand Up @@ -2586,12 +2598,8 @@ ac_config_files="$ac_config_files build.mak build/os-auto.mak build/cc-auto.mak

if test "$CFLAGS" = ""; then
CFLAGS="-O2"
else
CFLAGS="$CFLAGS"
fi

CXXFLAGS="$CFLAGS $CXXFLAGS"

ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Expand Down
4 changes: 0 additions & 4 deletions aconfigure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@ dnl Setup default CFLAGS
dnl
if test "$CFLAGS" = ""; then
CFLAGS="-O2"
else
CFLAGS="$CFLAGS"
fi

CXXFLAGS="$CFLAGS $CXXFLAGS"

dnl #
dnl # Configure tools
dnl #
Expand Down
6 changes: 3 additions & 3 deletions build.mak.in
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export APP_CFLAGS := -DPJ_AUTOCONF=1\
-I$(PJDIR)/pjnath/include\
-I$(PJDIR)/pjmedia/include\
-I$(PJDIR)/pjsip/include
export APP_CXXFLAGS := $(APP_CFLAGS)
export APP_CXXFLAGS := @CXXFLAGS@ $(APP_CFLAGS)
export APP_LDFLAGS := -L$(PJDIR)/pjlib/lib\
-L$(PJDIR)/pjlib-util/lib\
-L$(PJDIR)/pjnath/lib\
Expand Down Expand Up @@ -314,6 +314,6 @@ export PJ_LIBXX_FILES := $(APP_LIBXX_FILES)
export PJ_INSTALL_DIR := @prefix@
export PJ_INSTALL_INC_DIR := @includedir@
export PJ_INSTALL_LIB_DIR := @libdir@
export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @CFLAGS@
export PJ_INSTALL_CXXFLAGS := $(PJ_INSTALL_CFLAGS)
export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @CFLAGS@
export PJ_INSTALL_CXXFLAGS := @CXXFLAGS@ $(PJ_INSTALL_CFLAGS)
export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDLIBS)
2 changes: 1 addition & 1 deletion pjsip-apps/build/Footprint.mak
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include ../../build/common.mak
# Gather all flags.
#
export _CFLAGS := $(APP_CFLAGS) $(CFLAGS)
export _CXXFLAGS:= $(_CFLAGS)
export _CXXFLAGS:= $(APP_CXXFLAGS) $(CXXFLAGS)

export _LDFLAGS := $(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS)

Expand Down
4 changes: 2 additions & 2 deletions pjsip/build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export PJSUA2_LIB_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \
account.o endpoint.o json.o persistent.o types.o \
siptypes.o call.o presence.o media.o
export PJSUA2_LIB_CFLAGS += $(_CFLAGS) $(PJ_VIDEO_CFLAGS)
export PJSUA2_LIB_CXXFLAGS = $(PJSUA2_LIB_CFLAGS)
export PJSUA2_LIB_CXXFLAGS = $(_CXXFLAGS) $(PJSUA2_LIB_CFLAGS)
export PJSUA2_LIB_LDFLAGS += $(PJSUA_LIB_LDLIB) \
$(PJSIP_UA_LDLIB) \
$(PJSIP_SIMPLE_LDLIB) \
Expand All @@ -163,7 +163,7 @@ export PJSUA2_TEST_SRCDIR = ../src/pjsua2-test
export PJSUA2_TEST_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \
main.o
export PJSUA2_TEST_CFLAGS += $(_CFLAGS) $(PJ_VIDEO_CFLAGS)
export PJSUA2_TEST_CXXFLAGS = $(PJSUA2_LIB_CFLAGS)
export PJSUA2_TEST_CXXFLAGS = $(_CXXFLAGS) $(PJSUA2_LIB_CFLAGS)
export PJSUA2_TEST_LDFLAGS += $(PJ_LDXXFLAGS) $(PJ_LDXXLIBS) $(LDFLAGS)
export PJSUA2_TEST_EXE := pjsua2-test-$(TARGET_NAME)$(HOST_EXE)

Expand Down
2 changes: 1 addition & 1 deletion tests/pjsua/tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CC = $(APP_CC)
LDFLAGS = $(APP_LDFLAGS)
LDLIBS = $(APP_LDLIBS)
CFLAGS = $(APP_CFLAGS)
CPPFLAGS= ${CFLAGS}
CPPFLAGS= $(APP_CXXFLAGS)

# If your application is in a file named myapp.cpp or myapp.c
# # this is the line you will need to build the binary.
Expand Down

0 comments on commit eb4d878

Please sign in to comment.