forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-autotools.sh
More file actions
executable file
·38 lines (30 loc) · 1.15 KB
/
update-autotools.sh
File metadata and controls
executable file
·38 lines (30 loc) · 1.15 KB
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
#!/bin/sh
#
# Update the PHP autotools (autoconf, libtool) bits.
# Go to project root directory
cd "$(CDPATH='' cd -- "$(dirname -- "$0")/../../" && pwd -P)" || exit
# Use GNU grep for -P flag
grep="$(which ggrep)"
grep="${grep:-$(which grep)}"
# Handle MacPorts prefixing GNU libtoolize
libtoolize="$(which glibtoolize)"
libtoolize="${libtoolize:-$(which libtoolize)}"
old_libtool_serial=$($grep -Po '(?<=^# serial )(\d*)(?=.*)' build/libtool.m4)
echo "Old libtool serial: $old_libtool_serial"
$libtoolize -c
# For some reason, libtoolize doesn't copy it as +x
chmod +x build/ltmain.sh
new_libtool_serial=$($grep -Po '(?<=^# serial )(\d*)(?=.*)' build/libtool.m4)
echo "New libtool serial: $new_libtool_serial"
# For config.*, GNU recommendation for updates is to download from Savannah
# See: https://www.gnu.org/software/gettext/manual/html_node/config_002eguess.html
update_file() {
old_ts=$("build/$1" -t)
echo "Old $1 timestamp: $old_ts"
url="https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=$1;hb=HEAD"
wget -O "build/$1" "$url"
new_ts=$("build/$1" -t)
echo "New $1 timestamp: $new_ts"
}
update_file config.guess
update_file config.sub