Merged revisions 43996-43997,44008,44011-44012 via svnmerge from
authorKevin P. Fleming <kpfleming@digium.com>
Fri, 29 Sep 2006 18:54:21 +0000 (18:54 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Fri, 29 Sep 2006 18:54:21 +0000 (18:54 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r43996 | kpfleming | 2006-09-29 11:47:05 -0500 (Fri, 29 Sep 2006) | 2 lines

another cross-compile fix

........
r43997 | kpfleming | 2006-09-29 11:52:27 -0500 (Fri, 29 Sep 2006) | 2 lines

support --without-curl in configure script

........
r44008 | kpfleming | 2006-09-29 13:25:49 -0500 (Fri, 29 Sep 2006) | 2 lines

don't abuse CFLAGS and LDFLAGS for build of Asterisk components, because they are also then used for non-Asterisk components (like menuselect); use our own variables instead

........
r44011 | kpfleming | 2006-09-29 13:40:17 -0500 (Fri, 29 Sep 2006) | 2 lines

missed one conversion to ASTCFLAGS

........
r44012 | kpfleming | 2006-09-29 13:49:07 -0500 (Fri, 29 Sep 2006) | 2 lines

yet another place where we were not using the correct CFLAGS by default

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44013 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 files changed:
Makefile
Makefile.moddir_rules
Makefile.rules
channels/Makefile
codecs/Makefile
codecs/gsm/Makefile
configure
configure.ac
include/asterisk/autoconfig.h.in
main/Makefile
main/db1-ast/Makefile
pbx/Makefile
utils/Makefile

index 0644752..b38133a 100644 (file)
--- a/Makefile
+++ b/Makefile
 
 # All Makefiles use the following variables:
 #
-# LDFLAGS - linker flags (not libraries), used for all links
+# ASTCFLAGS - compiler options
+# ASTLDFLAGS - linker flags (not libraries)
 # LIBS - additional libraries, at top-level for all links,
 #      on a single object just for that object
 # SOLINK - linker flags used only for creating shared objects (.so files),
 #      used for all .so links
 #
-
-.EXPORT_ALL_VARIABLES:
+# Default values fo ASTCFLAGS and ASTLDFLAGS can be specified in the
+# environment when running make, as follows:
+#
+# $ ASTCFLAGS="-Werror" make
+
+export ASTTOPDIR
+export ASTERISKVERSION
+export ASTERISKVERSIONNUM
+export INSTALL_PATH
+export ASTETCDIR
+export ASTVARRUNDIR
+export MODULES_DIR
+export ASTSPOOLDIR
+export ASTVARLIBDIR
+export ASTDATADIR
+export ASTLOGDIR
+export AGI_DIR
+export ASTCONFPATH
+export NOISY_BUILD
+export MENUSELECT_CFLAGS
+export CC
+export CXX
+export AR
+export RANLIB
+export HOST_CC
+export STATIC_BUILD
+export INSTALL
+export DESTDIR
+export PROC
+export SOLINK
 
 # even though we could use '-include makeopts' here, use a wildcard
 # lookup anyway, so that make won't try to build makeopts if it doesn't
@@ -92,8 +121,6 @@ HTTP_DOCSDIR=/var/www/html
 # Determine by a grep 'ScriptAlias' of your Apache httpd.conf file
 HTTP_CGIDIR=/var/www/cgi-bin
 
-ASTCFLAGS=
-
 # Uncomment this to use the older DSP routines
 #ASTCFLAGS+=-DOLD_DSP_ROUTINES
 
@@ -275,10 +302,10 @@ $(SUBDIRS): depend makeopts.embed_rules
 main: $(filter-out main,$(MOD_SUBDIRS))
 
 $(MOD_SUBDIRS):
-       @CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $@ SUBDIR=$@ all
+       @ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(MAKE) --no-print-directory -C $@ SUBDIR=$@ all
 
 $(OTHER_SUBDIRS):
-       @CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $@ SUBDIR=$@ all
+       @ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(MAKE) --no-print-directory -C $@ SUBDIR=$@ all
 
 defaults.h: makeopts
        @build_tools/make_defaults_h > $@.tmp
@@ -588,10 +615,10 @@ config:
        fi
 
 $(MOD_SUBDIRS_DEPEND):
-       @CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $(@:-depend=) depend
+       @ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" $(MAKE) --no-print-directory -C $(@:-depend=) depend
 
 $(OTHER_SUBDIRS_DEPEND):
-       @CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $(@:-depend=) depend
+       @ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(ASTCFLAGS)" $(MAKE) --no-print-directory -C $(@:-depend=) depend
 
 depend: include/asterisk/version.h include/asterisk/buildopts.h defaults.h $(SUBDIRS_DEPEND)
 
@@ -646,7 +673,7 @@ menuselect: menuselect/menuselect menuselect-tree
        -@menuselect/menuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
 
 menuselect/menuselect: makeopts menuselect/menuselect.c menuselect/menuselect_curses.c menuselect/menuselect_stub.c menuselect/menuselect.h menuselect/linkedlists.h makeopts
-       @unset CC LD AR RANLIB CFLAGS LDFLAGS && $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
+       @unset CC LD AR RANLIB && $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
 
 menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml build_tools/embed_modules.xml
        @echo "Generating input for menuselect ..."
index 5f60470..2144e50 100644 (file)
 #
 
 ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),)
