diff options
Diffstat (limited to 'source4/lib/replace')
-rw-r--r-- | source4/lib/replace/libreplace_ld.m4 | 50 |
1 files changed, 50 insertions, 0 deletions
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) +]) |