]> git.lyx.org Git - features.git/blob - autogen.sh
ok, some more changes, this time I have gotten the fonttable and insettable in lyxpar...
[features.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=`type -path $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         echo 'run "./configure ; make"'
65 else
66         echo "autoconf not found -- aborting"
67         exit
68 fi
69
70 # Autogenerate lib/configure.m4.
71 if test x$GNUM4 != x ; then
72     echo -n "Building lib/configure ..."
73     rm -f lib/configure
74     $GNUM4 lib/configure.m4 > lib/configure
75     chmod a+x lib/configure
76     echo "done."
77 else
78     echo "No GNU m4. Impossible to build lib/configure -- aborting"
79     exit
80 fi
81
82 echo -n "Creating POTFILES.in..."
83 cat <<EOF > tmppot
84 #
85 # This file is automatically generated by autogen.sh. This command was
86 # used to extract the files from the sources:
87 #
88 # grep -E "_\(\".*\"\)" \`find src -name \*.[hHC]\` | \\
89 # awk 'BEGIN {FS= ":"} {print $1}' | sort | uniq
90 #
91 # This must be done when standing in lyx/
92 #
93 # This is all the files that contains internationalization strings.
94
95 EOF
96
97 grep -E "_\(\".*\"\)" `find src -name \*.[hHC]` | \
98 awk 'BEGIN {FS= ":"} {print $1}' | sort -f -d | uniq >> tmppot
99 mv tmppot po/POTFILES.in
100 echo "done"