Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions classes/autoconf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
privateEnvironment:
APPLY_LIBTOOL_PATCH: "no"

checkoutDeterministic: True
checkoutTools: [autotools]
checkoutToolsWeak: [m4]
checkoutSetup: |
buildTools: [autotools]
buildToolsWeak: [m4]
buildSetup: |
# Other classes can add paths to this array to pick up additional aclocal
# m4 files.
declare -a AUTOCONF_EXTRA_PKGS
Expand Down Expand Up @@ -87,3 +86,17 @@ checkoutSetup: |
touch .autoreconf.stamp
fi
}

autoconfSync () {
mkdir -p $2
rsync -aH --delete --exclude=".autoreconf.stamp" $1/ $2/
}

# Moves the sources of $1 to $2 and calls autoconfReconfigure
# The remaining arguments are passed to 'autoconfReconfigure'
autoconfSyncReconfigure () {
autoconfSync $1 $2
pushd $2
autoconfReconfigure ${@:3}
popd
}
20 changes: 17 additions & 3 deletions classes/autotools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ buildSetup: |
local INSTALL_TAGET=install
local INSTALL_OPTIONS=( )
local SHARED_STATIC=( )
local AUTOCONF_OPTS=()
local AUTOCONF_SYNC_RECONFIGURE=0

# Explicitly build everything static on host builds and shared on
# cross-builds. The package may disable this behaviour if the configure
Expand All @@ -33,7 +35,7 @@ buildSetup: |
# parse arguments
OPTIND=1
local opt
while getopts "i:m:o:O:s" opt ; do
while getopts "i:m:o:O:sS:" opt ; do
case "$opt" in
i)
INSTALL_TAGET="$OPTARG"
Expand All @@ -47,6 +49,12 @@ buildSetup: |
O)
INSTALL_OPTIONS+=( "$OPTARG" )
;;
s)
AUTOCONF_SYNC_RECONFIGURE=1
;;
S)
AUTOCONF_OPTS+=( "-$OPTARG" )
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
Expand All @@ -55,12 +63,18 @@ buildSetup: |
done
shift $(( OPTIND -1 ))

local AUTOTOOLS_SRC=$1
if [ ${AUTOCONF_SYNC_RECONFIGURE:-} -eq 1 ]; then
AUTOTOOLS_SRC=$(pwd)/src
autoconfSyncReconfigure $1 $AUTOTOOLS_SRC ${AUTOCONF_OPTS[@]}
fi

rm -rf install
mkdir -p build install
pushd build

if [[ $1/configure -nt .configure.stamp ]] ; then
$1/configure \
if [[ ${AUTOTOOLS_SRC}/configure -nt .configure.stamp ]] ; then
${AUTOTOOLS_SRC}/configure \
${AUTOCONF_BUILD:+--build=${AUTOCONF_BUILD}} \
${AUTOCONF_HOST:+--host=${AUTOCONF_HOST}} \
${AUTOCONF_TARGET:+--target=${AUTOCONF_TARGET}} \
Expand Down
3 changes: 1 addition & 2 deletions recipes/devel/flex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ checkoutTools: [gettext]
checkoutToolsWeak: [m4]
checkoutScript: |
patchApplySeries $<@flex/*.patch@>
autoconfReconfigure
# prevent Makefile from updating the file because it's older than "configure"
touch doc/stamp-vti

buildTools: [bison, host-toolchain]
buildScript: |
export M4=m4
autotoolsBuild $1 \
autotoolsBuild -s $1 \
--disable-nls

packageScript: |
Expand Down
15 changes: 8 additions & 7 deletions recipes/devel/gcc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,19 @@ checkoutDeterministic: True
checkoutScript: |
patchApplySeries $<@gcc/*.patch@>

for i in gcc libstdc++-v3 ; do
pushd $i
autoconfReconfigure -u
popd
done

buildVars: [AUTOCONF_BUILD, AUTOCONF_HOST, AUTOCONF_TARGET, GCC_TARGET_ABI,
GCC_TARGET_ARCH, GCC_TARGET_FLOAT_ABI, GCC_TARGET_FPU,
GCC_MULTILIB, GCC_EXTRA_OPTIONS]
buildToolsWeak: [m4]
buildScript: |
GCC_SRC=$1
GCC_SRC=$(pwd)/src
autoconfSync $1 $GCC_SRC
for i in gcc libstdc++-v3 ; do
pushd $GCC_SRC/$i
autoconfReconfigure -u
popd
done

mkdir -p build install

configureGcc()
Expand Down
6 changes: 1 addition & 5 deletions recipes/libs/expat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ checkoutSCM:
digestSHA256: a00ae8a6b96b63a3910ddc1100b1a7ef50dc26dceb65ced18ded31ab392f132b
stripComponents: 1

checkoutDeterministic: True
checkoutScript: |
autoconfReconfigure

buildScript: |
autotoolsBuild $1 --without-docbook
autotoolsBuild -s $1 --without-docbook

multiPackage:
dev:
Expand Down
5 changes: 2 additions & 3 deletions recipes/libs/gdbm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ checkoutSCM:
digestSHA1: "50ba1b1d45ce33fd44e4fdaaf3b55a9d8f3dc418"
stripComponents: 1

checkoutTools: [gettext]
checkoutDeterministic: True
checkoutScript: |
autoconfReconfigure
# prevent Makefile from updating the file because it's older than "configure"
touch doc/stamp-vti

buildTools: [gettext]
buildScript: |
autotoolsBuild $1 \
autotoolsBuild -s $1 \
--enable-libgdbm-compat

multiPackage:
Expand Down
3 changes: 1 addition & 2 deletions recipes/libs/gmp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ checkoutScript: |
patchApplySeries $<@gmp/*.patch@>
updateConfigFile config.guess configfsf.guess
updateConfigFile config.sub configfsf.sub
autoconfReconfigure

buildTools: [host-toolchain]
buildToolsWeak: [m4]
buildScript: |
autotoolsBuild $1
autotoolsBuild -s $1

multiPackage:
dev:
Expand Down
3 changes: 1 addition & 2 deletions recipes/libs/libffi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ checkoutSCM:
checkoutDeterministic: True
checkoutScript: |
patchApplySeries $<@libffi/*.diff@>
autoconfReconfigure -a

buildScript: |
autotoolsBuild $1
autotoolsBuild -s -Sa $1

multiPackage:
dev:
Expand Down
3 changes: 1 addition & 2 deletions recipes/libs/libuv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ checkoutScript: |
[ -e m4/libuv-extra-automake-flags.m4 ] || \
echo "m4_define([UV_EXTRA_AUTOMAKE_FLAGS], [serial-tests])" \
>m4/libuv-extra-automake-flags.m4
autoconfReconfigure

buildScript: |
autotoolsBuild "$1"
autotoolsBuild -s "$1"

multiPackage:
dev:
Expand Down
4 changes: 1 addition & 3 deletions recipes/python/python3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ checkoutSCM:
checkoutDeterministic: True
checkoutScript: |
patchApplySeries $<@python3/*@>
autoconfReconfigure

# We cannot use out-of-tree builds directly from the source workspace because
# the build somehow manages to create .pyc files in the sources. Setting
# PYTHONDONTWRITEBYTECODE does not suffice.
buildScript: |
mkdir -p src
rsync -aH --delete $1/ src/
autoconfSyncReconfigure $1 src

multiPackage:
"":
Expand Down