summaryrefslogtreecommitdiff
path: root/source4/build/m4/check_ld.m4
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build/m4/check_ld.m4')
-rw-r--r--source4/build/m4/check_ld.m426
1 files changed, 25 insertions, 1 deletions
diff --git a/source4/build/m4/check_ld.m4 b/source4/build/m4/check_ld.m4
index c3b01551ab..eb1d9a7a1d 100644
--- a/source4/build/m4/check_ld.m4
+++ b/source4/build/m4/check_ld.m4
@@ -115,6 +115,8 @@ AC_LD_EXPORT_DYNAMIC
AC_LD_SHLDFLAGS
AC_LD_SHLIBEXT
AC_LD_SONAMEFLAG
+AC_LIBREPLACE_MDLD
+AC_LIBREPLACE_MDLD_FLAGS
#######################################################
# test whether building a shared library actually works
@@ -125,6 +127,11 @@ if test $BLDSHARED = true; then
AC_MSG_CHECKING([SHLD_FLAGS])
AC_MSG_RESULT([$SHLD_FLAGS])
+ AC_MSG_CHECKING([MDLD])
+ AC_MSG_RESULT([$MDLD])
+ AC_MSG_CHECKING([MDLD_FLAGS])
+ AC_MSG_RESULT([$MDLD_FLAGS])
+
AC_MSG_CHECKING([SHLIBEXT])
AC_MSG_RESULT([$SHLIBEXT])
AC_MSG_CHECKING([SONAMEFLAG])
@@ -137,12 +144,22 @@ if test $BLDSHARED = true; then
[ac_cv_shlib_works],[
ac_cv_shlib_works=no
# try building a trivial shared library
+ # TODO: also test SONAMEFLAG
${CC} ${CFLAGS} ${PICFLAG} -c ${srcdir-.}/build/tests/shlib.c -o shlib.o &&
${SHLD} ${SHLD_FLAGS} -o shlib.${SHLIBEXT} shlib.o &&
ac_cv_shlib_works=yes
rm -f shlib.${SHLIBEXT} shlib.o
])
- if test $ac_cv_shlib_works = no; then
+ AC_CACHE_CHECK([whether building shared modules actually works],
+ [ac_cv_shmod_works],[
+ ac_cv_shmod_works=no
+ # try building a trivial shared library
+ ${CC} ${CFLAGS} ${PICFLAG} -c ${srcdir-.}/build/tests/shlib.c -o shlib.o &&
+ ${MDLD} ${MDLD_FLAGS} -o shlib.${SHLIBEXT} shlib.o &&
+ ac_cv_shmod_works=yes
+ rm -f shlib.${SHLIBEXT} shlib.o
+ ])
+ if test $ac_cv_shlib_works = no -o $ac_cv_shmod_works = no; then
BLDSHARED=false
fi
fi
@@ -150,6 +167,8 @@ fi
if test $BLDSHARED != true; then
SHLD="shared-libraries-disabled"
SHLD_FLAGS="shared-libraries-disabled"
+ MDLD="shared-modules-disabled"
+ MDLD_FLAGS="shared-modules-disabled"
SHLIBEXT="shared_libraries_disabled"
SONAMEFLAG="shared-libraries-disabled"
PICFLAG=""
@@ -158,6 +177,11 @@ if test $BLDSHARED != true; then
AC_MSG_CHECKING([SHLD_FLAGS])
AC_MSG_RESULT([$SHLD_FLAGS])
+ AC_MSG_CHECKING([MDLD])
+ AC_MSG_RESULT([$MDLD])
+ AC_MSG_CHECKING([MDLD_FLAGS])
+ AC_MSG_RESULT([$MDLD_FLAGS])
+
AC_MSG_CHECKING([SHLIBEXT])
AC_MSG_RESULT([$SHLIBEXT])
AC_MSG_CHECKING([SONAMEFLAG])