forked from darold/squidclamav
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·97 lines (85 loc) · 2.55 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
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
#! /bin/sh
#-------------------------------------------------------------------------
#
# This bootstrap script i used to clean dist directory and rebuild
# all configure and install script from scratch.
#
# Do not execute this file is you don't have aclocal / autoconf and
# automake installed, I mean GNU Autotools.
#
#-------------------------------------------------------------------------
rm -rf *.log aclocal.m4 autoconf.h* autom4te.cache compile stamp-* \
libtool etc/Makefile config.* configure depcomp etc/Makefile.in \
src/*.o .deps src/squidclamav src/.deps install-sh ltmain.sh \
Makefile.in Makefile missing src/Makefile src/Makefile.in src/.libs
# Autotool versions preferred. To override either edit the script
# to match the versions you want to use, or set the variables on
# the command line like "env acver=.. amver=... ./bootstrap.sh"
acversions="${acver:-2.57}"
amversions="${amver:-1.6}"
check_version()
{
eval $2 --version 2>/dev/null | grep -i "$1.*$3" >/dev/null
}
find_version()
{
tool=$1
found="NOT_FOUND"
shift
versions="$*"
for version in $versions; do
for variant in "" "-${version}" "`echo $version | sed -e 's/\.//g'`"; do
if check_version $tool ${tool}${variant} $version; then
found="${variant}"
break
fi
done
if [ "x$found" != "xNOT_FOUND" ]; then
break
fi
done
if [ "x$found" = "xNOT_FOUND" ]; then
echo "WARNING: Cannot find $tool version $versions" >&2
echo "Trying `$tool --version | head -1`" >&2
found=""
fi
echo $found
echo $found
}
bootstrap() {
if "$@"; then
true # Everything OK
else
echo "$1 failed"
echo "Autotool bootstrapping failed. You will need to investigate and correc
t" ;
echo "before you can develop on this source tree"
exit 1
fi
}
fixmakefiles() {
bad_files="`find . -name Makefile.in | xargs grep -l "AR = ar"`"
if [ -n "$bad_files" ]; then
perl -i -p -e 's/^/#/ if /^AR = ar/' $bad_files
fi
}
# Make sure config exists
#mkdir -p config
# Adjust paths of required autool packages
amver=`find_version automake ${amversions}`
acver=`find_version autoconf ${acversions}`
# Bootstrap the autotool subsystems
libtoolize --copy --force
bootstrap aclocal$amver
bootstrap autoconf$acver
bootstrap autoheader$acver
bootstrap automake$amver --foreign --add-missing --copy --force-missing
fixmakefiles
cp /usr/bin/libtool .
echo "Autotool bootstrapping complete."
#libtoolize --copy --force \
#&& aclocal \
#&& autoconf \
#&& autoheader \
#&& automake --foreign --add-missing --copy --force-missing \
#&& cp /usr/bin/libtool .