]> git.lyx.org Git - lyx.git/blob - autogen.sh
2002-08-08 Lars Gullik Bj�nnes <larsbj@birdstep.com>
[lyx.git] / autogen.sh
1 #!/bin/sh
2
3 # Discover what version of autoconf we are using.
4 autoversion=`autoconf --version | head -n 1`
5
6 case $autoversion in
7     *2.13)
8         echo "2.13"
9         cp config/acconfig.h .
10         cp config/configure.in .
11         cp config/relyx_configure.in lib/reLyX/configure.in
12         ;;
13     *2.53)
14         echo "2.53"
15         cp config/configure.ac .
16         cp config/relyx_configure.ac lib/reLyX/configure.ac
17         ;;
18     *)
19         echo "You are running a version of autoconf that"
20         echo "we do not support."
21         echo "LyX only supports autoconf 2.13 and 2.53."
22         exit
23         ;;
24 esac
25
26
27 ACLOCAL=aclocal
28 AUTOHEADER="autoheader"
29 AUTOMAKE="automake -a -c --foreign"
30 AUTOCONF="autoconf"
31 GNUM4=
32
33 ACINCLUDE_FILES="lyxinclude.m4 libtool.m4 codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4 progtest.m4 xforms.m4 qt2.m4 gtk--.m4 gnome--.m4 gnome.m4 pspell.m4 pkg.m4"
34 SIGCPP_ACINCLUDE_FILES="libtool.m4"
35
36 echo -n "Locating GNU m4... "
37 for prog in $M4 gm4 gnum4 m4 ; do
38   case `$prog --version 2>&1` in
39     *GNU*) ok=yes
40            GNUM4=$prog
41            echo "found: $GNUM4"
42            break ;;
43     *) ;;
44   esac
45 done
46 if test x$ok = xno ; then
47     echo "not found."
48 fi
49
50 # Generate acinclude.m4
51 echo -n "Generate acinclude.m4... "
52 rm -f acinclude.m4
53 (cd config ; cat ${ACINCLUDE_FILES} >../acinclude.m4)
54 echo "done."
55
56 # Generate the Makefiles and configure files
57 if ( $ACLOCAL --version ) </dev/null > /dev/null 2>&1; then
58         echo "Building macros..."
59         for dir in . lib/reLyX ; do
60             echo "        $dir"
61             ( cd $dir ; $ACLOCAL )
62         done
63         echo "done."
64 else
65         echo "aclocal not found -- aborting"
66         exit
67 fi
68
69 if ( $AUTOHEADER --version ) </dev/null > /dev/null 2>&1; then
70         echo "Building config header template..."
71         for dir in . ; do
72             echo "        $dir"
73             ( cd $dir ; $AUTOHEADER )
74         done
75         echo "done."
76 else
77         echo "autoheader not found -- aborting"
78         exit
79 fi
80
81 if ( $AUTOMAKE --version ) </dev/null > /dev/null 2>&1; then
82         echo "Building Makefile templates..."
83         for dir in . lib/reLyX ; do
84             echo "        $dir"
85             ( cd $dir ; $AUTOMAKE )
86         done
87         echo "done."
88 else
89         echo "automake not found -- aborting"
90         exit
91 fi
92
93 if ( $AUTOCONF --version ) </dev/null > /dev/null 2>&1; then
94         echo "Building configure..."
95         for dir in . lib/reLyX ; do
96             echo "       $dir"
97             ( cd $dir ; $AUTOCONF )
98         done
99         echo "done."
100 else
101         echo "autoconf not found -- aborting"
102         exit
103 fi
104
105 # Autogenerate lib/configure.m4.
106 if test x$GNUM4 != x ; then
107     echo -n "Building lib/configure ... "
108     rm -f lib/configure
109     $GNUM4 lib/configure.m4 > lib/configure
110     chmod a+x lib/configure
111     echo "done."
112 else
113     echo "No GNU m4. Impossible to build lib/configure -- aborting"
114     exit
115 fi
116
117 echo
118 echo 'run "./configure ; make"'
119 echo