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