1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-13 16:23:50 +03:00
Files
samba-mirror/source/lib/replace/libreplace_ld.m4
jelmer 48c70f6040 Add macro for picflag.
git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25850 0c0555d6-39d7-0310-84fc-f1cc0bd64818
2007-11-06 09:38:58 +01:00

66 lines
1.1 KiB
Plaintext

AC_DEFUN([AC_LD_EXPORT_DYNAMIC],
[
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
AC_LINK_IFELSE([ int main() { return 0; } ],
[ LD_EXPORT_DYNAMIC=-Wl,--export-dynamic ],
[ LD_EXPORT_DYNAMIC= ])
AC_SUBST(LD_EXPORT_DYNAMIC)
LDFLAGS="$saved_LDFLAGS"
])
AC_DEFUN([AC_LD_PICFLAG],
[
case "$host_os" in
*linux*)
PICFLAG="-fPIC"
;;
*solaris*)
if test "${GCC}" = "yes"; then
PICFLAG="-fPIC"
else
PICFLAG="-KPIC"
fi
;;
*sunos*)
PICFLAG="-KPIC" # Is this correct for SunOS
;;
*netbsd* | *freebsd* | *dragonfly* )
PICFLAG="-fPIC -DPIC"
;;
*openbsd*)
PICFLAG="-fPIC"
;;
*irix*)
if test "${GCC}" = "yes"; then
PICFLAG="-fPIC"
else
PICFLAG="-KPIC"
fi
;;
*aix*)
# as AIX code is always position independent...
PICFLAG="-O2"
;;
*hpux*)
if test $ac_cv_prog_cc_Ae = yes; then
PICFLAG="+z +ESnolit"
elif test "${GCC}" = "yes"; then
PICFLAG="-fPIC"
fi
if test "$host_cpu" = "ia64"; then
PICFLAG="+z"
fi
;;
*osf*)
PICFLAG="-fPIC"
;;
*unixware*)
PICFLAG="-KPIC"
;;
*darwin*)
;;
esac
AC_SUBST(PICFLAG)
])