make crash protection a configure option --enable-crash-protection and make mini-rtp have 4 byte headers

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1368 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2006-05-05 13:35:33 +00:00
parent 1fb17acaa8
commit 28173df273
8 changed files with 388 additions and 279 deletions

View File

@ -18,6 +18,10 @@ if ISLINUX
AM_LDFLAGS += -Wl,-E AM_LDFLAGS += -Wl,-E
endif endif
if CRASHPROT
AM_CFLAGS += -DCRASH_PROT
endif
if IS64BITLINUX if IS64BITLINUX
AM_CFLAGS += -m64 -march=k8 -fPIC AM_CFLAGS += -m64 -march=k8 -fPIC
endif endif

View File

@ -39,8 +39,9 @@ POST_UNINSTALL = :
build_triplet = @build@ build_triplet = @build@
host_triplet = @host@ host_triplet = @host@
@ISLINUX_TRUE@am__append_1 = -Wl,-E @ISLINUX_TRUE@am__append_1 = -Wl,-E
@IS64BITLINUX_TRUE@am__append_2 = -m64 -march=k8 -fPIC @CRASHPROT_TRUE@am__append_2 = -DCRASH_PROT
@ISMAC_TRUE@am__append_3 = -DMACOSX @IS64BITLINUX_TRUE@am__append_3 = -m64 -march=k8 -fPIC
@ISMAC_TRUE@am__append_4 = -DMACOSX
bin_PROGRAMS = freeswitch$(EXEEXT) bin_PROGRAMS = freeswitch$(EXEEXT)
DIST_COMMON = README $(am__configure_deps) $(library_include_HEADERS) \ DIST_COMMON = README $(am__configure_deps) $(library_include_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
@ -143,6 +144,8 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
CPP = @CPP@ CPP = @CPP@
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
CRASHPROT_FALSE = @CRASHPROT_FALSE@
CRASHPROT_TRUE = @CRASHPROT_TRUE@
CXX = @CXX@ CXX = @CXX@
CXXCPP = @CXXCPP@ CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@ CXXDEPMODE = @CXXDEPMODE@
@ -243,8 +246,9 @@ APU_CONFIG = $(prefix)/bin/apu-1-config
AM_CFLAGS = -I$(PREFIX)/include $(shell $(APR_CONFIG) --cflags \ AM_CFLAGS = -I$(PREFIX)/include $(shell $(APR_CONFIG) --cflags \
--cppflags --includes) -I${prefix}/include/srtp $(shell \ --cppflags --includes) -I${prefix}/include/srtp $(shell \
$(APU_CONFIG) --includes) $(am__append_2) $(am__append_3) \ $(APU_CONFIG) --includes) $(am__append_2) $(am__append_3) \
-fPIC -Wall -I$(PWD)/src/sqlite -I$(PWD) -I$(PWD)/src/include \ $(am__append_4) -fPIC -Wall -I$(PWD)/src/sqlite -I$(PWD) \
-I$(PREFIX)/include -DSWITCH_MOD_DIR=\"$(PREFIX)/mod\" \ -I$(PWD)/src/include -I$(PREFIX)/include \
-DSWITCH_MOD_DIR=\"$(PREFIX)/mod\" \
-DSWITCH_PREFIX_DIR=\"$(PREFIX)\" \ -DSWITCH_PREFIX_DIR=\"$(PREFIX)\" \
-DSWITCH_CONF_DIR=\"$(PREFIX)/conf\" \ -DSWITCH_CONF_DIR=\"$(PREFIX)/conf\" \
-DSWITCH_DB_DIR=\"$(PREFIX)/db\" \ -DSWITCH_DB_DIR=\"$(PREFIX)/db\" \

166
aclocal.m4 vendored
View File

@ -143,7 +143,7 @@ rm="rm -f"
default_ofile=libtool default_ofile=libtool
can_build_shared=yes can_build_shared=yes
# All known linkers require a `.a' archive for static linking (except M$VC, # All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib'). # which needs '.lib').
libext=a libext=a
ltmain="$ac_aux_dir/ltmain.sh" ltmain="$ac_aux_dir/ltmain.sh"
@ -359,8 +359,8 @@ if test "X${echo_test_string+set}" != Xset; then
# find a string as large as possible, as long as the shell can cope with it # find a string as large as possible, as long as the shell can cope with it
for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
# expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
if (echo_test_string="`eval $cmd`") 2>/dev/null && if (echo_test_string=`eval $cmd`) 2>/dev/null &&
echo_test_string="`eval $cmd`" && echo_test_string=`eval $cmd` &&
(test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
then then
break break
@ -529,7 +529,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
# Find out which ABI we are using. # Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then if AC_TRY_EVAL(ac_compile); then
case "`/usr/bin/file conftest.o`" in case `/usr/bin/file conftest.o` in
*32-bit*) *32-bit*)
case $host in case $host in
x86_64-*linux*) x86_64-*linux*)
@ -611,7 +611,7 @@ AC_CACHE_CHECK([$1], [$2],
# with a dollar sign (not a hyphen), so the echo should work correctly. # with a dollar sign (not a hyphen), so the echo should work correctly.
# The option is referenced via a variable to avoid confusing sed. # The option is referenced via a variable to avoid confusing sed.
lt_compile=`echo "$ac_compile" | $SED \ lt_compile=`echo "$ac_compile" | $SED \
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
@ -650,7 +650,7 @@ AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
LDFLAGS="$LDFLAGS $3" LDFLAGS="$LDFLAGS $3"
printf "$lt_simple_link_test_code" > conftest.$ac_ext printf "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The compiler can only warn and ignore the option if not recognized # The linker can only warn and ignore the option if not recognized
# So say no if there are warnings # So say no if there are warnings
if test -s conftest.err; then if test -s conftest.err; then
# Append any errors to the config.log. # Append any errors to the config.log.
@ -725,7 +725,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
elif test -x /usr/sbin/sysctl; then elif test -x /usr/sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
else else
lt_cv_sys_max_cmd_len=65536 # usable default for *BSD lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
fi fi
# And add a safety zone # And add a safety zone
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
@ -854,7 +854,7 @@ int main ()
}] }]
EOF EOF
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) 2>/dev/null (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
lt_status=$? lt_status=$?
case x$lt_status in case x$lt_status in
x$lt_dlno_uscore) $1 ;; x$lt_dlno_uscore) $1 ;;
@ -1003,7 +1003,7 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
# Note that $ac_compile itself does not contain backslashes and begins # Note that $ac_compile itself does not contain backslashes and begins
# with a dollar sign (not a hyphen), so the echo should work correctly. # with a dollar sign (not a hyphen), so the echo should work correctly.
lt_compile=`echo "$ac_compile" | $SED \ lt_compile=`echo "$ac_compile" | $SED \
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
@ -1021,7 +1021,7 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
fi fi
fi fi
chmod u+w . chmod u+w . 2>&AS_MESSAGE_LOG_FD
$rm conftest* $rm conftest*
# SGI C++ compiler will create directory out/ii_files/ for # SGI C++ compiler will create directory out/ii_files/ for
# template instantiation # template instantiation
@ -1281,7 +1281,8 @@ cygwin* | mingw* | pw32*)
dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~ dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~ test -d \$dldir || mkdir -p \$dldir~
$install_prog $dir/$dlname \$dldir/$dlname' $install_prog $dir/$dlname \$dldir/$dlname~
chmod a+x \$dldir/$dlname'
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~ dlpath=$dir/\$dldll~
$rm \$dlpath' $rm \$dlpath'
@ -1334,7 +1335,7 @@ darwin* | rhapsody*)
soname_spec='${libname}${release}${major}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext'
shlibpath_overrides_runpath=yes shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
# Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
if test "$GCC" = yes; then if test "$GCC" = yes; then
sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@ -1372,7 +1373,14 @@ kfreebsd*-gnu)
freebsd* | dragonfly*) freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new # DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this. # versioning mechanism, adjust this.
objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` if test -x /usr/bin/objformat; then
objformat=`/usr/bin/objformat`
else
case $host_os in
freebsd[[123]]*) objformat=aout ;;
*) objformat=elf ;;
esac
fi
version_type=freebsd-$objformat version_type=freebsd-$objformat
case $version_type in case $version_type in
freebsd-elf*) freebsd-elf*)
@ -1417,7 +1425,7 @@ hpux9* | hpux10* | hpux11*)
version_type=sunos version_type=sunos
need_lib_prefix=no need_lib_prefix=no
need_version=no need_version=no
case "$host_cpu" in case $host_cpu in
ia64*) ia64*)
shrext_cmds='.so' shrext_cmds='.so'
hardcode_into_libs=yes hardcode_into_libs=yes
@ -1813,7 +1821,7 @@ AC_DEFUN([AC_LIBTOOL_DLOPEN],
# AC_LIBTOOL_WIN32_DLL # AC_LIBTOOL_WIN32_DLL
# -------------------- # --------------------
# declare package support for building win32 dll's # declare package support for building win32 DLLs
AC_DEFUN([AC_LIBTOOL_WIN32_DLL], AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
])# AC_LIBTOOL_WIN32_DLL ])# AC_LIBTOOL_WIN32_DLL
@ -1987,7 +1995,7 @@ dnl not every word. This closes a longstanding sh security hole.
if test -n "$file_magic_test_file"; then if test -n "$file_magic_test_file"; then
case $deplibs_check_method in case $deplibs_check_method in
"file_magic "*) "file_magic "*)
file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
MAGIC_CMD="$lt_cv_path_MAGIC_CMD" MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
$EGREP "$file_magic_regex" > /dev/null; then $EGREP "$file_magic_regex" > /dev/null; then
@ -2097,7 +2105,7 @@ AC_CACHE_VAL(lt_cv_path_LD,
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
lt_cv_path_LD="$ac_dir/$ac_prog" lt_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version, # Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v. # but apparently some variants of GNU ld only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer. # Break only if it was the GNU/non-GNU ld that we prefer.
case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*) *GNU* | *'with BFD'*)
@ -2129,7 +2137,7 @@ AC_PROG_LD_GNU
AC_DEFUN([AC_PROG_LD_GNU], AC_DEFUN([AC_PROG_LD_GNU],
[AC_REQUIRE([AC_PROG_EGREP])dnl [AC_REQUIRE([AC_PROG_EGREP])dnl
AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v. [# I'd rather use --version here, but apparently some GNU lds only accept -v.
case `$LD -v 2>&1 </dev/null` in case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*) *GNU* | *'with BFD'*)
lt_cv_prog_gnu_ld=yes lt_cv_prog_gnu_ld=yes
@ -2243,7 +2251,7 @@ gnu*)
hpux10.20* | hpux11*) hpux10.20* | hpux11*)
lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_cmd=/usr/bin/file
case "$host_cpu" in case $host_cpu in
ia64*) ia64*)
lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
@ -2417,13 +2425,13 @@ esac
# ----------------------------------- # -----------------------------------
# sets LIBLTDL to the link flags for the libltdl convenience library and # sets LIBLTDL to the link flags for the libltdl convenience library and
# LTDLINCL to the include flags for the libltdl header and adds # LTDLINCL to the include flags for the libltdl header and adds
# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL # --enable-ltdl-convenience to the configure arguments. Note that
# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will # it is assumed to be `libltdl'. LIBLTDL will be prefixed with
# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with # '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
# '${top_srcdir}/' (note the single quotes!). If your package is not # (note the single quotes!). If your package is not flat and you're not
# flat and you're not using automake, define top_builddir and # using automake, define top_builddir and top_srcdir appropriately in
# top_srcdir appropriately in the Makefiles. # the Makefiles.
AC_DEFUN([AC_LIBLTDL_CONVENIENCE], AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
case $enable_ltdl_convenience in case $enable_ltdl_convenience in
@ -2442,13 +2450,13 @@ AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
# ----------------------------------- # -----------------------------------
# sets LIBLTDL to the link flags for the libltdl installable library and # sets LIBLTDL to the link flags for the libltdl installable library and
# LTDLINCL to the include flags for the libltdl header and adds # LTDLINCL to the include flags for the libltdl header and adds
# --enable-ltdl-install to the configure arguments. Note that LIBLTDL # --enable-ltdl-install to the configure arguments. Note that
# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
# DIRECTORY is not provided and an installed libltdl is not found, it is # and an installed libltdl is not found, it is assumed to be `libltdl'.
# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single # '${top_srcdir}/' (note the single quotes!). If your package is not
# quotes!). If your package is not flat and you're not using automake, # flat and you're not using automake, define top_builddir and top_srcdir
# define top_builddir and top_srcdir appropriately in the Makefiles. # appropriately in the Makefiles.
# In the future, this macro may have to be called after AC_PROG_LIBTOOL. # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
AC_DEFUN([AC_LIBLTDL_INSTALLABLE], AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
@ -2627,7 +2635,7 @@ test "$can_build_shared" = "no" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and # On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC. # are all built from PIC.
case "$host_os" in case $host_os in
aix3*) aix3*)
test "$enable_shared" = yes && enable_static=no test "$enable_shared" = yes && enable_static=no
if test -n "$RANLIB"; then if test -n "$RANLIB"; then
@ -2694,7 +2702,7 @@ _LT_AC_TAGVAR(postdeps, $1)=
_LT_AC_TAGVAR(compiler_lib_search_path, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)=
# Source file extension for C++ test sources. # Source file extension for C++ test sources.
ac_ext=cc ac_ext=cpp
# Object file extension for compiled C++ test sources. # Object file extension for compiled C++ test sources.
objext=o objext=o
@ -2910,7 +2918,7 @@ case $host_os in
# Exported symbols can be pulled into shared objects from archives # Exported symbols can be pulled into shared objects from archives
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
# This is similar to how AIX traditionally builds it's shared libraries. # This is similar to how AIX traditionally builds its shared libraries.
_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi fi
fi fi
@ -2949,7 +2957,7 @@ case $host_os in
fi fi
;; ;;
darwin* | rhapsody*) darwin* | rhapsody*)
case "$host_os" in case $host_os in
rhapsody* | darwin1.[[012]]) rhapsody* | darwin1.[[012]])
_LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
;; ;;
@ -2987,7 +2995,7 @@ case $host_os in
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
fi fi
_LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
if test "X$lt_int_apple_cc_single_mod" = Xyes ; then if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
else else
@ -3000,7 +3008,7 @@ case $host_os in
output_verbose_link_cmd='echo' output_verbose_link_cmd='echo'
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
_LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;; ;;
@ -3080,7 +3088,7 @@ case $host_os in
;; ;;
hpux10*|hpux11*) hpux10*|hpux11*)
if test $with_gnu_ld = no; then if test $with_gnu_ld = no; then
case "$host_cpu" in case $host_cpu in
hppa*64*) hppa*64*)
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
@ -3096,7 +3104,7 @@ case $host_os in
;; ;;
esac esac
fi fi
case "$host_cpu" in case $host_cpu in
hppa*64*) hppa*64*)
_LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
@ -3122,7 +3130,7 @@ case $host_os in
_LT_AC_TAGVAR(ld_shlibs, $1)=no _LT_AC_TAGVAR(ld_shlibs, $1)=no
;; ;;
aCC*) aCC*)
case "$host_cpu" in case $host_cpu in
hppa*64*|ia64*) hppa*64*|ia64*)
_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
;; ;;
@ -3143,7 +3151,7 @@ case $host_os in
*) *)
if test "$GXX" = yes; then if test "$GXX" = yes; then
if test $with_gnu_ld = no; then if test $with_gnu_ld = no; then
case "$host_cpu" in case $host_cpu in
ia64*|hppa*64*) ia64*|hppa*64*)
_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
;; ;;
@ -3244,7 +3252,7 @@ case $host_os in
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
;; ;;
cxx*) cxx*)
# Compaq C++ # Compaq C++
@ -3476,10 +3484,11 @@ case $host_os in
case $cc_basename in case $cc_basename in
CC*) CC*)
# Sun C++ 4.2, 5.x and Centerline C++ # Sun C++ 4.2, 5.x and Centerline C++
_LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
@ -3499,15 +3508,7 @@ case $host_os in
esac esac
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
# Commands to make compiler produce verbose output that lists output_verbose_link_cmd='echo'
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
#
# There doesn't appear to be a way to prevent this compiler from
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
# Archives containing C++ object files must be created using # Archives containing C++ object files must be created using
# "CC -xar", where "CC" is the Sun C++ compiler. This is # "CC -xar", where "CC" is the Sun C++ compiler. This is
@ -3664,7 +3665,7 @@ if AC_TRY_EVAL(ac_compile); then
# The `*' in the case matches for architectures that use `case' in # The `*' in the case matches for architectures that use `case' in
# $output_verbose_cmd can trigger glob expansion during the loop # $output_verbose_cmd can trigger glob expansion during the loop
# eval without this substitution. # eval without this substitution.
output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
for p in `eval $output_verbose_link_cmd`; do for p in `eval $output_verbose_link_cmd`; do
case $p in case $p in
@ -3740,6 +3741,21 @@ fi
$rm -f confest.$objext $rm -f confest.$objext
# PORTME: override above test on systems where it is broken
ifelse([$1],[CXX],
[case $host_os in
solaris*)
case $cc_basename in
CC*)
# Adding this requires a known-good setup of shared libraries for
# Sun compiler versions before 5.6, else PIC objects from an old
# archive will be linked into the output, leading to subtle bugs.
_LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
;;
esac
esac
])
case " $_LT_AC_TAGVAR(postdeps, $1) " in case " $_LT_AC_TAGVAR(postdeps, $1) " in
*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
esac esac
@ -3809,7 +3825,7 @@ test "$can_build_shared" = "no" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and # On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC. # are all built from PIC.
case "$host_os" in case $host_os in
aix3*) aix3*)
test "$enable_shared" = yes && enable_static=no test "$enable_shared" = yes && enable_static=no
if test -n "$RANLIB"; then if test -n "$RANLIB"; then
@ -4708,7 +4724,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
hpux*) hpux*)
# PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
# not for PA HP-UX. # not for PA HP-UX.
case "$host_cpu" in case $host_cpu in
hppa*64*|ia64*) hppa*64*|ia64*)
;; ;;
*) *)
@ -4777,7 +4793,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
aCC*) aCC*)
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
case "$host_cpu" in case $host_cpu in
hppa*64*|ia64*) hppa*64*|ia64*)
# +Z the default # +Z the default
;; ;;
@ -4818,7 +4834,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
# Portland Group C++ compiler. # Portland Group C++ compiler.
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;; ;;
cxx*) cxx*)
# Compaq C++ # Compaq C++
@ -4982,7 +4998,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
hpux*) hpux*)
# PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
# not for PA HP-UX. # not for PA HP-UX.
case "$host_cpu" in case $host_cpu in
hppa*64*|ia64*) hppa*64*|ia64*)
# +Z the default # +Z the default
;; ;;
@ -5029,7 +5045,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
# not for PA HP-UX. # not for PA HP-UX.
case "$host_cpu" in case $host_cpu in
hppa*64*|ia64*) hppa*64*|ia64*)
# +Z the default # +Z the default
;; ;;
@ -5059,12 +5075,12 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
;; ;;
pgcc* | pgf77* | pgf90*) pgcc* | pgf77* | pgf90* | pgf95*)
# Portland Group compilers (*not* the Pentium gcc compiler, # Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project) # which looks to be a dead project)
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;; ;;
ccc*) ccc*)
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
@ -5147,7 +5163,7 @@ if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
fi fi
case "$host_os" in case $host_os in
# For platforms which do not support PIC, -DPIC is meaningless: # For platforms which do not support PIC, -DPIC is meaningless:
*djgpp*) *djgpp*)
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
@ -5338,11 +5354,11 @@ EOF
tmp_addflag= tmp_addflag=
case $cc_basename,$host_cpu in case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler pgcc*) # Portland Group C compiler
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag' tmp_addflag=' $pic_flag'
;; ;;
pgf77* | pgf90* ) # Portland Group f77 and f90 compilers pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag -Mnomain' ;; tmp_addflag=' $pic_flag -Mnomain' ;;
ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;; tmp_addflag=' -i_dynamic' ;;
@ -5548,7 +5564,7 @@ EOF
# Exported symbols can be pulled into shared objects from archives # Exported symbols can be pulled into shared objects from archives
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
# This is similar to how AIX traditionally builds it's shared libraries. # This is similar to how AIX traditionally builds its shared libraries.
_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi fi
fi fi
@ -5588,7 +5604,7 @@ EOF
;; ;;
darwin* | rhapsody*) darwin* | rhapsody*)
case "$host_os" in case $host_os in
rhapsody* | darwin1.[[012]]) rhapsody* | darwin1.[[012]])
_LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
;; ;;
@ -5617,7 +5633,7 @@ EOF
output_verbose_link_cmd='echo' output_verbose_link_cmd='echo'
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
_LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
else else
@ -5626,7 +5642,7 @@ EOF
output_verbose_link_cmd='echo' output_verbose_link_cmd='echo'
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
_LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;; ;;
@ -5692,7 +5708,7 @@ EOF
hpux10* | hpux11*) hpux10* | hpux11*)
if test "$GCC" = yes -a "$with_gnu_ld" = no; then if test "$GCC" = yes -a "$with_gnu_ld" = no; then
case "$host_cpu" in case $host_cpu in
hppa*64*|ia64*) hppa*64*|ia64*)
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;; ;;
@ -5701,7 +5717,7 @@ EOF
;; ;;
esac esac
else else
case "$host_cpu" in case $host_cpu in
hppa*64*|ia64*) hppa*64*|ia64*)
_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
;; ;;
@ -5711,7 +5727,7 @@ EOF
esac esac
fi fi
if test "$with_gnu_ld" = no; then if test "$with_gnu_ld" = no; then
case "$host_cpu" in case $host_cpu in
hppa*64*) hppa*64*)
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'