-  CFLAGS+=-include $(ASTTOPDIR)/include/asterisk/astmm.h
+  ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/astmm.h
 endif
 
 ifeq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
-  CFLAGS+=${GC_CFLAGS}
+  ASTCFLAGS+=${GC_CFLAGS}
 endif
 
 ifneq ($(findstring STATIC_BUILD,$(MENUSELECT_CFLAGS)),)
@@ -29,14 +29,14 @@ comma:=,
 
 define module_o_template
 $(2): $(3)
-$(2): CFLAGS+=-DAST_MODULE=\"$(1)\" $$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
+$(2): ASTCFLAGS+=-DAST_MODULE=\"$(1)\" $$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
 endef
 
 define module_so_template
 $(1)=$(1).so
-$(1).so: CFLAGS+=-fPIC
+$(1).so: ASTCFLAGS+=-fPIC
 $(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
-$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
+$(1).so: ASTLDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
 $(1).so: $(2)
 endef
 
@@ -102,4 +102,4 @@ endif
 depend: .depend
 
 .depend:
-       ../build_tools/mkdep $(CFLAGS) `ls *.c *.cc 2> /dev/null`
+       ../build_tools/mkdep $(ASTCFLAGS) `ls *.c *.cc 2> /dev/null`
index b179ae6..cdad748 100644 (file)
@@ -33,19 +33,19 @@ ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)),)
 #K6OPT=-DK6OPT
 
 OPTIMIZE?=-O6
-CFLAGS+=$(OPTIMIZE)
+ASTCFLAGS+=$(OPTIMIZE)
 endif
 
 define ast_make_o_c
 $(1): $(2)
        $(ECHO_PREFIX) echo "   [CC] $$< -> $$@"
-       $(CMD_PREFIX) $$(CC) -o $$@ -c $$< $$(CFLAGS)
+       $(CMD_PREFIX) $$(CC) -o $$@ -c $$< $$(ASTCFLAGS)
 endef
 
 define ast_make_oo_cc
 $(1): $(2)
        $(ECHO_PREFIX) echo "   [CXX] $$< -> $$@"
-       $(CMD_PREFIX) $$(CXX) -o $$@ -c $$< $$(CFLAGS)
+       $(CMD_PREFIX) $$(CXX) -o $$@ -c $$< $$(ASTCFLAGS)
 endef
 
 define ast_make_c_y
@@ -63,13 +63,13 @@ endef
 define ast_make_so_o
 $(1): $(2)
        $(ECHO_PREFIX) echo "   [LD] $$^ -> $$@"
