diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-26 16:45:35 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-26 16:45:35 +0000 |
commit | da5141501bbaee1750bd85d88dd86d8b5acbb040 (patch) | |
tree | 9a2fde65d5e68d945737adfbf3732993de3886b5 /configure | |
parent | cdffda3e50f00b25b011a6d8e16b5eddee0b6d23 (diff) |
more optimizations for embedded systems:
when LOADABLE_MODULES is off, don't export symbols from the main binary
when LOADABLE_MODULES is off, and the compiler/linker support it, strip out code not used in the final binary
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41166 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 258 |
1 files changed, 200 insertions, 58 deletions
@@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 41119 . +# From configure.ac Revision: 41133 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.60. # @@ -795,6 +795,8 @@ ALLOCA EGREP LIBOBJS POW_LIB +GC_CFLAGS +GC_LDFLAGS GSM_INTERNAL KDEINIT KDEDIR @@ -13614,31 +13616,32 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking checking for res_ninit" >&5 -echo $ECHO_N "checking checking for res_ninit... $ECHO_C" >&6; } + +{ echo "$as_me:$LINENO: checking checking for compiler 'attribute pure' support" >&5 +echo $ECHO_N "checking checking for compiler 'attribute pure' support... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <resolv.h> +static int __attribute__((pure)) test(void) {} int main () { -int foo = res_ninit(NULL); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -13655,7 +13658,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; @@ -13668,8 +13671,8 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } -cat >>confdefs.h <<\_ACEOF -#define HAVE_RES_NINIT 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_ATTRIBUTE_pure 1 _ACEOF else @@ -13678,37 +13681,36 @@ sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } - fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking checking for RTLD_NOLOAD" >&5 -echo $ECHO_N "checking checking for RTLD_NOLOAD... $ECHO_C" >&6; } + +{ echo "$as_me:$LINENO: checking checking for compiler 'attribute malloc' support" >&5 +echo $ECHO_N "checking checking for compiler 'attribute malloc' support... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <dlfcn.h> +static int __attribute__((malloc)) test(void) {} int main () { -int foo = RTLD_NOLOAD; + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -13725,7 +13727,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; @@ -13738,8 +13740,8 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } -cat >>confdefs.h <<\_ACEOF -#define HAVE_RTLD_NOLOAD 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_ATTRIBUTE_malloc 1 _ACEOF else @@ -13748,22 +13750,20 @@ sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } - fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking checking for compiler 'attribute pure' support" >&5 -echo $ECHO_N "checking checking for compiler 'attribute pure' support... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: checking checking for compiler 'attribute const' support" >&5 +echo $ECHO_N "checking checking for compiler 'attribute const' support... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static int __attribute__((pure)) test(void) {} +static int __attribute__((const)) test(void) {} int main () { @@ -13810,7 +13810,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_pure 1 +#define HAVE_ATTRIBUTE_const 1 _ACEOF else @@ -13824,15 +13824,15 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking checking for compiler 'attribute malloc' support" >&5 -echo $ECHO_N "checking checking for compiler 'attribute malloc' support... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: checking checking for compiler 'attribute unused' support" >&5 +echo $ECHO_N "checking checking for compiler 'attribute unused' support... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static int __attribute__((malloc)) test(void) {} +static int __attribute__((unused)) test(void) {} int main () { @@ -13879,7 +13879,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_malloc 1 +#define HAVE_ATTRIBUTE_unused 1 _ACEOF else @@ -13893,15 +13893,15 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking checking for compiler 'attribute const' support" >&5 -echo $ECHO_N "checking checking for compiler 'attribute const' support... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: checking checking for compiler 'attribute always_inline' support" >&5 +echo $ECHO_N "checking checking for compiler 'attribute always_inline' support... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static int __attribute__((const)) test(void) {} +static int __attribute__((always_inline)) test(void) {} int main () { @@ -13948,7 +13948,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_const 1 +#define HAVE_ATTRIBUTE_always_inline 1 _ACEOF else @@ -13962,19 +13962,21 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking checking for compiler 'attribute unused' support" >&5 -echo $ECHO_N "checking checking for compiler 'attribute unused' support... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: checking checking for -ffunction-sections support" >&5 +echo $ECHO_N "checking checking for -ffunction-sections support... $ECHO_C" >&6; } +saved_CFLAGS="${CFLAGS}" +CFLAGS="${CFLAGS} -ffunction-sections" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static int __attribute__((unused)) test(void) {} + int main () { - +int x = 1; ; return 0; } @@ -14015,47 +14017,114 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (exit $ac_status); }; }; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } + saved_LDFLAGS="${LDFLAGS}" + LDFLAGS="${LDFLAGS} -Wl,--gc-sections" + { echo "$as_me:$LINENO: checking checking for --gc-sections support" >&5 +echo $ECHO_N "checking checking for --gc-sections support... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_unused 1 +int +main () +{ +int x = 1; + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + GC_CFLAGS="-ffunction-sections" + GC_LDFLAGS="-Wl,--gc-sections" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="${saved_LDFLAGS}" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS="${saved_CFLAGS}" -{ echo "$as_me:$LINENO: checking checking for compiler 'attribute always_inline' support" >&5 -echo $ECHO_N "checking checking for compiler 'attribute always_inline' support... $ECHO_C" >&6; } + +{ echo "$as_me:$LINENO: checking checking for res_ninit" >&5 +echo $ECHO_N "checking checking for res_ninit... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -static int __attribute__((always_inline)) test(void) {} +#include <resolv.h> int main () { - +int foo = res_ninit(NULL); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -14072,7 +14141,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; @@ -14085,8 +14154,8 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_always_inline 1 +cat >>confdefs.h <<\_ACEOF +#define HAVE_RES_NINIT 1 _ACEOF else @@ -14095,10 +14164,81 @@ sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +{ echo "$as_me:$LINENO: checking checking for RTLD_NOLOAD" >&5 +echo $ECHO_N "checking checking for RTLD_NOLOAD... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <dlfcn.h> +int +main () +{ +int foo = RTLD_NOLOAD; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +cat >>confdefs.h <<\_ACEOF +#define HAVE_RTLD_NOLOAD 1 +_ACEOF + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext if test "${ac_cv_header_libkern_OSAtomic_h+set}" = set; then { echo "$as_me:$LINENO: checking for libkern/OSAtomic.h" >&5 @@ -30337,7 +30477,7 @@ ALLOCA!$ALLOCA$ac_delim EGREP!$EGREP$ac_delim LIBOBJS!$LIBOBJS$ac_delim POW_LIB!$POW_LIB$ac_delim -GSM_INTERNAL!$GSM_INTERNAL$ac_delim +GC_CFLAGS!$GC_CFLAGS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -30379,6 +30519,8 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +GC_LDFLAGS!$GC_LDFLAGS$ac_delim +GSM_INTERNAL!$GSM_INTERNAL$ac_delim KDEINIT!$KDEINIT$ac_delim KDEDIR!$KDEDIR$ac_delim NETSNMP_CONFIG!$NETSNMP_CONFIG$ac_delim @@ -30398,7 +30540,7 @@ CURL_LIB!$CURL_LIB$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 17; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 19; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 |