@ -13,18 +13,24 @@
# All Makefiles use the following variables:
#
# ASTCFLAGS - compiler options
# ASTLDFLAGS - linker flags (not libraries)
# ASTCFLAGS - compiler options provided by the user (if any)
# _ASTCFLAGS - compiler options provided by the build system
# ASTLDFLAGS - linker flags (not libraries) provided by the user (if any)
# _ASTLDFLAGS - linker flags (not libraries) provided by the build system
# AST_LIBS - libraries to build binaries XXX
# 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
#
# Default values fo ASTCFLAGS and ASTLDFLAGS can be specified in the
# Values for ASTCFLAGS and ASTLDFLAGS can be specified in the
# environment when running make, as follows:
#
# $ ASTCFLAGS="-Werror" make
# $ ASTCFLAGS="-Werror" make ...
#
# or as a variable value on the make command line itself:
#
# $ make ASTCFLAGS="-Werror" ...
export ASTTOPDIR
export ASTERISKVERSION
@ -150,7 +156,7 @@ HTTP_DOCSDIR=/var/www/html
HTTP_CGIDIR = /var/www/cgi-bin
# Uncomment this to use the older DSP routines
# ASTCFLAGS+=-DOLD_DSP_ROUTINES
# _ ASTCFLAGS+=-DOLD_DSP_ROUTINES
# If the file .asterisk.makeopts is present in your home directory, you can
# include all of your favorite menuselect options so that every time you download
@ -197,53 +203,53 @@ ifeq ($(OSARCH),linux-gnu)
endif
e n d i f
i f e q ( $( findstring -save -temps ,$ ( ASTCFLAGS) ) , )
ASTCFLAGS+= -pipe
i f e q ( $( findstring -save -temps ,$ ( _ASTCFLAGS) $ ( ASTCFLAGS) ) , )
_ ASTCFLAGS+= -pipe
e n d i f
ASTCFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $( DEBUG)
_ ASTCFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $( DEBUG)
i f e q ( $( AST_DEVMODE ) , y e s )
ASTCFLAGS+= -Werror
ASTCFLAGS+= -Wunused
ASTCFLAGS+= $( AST_DECLARATION_AFTER_STATEMENT)
ASTCFLAGS+= $( AST_FORTIFY_SOURCE)
# ASTCFLAGS+=-Wundef
ASTCFLAGS+= -Wformat -Wformat-security
ASTCFLAGS+= -Wmissing-format-attribute
# ASTCFLAGS+=-Wformat=2
_ ASTCFLAGS+= -Werror
_ ASTCFLAGS+= -Wunused
_ ASTCFLAGS+= $( AST_DECLARATION_AFTER_STATEMENT)
_ ASTCFLAGS+= $( AST_FORTIFY_SOURCE)
# _ ASTCFLAGS+=-Wundef
_ ASTCFLAGS+= -Wformat -Wformat-security
_ ASTCFLAGS+= -Wmissing-format-attribute
# _ ASTCFLAGS+=-Wformat=2
e n d i f
i f n e q ( $( findstring BSD ,$ ( OSARCH ) ) , )
ASTCFLAGS+= -I/usr/local/include
ASTLDFLAGS+= -L/usr/local/lib
_ ASTCFLAGS+= -I/usr/local/include
_ ASTLDFLAGS+= -L/usr/local/lib
e n d i f
i f n e q ( $( PROC ) , u l t r a s p a r c )
ASTCFLAGS+= $( shell if $( CC) -march= $( PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>& 1; then echo " -march= $( PROC) " ; fi )
_ ASTCFLAGS+= $( shell if $( CC) -march= $( PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>& 1; then echo " -march= $( PROC) " ; fi )
e n d i f
i f e q ( $( PROC ) , p p c )
ASTCFLAGS+= -fsigned-char
_ ASTCFLAGS+= -fsigned-char
e n d i f
i f e q ( $( OSARCH ) , F r e e B S D )
# -V is understood by BSD Make, not by GNU make.
BSDVERSION = $( shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
ASTCFLAGS+= $( shell if test $( BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE" ; fi )
_ ASTCFLAGS+= $( shell if test $( BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE" ; fi )
AST_LIBS += $( shell if test $( BSDVERSION) -lt 502102 ; then echo "-lc_r" ; else echo "-pthread" ; fi )
e n d i f
i f e q ( $( OSARCH ) , N e t B S D )
ASTCFLAGS+= -pthread -I/usr/pkg/include
_ ASTCFLAGS+= -pthread -I/usr/pkg/include
e n d i f
i f e q ( $( OSARCH ) , O p e n B S D )
ASTCFLAGS+= -pthread
_ ASTCFLAGS+= -pthread
e n d i f
i f e q ( $( OSARCH ) , S u n O S )
ASTCFLAGS+= -Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include
_ ASTCFLAGS+= -Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include
e n d i f
ASTERISKVERSION := $( shell GREP = $( GREP) AWK = $( AWK) build_tools/make_version .)
@ -256,7 +262,7 @@ ifneq ($(wildcard .svn),)
ASTERISKVERSIONNUM = 999999
e n d i f
ASTCFLAGS+= $( MALLOC_DEBUG) $( BUSYDETECT) $( OPTIONS)
_ ASTCFLAGS+= $( BUSYDETECT) $( OPTIONS)
MOD_SUBDIRS := res channels pbx apps codecs formats cdr funcs main
OTHER_SUBDIRS := utils agi
@ -271,7 +277,7 @@ MOD_SUBDIRS_EMBED_LIBS:=$(MOD_SUBDIRS:%=%-embed-libs)
MOD_SUBDIRS_MENUSELECT_TREE := $( MOD_SUBDIRS:%= %-menuselect-tree)
i f n e q ( $( findstring darwin ,$ ( OSARCH ) ) , )
ASTCFLAGS+= -D__Darwin__
_ ASTCFLAGS+= -D__Darwin__
AUDIO_LIBS = -framework CoreAudio
SOLINK = -dynamic -bundle -undefined suppress -force_flat_namespace
e l s e
@ -348,10 +354,10 @@ $(SUBDIRS): include/asterisk/version.h include/asterisk/buildopts.h defaults.h m
main : $( filter -out main ,$ ( MOD_SUBDIRS ) )
$(MOD_SUBDIRS) :
@ASTCFLAGS= " $( MOD_SUBDIR_CFLAGS) $( ASTCFLAGS) " ASTLDFLAGS = " $( ASTLDFLAGS) " AST_LIBS = " $( AST_LIB S) " $( MAKE) --no-builtin-rules -C $@ SUBDIR = $@ all
@_ ASTCFLAGS= " $( MOD_SUBDIR_CFLAGS) $( _ ASTCFLAGS) " $( MAKE) --no-builtin-rules -C $@ SUBDIR = $@ all
$(OTHER_SUBDIRS) :
@ASTCFLAGS= " $( OTHER_SUBDIR_CFLAGS) $( ASTCFLAGS) " ASTLDFLAGS = " $( ASTLDFLAGS) " AUDIO_LIBS = " $( AUDIO_LIB S) " $( MAKE) --no-builtin-rules -C $@ SUBDIR = $@ all
@_ ASTCFLAGS= " $( OTHER_SUBDIR_CFLAGS) $( _ ASTCFLAGS) " $( MAKE) --no-builtin-rules -C $@ SUBDIR = $@ all
defaults.h : makeopts
@build_tools/make_defaults_h > $@ .tmp
@ -404,7 +410,7 @@ distclean: $(SUBDIRS_DIST_CLEAN) _clean
rm -f build_tools/menuselect-deps
datafiles : _all
if [ x` $( ID) -un` = xroot ] ; then CFLAGS = " $( ASTCFLAGS) " bash build_tools/mkpkgconfig $( DESTDIR) /usr/lib/pkgconfig; fi
if [ x` $( ID) -un` = xroot ] ; then CFLAGS = " $( _ASTCFLAGS) $( ASTCFLAGS) " bash build_tools/mkpkgconfig $( DESTDIR) /usr/lib/pkgconfig; fi
# Should static HTTP be installed during make samples or even with its own target ala
# webvoicemail? There are portions here that *could* be customized but might also be
# improved a lot. I'll put it here for now.