Skip to content

Commit 12aff48

Browse files
committed
autoconf: run autoconfreconfgure in build step
1 parent 0938c17 commit 12aff48

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
@@ -14,14 +14,13 @@ checkoutTools: [gettext]
1414
checkoutToolsWeak: [m4]
1515
checkoutScript: |
1616
patchApplySeries $<@flex/*.patch@>
17-
autoconfReconfigure
1817
# prevent Makefile from updating the file because it's older than "configure"
1918
touch doc/stamp-vti
2019
2120
buildTools: [bison, host-toolchain]
2221
buildScript: |
2322
export M4=m4
24-
autotoolsBuild $1 \
23+
autotoolsBuild -s $1 \
2524
--disable-nls
2625
2726
packageScript: |

recipes/devel/gcc.yaml

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

recipes/libs/expat.yaml

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

13-
checkoutDeterministic: True
14-
checkoutScript: |
15-
autoconfReconfigure
16-
1713
buildScript: |
18-
autotoolsBuild $1 --without-docbook
14+
autotoolsBuild -s $1 --without-docbook
1915
2016
multiPackage:
2117
dev:

recipes/libs/gdbm.yaml

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

12-
checkoutTools: [gettext]
1312
checkoutDeterministic: True
1413
checkoutScript: |
15-
autoconfReconfigure
1614
# prevent Makefile from updating the file because it's older than "configure"
1715
touch doc/stamp-vti
1816
17+
buildTools: [gettext]
1918
buildScript: |
20-
autotoolsBuild $1 \
19+
autotoolsBuild -s $1 \
2120
--enable-libgdbm-compat
2221
2322
multiPackage:

recipes/libs/gmp.yaml

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

recipes/libs/libffi.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ checkoutSCM:
1212
checkoutDeterministic: True
1313
checkoutScript: |
1414
patchApplySeries $<@libffi/*.diff@>
15-
autoconfReconfigure -a
1615
1716
buildScript: |
18-
autotoolsBuild $1
17+
autotoolsBuild -s -Sa $1
1918
2019
multiPackage:
2120
dev:

recipes/libs/libuv.yaml

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

recipes/python/python3.yaml

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

0 commit comments

Comments
 (0)