diff options
author | jelmer <jelmer@samba.org> | 2007-11-06 02:16:55 +0000 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-11-06 09:38:58 +0100 |
commit | 1622ab608dfc08e8b6346d8ff7b642e55a17daad (patch) | |
tree | 4585aa7d6a26389f0d6653f0dc31287c7ae507ee | |
parent | 0627ebc62054e217fcf3c9dda38ae643b528680d (diff) | |
download | samba-1622ab608dfc08e8b6346d8ff7b642e55a17daad.tar.gz samba-1622ab608dfc08e8b6346d8ff7b642e55a17daad.tar.bz2 samba-1622ab608dfc08e8b6346d8ff7b642e55a17daad.zip |
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
(This used to be commit 48c70f604071fcf7c0887fe0136bdc2dda4c8ff4)
-rw-r--r-- | source3/lib/replace/libreplace_ld.m4 | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/source3/lib/replace/libreplace_ld.m4 b/source3/lib/replace/libreplace_ld.m4 index 8d7d3d7ebb..d3d3f9464f 100644 --- a/source3/lib/replace/libreplace_ld.m4 +++ b/source3/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) +]) |