-
-
Notifications
You must be signed in to change notification settings - Fork 265
Expand file tree
/
Copy pathautogen.sh
More file actions
executable file
·105 lines (89 loc) · 2.9 KB
/
autogen.sh
File metadata and controls
executable file
·105 lines (89 loc) · 2.9 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/sh
#
# Run this to generate all the initial makefiles, etc.
#
PKG_NAME=Firebird6
SRCDIR=`dirname $0`
SRCDIR=`(cd "$SRCDIR" && pwd)`
OBJDIR=`pwd`
if [ "$OBJDIR" = "$SRCDIR" ]
then
BUILD_MODE=in-tree
else
BUILD_MODE=out-of-tree
fi
if [ -z "$AUTORECONF" ]
then
AUTORECONF=autoreconf
fi
echo "AUTORECONF="$AUTORECONF
# This prevents calling automake in old autotools
AUTOMAKE=true
export AUTOMAKE
# This helps some old aclocal versions find local and source m4 macros
ACLOCAL="aclocal -I $OBJDIR -I $OBJDIR/m4 -I $SRCDIR"
if [ -d "$SRCDIR/m4" ]; then
ACLOCAL="$ACLOCAL -I $SRCDIR/m4"
fi
export ACLOCAL
# Give a warning if no arguments to 'configure' have been supplied.
if test -z "$*" -a x$NOCONFIGURE = x; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
echo
fi
# Some versions of autotools need it
if [ ! -d "$OBJDIR/m4" ]; then
rm -rf "$OBJDIR/m4"
mkdir -p "$OBJDIR/m4"
fi
# Ensure correct utilities are called by AUTORECONF
autopath=`dirname $AUTORECONF`
if [ "x$autopath" != "x" ]; then
PATH=$autopath:$PATH
export PATH
fi
if [ "$BUILD_MODE" = "out-of-tree" ]
then
mkdir -p "$OBJDIR/builds/make.new"
ln -sf "$SRCDIR/configure.ac" "$OBJDIR/configure.ac"
ln -sf "$SRCDIR/acx_pthread.m4" "$OBJDIR/acx_pthread.m4"
ln -sf "$SRCDIR/binreloc.m4" "$OBJDIR/binreloc.m4"
fi
echo "Running autoreconf in $OBJDIR ($BUILD_MODE) ..."
(cd "$OBJDIR" && $AUTORECONF --install --force --verbose) || exit 1
if [ "$BUILD_MODE" = "out-of-tree" ]
then
# Prefer auxiliary files generated in the build directory when running configure
sed -i 's#ac_aux_dir_candidates="${srcdir}/builds/make.new/config"#ac_aux_dir_candidates="$ac_pwd/builds/make.new/config${PATH_SEPARATOR}${srcdir}/builds/make.new/config"#' "$OBJDIR/configure"
fi
# Hack to bypass bug in autoreconf - --install switch not passed to libtoolize,
# therefore missing config.sub and confg.guess files
CONFIG_AUX_DIR="$OBJDIR/builds/make.new/config"
if [ ! -f "$CONFIG_AUX_DIR/config.sub" -o ! -f "$CONFIG_AUX_DIR/config.guess" ]; then
# re-run libtoolize with --install switch, if it does not understand that switch
# and there are no config.sub/guess files in CONFIG_AUX_DIR, we will anyway fail
echo "Re-running libtoolize ..."
if [ -z "$LIBTOOLIZE" ]; then
LIBTOOLIZE=libtoolize
fi
(cd "$OBJDIR" && $LIBTOOLIZE --install --copy --force) || exit 1
fi
# If NOCONFIGURE is set, skip the call to configure
if test "x$NOCONFIGURE" = "x"; then
if [ "$BUILD_MODE" = "out-of-tree" ]
then
CONFIGURE_CMD="$OBJDIR/configure --srcdir=$SRCDIR"
else
CONFIGURE_CMD="$OBJDIR/configure"
fi
echo Running $CONFIGURE_CMD $conf_flags "$@" ...
rm -f config.cache config.log
chmod a+x "$OBJDIR/configure"
$CONFIGURE_CMD $conf_flags "$@" \
&& echo Now type \`make\' to compile $PKG_NAME
else
echo Autogen skipping configure process.
fi
# EOF