~registry/codeblocks/trunk

664 by mandrav
* Added autoconf/automake build system for non-windows platforms
1
#!/bin/sh
2
677 by mandrav
* Added --with-wx-* flags for configure. Also re-organized the build system a bit.
3
# Check for proper versions of autotools
4
# We require:
5
#  - autoconf 2.50+
2865 by daniel2000
- better tar format detection (make dist only works with automake 1.9+, rest also with 1.7+)
6
#  - automake 1.7+, 1.9+ for make dist
677 by mandrav
* Added --with-wx-* flags for configure. Also re-organized the build system a bit.
7
#  - libtool 1.4+
8
2162 by mandrav
* Updated autotools build system.
9
# Touch revision.m4
10
if [ -f ./update_revision.sh ]; then
11
	./update_revision.sh;
12
elif [ ! -f ./revision.m4 ]; then
2863 by daniel2000
- little fix in autorevision (in revision comparison with existing autorevision.h)
13
	echo "m4_define([SVN_REV], 0)" > ./revision.m4;
14
	echo "m4_define([SVN_REVISION], trunk-r0)" >> ./revision.m4;
15
	echo "m4_define([SVN_DATE], )" >> ./revision.m4;
2162 by mandrav
* Updated autotools build system.
16
fi
17
677 by mandrav
* Added --with-wx-* flags for configure. Also re-organized the build system a bit.
18
# Deal with some gentoo-specific issues
2865 by daniel2000
- better tar format detection (make dist only works with automake 1.9+, rest also with 1.7+)
19
WANT_AUTOMAKE='1.9 1.8 1.7' #latest of these is chosen or default if none hits
2655 by afb
- simplify bootstrap for stupid /bin/sh
20
export WANT_AUTOMAKE
21
WANT_AUTOCONF='2.5'
22
export WANT_AUTOCONF
677 by mandrav
* Added --with-wx-* flags for configure. Also re-organized the build system a bit.
23
2558 by mandrav
* Modified bootstrap to recognize and use environment variables like $AUTOMAKE, $AUTOCONF, etc. Patch #1502.
24
# Default program names
25
test -z "$AUTOCONF" && AUTOCONF=autoconf
26
test -z "$AUTOHEADER" && AUTOHEADER=autoheader
27
28
test -z "$AUTOMAKE" && AUTOMAKE=automake
29
test -z "$ACLOCAL" && ACLOCAL=aclocal
30
31
test -z "$LIBTOOL" && for LIBTOOL in glibtool libtool; do
32
  ($LIBTOOL --version) < /dev/null > /dev/null 2>&1 && break
33
done
34
test -z "$LIBTOOLIZE" && for LIBTOOLIZE in glibtoolize libtoolize; do
35
  ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break
36
done
37
677 by mandrav
* Added --with-wx-* flags for configure. Also re-organized the build system a bit.
38
## Using prereq in autoconf rather than here, mostly for the debian systems at
39
## this point
3995 by daniel2000
- added missing build dependency in spec file
40
if test -n "`$AUTOCONF --version 2>&1|head -n 1|egrep '1\.[0-9]+|2\.[0-4]+'`"; then
677 by mandrav
* Added --with-wx-* flags for configure. Also re-organized the build system a bit.
41
	echo "Autoconf 2.50 or above is required. Aborting build...";
2865 by daniel2000
- better tar format detection (make dist only works with automake 1.9+, rest also with 1.7+)
42
	exit 1;
677 by mandrav
* Added --with-wx-* flags for configure. Also re-organized the build system a bit.
43
fi
44
3995 by daniel2000
- added missing build dependency in spec file
45
if test -n "`$AUTOMAKE --version 2>&1|head -n 1|egrep '1\.[0-6](\.[0-9]+)?$'`"; then
681 by mandrav
* Converted some build system files to unix format
46
	echo "Automake 1.7 or above is required. Aborting build...";
677 by mandrav
* Added --with-wx-* flags for configure. Also re-organized the build system a bit.
47
	exit 1;
48
fi
49
3995 by daniel2000
- added missing build dependency in spec file
50
if test -n "`$AUTOMAKE --version 2>&1|head -n 1|egrep '1\.7(\.[0-9]+)?$|1\.8(\.[0-9]+)?$'`"; then
2865 by daniel2000
- better tar format detection (make dist only works with automake 1.9+, rest also with 1.7+)
51
	echo "make dist only supported with automake 1.9 or above" >&2;
52
fi
53
3995 by daniel2000
- added missing build dependency in spec file
54
if test -n "`$LIBTOOL --version 2>&1|head -n 1|cut -f 4 -d ' '|egrep '1\.[0-3](\.[0-9]+)?$'`"; then
677 by mandrav
* Added --with-wx-* flags for configure. Also re-organized the build system a bit.
55
	echo "Libtool 1.4 or above is required. Aborting build...";
56
	exit 1;
57
fi
58
59
# clean up files which cause confusion when switch versions of auto*
60
rm -rf autom4te.cache
61
62
# Fire up autotools
2558 by mandrav
* Modified bootstrap to recognize and use environment variables like $AUTOMAKE, $AUTOCONF, etc. Patch #1502.
63
$LIBTOOLIZE --force --copy && \
64
	$ACLOCAL $ACLOCAL_FLAGS && \
65
	$AUTOHEADER && \
66
	$AUTOMAKE --include-deps --add-missing --foreign --copy && \
67
	$AUTOCONF