r25851: Move system-specific ldflags checks to libreplace so they can be used by...
[vlendec/samba-autobuild/.git] / source4 / lib / replace / libreplace_ld.m4
index d3d3f9464fc98024ef3dd306ed66dbc0c597c4f0..07dd2db231786cc290ba8d058ead7fc834d19a4a 100644 (file)
@@ -63,3 +63,41 @@ case "$host_os" in
 esac
 AC_SUBST(PICFLAG)
 ])
+
+AC_DEFUN([AC_LD_SHLDFLAGS],
+[
+       SHLD_FLAGS="-shared"
+
+       case "$host_os" in
+               *linux*)
+                       SHLD_FLAGS="-shared -Wl,-Bsymbolic"
+                       ;;
+               *solaris*)
+                       SHLD_FLAGS="-G"
+                       if test "${GCC}" = "no"; then
+                               ## ${CFLAGS} added for building 64-bit shared 
+                               ## libs using Sun's Compiler
+                               SHLD_FLAGS="-G \${CFLAGS}"
+                       fi
+                       ;;
+               *sunos*)
+                       SHLD_FLAGS="-G"
+                       ;;
+               *irix*)
+                       SHLD_FLAGS="-set_version sgi1.0 -shared"
+                       ;;
+               *aix*)
+                       SHLD_FLAGS="-Wl,-G,-bexpall,-bbigtoc"
+                       ;;
+               *hpux*)
+                       if test $ac_cv_prog_cc_Ae = yes; then
+                               SHLD_FLAGS="-b -Wl,-B,symbolic,-b,-z"
+                       fi
+                       ;;
+               *darwin*)
+                       SHLD_FLAGS="-bundle -flat_namespace -undefined suppress"
+                       ;;
+       esac
+
+       AC_SUBST(SHLD_FLAGS)
+])