-       $(CMD_PREFIX) $$(CC) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
+       $(CMD_PREFIX) $$(CC) $$(STATIC_BUILD) -o $$@ $$(ASTLDFLAGS) $$(SOLINK) $$^ $$(LIBS)
 endef
 
 define ast_make_so_oo
 $(1): $(2)
        $(ECHO_PREFIX) echo "   [LDXX] $$^ -> $$@"
-       $(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
+       $(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(ASTLDFLAGS) $$(SOLINK) $$^ $$(LIBS)
 endef
 
 define ast_make_a_o
@@ -82,13 +82,13 @@ endef
 define ast_make_final
 $(1): $(2)
        $(ECHO_PREFIX) echo "   [LD] $$^ -> $$@"
-       $(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
+       $(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(ASTLDFLAGS) $$^ $$(LIBS)
 endef
 
 define ast_make_final_host
 $(1): $(2)
        $(ECHO_PREFIX) echo "   [LD] $$^ -> $$@"
-       $(CMD_PREFIX) $$(HOST_CC) $$(STATIC_BUILD) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
+       $(CMD_PREFIX) $$(HOST_CC) $$(STATIC_BUILD) -o $$@ $$(HOST_CFLAGS) $$(HOST_LDFLAGS) $$^ $$(LIBS)
 endef
 
 $(eval $(call ast_make_o_c,%.o,%.c))
index b5f55a3..6c10010 100644 (file)
@@ -65,7 +65,7 @@ clean::
 
 ifneq ($(wildcard h323/Makefile.ast),)
   include h323/Makefile.ast
-H323LDFLAGS += -Wl,--version-script=h323/noexport.map
+H323LDFLAGS+=-Wl,--version-script=h323/noexport.map
 clean::
        $(MAKE) -C h323 clean
 else
@@ -105,8 +105,8 @@ chan_h323.so: chan_h323.o h323/libchanh323.a
        $(CMD_PREFIX) $(CXX) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
 endif
 
-chan_misdn.o: CFLAGS+=-Imisdn 
+chan_misdn.o: ASTCFLAGS+=-Imisdn 
 
-misdn_config.o: CFLAGS+=-Imisdn 
+misdn_config.o: ASTCFLAGS+=-Imisdn 
 
 $(chan_misdn): chan_misdn.o misdn_config.o misdn/isdn_lib.o misdn/isdn_msg_parser.o
index cdc581d..8996ad4 100644 (file)
@@ -42,14 +42,14 @@ clean::
 
 gsm/lib/libgsm.a:
        @mkdir -p gsm/lib
-       @CFLAGS="$(OTHER_SUBDIR_CFLAGS) -I." $(MAKE) -C gsm lib/libgsm.a
+       @$(MAKE) -C gsm lib/libgsm.a
 
 $(LIBLPC10):
-       @CFLAGS="$(OTHER_SUBDIR_CFLAGS)" $(MAKE) -C lpc10 all
+       @$(MAKE) -C lpc10 all
 
 $(codec_lpc10): $(LIBLPC10)
 
 $(LIBILBC):
-       @CFLAGS="$(OTHER_SUBDIR_CFLAGS)" $(MAKE) -C ilbc all
+       @$(MAKE) -C ilbc all
 
 $(codec_ilbc): $(LIBILBC)
index 036bb53..ba3a200 100644 (file)
@@ -72,7 +72,6 @@ PG =
 # CCFLAGS      = -c -O
 
 CCFLAGS        += -c -DNeedFunctionPrototypes=1 -funroll-loops $(OPTIMIZE)
-CCFLAGS   += -fPIC
 
 # LD           = gcc
 # LDFLAGS      =
@@ -155,7 +154,7 @@ INC = $(ROOT)/inc
 DEBUG  = -DNDEBUG
 ######### Remove -DNDEBUG to enable assertions.
 
-CFLAGS += $(PG) $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) \
+ASTCFLAGS += $(PG) $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) \
        $(LTP_CUT) $(WAV49) $(K6OPT) $(CCINC) -I$(INC)
 ######### It's $(CC) $(CFLAGS)
 
@@ -319,10 +318,6 @@ TOAST_INSTALL_TARGETS =    \
 
 # Default rules
 
-.c.o:
-               $(CC) $(CFLAGS:-Werror=) $?
-               @-mv `$(BASENAME) $@` $@ > /dev/null 2>&1
-
 include $(ASTTOPDIR)/Makefile.rules
 
 # Target rules
index 30713ba..72667e9 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 43427 .
+# From configure.ac Revision: 43830 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.60a.
 #
@@ -694,6 +694,9 @@ PBX_ALSA
 CAP_LIB
 CAP_INCLUDE
 PBX_CAP
+CURL_LIB
+CURL_INCLUDE
+PBX_CURL
 CURSES_LIB
 CURSES_INCLUDE
 PBX_CURSES
@@ -832,9 +835,6 @@ PBX_GTK
 GTK_INCLUDE
 GTK_LIB
 CURL
-PBX_CURL
-CURL_INCLUDE
-CURL_LIB
 LTLIBOBJS'
 ac_subst_files=''
       ac_precious_vars='build_alias
@@ -1429,6 +1429,7 @@ Optional Packages:
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-asound=PATH      use Advanced Linux Sound Architecture files in PATH
   --with-cap=PATH         use POSIX 1.e capabilities files in PATH
+  --with-curl=PATH        use cURL files in PATH
   --with-curses=PATH      use curses files in PATH
   --with-gnutls=PATH      use GNU TLS support (used for iksemel only) files in
                           PATH
@@ -5422,6 +5423,33 @@ PBX_CAP=0
 
 
 
+CURL_DESCRIP="cURL"
+CURL_OPTION="curl"
+
+# Check whether --with-curl was given.
+if test "${with_curl+set}" = set; then
+  withval=$with_curl;
+case ${withval} in
+     n|no)
+     USE_CURL=no
+     ;;
+     y|ye|yes)
+     CURL_MANDATORY="yes"
+     ;;
+     *)
+     CURL_DIR="${withval}"
+     CURL_MANDATORY="yes"
+     ;;
+esac
+
+fi
+
+PBX_CURL=0
+
+
+
+
+
 CURSES_DESCRIP="curses"
 CURSES_OPTION="curses"
 
