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,
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=""
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])
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)'