Skip to content

Commit f524ac2

Browse files
authored
Merge pull request #281 from rhubert/autoreconf
Autoreconf
2 parents 2eabb35 + 12aff48 commit f524ac2

10 files changed

Lines changed: 50 additions & 33 deletions

File tree

classes/autoconf.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
privateEnvironment:
88
APPLY_LIBTOOL_PATCH: "no"
99

10-
checkoutDeterministic: True
11-
checkoutTools: [autotools]
12-
checkoutToolsWeak: [m4]
13-
checkoutSetup: |
10+
buildTools: [autotools]
11+
buildToolsWeak: [m4]
12+
buildSetup: |
1413
# Other classes can add paths to this array to pick up additional aclocal
1514
# m4 files.
1615
declare -a AUTOCONF_EXTRA_PKGS
@@ -87,3 +86,17 @@ checkoutSetup: |
8786
touch .autoreconf.stamp
8887
fi
8988
}
89+
90+
autoconfSync () {
91+
mkdir -p $2
92+
rsync -aH --delete --exclude=".autoreconf.stamp" $1/ $2/
93+
}
94+
95+
# Moves the sources of $1 to $2 and calls autoconfReconfigure
96+
# The remaining arguments are passed to 'autoconfReconfigure'
97+
autoconfSyncReconfigure () {
98+
autoconfSync $1 $2
99+
pushd $2
100+
autoconfReconfigure ${@:3}
101+
popd
102+
}

classes/autotools.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ buildSetup: |
1010
local INSTALL_TAGET=install
1111
local INSTALL_OPTIONS=( )
1212
local SHARED_STATIC=( )
13+
local AUTOCONF_OPTS=()
14+
local AUTOCONF_SYNC_RECONFIGURE=0
1315
1416
# Explicitly build everything static on host builds and shared on
1517
# cross-builds. The package may disable this behaviour if the configure
@@ -33,7 +35,7 @@ buildSetup: |
3335
# parse arguments
3436
OPTIND=1
3537
local opt
36-
while getopts "i:m:o:O:s" opt ; do
38+
while getopts "i:m:o:O:sS:" opt ; do
3739
case "$opt" in
3840
i)
3941
INSTALL_TAGET="$OPTARG"
@@ -47,6 +49,12 @@ buildSetup: |
4749
O)
4850
INSTALL_OPTIONS+=( "$OPTARG" )
4951
;;
52+
s)
53+
AUTOCONF_SYNC_RECONFIGURE=1
54+
;;
55+
S)
56+
AUTOCONF_OPTS+=( "-$OPTARG" )
57+
;;
5058
\?)
5159
echo "Invalid option: -$OPTARG" >&2
5260
exit 1
@@ -55,12 +63,18 @@ buildSetup: |
5563
done
5664
shift $(( OPTIND -1 ))
5765
66+
local AUTOTOOLS_SRC=$1
67+
if [ ${AUTOCONF_SYNC_RECONFIGURE:-} -eq 1 ]; then
68+
AUTOTOOLS_SRC=$(pwd)/src
69+
autoconfSyncReconfigure $1 $AUTOTOOLS_SRC ${AUTOCONF_OPTS[@]}
70+
fi
71+
5872
rm -rf install
5973
mkdir -p build install
6074
pushd build
6175
62-
if [[ $1/configure -nt .configure.stamp ]] ; then
63-
$1/configure \
76+
if [[ ${AUTOTOOLS_SRC}/configure -nt .configure.stamp ]] ; then
77+
${AUTOTOOLS_SRC}/configure \
6478
${AUTOCONF_BUILD:+--build=${AUTOCONF_BUILD}} \
6579
${AUTOCONF_HOST:+--host=${AUTOCONF_HOST}} \
6680
${AUTOCONF_TARGET:+--target=${AUTOCONF_TARGET}} \