@@ -31436,8 +31464,8 @@ fi
 
 
 
-PBX_CURL=0
-if test -n "$ac_tool_prefix"; then
+if test "${USE_CURL}" != "no"; then
+   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}curl-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}curl-config; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -31539,36 +31567,34 @@ else
   CURL="$ac_cv_path_CURL"
 fi
 
-if test ! x"${CURL}" = xNo; then
-# check for version
-   if test "${host_os}" = "SunOS"; then
-      if [ 0x`curl-config --vernum` -ge 0x70907 ]; then
-         CURL_INCLUDE=$(${CURL} --cflags)
-         CURL_LIB=$(${CURL} --libs)
-         PBX_CURL=1
+   if test ! x"${CURL}" = xNo; then
+   # check for version
+      if test "${host_os}" = "SunOS"; then
+            if [ 0x`curl-config --vernum` -ge 0x70907 ]; then
+               CURL_INCLUDE=$(${CURL} --cflags)
+               CURL_LIB=$(${CURL} --libs)
+               PBX_CURL=1
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_CURL 1
 _ACEOF
 
-      fi
-   else
-      if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
-         CURL_INCLUDE=$(${CURL} --cflags)
-         CURL_LIB=$(${CURL} --libs)
-         PBX_CURL=1
+           fi
+        else
+           if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
+               CURL_INCLUDE=$(${CURL} --cflags)
+               CURL_LIB=$(${CURL} --libs)
+               PBX_CURL=1
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_CURL 1
 _ACEOF
 
-      fi
-   fi
+           fi
+       fi
+    fi
 fi
 
-
-
-
 ac_config_files="$ac_config_files build_tools/menuselect-deps makeopts channels/h323/Makefile"
 
 cat >confcache <<\_ACEOF
