Skip to content

Commit 6b4b1e7

Browse files
author
Jani Taskinen
committed
MFH: cleanup & sync
1 parent 521917b commit 6b4b1e7

File tree

1 file changed

+31
-37
lines changed

1 file changed

+31
-37
lines changed

scripts/phpize.m4

+31-37
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,7 @@ AC_INIT(config.m4)
77

88
PHP_CONFIG_NICE(config.nice)
99

10-
AC_DEFUN([PHP_WITH_PHP_CONFIG],[
11-
AC_ARG_WITH(php-config,
12-
[ --with-php-config=PATH],[
13-
PHP_CONFIG=$withval
14-
],[
15-
PHP_CONFIG=php-config
16-
])
17-
18-
prefix=`$PHP_CONFIG --prefix 2>/dev/null`
19-
phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
20-
INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
21-
EXTENSION_DIR=`$PHP_CONFIG --extension-dir`
22-
PHP_EXECUTABLE=`$PHP_CONFIG --php-binary`
23-
24-
if test -z "$prefix"; then
25-
AC_MSG_ERROR(Cannot find php-config. Please use --with-php-config=PATH)
26-
fi
27-
28-
php_shtool=$srcdir/build/shtool
29-
PHP_INIT_BUILD_SYSTEM
30-
31-
AC_MSG_CHECKING(for PHP prefix)
32-
AC_MSG_RESULT($prefix)
33-
AC_MSG_CHECKING(for PHP includes)
34-
AC_MSG_RESULT($INCLUDES)
35-
AC_MSG_CHECKING(for PHP extension directory)
36-
AC_MSG_RESULT($EXTENSION_DIR)
37-
AC_MSG_CHECKING(for PHP installed headers prefix)
38-
AC_MSG_RESULT($phpincludedir)
39-
])
40-
dnl
10+
dnl
4111
AC_DEFUN([PHP_EXT_BUILDDIR],[.])dnl
4212
AC_DEFUN([PHP_EXT_DIR],[""])dnl
4313
AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir])dnl
@@ -54,18 +24,42 @@ AC_PROG_CC
5424
AC_PROG_CC_C_O
5525

5626
dnl Support systems with system libraries in e.g. /usr/lib64
57-
AC_ARG_WITH(libdir,
58-
[ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib],
59-
[PHP_LIBDIR=$withval], [PHP_LIBDIR=lib])
27+
PHP_ARG_WITH(libdir, for system library directory,
28+
[ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib], lib, no)
6029

6130
PHP_RUNPATH_SWITCH
6231
PHP_SHLIB_SUFFIX_NAMES
63-
PHP_WITH_PHP_CONFIG
6432

65-
PHP_BUILD_SHARED
33+
dnl Find php-config script
34+
PHP_ARG_WITH(config,,
35+
[ --with-php-config=PATH Path to php-config [php-config]], php-config, no)
6636

67-
AC_PREFIX_DEFAULT()
37+
prefix=`$PHP_CONFIG --prefix 2>/dev/null`
38+
phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
39+
INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
40+
EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
41+
PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
42+
43+
if test -z "$prefix"; then
44+
AC_MSG_ERROR([Cannot find php-config. Please use --with-php-config=PATH])
45+
fi
46+
47+
php_shtool=$srcdir/build/shtool
48+
PHP_INIT_BUILD_SYSTEM
49+
50+
AC_MSG_CHECKING([for PHP prefix])
51+
AC_MSG_RESULT([$prefix])
52+
AC_MSG_CHECKING([for PHP includes])
53+
AC_MSG_RESULT([$INCLUDES])
54+
AC_MSG_CHECKING([for PHP extension directory])
55+
AC_MSG_RESULT([$EXTENSION_DIR])
56+
AC_MSG_CHECKING([for PHP installed headers prefix])
57+
AC_MSG_RESULT([$phpincludedir])
58+
59+
dnl Always shared
60+
PHP_BUILD_SHARED
6861

62+
dnl Required programs
6963
PHP_PROG_RE2C
7064
PHP_PROG_AWK
7165

0 commit comments

Comments
 (0)