1 #!/bin/sh -e
2 #**************************************************************************
3 #* *
4 #* OCaml *
5 #* *
6 #* David Allsopp, MetaStack Solutions Ltd. *
7 #* *
8 #* Copyright 2019 MetaStack Solutions Ltd. *
9 #* *
10 #* All rights reserved. This file is distributed under the terms of *
11 #* the GNU Lesser General Public License version 2.1, with the *
12 #* special exception on linking described in the file LICENSE. *
13 #* *
14 #**************************************************************************
15
16 # Remove the autom4te.cache directory to make sure we start in a clean state
17 rm -rf autom4te.cache
18
19 autoconf --force --warnings=all,error
20
21 # Allow pre-processing of configure arguments for Git check-outs
22 # The sed call removes dra27's copyright on the whole configure script...
23 sed -e '/^#[^!]/d' tools/git-dev-options.sh > configure.tmp
24
25 # Some distros have the 2013 --runstatedir patch to autoconf (see
26 # http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=a197431414088a417b407b9b20583b2e8f7363bd
27 # in the GNU autoconf repo), and some don't, so ensure its effects are
28 # removed for CI consistency...
29 # POSIX Notes
30 # - sed -i without a backup file is not portable, hence configure.tmp
31 # - GNU sed's /../,+8d becomes /../{N;..;d;} (and the last ; is important)
32 sed -e '/^runstatedir/d' \
33 -e '/-runstatedir /{N;N;N;N;N;N;N;N;d;}' \
34 -e '/--runstatedir=DIR/d' \
35 -e 's/ runstatedir//' \
36 -e '1d' \
37 configure >> configure.tmp
38
39 mv -f configure.tmp configure
40 chmod +x configure
41