]> granicus.if.org Git - php/commitdiff
First step towards full libtool 1.4 portability
authorSascha Schumann <sas@php.net>
Sat, 12 May 2001 12:22:34 +0000 (12:22 +0000)
committerSascha Schumann <sas@php.net>
Sat, 12 May 2001 12:22:34 +0000 (12:22 +0000)
build/rules_common.mk
configure.in
ext/satellite/corba.c
ext/satellite/php_orbit.c

index 32ce8086b51ae467ea031b3d9d20b23b05b46438..bab3a16343fc6e0c621c28fd1f0fcafa1b5f3cdf 100644 (file)
@@ -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 $@
 
index 57ae84a81d67372656aeb5a8aba2b4181d520c53..9c778fc202934dc894914eabe9e7d6a3c290efc3 100644 (file)
@@ -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<<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([,])
-
 PHP_CONFIGURE_PART(Generating files)
 
+CXXFLAGS_CLEAN=$CXXFLAGS
+CFLAGS_CLEAN=$CFLAGS
+CFLAGS="$CFLAGS $standard_libtool_flag"
+INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
+CXXFLAGS="$CXXFLAGS $standard_libtool_flag"
+
 PHP_GEN_CONFIG_VARS
 
 $php_shtool mkdir -p pear/scripts
index b8a083c95a4f14c73b9444202440a8af28b979f1..9c5ff446c6602da519aa1837b5376c66cd96f65f 100644 (file)
@@ -30,9 +30,7 @@
  */
 #include "corba.h"
 
-#ifdef HAVE_CONFIG_H
 #include "php_config.h"        /* for COMPILE_DL_ORBIT */
-#endif
 
 /* ZTS = thread-safe Zend */
 #ifdef ZTS
index 554a3140169832c0b2825a32414907e10a98e355..a1c31be396f3e1adc0721c1c05193db02cfa3a99 100644 (file)
@@ -38,9 +38,7 @@
 #include "struct.h"
 
 
-#ifdef HAVE_CONFIG_H
 #include "php_config.h"        /* for COMPILE_DL_ORBIT */
-#endif
 
 /* see php4/README.SELF-CONTAINED-EXTENSIONS */
 #if COMPILE_DL_SATELLITE