recreate-configure.sh 928 Bytes
Newer Older
1
2
3
#!/bin/bash

# recreates 'configure' from 'configure.ac'
4
# this script should run on Ubuntu 20.04
5
6
AUTOCONF_VERSION=$(cat R-package/AUTOCONF_UBUNTU_VERSION)

7
8
9
10
11
12
13
14
# R packages cannot have versions like 3.0.0rc1, but
# 3.0.0-1 is acceptable
LGB_VERSION=$(cat VERSION.txt | sed "s/rc/-/g")

# this script changes configure.ac. Copying to a temporary file
# so changes to configure.ac don't get committed in git
TMP_CONFIGURE_AC=".configure.ac"

15
16
17
18
19
20
21
22
23
echo "Creating 'configure' script with Autoconf ${AUTOCONF_VERSION}"

apt update
apt-get install \
    --no-install-recommends \
    -y \
        autoconf=${AUTOCONF_VERSION}

cd R-package
24
25
26
27

cp configure.ac ${TMP_CONFIGURE_AC}
sed -i.bak -e "s/~~VERSION~~/${LGB_VERSION}/" ${TMP_CONFIGURE_AC}

28
29
autoconf \
    --output configure \
30
    ${TMP_CONFIGURE_AC} \
31
32
    || exit -1

33
34
rm ${TMP_CONFIGURE_AC}

35
36
37
rm -r autom4te.cache || echo "no autoconf cache found"

echo "done creating 'configure' script"