|
2 | 2 | #
|
3 | 3 | # A wrapper around Autoconf that generates files to build PHP on *nix systems.
|
4 | 4 |
|
5 |
| -MAKE=${MAKE:-make} |
6 | 5 | PHP_AUTOCONF=${PHP_AUTOCONF:-autoconf}
|
7 | 6 | PHP_AUTOHEADER=${PHP_AUTOHEADER:-autoheader}
|
8 | 7 | force=0
|
@@ -38,15 +37,13 @@ SYNOPSIS:
|
38 | 37 | buildconf [<options>]
|
39 | 38 |
|
40 | 39 | OPTIONS:
|
41 |
| - -f, --force Clean cache and overwrite configure files. |
| 40 | + -f, --force Regenerate configure files in PHP release packages. |
42 | 41 | --debug Display warnings emitted by Autoconf.
|
43 | 42 | -h, --help Display this help.
|
44 | 43 |
|
45 | 44 | ENVIRONMENT:
|
46 | 45 | The following optional variables are supported:
|
47 | 46 |
|
48 |
| - MAKE Overrides the path to make tool. |
49 |
| - MAKE=/path/to/make ./buildconf |
50 | 47 | PHP_AUTOCONF Overrides the path to autoconf tool.
|
51 | 48 | PHP_AUTOCONF=/path/to/autoconf ./buildconf
|
52 | 49 | PHP_AUTOHEADER Overrides the path to autoheader tool.
|
|
66 | 63 | shift
|
67 | 64 | done
|
68 | 65 |
|
69 |
| -if test "$dev" = "0" -a "$force" = "0"; then |
70 |
| - if test -f "configure"; then |
71 |
| - echo "The configure script has already been built for you. All done." |
72 |
| - echo "Run ./configure to proceed with customizing the PHP build." |
| 66 | +if test "$dev" = "0" && test "$force" = "0"; then |
| 67 | + if test -f "configure" && test -f "main/php_config.h.in"; then |
| 68 | + echo "buildconf: The configure script is already built. All done." |
| 69 | + echo " Run ./configure to proceed with customizing the PHP build." |
73 | 70 | exit 0
|
74 | 71 | else
|
75 |
| - echo "Configure script is missing." >&2 |
76 |
| - echo "Run ./buildconf --force to create a configure script." >&2 |
| 72 | + echo "buildconf: Configure files are missing." >&2 |
| 73 | + echo " Run ./buildconf --force to create a configure script." >&2 |
77 | 74 | exit 1
|
78 | 75 | fi
|
79 | 76 | fi
|
80 | 77 |
|
81 |
| -if test "$force" = "1"; then |
82 |
| - echo "buildconf: Forcing buildconf" |
83 |
| - echo "buildconf: Removing configure caches and files" |
84 |
| - rm -rf autom4te.cache config.cache configure |
85 |
| -fi |
86 |
| - |
87 | 78 | echo "buildconf: Checking installation"
|
88 | 79 |
|
89 | 80 | # Get minimum required autoconf version from the configure.ac file.
|
@@ -114,23 +105,33 @@ else
|
114 | 105 | echo "buildconf: autoconf version $ac_version (ok)"
|
115 | 106 | fi
|
116 | 107 |
|
117 |
| -# Check if make exists. |
118 |
| -if ! test -x "$(command -v $MAKE)"; then |
119 |
| - echo "buildconf: make not found." >&2 |
120 |
| - echo " You need to have make installed to build PHP." >&2 |
121 |
| - exit 1 |
| 108 | +if test "$force" = "1"; then |
| 109 | + echo "buildconf: Forcing buildconf. The configure files will be regenerated." |
122 | 110 | fi
|
123 | 111 |
|
124 |
| -echo "buildconf: Building configure files" |
| 112 | +# Clean cache and explicitly remove all targets if present. Remove also |
| 113 | +# aclocal.m4 if present. It is automatically included by autoconf but not used |
| 114 | +# by the PHP build system since PHP 7.4. |
| 115 | +echo "buildconf: Cleaning cache and configure files" |
| 116 | +rm -rf \ |
| 117 | + aclocal.m4 \ |
| 118 | + autom4te.cache \ |
| 119 | + config.cache \ |
| 120 | + configure \ |
| 121 | + main/php_config.h.in |
125 | 122 |
|
126 | 123 | if test "$debug" = "1"; then
|
127 | 124 | autoconf_flags="-f -Wall"
|
| 125 | + autoheader_flags="-Wall" |
128 | 126 | else
|
129 | 127 | autoconf_flags="-f"
|
| 128 | + autoheader_flags="" |
130 | 129 | fi
|
131 | 130 |
|
132 |
| -$MAKE -s -f build/build.mk \ |
133 |
| - PHP_AUTOCONF="$PHP_AUTOCONF" \ |
134 |
| - PHP_AUTOHEADER="$PHP_AUTOHEADER" \ |
135 |
| - PHP_AUTOCONF_FLAGS="$autoconf_flags" \ |
136 |
| - PHP_M4_FILES="$(echo TSRM/*.m4 Zend/Zend.m4 build/*.m4 ext/*/config*.m4 sapi/*/config*.m4)" |
| 131 | +echo "buildconf: Rebuilding configure" |
| 132 | +$PHP_AUTOCONF $autoconf_flags |
| 133 | + |
| 134 | +echo "buildconf: Rebuilding main/php_config.h.in" |
| 135 | +$PHP_AUTOHEADER $autoheader_flags |
| 136 | + |
| 137 | +echo "buildconf: Run ./configure to proceed with customizing the PHP build." |
0 commit comments