File: setup

package info (click to toggle)
php3 1%3A3.0.5-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 8,348 kB
  • ctags: 9,086
  • sloc: ansic: 76,362; sh: 2,333; php: 1,329; yacc: 1,148; makefile: 970; perl: 763; cpp: 529; awk: 90; sql: 11
file content (43 lines) | stat: -rwxr-xr-x 1,809 bytes parent folder | download | duplicates (2)
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
40
41
42
43
#!/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
#
# Replace the below definitions with the output you see.
#
if test ! -r "perl.out"; then
	perl -V > perl.out
fi

# if the greps and cuts don't do the job, set these manually
CC=`grep cc= perl.out | cut -d, -f1 | cut -d\' -f2`
OPT=`grep optimize= perl.out | cut -d, -f2 | cut -d\' -f2`
CCFLAGS=`grep ccflags perl.out | cut -d, -f1 | cut -d\' -f2`
LD=`grep ld= perl.out | cut -d, -f1 | cut -d\' -f2`
LFLAGS=`grep cccdlflags= perl.out | cut -d, -f1 | cut -d\' -f2`
CCDLFLAGS=`grep ccdlflags= perl.out | cut -d, -f4 | cut -d\' -f2 | sed "s, ,,"`
LDDLFLAGS=`grep lddlflags perl.out | 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 apaches      "
        echo "Configuration file.                                          "
fi

CC="$CC $OPT $CCFLAGS -I. -I.. $LFLAGS"
LD="$LD $LDDLFLAGS $CCDLFLAGS"

sed "s,@CC@,$CC,
	 s,@LD@,$LD," <Makefile.tmpl >Makefile