summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2000-03-18 17:58:09 +0000
committerSascha Schumann <sas@php.net>2000-03-18 17:58:09 +0000
commit827ad656cb2585d2b9a9cc2d3bb021e8edf34365 (patch)
treeecec1b6e6c91f251316bcef7b4cc67958a5a0a9d /configure.in
parent608b96a8aa5c9c79c6fb83fc13e2406f41c32b13 (diff)
downloadphp-git-827ad656cb2585d2b9a9cc2d3bb021e8edf34365.tar.gz
@- Added --disable-pic for disabling generating PIC for shared objects
on platforms which support it (i.e. Linux) (Sascha) Additionally, we enforce passing pthread_cflags to the compiler, if libtool chooses it as linker.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in44
1 files changed, 35 insertions, 9 deletions
diff --git a/configure.in b/configure.in
index 366d4afdb7..ec0ad5fb17 100644
--- a/configure.in
+++ b/configure.in
@@ -540,6 +540,15 @@ AC_ARG_ENABLE(url-fopen-wrapper,
AC_MSG_RESULT(yes)
])
+AC_MSG_CHECKING(whether to enable PIC for shared objects)
+AC_ARG_ENABLE(pic,
+[ --disable-pic Disable PIC for shared objects],[
+ PHP_PIC=$enableval
+],[
+ PHP_PIC=yes
+])
+AC_MSG_RESULT($PHP_PIC)
+
DMALLOC_RESULT=no
AC_MSG_CHECKING(whether to enable dmalloc)
AC_ARG_ENABLE(dmalloc,
@@ -657,15 +666,6 @@ if test "$abs_srcdir" != "$abs_builddir"; then
fi
fi
-dnl *** Commented out - generates slow code and consumes a lot of
-dnl *** resources during compilation - we need to figure out how
-dnl *** to supply it only when absolutely necessary
-dnl If we are using gcc add -fpic to make dl() work on some platforms
-dnl test -n "$GCC" && CFLAGS="$CFLAGS -fpic"
-
-dnl add -fPIC option on Solaris if we are building dynamic extensions
-dnl PHP_SOLARIS_PIC_WEIRDNESS
-
EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS"
LIBS=""
LDFLAGS=""
@@ -742,6 +742,18 @@ PHP_SUBST(WARNING_LEVEL)
PHP_SUBST(YACC)
PHP_CONFIGURE_PART(Configuring libtool)
+
+old_CC="$CC"
+
+if test "$PHP_THREAD_SAFETY" = "yes" && test -n "$ac_cv_pthreads_cflags"; then
+ cat >meta_ccld<<EOF
+#! /bin/sh
+exec $CC $ac_cv_pthreads_cflags \$@
+EOF
+ CC="$abs_builddir/meta_ccld"
+ chmod +x meta_ccld
+fi
+
AM_PROG_LIBTOOL
if test "$enable_debug" != "yes"; then
AM_SET_LIBTOOL_VARIABLE([--silent])
@@ -761,6 +773,20 @@ else
fi
fi
+CC="$old_CC"
+
+changequote({,})
+if test "$PHP_PIC" = "no"; then
+ cat >meta_cc<<EOF
+#! /bin/sh
+cmd="$CC \`echo \$@|sed s/-[fFD]PIC//g\`"
+exec \$cmd
+EOF
+ chmod +x meta_cc
+ CC="$abs_builddir/meta_cc"
+fi
+changequote([,])
+
test "$prefix" = "NONE" && prefix="/usr/local"
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'