@@ -32268,11 +32294,11 @@ PBX_ALSA!$PBX_ALSA$ac_delim
 CAP_LIB!$CAP_LIB$ac_delim
 CAP_INCLUDE!$CAP_INCLUDE$ac_delim
 PBX_CAP!$PBX_CAP$ac_delim
+CURL_LIB!$CURL_LIB$ac_delim
+CURL_INCLUDE!$CURL_INCLUDE$ac_delim
+PBX_CURL!$PBX_CURL$ac_delim
 CURSES_LIB!$CURSES_LIB$ac_delim
 CURSES_INCLUDE!$CURSES_INCLUDE$ac_delim
-PBX_CURSES!$PBX_CURSES$ac_delim
-GNUTLS_LIB!$GNUTLS_LIB$ac_delim
-GNUTLS_INCLUDE!$GNUTLS_INCLUDE$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -32314,6 +32340,9 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+PBX_CURSES!$PBX_CURSES$ac_delim
+GNUTLS_LIB!$GNUTLS_LIB$ac_delim
+GNUTLS_INCLUDE!$GNUTLS_INCLUDE$ac_delim
 PBX_GNUTLS!$PBX_GNUTLS$ac_delim
 GSM_LIB!$GSM_LIB$ac_delim
 GSM_INCLUDE!$GSM_INCLUDE$ac_delim
@@ -32408,9 +32437,6 @@ PBX_TONEZONE!$PBX_TONEZONE$ac_delim
 VORBIS_LIB!$VORBIS_LIB$ac_delim
 VORBIS_INCLUDE!$VORBIS_INCLUDE$ac_delim
 PBX_VORBIS!$PBX_VORBIS$ac_delim
-VPB_LIB!$VPB_LIB$ac_delim
-VPB_INCLUDE!$VPB_INCLUDE$ac_delim
-PBX_VPB!$PBX_VPB$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -32452,6 +32478,9 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+VPB_LIB!$VPB_LIB$ac_delim
+VPB_INCLUDE!$VPB_INCLUDE$ac_delim
+PBX_VPB!$PBX_VPB$ac_delim
 ZLIB_LIB!$ZLIB_LIB$ac_delim
 ZLIB_INCLUDE!$ZLIB_INCLUDE$ac_delim
 PBX_ZLIB!$PBX_ZLIB$ac_delim
@@ -32488,9 +32517,6 @@ PBX_GTK!$PBX_GTK$ac_delim
 GTK_INCLUDE!$GTK_INCLUDE$ac_delim
 GTK_LIB!$GTK_LIB$ac_delim
 CURL!$CURL$ac_delim
-PBX_CURL!$PBX_CURL$ac_delim
-CURL_INCLUDE!$CURL_INCLUDE$ac_delim
-CURL_LIB!$CURL_LIB$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
index e23ab23..c64d37e 100644 (file)
@@ -176,6 +176,7 @@ AC_SUBST(AST_DEVMODE)
 
 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
 AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
+AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
@@ -997,29 +998,27 @@ AC_SUBST(PBX_GTK)
 AC_SUBST(GTK_INCLUDE)
 AC_SUBST(GTK_LIB)
 
-PBX_CURL=0
-AC_PATH_TOOL([CURL], [curl-config], No)
-if test ! x"${CURL}" = xNo; then
-# check for version
-   if test "${host_os}" = "SunOS"; then
-      if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
-         CURL_INCLUDE=$(${CURL} --cflags)
-         CURL_LIB=$(${CURL} --libs)
-         PBX_CURL=1
-         AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
-      fi
-   else
-      if [[[ 0x`curl-config --vernum` -ge 0x70907 ]]]; then
-         CURL_INCLUDE=$(${CURL} --cflags)
-         CURL_LIB=$(${CURL} --libs)
-         PBX_CURL=1
-         AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
-      fi
-   fi
+if test "${USE_CURL}" != "no"; then
+   AC_PATH_TOOL([CURL], [curl-config], No)
+   if test ! x"${CURL}" = xNo; then
+   # check for version
+      if test "${host_os}" = "SunOS"; then
+            if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
+               CURL_INCLUDE=$(${CURL} --cflags)
+               CURL_LIB=$(${CURL} --libs)
+               PBX_CURL=1
+               AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
+           fi
+        else
+           if [[[ 0x`curl-config --vernum` -ge 0x70907 ]]]; then
+               CURL_INCLUDE=$(${CURL} --cflags)
+               CURL_LIB=$(${CURL} --libs)
+               PBX_CURL=1
+               AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
+           fi
+       fi
+    fi
 fi
