]> git.lyx.org Git - lyx.git/blob - autogen.sh
Support new hunspell C++ ABI if LyX is built against hunspell >= 1.5
[lyx.git] / autogen.sh
1 #!/bin/sh
2
3 ACLOCAL="aclocal -I m4 -I config"
4 AUTOHEADER="autoheader"
5 AUTOMAKE="automake --add-missing --force-missing --copy --foreign"
6 AUTOCONF="autoconf"
7
8 # Discover what version of automake we are using.
9 automake_version=`$AUTOMAKE --version 2>/dev/null | head -n 1`
10
11 test "$automake_version" != "" && {
12     echo "Using $automake_version"
13 } || {
14     echo "LyX requires automake >= 1.14"
15     exit 1
16 }
17
18 case $automake_version in
19     *' '1.1[45]*)
20         ;;
21     *)
22         echo "This automake version is not supported by LyX."
23         echo "LyX only supports automake 1.14 to 1.15."
24         exit 1
25         ;;
26 esac
27
28 # Discover what version of autoconf we are using.
29 autoversion=`$AUTOCONF --version 2>/dev/null | head -n 1`
30
31 test "$autoversion" != "" && {
32     echo "Using $autoversion"
33 } || {
34     echo "LyX requires autoconf >= 2.65"
35     exit 1
36 }
37
38 case $autoversion in
39     *' '2.6[5-9])
40         ;;
41     *)
42         echo "This autoconf version is not supported by LyX."
43         echo "LyX only supports autoconf 2.65-2.69."
44         exit 1
45         ;;
46 esac
47
48 # Delete old cache directories.
49 # automake will stop if their contents was created by an earlier version.
50 rm -rf autom4te.cache
51
52 # Generate the Makefiles and configure files
53 echo "Building macros..."
54 if ( $ACLOCAL --version ) < /dev/null > /dev/null 2>&1; then
55         $ACLOCAL
56 else
57         echo "aclocal not found -- aborting"
58         exit 1
59 fi
60
61 echo "Building config header template..."
62 if ( $AUTOHEADER --version ) < /dev/null > /dev/null 2>&1; then
63         $AUTOHEADER
64 else
65         echo "autoheader not found -- aborting"
66         exit 1
67 fi
68
69 echo "Building Makefile templates..."
70 if ( $AUTOMAKE --version ) < /dev/null > /dev/null 2>&1; then
71         $AUTOMAKE
72 else
73         echo "automake not found -- aborting"
74         exit 1
75 fi
76
77 echo "Building configure..."
78 if ( $AUTOCONF --version ) < /dev/null > /dev/null 2>&1; then
79         $AUTOCONF
80 else
81         echo "autoconf not found -- aborting"
82         exit 1
83 fi
84
85 echo "Building po/POTFILES.in..."
86 if ( make -s -f po/Rules-lyx srcdir=po top_srcdir=. po/POTFILES.in ); then
87     :
88 else
89         echo "Building po/POTFILES.in failed -- aborting"
90         exit 1
91 fi
92
93 echo
94 echo 'run "./configure && make"'
95 echo