summaryrefslogtreecommitdiff
path: root/source3/configure.in
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-10-08 04:52:11 +0000
committerAndrew Tridgell <tridge@samba.org>1998-10-08 04:52:11 +0000
commit7e5f267ee9baf3f25bf9b5d8af949f12f1ffbde9 (patch)
treea1a49b3c0cedb1f5f0b6b8b500ba29a990d57640 /source3/configure.in
parent4750ce1760a39100f71e74ce8b88a925fef4c42f (diff)
downloadsamba-7e5f267ee9baf3f25bf9b5d8af949f12f1ffbde9.tar.gz
samba-7e5f267ee9baf3f25bf9b5d8af949f12f1ffbde9.tar.bz2
samba-7e5f267ee9baf3f25bf9b5d8af949f12f1ffbde9.zip
auto-detect the right flag for the compiler to produce PIC code
(This used to be commit 5d92e003978f02e53c0886508ccefc8c24ec1bbf)
Diffstat (limited to 'source3/configure.in')
-rw-r--r--source3/configure.in26
1 files changed, 23 insertions, 3 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 998479cadb..9c92272e9e 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -24,7 +24,6 @@ SAMBA_MAINTAINER_MODE
# how to compile C code to produce PIC object files
# these are the defaults, good for lots of systems
-PICFLAG="-fpic"
HOST_OS="$host_os"
LDSHFLAGS="-shared"
@@ -32,13 +31,13 @@ LDSHFLAGS="-shared"
case "$host_os" in
*linux*) AC_DEFINE(LINUX);;
*solaris*) AC_DEFINE(SUNOS5)
- LDSHFLAGS="-G";;
+ LDSHFLAGS="-G"
+ ;;
*sunos*) AC_DEFINE(SUNOS4)
LDSHFLAGS=""
;;
*irix*) AC_DEFINE(IRIX)
WRAP32=smbwrapper/smbwrapper.32.so
- PICFLAG="-KPIC"
;;
*aix*) AC_DEFINE(AIX);;
*hpux*) AC_DEFINE(HPUX);;
@@ -48,6 +47,27 @@ case "$host_os" in
*next2*) AC_DEFINE(NEXT2);;
esac
+
+# try to work out how to produce pic code with this compiler
+PICFLAG=""
+AC_PROG_CC_FLAG(fpic)
+if test $ac_cv_prog_cc_fpic = yes; then
+ PICFLAG="-fpic";
+fi
+if test x$PICFLAG = x; then
+ AC_PROG_CC_FLAG(Kpic)
+ if test $ac_cv_prog_cc_Kpic = yes; then
+ PICFLAG="-Kpic";
+ fi
+fi
+if test x$PICFLAG = x; then
+ AC_PROG_CC_FLAG(KPIC)
+ if test $ac_cv_prog_cc_KPIC = yes; then
+ PICFLAG="-KPIC";
+ fi
+fi
+
+
AC_INLINE
AC_HEADER_STDC
AC_HEADER_DIRENT