From 7c2f1384d45876bbdef255c4a57301e6406f6964 Mon Sep 17 00:00:00 2001 From: Stig Bakken Date: Sat, 24 Jul 1999 19:02:38 +0000 Subject: [PATCH] added workaround for Solaris PIC weirdness. added RPM spec file for a future "official" RPM, work-in-progress --- acinclude.m4 | 24 +++++++++++++++++++++++ configure.in.in | 10 +++++----- php4.spec.in | 48 +++++++++++++++++++++++++++++++++++++++++++++ scripts/mkextlib.in | 1 + 4 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 php4.spec.in diff --git a/acinclude.m4 b/acinclude.m4 index 544192f97b..eb8f22abec 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -158,3 +158,27 @@ AC_SUBST(EXT_LIBS) AC_SUBST(EXTINFO_DEPS) dnl AC_SUBST(EXT_INCLUDE_CODE) dnl AC_SUBST(EXT_MODULES_PTRS) + +dnl +dnl Solaris requires main code to be position independent in order +dnl to let shared objects find symbols. Weird. Ugly. +dnl +dnl Must be run after all --with-NN options that let the user +dnl choose dynamic extensions, and after the gcc test. +dnl +AC_DEFUN(PHP_SOLARIS_PIC_WEIRDNESS,[ + AC_MSG_CHECKING(whether -fPIC is required) + if test "$EXT_SHARED" != ""; then + os=`uname -sr 2>/dev/null` + case "$os" in + "SunOS 5"*) + case "$CC" in + gcc*|egcs*) CFLAGS="$CFLAGS -fPIC";; + *) CFLAGS="$CFLAGS -fpic";; + esac + AC_MSG_RESULT(yes);; + *) + AC_MSG_RESULT(no);; + esac + fi +]) diff --git a/configure.in.in b/configure.in.in index f4a169025d..108fac58bb 100644 --- a/configure.in.in +++ b/configure.in.in @@ -29,10 +29,9 @@ if test "$recurse" = "yes"; then if test "$threadsafe" = "yes"; then (set -x; test -d TSRM || mkdir TSRM; cd TSRM; $cwd/$srcdir/TSRM/configure --cache-file=$cachefile $@) fi + (set -x; cd $srcdir; sh ltconfig --disable-static --enable-dlopen --cache-file=$cachefile ltmain.sh) fi -(set -x; cd $srcdir; sh ltconfig --disable-static --enable-dlopen --cache-file=$cachefile ltmain.sh) - dnl ## Diversion 1 is the initial checking of OS features, programs, dnl ## libraries and so on. @@ -53,8 +52,6 @@ divert(1) dnl ## This is where the version number is changed from now on! AM_INIT_AUTOMAKE(php, 4.0b2-dev) - - PHP_VERSION=$VERSION echo "/* automatically generated by configure */" > php_version.h.new echo "/* edit configure.in.in to change version number */" >> php_version.h.new @@ -873,6 +870,9 @@ 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 +PHP_SOLARIS_PIC_WEIRDNESS + AC_SUBST(CFLAGS) AC_SUBST(PROG_SENDMAIL) AC_SUBST(CFLAGS_SHLIB) @@ -889,7 +889,7 @@ AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME") PHP_OS=`uname` AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS") -AC_OUTPUT(Makefile libphp4.module +AC_OUTPUT(Makefile libphp4.module php4.spec scripts/mkextlib regex/Makefile @@EXT_MAKEFILES@@ build-defs.h, [ ], [ diff --git a/php4.spec.in b/php4.spec.in new file mode 100644 index 0000000000..cfcd0796c7 --- /dev/null +++ b/php4.spec.in @@ -0,0 +1,48 @@ +%define version @VERSION@ +%define so_version 4 +%define release 1 + +Name: php +Summary: PHP: Hypertext Preprocessor +Group: Development/Languages +Version: %{version} +Release: %{release} +Copyright: The PHP license (see "LICENSE" file included in distribution) +Source: http://www.php.net/version4/downloads/php-%{version}.tar.gz +Icon: php4.gif +URL: http://www.php.net/ +Packager: PHP Group + +BuildRoot: /var/tmp/php-%{version} + +%description +PHP is an HTML-embedded scripting language. Much of its syntax is +borrowed from C, Java and Perl with a couple of unique PHP-specific +features thrown in. The goal of the language is to allow web +developers to write dynamically generated pages quickly. + +%prep + +%setup + +%build +set -x +./buildconf +./configure --prefix=/usr --with-apxs \ + --enable-track-vars --disable-debug \ + --with-xml=shared \ + +# figure out configure options options based on what packages are installed +# to override, use the OVERRIDE_OPTIONS environment variable. To add +# extra options, use the OPTIONS environment variable. + +#test rpm -q MySQL-devel >&/dev/null && OPTIONS="$OPTIONS --with-mysql=shared" +#test rpm -q solid-devel >&/dev/null && OPTIONS="$OPTIONS --with-solid=shared,/home/solid" +#test rpm -q postgresql-devel >&/dev/null && OPTIONS="$OPTIONS --with-pgsql=shared" +test rpm -q expat >&/dev/null && OPTIONS="$OPTIONS --with-xml=shared" + +if test "x$OVERRIDE_OPTIONS" = "x"; then + ./configure --prefix=/usr --with-apxs=$APXS $OPTIONS +else + ./configure $OVERRIDE_OPTIONS +fi diff --git a/scripts/mkextlib.in b/scripts/mkextlib.in index 7acb214e18..c098ef7b5d 100755 --- a/scripts/mkextlib.in +++ b/scripts/mkextlib.in @@ -14,3 +14,4 @@ for dir in $extensions; do done (set -x; $top_srcdir/scripts/armerge $outfile $ext_libs) +exit 0 -- 2.40.0