1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#!/bin/sh
#
# The following is a massive hack. It tries to steal the
# mechanism for build a dynamic library from Perl's -V output
# If this script fails on this machine, try running 'perl -V'
# manually and pick out the setting for:
#
# cc, optimize, ccflags, ld, cccdlflags and lddlflags
#
# if the greps and cuts don't do the job, set these manually
CC=`perl -V:cc | cut -d, -f1 | cut -d\' -f2`
OPT=`perl -V:optimize | cut -d, -f2 | cut -d\' -f2`
CCFLAGS=`perl -V:ccflags | cut -d, -f1 | cut -d\' -f2`
LD=`perl -V:ld | cut -d, -f1 | cut -d\' -f2`
LFLAGS=`perl -V:cccdlflags | cut -d, -f1 | cut -d\' -f2`
CCDLFLAGS=`perl -V:ccdlflags | cut -d, -f4 | cut -d\' -f2 | sed "s, ,,"`
LDDLFLAGS=`perl -V:lddlflags | cut -d, -f2 | cut -d\' -f2`
#--------
if [ ! ".$CCDLFLAGS" = "." ]; then
echo "To use extensions on your OS, you will need to recompile PHP."
echo "You need to edit the Makefile in the php3 directory and add "
echo "$CCDLFLAGS to the start of the LDFLAGS line at the top of the "
echo "Makefile. Then type: 'make clean; make' "
echo "You can still go ahead and build the extensions now by typing"
echo "'make' in this directory. They just won't work correctly "
echo "until you recompile your PHP. "
echo "If you are compiling php as a module, you should also add "
echo "$CCDLFLAGS to the start of the EXTRA_LDFLAGS in Apache "
echo "Configuration file. Note that if you are using the APACI "
echo "build mechanism you should make this change in the "
echo "Configuration.tmpl file instead. "
fi
CC="$CC $OPT $CCFLAGS -I. -I.. $LFLAGS"
LD="$LD $LDDLFLAGS $CCDLFLAGS"
sed "s,@CC@,$CC,
s,@LD@,$LD," <Makefile.tmpl >Makefile
|