Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 156 lines (124 sloc) 3.061 kb
1e1e343 - restructured phpize
Jan Lehnardt authored
1 #!/bin/sh
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
2
1e1e343 - restructured phpize
Jan Lehnardt authored
3 # Variable declaration
fbc947f * generate pear scripts properly with configure
Stig Bakken authored
4 prefix='@prefix@'
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
5 phpdir="$prefix/lib/php/build"
24e9621 - Fix phpize
Derick Rethans authored
6 includedir="$prefix/include/php"
5989ae5 Fix building external extensions.
Sascha Schumann authored
7 builddir="`pwd`"
20c4328 - Fixed bug: #13561 (--without-pear prevents install of phpize, php-conf...
foobar authored
8
755eccf - Moved scan_makefile_in.awk to better suitable place for it.
foobar authored
9 FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool"
10 FILES="acinclude.m4 Makefile.global"
20c4328 - Fixed bug: #13561 (--without-pear prevents install of phpize, php-conf...
foobar authored
11 CLEAN_FILES="$FILES *.lo *.la *.o .deps .libs/ build/ include/ modules/ install-sh \
12 mkinstalldirs missing config.nice config.sub config.guess configure configure.in \
13 aclocal.m4 config.h config.h.in conftest* ltmain.sh libtool config.cache \
8fec4cc Missing "confdefs.h" in the cleanup-files-list
foobar authored
14 config.log config.status Makefile Makefile.fragments Makefile.objects confdefs.h"
5989ae5 Fix building external extensions.
Sascha Schumann authored
15
1e1e343 - restructured phpize
Jan Lehnardt authored
16 # function declaration
17 phpize_usage()
18 {
19 echo "Usage: $0 [--clean|--help|--version|-v]"
20 }
21
22 phpize_no_configm4()
23 {
24 if test $@ -eq 1; then
25 clean=" --clean"
26 fi
27
28 echo "Cannot find config.m4. "
29 echo "Make sure that you run '$0$clean' in the top level source directory of the module"
30 echo
31 }
32
33 phpize_clean()
34 {
35 echo "Cleaning.."
36 for i in $CLEAN_FILES; do
37 test -e $i && rm -rf $i
38 done
39 }
40
41 phpize_check_configm4()
42 {
43 if test ! -r config.m4; then
44 phpize_no_configm4 $@
45 exit 1
46 fi
47
48 }
49
50 phpize_get_api_numbers()
51 {
52 # extracting API NOs:
53 PHP_API_VERSION=`egrep '#define PHP_API_VERSION' $includedir/main/php.h|sed 's/#define PHP_API_VERSION//'`
54 ZEND_MODULE_API_NO=`egrep '#define ZEND_MODULE_API_NO' $includedir/Zend/zend_modules.h|sed 's/#define ZEND_MODULE_API_NO//'`
55 ZEND_EXTENSION_API_NO=`egrep '#define ZEND_EXTENSION_API_NO' $includedir/Zend/zend_extensions.h|sed 's/#define ZEND_EXTENSION_API_NO//'`
56 }
57
58 phpize_print_api_numbers()
59 {
60 phpize_get_api_numbers
61 echo "Configuring for:"
62 echo "PHP Api Version: "$PHP_API_VERSION
63 echo "Zend Module Api No: "$ZEND_MODULE_API_NO
64 echo "Zend Extension Api No: "$ZEND_EXTENSION_API_NO
65 }
66
67 phpize_no_shtool()
68 {
69 echo <<EOF
70 shtool at '$builddir/build/shtool' not executable.
71 Make sure that the file exists and is executable and then rerun this script.
72
73 EOF
74 }
75
76 phpize_check_shtool()
77 {
78 test -x $builddir/build/shtool || chmod +x $builddir/build/shtool
79
80 if test ! -x $builddir/build/shtool; then
81 phpize_no_shtool
82 exit 1
83 fi
84 }
85
86
87 phpize_copy_files()
88 {
89 test -d build || mkdir build
90
91 (cd $phpdir && cp $FILES_BUILD "$builddir"/build)
92 (cd $phpdir && cp $FILES "$builddir")
93 }
94
95 phpize_replace_prefix()
96 {
97 sed \
98 -e "s#@prefix@#$prefix#" \
99 < $phpdir/phpize.m4 > configure.in
100 }
101
102 phpize_autotools()
103 {
104 aclocal || exit 1
105 autoconf || exit 1
106 autoheader || exit 1
107 }
108
109 phpize_libtoolize()
110 {
111 libtoolize=`$builddir/build/shtool path glibtoolize libtoolize`
112 $libtoolize -f -c || exit 1
113 }
114
115 # Main script
116
f6cafd6 Fix previous commit. (never do 2 things same time :)
foobar authored
117 case "$1" in
118 # Cleanup
063e4e2 Added --help to phpize
foobar authored
119 --clean)
1e1e343 - restructured phpize
Jan Lehnardt authored
120 phpize_check_configm4 1
121 phpize_clean
122 exit 0
063e4e2 Added --help to phpize
foobar authored
123 ;;
1e1e343 - restructured phpize
Jan Lehnardt authored
124
f6cafd6 Fix previous commit. (never do 2 things same time :)
foobar authored
125 # Usage
063e4e2 Added --help to phpize
foobar authored
126 --help)
1e1e343 - restructured phpize
Jan Lehnardt authored
127 phpize_usage
128 exit 0
063e4e2 Added --help to phpize
foobar authored
129 ;;
1e1e343 - restructured phpize
Jan Lehnardt authored
130
131 # Version
132 --version|-v)
133 phpize_get_api_numbers
134 phpize_print_api_numbers
135 exit 0
136 ;;
137
138 # Default
f6cafd6 Fix previous commit. (never do 2 things same time :)
foobar authored
139 *)
1e1e343 - restructured phpize
Jan Lehnardt authored
140 phpize_check_configm4 0
20c4328 - Fixed bug: #13561 (--without-pear prevents install of phpize, php-conf...
foobar authored
141
1e1e343 - restructured phpize
Jan Lehnardt authored
142 phpize_copy_files
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
143
1e1e343 - restructured phpize
Jan Lehnardt authored
144 phpize_replace_prefix
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
145
1e1e343 - restructured phpize
Jan Lehnardt authored
146 touch install-sh mkinstalldirs missing
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
147
1e1e343 - restructured phpize
Jan Lehnardt authored
148 phpize_autotools
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
149
1e1e343 - restructured phpize
Jan Lehnardt authored
150 phpize_check_shtool
151
152 phpize_libtoolize
153 ;;
154 esac
155
156 exit 0
Something went wrong with that request. Please try again.