From: Sascha Schumann Date: Sat, 12 May 2001 12:22:34 +0000 (+0000) Subject: First step towards full libtool 1.4 portability X-Git-Tag: PRE_GRANULAR_GARBAGE_FIX~460 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e5176fe60a9ffbe211ee016acdcddb18118e4487;p=php First step towards full libtool 1.4 portability --- diff --git a/build/rules_common.mk b/build/rules_common.mk index 32ce8086b5..bab3a16343 100644 --- a/build/rules_common.mk +++ b/build/rules_common.mk @@ -23,8 +23,8 @@ COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) COMPILE = $(CC) $(COMMON_FLAGS) $(CFLAGS) $(EXTRA_CFLAGS) CXX_COMPILE = $(CXX) $(COMMON_FLAGS) $(CXXFLAGS) $(EXTRA_CXXFLAGS) -SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(COMPILE) -c $< && touch $@ -CXX_SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CXX_COMPILE) -c $< && touch $@ +SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) -prefer-pic $(EXTRA_CFLAGS) -c $< && touch $@ +CXX_SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CXX) $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) -prefer-pic $(EXTRA_CXXFLAGS) -c $< && touch $@ LINK = $(LIBTOOL) --mode=link $(COMPILE) $(LDFLAGS) -o $@ diff --git a/configure.in b/configure.in index 57ae84a81d..9c778fc202 100644 --- a/configure.in +++ b/configure.in @@ -594,10 +594,6 @@ else fi -PHP_ARG_ENABLE(pic,whether to enable PIC for shared objects, -[ --disable-pic Disable PIC for shared objects], yes) - - PHP_ARG_ENABLE(dmalloc,whether to enable dmalloc, [ --enable-dmalloc Enable dmalloc]) @@ -652,18 +648,22 @@ divert(6) enable_shared=yes enable_static=yes +unset with_pic case $php_build_target in -program) - enable_shared=no +program|static) + standard_libtool_flag='-prefer-non-pic -static' + if test "$lib_build_shared" != "yes"; then + enable_shared=no + fi + PHP_COMPILE='$(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c $< && touch $@' + CXX_PHP_COMPILE='$(CXX) $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -c $< && touch $@' ;; shared) enable_static=no + standard_libtool_flag=-prefer-pic EXTRA_LDFLAGS="$EXTRA_LDFLAGS -avoid-version" ;; -static) - enable_shared=no -;; esac if test "$PHP_SAPI" = "cgi"; then @@ -822,11 +822,13 @@ PHP_SUBST(sysconfdir) PHP_SUBST(AWK) PHP_SUBST(CC) PHP_SUBST(CFLAGS) +PHP_SUBST(CFLAGS_CLEAN) PHP_SUBST_OLD(CONFIGURE_COMMAND) PHP_SUBST(CPP) PHP_SUBST(CPPFLAGS) PHP_SUBST(CXX) PHP_SUBST(CXXFLAGS) +PHP_SUBST(CXXFLAGS_CLEAN) PHP_SUBST(CXX_PHP_COMPILE) PHP_SUBST_OLD(DEBUG_CFLAGS) PHP_SUBST(DEFS) @@ -886,39 +888,21 @@ if test "$enable_debug" != "yes"; then AM_SET_LIBTOOL_VARIABLE([--silent]) fi -PHP_COMPILE='$(LIBTOOL) --mode=compile $(COMPILE) -c $<' -CXX_PHP_COMPILE='$(LIBTOOL) --mode=compile $(CXX_COMPILE) -c $<' -if test "$enable_shared" = "yes"; then - SHARED_LIBTOOL='$(LIBTOOL)' -else - if test "$lib_build_shared" = "yes"; then - PHP_CONFIGURE_PART(Configuring shared libtool) -dnl XXX This needs to be fixed -# $SHELL $srcdir/ltconfig --output=shlibtool --disable-static --srcdir=$srcdir --cache-file=./config.cache $srcdir/ltmain.sh - SHARED_LIBTOOL='$(SHELL) $(top_builddir)/shlibtool' - else - PHP_COMPILE='$(COMPILE) -c $< && touch $@' - CXX_PHP_COMPILE='$(CXX_COMPILE) -c $< && touch $@' - fi -fi +test -z "$PHP_COMPILE" && PHP_COMPILE='$(LIBTOOL) --mode=compile $(COMPILE) -c $<' +test -z "$CXX_PHP_COMPILE" && CXX_PHP_COMPILE='$(LIBTOOL) --mode=compile $(CXX_COMPILE) -c $<' +SHARED_LIBTOOL='$(LIBTOOL)' CC=$old_CC -changequote({,}) -if test "$PHP_PIC" = "no"; then - cat >meta_cc<