From b415712d3fe7c71f79334bf7c1cdd246150ff077 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 15 Nov 2007 16:44:28 +0100 Subject: r25977: libreplace: add AC_LIBREPLACE_MDLD and AC_LIBREPLACE_MDLD_FLAGS macros They define the linker and link flags for building shared modules metze (This used to be commit 128b4e1a512a9ae5592ba7ccf8adde11189fc5a9) --- source4/lib/replace/libreplace_ld.m4 | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'source4/lib') diff --git a/source4/lib/replace/libreplace_ld.m4 b/source4/lib/replace/libreplace_ld.m4 index 506933ce31..2f9834838d 100644 --- a/source4/lib/replace/libreplace_ld.m4 +++ b/source4/lib/replace/libreplace_ld.m4 @@ -180,3 +180,53 @@ AC_DEFUN([AC_LD_SONAMEFLAG], ;; esac ]) + +AC_DEFUN([AC_LIBREPLACE_MDLD], +[ + MDLD="${CC}" + + case "$host_os" in + *irix*) + MDLD="${PROG_LD}" + ;; + esac + + AC_SUBST(MDLD) +]) + +AC_DEFUN([AC_LIBREPLACE_MDLD_FLAGS], +[ + MDLD_FLAGS="-shared" + + case "$host_os" in + *linux*) + MDLD_FLAGS="-shared -Wl,-Bsymbolic -Wl,--allow-shlib-undefined" + ;; + *solaris*) + MDLD_FLAGS="-G" + if test "${GCC}" = "no"; then + ## ${CFLAGS} added for building 64-bit shared + ## libs using Sun's Compiler + NDLD_FLAGS="-G \${CFLAGS}" + fi + ;; + *sunos*) + MDLD_FLAGS="-G" + ;; + *aix*) + MDLD_FLAGS="-Wl,-G,-bexpall,-bbigtoc" + ;; + *hpux*) + if test "${GCC}" = "yes"; then + MDLD_FLAGS="-shared" + else + MDLD_FLAGS="-b" + fi + ;; + *darwin*) + MDLD_FLAGS="-bundle -flat_namespace -undefined suppress -Wl,-search_paths_first" + ;; + esac + + AC_SUBST(MDLD_FLAGS) +]) -- cgit