recipes/devel/flex.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ checkoutTools: [gettext]
1717
checkoutToolsWeak: [m4]
1818
checkoutScript: |
1919
patchApplySeries $<@flex/*.patch@>
20-
autoconfReconfigure
2120
# prevent Makefile from updating the file because it's older than "configure"
2221
touch doc/stamp-vti
2322
2423
buildTools: [bison, host-toolchain]
2524
buildScript: |
2625
export M4=m4
27-
autotoolsBuild $1 \
26+
autotoolsBuild -s $1 \
2827
--disable-nls
2928
3029
packageScript: |

recipes/devel/gcc.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,19 @@ checkoutDeterministic: True
6363
checkoutScript: |
6464
patchApplySeries $<@gcc/*.patch@>
6565
66-
for i in gcc libstdc++-v3 ; do
67-
pushd $i
68-
autoconfReconfigure -u
69-
popd
70-
done
71-
7266
buildVars: [AUTOCONF_BUILD, AUTOCONF_HOST, AUTOCONF_TARGET, GCC_TARGET_ABI,
7367
GCC_TARGET_ARCH, GCC_TARGET_FLOAT_ABI, GCC_TARGET_FPU,
7468
GCC_MULTILIB, GCC_EXTRA_OPTIONS]
7569
buildToolsWeak: [m4]
7670
buildScript: |
77-
GCC_SRC=$1
71+
GCC_SRC=$(pwd)/src
72+
autoconfSync $1 $GCC_SRC
73+
for i in gcc libstdc++-v3 ; do
74+
pushd $GCC_SRC/$i
75+
autoconfReconfigure -u
76+
popd
77+
done
78+
7879
mkdir -p build install
7980
8081
configureGcc()

recipes/libs/expat.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@ checkoutSCM:
1111
digestSHA256: a00ae8a6b96b63a3910ddc1100b1a7ef50dc26dceb65ced18ded31ab392f132b
1212
stripComponents: 1
1313

14-
checkoutDeterministic: True
15-
checkoutScript: |
16-
autoconfReconfigure
17-
1814
buildScript: |
19-
autotoolsBuild $1 --without-docbook
15+
autotoolsBuild -s $1 --without-docbook
2016
2117
multiPackage:
2218
dev:

recipes/libs/gdbm.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ checkoutSCM:
1010
digestSHA1: "50ba1b1d45ce33fd44e4fdaaf3b55a9d8f3dc418"
1111
stripComponents: 1
1212

13-
checkoutTools: [gettext]
1413
checkoutDeterministic: True
1514
checkoutScript: |
16-
autoconfReconfigure
1715
# prevent Makefile from updating the file because it's older than "configure"
1816
touch doc/stamp-vti
1917
18+
buildTools: [gettext]
2019
buildScript: |
21-
autotoolsBuild $1 \
20+
autotoolsBuild -s $1 \
2221
--enable-libgdbm-compat
2322
2423
multiPackage:

recipes/libs/gmp.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ checkoutScript: |
1818
patchApplySeries $<@gmp/*.patch@>
1919
updateConfigFile config.guess configfsf.guess
2020
updateConfigFile config.sub configfsf.sub
21-
autoconfReconfigure
2221
2322
buildTools: [host-toolchain]
2423
buildToolsWeak: [m4]
2524
buildScript: |
26-
autotoolsBuild $1
25+
autotoolsBuild -s $1
2726
2827
multiPackage:
2928
dev:

recipes/libs/libffi.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ checkoutSCM:
1313
checkoutDeterministic: True
1414
checkoutScript: |
1515
patchApplySeries $<@libffi/*.diff@>
16-
autoconfReconfigure -a
1716
1817
buildScript: |
19-
autotoolsBuild $1
18+
autotoolsBuild -s -Sa $1
2019
2120
multiPackage:
2221
dev:

recipes/libs/libuv.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ checkoutScript: |
2121
[ -e m4/libuv-extra-automake-flags.m4 ] || \
2222
echo "m4_define([UV_EXTRA_AUTOMAKE_FLAGS], [serial-tests])" \
2323
>m4/libuv-extra-automake-flags.m4
24-
autoconfReconfigure
2524
2625
buildScript: |
27-
autotoolsBuild "$1"
26+
autotoolsBuild -s "$1"
2827
2928
multiPackage:
3029
dev:

recipes/python/python3.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ checkoutSCM:
1616
checkoutDeterministic: True
1717
checkoutScript: |
1818
patchApplySeries $<@python3/*@>
19-
autoconfReconfigure
2019
2120
# We cannot use out-of-tree builds directly from the source workspace because
2221
# the build somehow manages to create .pyc files in the sources. Setting
2322
# PYTHONDONTWRITEBYTECODE does not suffice.
2423
buildScript: |
25-
mkdir -p src
26-
rsync -aH --delete $1/ src/
24+
autoconfSyncReconfigure $1 src
2725
2826
multiPackage:
2927
"":

0 commit comments

Comments
 (0)