-AC_SUBST(PBX_CURL)
-AC_SUBST(CURL_INCLUDE)
-AC_SUBST(CURL_LIB)
 
 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
 AC_OUTPUT
index 4d1a86b..d57315d 100644 (file)
@@ -62,6 +62,9 @@
 /* Define to 1 if you have the `bzero' function. */
 #undef HAVE_BZERO
 
+/* Define to indicate the ${CAP_DESCRIP} library */
+#undef HAVE_CAP
+
 /* Define to 1 if your system has a working `chown' function. */
 #undef HAVE_CHOWN
 
index dfd4827..4432916 100644 (file)
@@ -93,11 +93,11 @@ ifeq ($(OSARCH),SunOS)
 endif
 
 editline/libedit.a:
-       cd editline && unset CFLAGS AST_LIBS && test -f config.h || CFLAGS="$(OPTIMIZE)" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)
+       cd editline && test -f config.h || CFLAGS="$(ASTCFLAGS)" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)
        $(MAKE) -C editline libedit.a
 
 db1-ast/libdb1.a:
-       CFLAGS="$(ASTCFLAGS)" $(MAKE) -C db1-ast libdb1.a
+       CFLAGS="$(ASTCFLAGS)" LDFLAGS="$(ASTLDFLAGS)" $(MAKE) -C db1-ast libdb1.a
 
 ast_expr2.c ast_expr2.h:
        bison -o $@ -d --name-prefix=ast_yy ast_expr2.y
@@ -111,7 +111,7 @@ testexpr2: ast_expr2f.c ast_expr2.c ast_expr2.h
        $(CC) -g -o testexpr2 ast_expr2f.o ast_expr2.o
        rm ast_expr2.o ast_expr2f.o 
 
-channel.o: CFLAGS+=$(ZAPTEL_INCLUDE)
+channel.o: ASTCFLAGS+=$(ZAPTEL_INCLUDE)
 
 AST_EMBED_LDSCRIPTS:=$(sort $(EMBED_LDSCRIPTS))
 AST_EMBED_LDFLAGS:=$(foreach dep,$(EMBED_LDFLAGS),$(value $(dep)))
@@ -131,9 +131,9 @@ asterisk: $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS)
                mv $(ASTTOPDIR)/include/asterisk/build.h.tmp $(ASTTOPDIR)/include/asterisk/build.h ; \
        fi
        @rm -f $(ASTTOPDIR)/include/asterisk/build.h.tmp
-       @$(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
+       @$(CC) -c -o buildinfo.o $(ASTCFLAGS) buildinfo.c
        $(ECHO_PREFIX) echo "   [LD] $^ -> $@"
-       $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(LDFLAGS) $(H323LDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS)
+       $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS)
        @$(ASTTOPDIR)/build_tools/strip_nonapi $@
 
 clean::
index 3e5a6fb..4fb92fc 100644 (file)
@@ -10,7 +10,7 @@ endif
 #Added support for UltraSparc - Belgarath
 ifeq ($(ARCH),sparc64)
 PROC=ultrasparc
-CFLAGS += -mtune=$(PROC) -pipe -fomit-frame-pointer -mcpu=v8
+ASTCFLAGS += -mtune=$(PROC) -pipe -fomit-frame-pointer -mcpu=v8
 endif
 
 ifeq ($(OSARCH),Darwin)
