aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.moddir_rules4
-rwxr-xr-xconfigure258
-rw-r--r--configure.ac35
-rw-r--r--main/Makefile10
-rw-r--r--makeopts.in3
5 files changed, 244 insertions, 66 deletions
diff --git a/Makefile.moddir_rules b/Makefile.moddir_rules
index 8e9c082fe..0963cedfc 100644
--- a/Makefile.moddir_rules
+++ b/Makefile.moddir_rules
@@ -15,6 +15,10 @@ ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),)
CFLAGS+=-include $(ASTTOPDIR)/include/asterisk/astmm.h
endif
+ifeq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
+ CFLAGS+=${GC_CFLAGS}
+endif
+
ifneq ($(findstring STATIC_BUILD,$(MENUSELECT_CFLAGS)),)
STATIC_BUILD=-static
endif
diff --git a/configure b/configure
index 727d7f1d1..6d297c364 100755
--- a/configure
+++ b/configure
@@ -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
diff --git a/configure.ac b/configure.ac
index 46e5ad734..a62d24380 100644
--- a/configure.ac
+++ b/configure.ac
@@ -251,6 +251,35 @@ AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides at
AC_MSG_RESULT(no)
)
+AST_GCC_ATTRIBUTE(pure)
+AST_GCC_ATTRIBUTE(malloc)
+AST_GCC_ATTRIBUTE(const)
+AST_GCC_ATTRIBUTE(unused)
+AST_GCC_ATTRIBUTE(always_inline)
+
+AC_MSG_CHECKING(checking for -ffunction-sections support)
+saved_CFLAGS="${CFLAGS}"
+CFLAGS="${CFLAGS} -ffunction-sections"
+AC_COMPILE_IFELSE(
+ AC_LANG_PROGRAM([], [int x = 1;]),
+ AC_MSG_RESULT(yes)
+ [saved_LDFLAGS="${LDFLAGS}"]
+ [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
+ AC_MSG_CHECKING(checking for --gc-sections support)
+ AC_LINK_IFELSE(
+ AC_LANG_PROGRAM([], [int x = 1;]),
+ AC_MSG_RESULT(yes)
+ [GC_CFLAGS="-ffunction-sections"]
+ [[GC_LDFLAGS="-Wl,--gc-sections"]],
+ AC_MSG_RESULT(no)
+ )
+ [LDFLAGS="${saved_LDFLAGS}"],
+ AC_MSG_RESULT(no)
+)
+CFLAGS="${saved_CFLAGS}"
+AC_SUBST(GC_CFLAGS)
+AC_SUBST(GC_LDFLAGS)
+
AC_MSG_CHECKING(checking for res_ninit)
AC_LINK_IFELSE(
AC_LANG_PROGRAM([#include <resolv.h>],
@@ -269,12 +298,6 @@ AC_LINK_IFELSE(
AC_MSG_RESULT(no)
)
-AST_GCC_ATTRIBUTE(pure)
-AST_GCC_ATTRIBUTE(malloc)
-AST_GCC_ATTRIBUTE(const)
-AST_GCC_ATTRIBUTE(unused)
-AST_GCC_ATTRIBUTE(always_inline)
-
AC_CHECK_HEADER([libkern/OSAtomic.h],
[AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
diff --git a/main/Makefile b/main/Makefile
index 850af5f4d..f9c40592a 100644
--- a/main/Makefile
+++ b/main/Makefile
@@ -62,7 +62,9 @@ endif
ifneq ($(findstring darwin,$(OSARCH)),)
AST_LIBS+=-lresolv
- ASTLINK=-Wl,-dynamic
+ ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
+ ASTLINK=-Wl,-dynamic
+ endif
# Mac on Intel CoreDuo does not need poll compatibility layer
ifneq ($(PROC),i386)
OBJS+=poll.o
@@ -70,7 +72,11 @@ ifneq ($(findstring darwin,$(OSARCH)),)
endif
else
# These are used for all but Darwin
- ASTLINK=-Wl,-E
+ ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
+ ASTLINK+=-Wl,--export-dynamic
+ else
+ ASTLINK+=${GC_LDFLAGS}
+ endif
ifneq ($(findstring BSD,$(OSARCH)),)
LDFLAGS+=-L/usr/local/lib
endif
diff --git a/makeopts.in b/makeopts.in
index da986d33c..b3d07a0e4 100644
--- a/makeopts.in
+++ b/makeopts.in
@@ -32,6 +32,9 @@ PROC=@HOST_CPU@
OSARCH=@HOST_OS@
OSREV=@PBX_OSREV@
+GC_CFLAGS=@GC_CFLAGS@
+GC_LDFLAGS=@GC_LDFLAGS@
+
prefix = @prefix@
exec_prefix = @exec_prefix@