added workaround for Solaris PIC weirdness.

added RPM spec file for a future "official" RPM, work-in-progress
This commit is contained in:
Stig Bakken 1999-07-24 19:02:38 +00:00
parent b81789eb1e
commit 7c2f1384d4
4 changed files with 78 additions and 5 deletions

View File

@ -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
])

View File

@ -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, [
], [

48
php4.spec.in Normal file
View File

@ -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 <group@php.net>
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

View File

@ -14,3 +14,4 @@ for dir in $extensions; do
done
(set -x; $top_srcdir/scripts/armerge $outfile $ext_libs)
exit 0