]> git.lyx.org Git - lyx.git/blob - autogen.sh
small cleanup
[lyx.git] / autogen.sh
1 #!/bin/sh
2
3 ACLOCAL=aclocal
4 AUTOHEADER=autoheader
5 AUTOMAKE="automake -a -c --foreign"
6 AUTOCONF=autoconf
7 GNUM4=
8
9 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"
10 SIGCPP_ACINCLUDE_FILES="libtool.m4"
11
12 echo -n "Locating GNU m4... "
13 for prog in $M4 gm4 gnum4 m4 ; do
14   case `$prog --version 2>&1` in
15     *GNU*) ok=yes
16            GNUM4=$prog
17            echo "found: $GNUM4"
18            break ;;
19     *) ;;
20   esac
21 done
22 if test x$ok = xno ; then
23     echo "not found."
24 fi
25
26 # Generate acinclude.m4
27 echo -n "Generate acinclude.m4... "
28 rm -f acinclude.m4
29 (cd config ; cat ${ACINCLUDE_FILES} >../acinclude.m4)
30 echo "done."
31
32 # Generate the Makefiles and configure files
33 if ( $ACLOCAL --version ) </dev/null > /dev/null 2>&1; then
34         echo "Building macros..."
35         for dir in . lib/reLyX ; do
36             echo "        $dir"
37             ( cd $dir ; $ACLOCAL )
38         done
39         echo "done."
40 else
41         echo "aclocal not found -- aborting"
42         exit
43 fi
44
45 if ( $AUTOHEADER --version ) </dev/null > /dev/null 2>&1; then
46         echo "Building config header template..."
47         for dir in . ; do
48             echo "        $dir"
49             ( cd $dir ; $AUTOHEADER )
50         done
51         echo "done."
52 else
53         echo "autoheader not found -- aborting"
54         exit
55 fi
56
57 if ( $AUTOMAKE --version ) </dev/null > /dev/null 2>&1; then
58         echo "Building Makefile templates..."
59         for dir in . lib/reLyX ; do
60             echo "        $dir"
61             ( cd $dir ; $AUTOMAKE )
62         done
63         echo "done."
64 else
65         echo "automake not found -- aborting"
66         exit
67 fi
68
69 if ( $AUTOCONF --version ) </dev/null > /dev/null 2>&1; then
70         echo "Building configure..."
71         for dir in . lib/reLyX ; do
72             echo "       $dir"
73             ( cd $dir ; $AUTOCONF )
74         done
75         echo "done."
76 else
77         echo "autoconf not found -- aborting"
78         exit
79 fi
80
81 # Autogenerate lib/configure.m4.
82 if test x$GNUM4 != x ; then
83     echo -n "Building lib/configure ... "
84     rm -f lib/configure
85     $GNUM4 lib/configure.m4 > lib/configure
86     chmod a+x lib/configure
87     echo "done."
88 else
89     echo "No GNU m4. Impossible to build lib/configure -- aborting"
90     exit
91 fi
92
93 echo
94 echo 'run "./configure ; make"'
95 echo