368
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,10 @@ AC_C_BIGENDIAN(AC_DEFINE([__BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([__
AC_DEFINE([__LITTLE_ENDIAN],1234,[for the places where it is not defined]) AC_DEFINE([__LITTLE_ENDIAN],1234,[for the places where it is not defined])
AC_DEFINE([__BIG_ENDIAN],4321,[for the places where it is not defined]) AC_DEFINE([__BIG_ENDIAN],4321,[for the places where it is not defined])
AC_ARG_ENABLE(crash-protection,
[ --enable-crash-protection Compile with CRASH Protection],,[enable_crash_prot="no"])
AM_CONDITIONAL([CRASHPROT],[test "x$enable_crash_prot" != "xno"])
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile])

View File

@ -176,7 +176,13 @@ int main(int argc, char *argv[])
switch_event_fire(&event); switch_event_fire(&event);
} }
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "freeswitch Version %s Started\n\n", SWITCH_VERSION_FULL); #ifdef CRASH_PROT
#define __CP "ENABLED"
#else
#define __CP "DISABLED"
#endif
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "freeswitch Version %s Started. Crash Protection [%s]\n\n", SWITCH_VERSION_FULL, __CP);
snprintf(path, sizeof(path), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, pfile); snprintf(path, sizeof(path), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, pfile);
if (bg) { if (bg) {

View File

@ -36,7 +36,6 @@
#define SWITCH_EVENT_QUEUE_LEN 256 #define SWITCH_EVENT_QUEUE_LEN 256
#define SWITCH_SQL_QUEUE_LEN 2000 #define SWITCH_SQL_QUEUE_LEN 2000
#define SWITCH_THREAD_JMP_KEY "JMP_KEY"
struct switch_core_session { struct switch_core_session {
uint32_t id; uint32_t id;
@ -86,7 +85,9 @@ struct switch_core_runtime {
uint32_t session_id; uint32_t session_id;
apr_pool_t *memory_pool; apr_pool_t *memory_pool;
switch_hash_t *session_table; switch_hash_t *session_table;
#ifdef CRASH_PROT
switch_hash_t *stack_table; switch_hash_t *stack_table;
#endif
switch_core_db_t *db; switch_core_db_t *db;
switch_core_db_t *event_db; switch_core_db_t *event_db;
const switch_state_handler_table_t *state_handlers[SWITCH_MAX_STATE_HANDLERS]; const switch_state_handler_table_t *state_handlers[SWITCH_MAX_STATE_HANDLERS];
@ -1099,8 +1100,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
break; break;
default: default:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s decoder error!\n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s decoder error!\n",
session->read_codec->codec_interface->interface_name);
session->read_codec->codec_interface->interface_name);
return status; return status;
} }
} }
@ -1862,7 +1862,7 @@ SWITCH_DECLARE(unsigned int) switch_core_session_runing(switch_core_session_t *s
{ {
return session->thread_running; return session->thread_running;
} }
#ifdef CRASH_PROT
#if defined (__GNUC__) && defined (LINUX) #if defined (__GNUC__) && defined (LINUX)
#include <execinfo.h> #include <execinfo.h>
#include <stdio.h> #include <stdio.h>
@ -1911,7 +1911,7 @@ static int handle_fatality(int sig)
return 0; return 0;
} }
#endif
SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session) SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
{ {
@ -1919,6 +1919,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
const switch_endpoint_interface_t *endpoint_interface; const switch_endpoint_interface_t *endpoint_interface;
const switch_state_handler_table_t *driver_state_handler = NULL; const switch_state_handler_table_t *driver_state_handler = NULL;
const switch_state_handler_table_t *application_state_handler = NULL; const switch_state_handler_table_t *application_state_handler = NULL;
#ifdef CRASH_PROT
switch_thread_id_t thread_id = switch_thread_self(); switch_thread_id_t thread_id = switch_thread_self();
jmp_buf env; jmp_buf env;
int sig; int sig;
@ -1941,7 +1942,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
} else { } else {
apr_hash_set(runtime.stack_table, &thread_id, sizeof(thread_id), &env); apr_hash_set(runtime.stack_table, &thread_id, sizeof(thread_id), &env);
} }
#endif
/* /*
Life of the channel. you have channel and pool in your session Life of the channel. you have channel and pool in your session
everywhere you go you use the session to malloc with everywhere you go you use the session to malloc with
@ -2250,9 +2251,9 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
switch_thread_cond_wait(session->cond, session->mutex); switch_thread_cond_wait(session->cond, session->mutex);
} }
} }
#ifdef CRASH_PROT
apr_hash_set(runtime.stack_table, &thread_id, sizeof(thread_id), NULL); apr_hash_set(runtime.stack_table, &thread_id, sizeof(thread_id), NULL);
#endif
session->thread_running = 0; session->thread_running = 0;
} }
@ -2825,8 +2826,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(char *console)
runtime.session_id = 1; runtime.session_id = 1;
switch_core_hash_init(&runtime.session_table, runtime.memory_pool); switch_core_hash_init(&runtime.session_table, runtime.memory_pool);
#ifdef CRASH_PROT
switch_core_hash_init(&runtime.stack_table, runtime.memory_pool); switch_core_hash_init(&runtime.stack_table, runtime.memory_pool);
#endif
time(&runtime.initiated); time(&runtime.initiated);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }

View File

@ -46,6 +46,7 @@
#define SWITCH_RTP_CNG_PAYLOAD 13 #define SWITCH_RTP_CNG_PAYLOAD 13
#define MAX_KEY_LEN 64 #define MAX_KEY_LEN 64
#define MASTER_KEY_LEN 30 #define MASTER_KEY_LEN 30
#define RTP_MAGIC_NUMBER 42
static switch_port_t NEXT_PORT = RTP_START_PORT; static switch_port_t NEXT_PORT = RTP_START_PORT;
static switch_mutex_t *port_lock = NULL; static switch_mutex_t *port_lock = NULL;
@ -53,26 +54,18 @@ static switch_mutex_t *port_lock = NULL;
typedef srtp_hdr_t rtp_hdr_t; typedef srtp_hdr_t rtp_hdr_t;
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma pack(1) #pragma pack(4)
#endif #endif
#if __BYTE_ORDER == __BIG_ENDIAN #if __BYTE_ORDER == __BIG_ENDIAN
typedef struct { typedef struct {
unsigned version:2; /* protocol version */ uint32_t ts; /* timestamp */
unsigned p:1; /* padding flag */
unsigned x:1; /* header extension flag */
unsigned cc:4; /* CSRC count */
uint32_t ts; /* timestamp */
} PACKED srtp_mini_hdr_t; } PACKED srtp_mini_hdr_t;
#else #else
typedef struct { typedef struct {
uint8_t cc:4; /* CSRC count */ uint32_t ts; /* timestamp */
uint8_t x:1; /* header extension flag */
uint8_t p:1; /* padding flag */
uint8_t version:2; /* protocol version */
uint32_t ts; /* timestamp */
} PACKED srtp_mini_hdr_t; } PACKED srtp_mini_hdr_t;
#endif #endif
@ -166,6 +159,7 @@ struct switch_rtp {
char *user_ice; char *user_ice;
switch_time_t last_stun; switch_time_t last_stun;
uint32_t packet_size; uint32_t packet_size;
uint32_t rpacket_size;
switch_time_t last_read; switch_time_t last_read;
switch_time_t next_read; switch_time_t next_read;
uint32_t ms_per_packet; uint32_t ms_per_packet;
@ -181,19 +175,28 @@ static int global_init = 0;
static void switch_rtp_miniframe_probe(switch_rtp_t *rtp_session) static void switch_rtp_miniframe_probe(switch_rtp_t *rtp_session)
{ {
rtp_mini_msg_t mini = {{0}};
int x;
const char *str = "!"; const char *str = "!";
rtp_msg_t msg = {{0}};
int x;
mini.header.version = 1; msg.header.ssrc = htonl(RTP_MAGIC_NUMBER);
mini.header.ts = 42; msg.header.ts = htonl(rtp_session->packet_size);
snprintf(mini.body, sizeof(mini.body), str); msg.header.seq = htons(RTP_MAGIC_NUMBER);
msg.header.m = 1;
msg.header.pt = RTP_MAGIC_NUMBER;
msg.header.version = 2;
msg.header.p = 0;
msg.header.x = 0;
msg.header.cc = 0;
snprintf(msg.body, sizeof(msg.body), str);
for(x = 0; x < 3 ; x++) { for(x = 0; x < 3 ; x++) {
switch_size_t bytes = strlen(str) + sizeof(mini.header); switch_size_t bytes = strlen(str) + sizeof(msg.header);
switch_socket_sendto(rtp_session->sock, rtp_session->remote_addr, 0, (void*)&mini, &bytes); switch_socket_sendto(rtp_session->sock, rtp_session->remote_addr, 0, (void*)&msg, &bytes);
} }
} }
static switch_status_t ice_out(switch_rtp_t *rtp_session) static switch_status_t ice_out(switch_rtp_t *rtp_session)
{ {
@ -708,35 +711,40 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
bytes = sbytes; bytes = sbytes;
} }
if (bytes > 0 && rtp_session->recv_msg.header.version == 1) { if (bytes > 0) {
uint32_t ts; int effective_size = bytes - sizeof(srtp_mini_hdr_t);
rtp_mini_msg_t *mini = (rtp_mini_msg_t *) &rtp_session->recv_msg;
if (mini->header.ts == 42) {
if (rtp_session->recv_msg.header.pt == RTP_MAGIC_NUMBER) {
if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_MINI)) { if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_MINI)) {
switch_set_flag(rtp_session, SWITCH_RTP_FLAG_MINI); switch_set_flag(rtp_session, SWITCH_RTP_FLAG_MINI);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "YAY MINI-RTP!\n"); rtp_session->rpacket_size = ntohl(rtp_session->recv_msg.header.ts);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "YAY MINI-RTP! %d\n", rtp_session->rpacket_size);
switch_rtp_miniframe_probe(rtp_session); switch_rtp_miniframe_probe(rtp_session);
} }
continue; continue;
} }
ts = mini->header.ts; if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_MINI) && rtp_session->rpacket_size && effective_size > 0) {
bytes -= sizeof(srtp_mini_hdr_t); uint32_t mfactor = (effective_size % rtp_session->rpacket_size);
memmove(rtp_session->recv_msg.body, mini->body, bytes); if (!mfactor) {
uint32_t ts;
rtp_mini_msg_t *mini = (rtp_mini_msg_t *) &rtp_session->recv_msg;
ts = mini->header.ts;
bytes -= sizeof(srtp_mini_hdr_t);
rtp_session->recv_msg.header.ts = ts; memmove(rtp_session->recv_msg.body, mini->body, bytes);
rtp_session->recv_msg.header.seq = htons(rtp_session->rseq++);
rtp_session->recv_msg.header.pt = rtp_session->rpayload; rtp_session->recv_msg.header.ts = ts;
bytes += rtp_header_len; rtp_session->recv_msg.header.seq = htons(rtp_session->rseq++);
rtp_session->recv_msg.header.version = 2; rtp_session->recv_msg.header.pt = rtp_session->rpayload;
bytes += rtp_header_len;
rtp_session->recv_msg.header.version = 2;
}
}
} }
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) {
if ((switch_time_now() - rtp_session->next_read) > 1000) { if ((switch_time_now() - rtp_session->next_read) > 1000) {
/* We're late! We're Late!*/ /* We're late! We're Late!*/
@ -846,6 +854,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
if (bytes > 0) { if (bytes > 0) {
do_2833(rtp_session); do_2833(rtp_session);
} }
return (int) bytes; return (int) bytes;
} }
@ -1171,7 +1180,6 @@ static int rtp_common_write(switch_rtp_t *rtp_session, void *data, uint32_t data
rtp_mini_msg_t mini = {{0}}; rtp_mini_msg_t mini = {{0}};
bytes -= rtp_header_len; bytes -= rtp_header_len;
mini.header.ts = send_msg->header.ts; mini.header.ts = send_msg->header.ts;
mini.header.version = 1;
memcpy(mini.body, send_msg->body, bytes); memcpy(mini.body, send_msg->body, bytes);
bytes += sizeof(srtp_mini_hdr_t); bytes += sizeof(srtp_mini_hdr_t);
switch_socket_sendto(rtp_session->sock, rtp_session->remote_addr, 0, (void*)&mini, &bytes); switch_socket_sendto(rtp_session->sock, rtp_session->remote_addr, 0, (void*)&mini, &bytes);