r25977: libreplace: add AC_LIBREPLACE_MDLD and AC_LIBREPLACE_MDLD_FLAGS macros
authorStefan Metzmacher <metze@samba.org>
Thu, 15 Nov 2007 15:44:28 +0000 (16:44 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:45:27 +0000 (05:45 +0100)
They define the linker and link flags for building shared modules

metze

source/lib/replace/libreplace_ld.m4

index 506933ce31c9efbad854b155191aeb70fba9a69f..2f9834838d8cdd9c33d49d81b45ede0d60b51cbd 100644 (file)
@@ -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)
+])