forked from atompaw/atompaw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·66 lines (56 loc) · 1.71 KB
/
bootstrap.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh
#
# Copyright (C) 2010 Yann Pouillon
#
# This file is part of the AtomPAW software package. For license information,
# please see the COPYING file in the top-level directory of the source
# distribution.
#
# Stop at first error encountered
set -e
# Check that we are in the right directory
if test ! -s "./configure.ac" -o ! -s "src/atompaw_prog.F90"; then
echo "This is not a AtomPAW source tree - aborting now"
exit 1
fi
# Create possibly missing directories
mkdir -p config/gnu
# Generate M4 includes
echo "Generating aclocal.m4..."
aclocal -I config/m4
echo "done."
# Generate configure auxiliary files
echo "Generating config.h.in..."
autoheader
echo "done."
# Generate configure
echo "Generating configure script..."
autoconf
echo "done."
# Generate libtool scripts
echo "Generating libtool scripts..."
set +e
my_libtoolize="libtoolize"
${my_libtoolize} --version >/dev/null 2>&1
if test "${?}" != "0"; then
my_libtoolize="glibtoolize"
fi
${my_libtoolize} --version >/dev/null 2>&1
if test "${?}" != "0"; then
echo "Error: could not find a working version of libtoolize" >&2
exit 1
fi
set -e
${my_libtoolize} --automake --copy --force
echo "done."
# Generate makefile inputs
# Do not use "automake --force-missing", as it overwrites the INSTALL file.
echo "Generating Makefile.in for each directory..."
automake --add-missing --copy
# Dirty trick to fix a (possible) automake bug
# Change src/Makefile.in preserving timestamp
touch -r src/Makefile.in src/Makefile.timestamp
sed -i -e 's/\$(PROGRAMS) \$(LTLIBRARIES)/\$(LTLIBRARIES) \$(PROGRAMS)/g' src/Makefile.in
touch -r src/Makefile.timestamp src/Makefile.in
rm -rf src/Makefile.timestamp src/Makefile.in-e # *-e file is created on Mac only
echo "done."