]> git.lyx.org Git - lyx.git/blob - autogen.sh
More textinset fixes! Now also undo works and I removed some unneeded
[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 echo -n "Locating GNU m4... "
10 for prog in $M4 gm4 gnum4 m4 ; do
11   case `$prog --version 2>&1` in
12     *GNU*) ok=yes
13            GNUM4=$prog
14            echo "found: $GNUM4"
15            break ;;
16     *) ;;
17   esac
18 done
19 if test x$ok = xno ; then
20     echo "not found."
21 fi
22
23 # Generate acinclude.m4
24 echo -n "Generate acinclude.m4... "
25 rm -rf acinclude.m4
26 touch acinclude.m4
27 for fil in config/lyxinclude.m4 config/libtool.m4 config/gettext.m4 config/lcmessage.m4 config/progtest.m4 ; do
28     cat $fil >> acinclude.m4
29 done
30 echo "done."
31
32 # Generate the Makefiles and configure files
33 if ( aclocal --version ) </dev/null > /dev/null 2>&1; then
34         echo -n "Building macros... "
35         $ACLOCAL ; (cd lib/reLyX; $ACLOCAL )
36         echo "done."
37 else
38         echo "aclocal not found -- aborting"
39         exit
40 fi
41
42 if ( autoheader --version ) </dev/null > /dev/null 2>&1; then
43         echo -n "Building config header template... "
44         $AUTOHEADER
45         echo "done."
46 else
47         echo "autoheader not found -- aborting"
48         exit
49 fi
50
51 if ( $AUTOMAKE --version ) </dev/null > /dev/null 2>&1; then
52         echo -n "Building Makefile templates... "
53         $AUTOMAKE ; (cd lib/reLyX ; $AUTOMAKE )
54         echo "done."
55 else
56         echo "automake not found -- aborting"
57         exit
58 fi
59
60 if ( $AUTOCONF --version ) </dev/null > /dev/null 2>&1; then
61         echo -n "Building configure... "
62         $AUTOCONF ; ( cd lib/reLyX ; $AUTOCONF )
63         echo "done."
64 else
65         echo "autoconf not found -- aborting"
66         exit
67 fi
68
69 # Autogenerate lib/configure.m4.
70 if test x$GNUM4 != x ; then
71     echo -n "Building lib/configure ... "
72     rm -f lib/configure
73     $GNUM4 lib/configure.m4 > lib/configure
74     chmod a+x lib/configure
75     echo "done."
76 else
77     echo "No GNU m4. Impossible to build lib/configure -- aborting"
78     exit
79 fi
80
81 echo -n "Creating POTFILES.in... "
82 cat <<EOF > tmppot
83 #
84 # This file is automatically generated by autogen.sh. This command was
85 # used to extract the files from the sources:
86 #
87 # grep -E "_\(\".*\"\)" \`find src -name \*.[hHC]\` | \\
88 # awk 'BEGIN {FS= ":"} {print $1}' | sort | uniq
89 #
90 # This must be done when standing in lyx/
91 #
92 # This is all the files that contains internationalization strings.
93
94 EOF
95
96 grep -E "_\(\".*\"\)" `find src -name \*.[hHC]` | \
97 awk 'BEGIN {FS= ":"} {print $1}' | sort -f -d | uniq >> tmppot
98 mv tmppot po/POTFILES.in
99 echo "done"
100
101 echo
102 echo 'run "./configure ; make"'
103 echo