summaryrefslogtreecommitdiff
path: root/source3/configure.in
diff options
context:
space:
mode:
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