@@ -50,11 +50,11 @@ clean-depend:
 clean:
        rm -f $(LIBDB) $(LIBDBSO) $(OBJS) $(SHOBJS)
 
-CFLAGS+=-Wall -D__DBINTERFACE_PRIVATE -I. -I.. -Iinclude -Ihash -Ibtree -Irecno
+ASTCFLAGS+=-Wall -D__DBINTERFACE_PRIVATE -I. -I.. -Iinclude -Ihash -Ibtree -Irecno
 
 OSTYPE=$(shell uname -s)
 ifeq ($(OSTYPE),SunOS)
-CFLAGS+=-I../../include -I../../include/solaris-compat -DSOLARIS
+ASTCFLAGS+=-I../../include -I../../include/solaris-compat -DSOLARIS
 endif
 
 db_dump185.o: db_dump185.c
index 056e204..43812f1 100644 (file)
@@ -29,10 +29,10 @@ clean::
        rm -f ael/*.o
 
 $(eval $(call ast_make_o_c,ael/aelflex.o,ael/ael_lex.c ../include/asterisk/ael_structs.h ael/ael.tab.h))
-ael/aelflex.o: CFLAGS+=-I.
+ael/aelflex.o: ASTCFLAGS+=-I.
 
 $(eval $(call ast_make_o_c,ael/aelbison.o,ael/ael.tab.c ael/ael.tab.h ../include/asterisk/ael_structs.h))
-ael/aelbison.o: CFLAGS+=-I.
+ael/aelbison.o: ASTCFLAGS+=-I.
 
 $(pbx_ael): ael/aelbison.o ael/aelflex.o
 
@@ -43,6 +43,6 @@ ael/ael.tab.c ael/ael.tab.h:
        (cd ael; bison -v -d ael.y)
 
 dundi-parser.o: dundi-parser.h
-dundi-parser.o: CFLAGS+=-I.
+dundi-parser.o: ASTCFLAGS+=-I.
 
 $(pbx_dundi): dundi-parser.o
index 084a01a..5e5bdca 100644 (file)
@@ -71,18 +71,18 @@ $(eval $(call ast_make_o_c,strcompat.o,../main/strcompat.c))
 $(eval $(call ast_make_o_c,ast_expr2.o,../main/ast_expr2.c))
 
 $(eval $(call ast_make_o_c,ast_expr2f.o,../main/ast_expr2f.c))
-ast_expr2f.o: CFLAGS+=-DSTANDALONE_AEL
+ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE_AEL
 
 $(eval $(call ast_make_final,check_expr,check_expr.c ast_expr2.o ast_expr2f.o))
 
 $(eval $(call ast_make_o_c,aelflex.o,../pbx/ael/ael_lex.c ../include/asterisk/ael_structs.h ../pbx/ael/ael.tab.h))
-aelflex.o: CFLAGS+=-I../pbx -DSTANDALONE_AEL
+aelflex.o: ASTCFLAGS+=-I../pbx -DSTANDALONE_AEL
 
 $(eval $(call ast_make_o_c,aelbison.o,../pbx/ael/ael.tab.c ../pbx/ael/ael.tab.h ../include/asterisk/ael_structs.h))
-aelbison.o: CFLAGS+=-I../pbx
+aelbison.o: ASTCFLAGS+=-I../pbx
 
 $(eval $(call ast_make_o_c,pbx_ael.o,../pbx/pbx_ael.c))
-pbx_ael.o: CFLAGS+=-DSTANDALONE_AEL
+pbx_ael.o: ASTCFLAGS+=-DSTANDALONE_AEL
 
 $(eval $(call ast_make_final,aelparse,aelflex.o aelbison.o pbx_ael.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o))
 
@@ -110,4 +110,4 @@ endif
 depend: .depend
 
 .depend:
-       ../build_tools/mkdep $(CFLAGS) `ls *.c`
+       ../build_tools/mkdep $(ASTCFLAGS) `ls *.c`