]> jfr.im git - irc/xchat.git/blob - autogen.sh
Avoid other potential hook problems
[irc/xchat.git] / autogen.sh
1 #!/bin/bash
2 have_automake=false
3
4 if automake --version < /dev/null > /dev/null 2>&1 ; then
5 automake_version=`automake --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'`
6 case $automake_version in
7 1.2*|1.3*|1.4|1.4*|1.5*|1.6*|1.7*|1.8*)
8 ;;
9 *)
10 have_automake=true
11 ;;
12 esac
13 fi
14 if $have_automake ; then
15 AUTOMAKE="automake"
16 ACLOCAL="aclocal"
17 else
18 if automake-1.9 --version < /dev/null > /dev/null 2>&1 ; then
19 AUTOMAKE="automake-1.9"
20 ACLOCAL="aclocal-1.9"
21 else
22 echo "automake missing or too old. This requires atleast automake 1.9"
23 exit 1
24 fi
25 fi
26
27 # ------ START GETTEXT ------
28
29 echo searching for GNU gettext intl directory...
30
31 dirs="/usr/share /usr/local/share /opt/share /usr /usr/local /opt /usr/gnu/share /opt/local /opt/local/share"
32 found=0
33 for try in $dirs; do
34 echo -n " -> $try/gettext/intl... "
35 if test -d $try/gettext/intl; then
36 echo found it
37 found=1
38 break
39 fi
40 echo no
41 done
42 if test "$found" != 1; then
43 echo ERROR: Cannot find gettext/intl directory.
44 echo ERROR: Install GNU gettext in /usr or /usr/local prefix.
45 exit 7
46 fi;
47
48 echo copying gettext intl files...
49 if test -f $try/gettext/mkinstalldirs; then
50 ln -s $try/gettext/mkinstalldirs mkinstalldirs
51 fi
52 intldir="$try/gettext/intl"
53 if test ! -d intl; then
54 mkdir intl
55 fi
56 olddir=`pwd`
57 cd $intldir
58 for file in *; do
59 if test $file != COPYING.LIB-2.0 && test $file != COPYING.LIB-2.1; then
60 rm -f $olddir/intl/$file
61 cp $intldir/$file $olddir/intl/
62 fi
63 done
64 cp -f $try/gettext/po/Makefile.in.in $olddir/po/
65 cd $olddir
66 if test -f intl/plural.c; then
67 sleep 2
68 touch intl/plural.c
69 fi
70
71 # ------ END GETTEXT ------
72
73
74 echo running $ACLOCAL...
75 $ACLOCAL $ACLOCAL_FLAGS
76 if test "$?" != "0"; then
77 echo aclocal failed, stopping.
78 exit 2
79 fi
80 echo running libtoolize...
81 libtoolize --force
82 if test "$?" != "0"; then
83 echo libtoolize failed, stopping.
84 exit 3
85 fi
86 echo running autoheader...
87 autoheader
88 if test "$?" != "0"; then
89 echo autoheader failed, stopping.
90 exit 4
91 fi
92 echo running $AUTOMAKE...
93 $AUTOMAKE -a --foreign
94 if test "$?" != "0"; then
95 echo automake failed, stopping.
96 exit 5
97 fi
98 echo running autoconf...
99 autoconf
100 if test "$?" != "0"; then
101 echo autoconf failed, stopping.
102 exit 6
103 fi
104
105 echo if no errors occured, run ./configure --enable-maintainer-mode
106 exit 0
107
108 #autogen.sh generates:
109 # aclocal.m4 Makefile.in config.guess config.sub ltmain.sh
110 # configure install-sh missing mkinstalldirs depcomp
111 #
112 #configure generates:
113 # config.status libtool Makefile.in