summaryrefslogtreecommitdiff
path: root/source4/lib/replace
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-11-06 02:16:55 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:44:26 +0100
commit6e561c7f7de2e1489033da40472311147a46c1f9 (patch)
tree80f07683d94c75692008224579e0ad4776577a8b /source4/lib/replace
parentef71598952f98edc55b4303ad3b66eec9ec24b9f (diff)
downloadsamba-6e561c7f7de2e1489033da40472311147a46c1f9.tar.gz
samba-6e561c7f7de2e1489033da40472311147a46c1f9.tar.bz2
samba-6e561c7f7de2e1489033da40472311147a46c1f9.zip
r25850: Add macro for picflag.
(This used to be commit 9ebc6f2d17349b214618d65b29826867796c12ce)
Diffstat (limited to 'source4/lib/replace')
-rw-r--r--source4/lib/replace/libreplace_ld.m455
1 files changed, 55 insertions, 0 deletions
diff --git a/source4/lib/replace/libreplace_ld.m4 b/source4/lib/replace/libreplace_ld.m4
index 8d7d3d7ebb..d3d3f9464f 100644
--- a/source4/lib/replace/libreplace_ld.m4
+++ b/source4/lib/replace/libreplace_ld.m4
@@ -8,3 +8,58 @@ AC_LINK_IFELSE([ int main() { return 0; } ],
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)
+])