@@ -540,6 +540,15 @@ AC_ARG_ENABLE(url-fopen-wrapper,
540
540
AC_MSG_RESULT(yes)
541
541
])
542
542
543
+ AC_MSG_CHECKING(whether to enable PIC for shared objects)
544
+ AC_ARG_ENABLE(pic,
545
+ [ --disable-pic Disable PIC for shared objects],[
546
+ PHP_PIC=$enableval
547
+ ],[
548
+ PHP_PIC=yes
549
+ ])
550
+ AC_MSG_RESULT($PHP_PIC )
551
+
543
552
DMALLOC_RESULT=no
544
553
AC_MSG_CHECKING(whether to enable dmalloc)
545
554
AC_ARG_ENABLE(dmalloc,
@@ -657,15 +666,6 @@ if test "$abs_srcdir" != "$abs_builddir"; then
657
666
fi
658
667
fi
659
668
660
- dnl *** Commented out - generates slow code and consumes a lot of
661
- dnl *** resources during compilation - we need to figure out how
662
- dnl *** to supply it only when absolutely necessary
663
- dnl If we are using gcc add -fpic to make dl() work on some platforms
664
- dnl test -n "$GCC " && CFLAGS="$CFLAGS -fpic"
665
-
666
- dnl add -fPIC option on Solaris if we are building dynamic extensions
667
- dnl PHP_SOLARIS_PIC_WEIRDNESS
668
-
669
669
EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS "
670
670
LIBS=""
671
671
LDFLAGS=""
@@ -742,6 +742,18 @@ PHP_SUBST(WARNING_LEVEL)
742
742
PHP_SUBST(YACC)
743
743
744
744
PHP_CONFIGURE_PART(Configuring libtool)
745
+
746
+ old_CC="$CC "
747
+
748
+ if test "$PHP_THREAD_SAFETY " = "yes" && test -n "$ac_cv_pthreads_cflags "; then
749
+ cat >meta_ccld<<EOF
750
+ #! /bin/sh
751
+ exec $CC $ac_cv_pthreads_cflags \$ @
752
+ EOF
753
+ CC="$abs_builddir /meta_ccld"
754
+ chmod +x meta_ccld
755
+ fi
756
+
745
757
AM_PROG_LIBTOOL
746
758
if test "$enable_debug " != "yes"; then
747
759
AM_SET_LIBTOOL_VARIABLE([--silent])
@@ -761,6 +773,20 @@ else
761
773
fi
762
774
fi
763
775
776
+ CC="$old_CC "
777
+
778
+ changequote({,})
779
+ if test "$PHP_PIC " = "no"; then
780
+ cat >meta_cc<<EOF
781
+ #! /bin/sh
782
+ cmd="$CC \` echo \$ @|sed s/-[fFD]PIC//g\` "
783
+ exec \$ cmd
784
+ EOF
785
+ chmod +x meta_cc
786
+ CC="$abs_builddir /meta_cc"
787
+ fi
788
+ changequote([,])
789
+
764
790
test "$prefix " = "NONE" && prefix="/usr/local"
765
791
test "$exec_prefix " = "NONE" && exec_prefix='$( prefix) '
766
792
0 commit comments