]> git.lyx.org Git - features.git/blob - autogen.sh
my changes during the holidyas...i expect some compilers to have some problems, but...
[features.git] / autogen.sh
1 #!/bin/sh
2
3 ACLOCAL=aclocal
4 AUTOHEADER=autoheader
5 AUTOMAKE="automake -a -c --foreign"
6 AUTOCONF=autoconf
7
8 # Generate the Makefiles and configure files
9 if ( aclocal --version ) </dev/null > /dev/null 2>&1; then
10         echo "Building macros."
11         $ACLOCAL ; (cd lib/reLyX; $ACLOCAL )
12 else
13         echo "aclocal not found -- aborting"
14         exit
15 fi
16
17 if ( autoheader --version ) </dev/null > /dev/null 2>&1; then
18         echo "Building config header template"
19         $AUTOHEADER
20 else
21         echo "autoheader not found -- aborting"
22         exit
23 fi
24
25 if ( $AUTOMAKE --version ) </dev/null > /dev/null 2>&1; then
26         echo "Building Makefile templates"
27         $AUTOMAKE ; (cd lib/reLyX ; $AUTOMAKE )
28 else
29         echo "automake not found -- aborting"
30         exit
31 fi
32
33 if ( $AUTOCONF --version ) </dev/null > /dev/null 2>&1; then
34         echo "Building configure"
35         $AUTOCONF ; ( cd lib/reLyX ; $AUTOCONF )
36         echo 'run "./configure ; make"'
37 else
38         echo "autoconf not found -- aborting"
39         exit
40 fi
41
42 # Autogenerate lib/configure.m4. We need GNU m4 for that and thus have
43 # to try several ones.  
44 ok=no
45 #for prog in $M4 gm4 gnum4 m4 ; do
46 #  case `$prog --help < /dev/null 2>&1 | grep traditional` in
47 #    *traditional*) echo "Building lib/configure"
48 #                  rm -f lib/configure
49 #                  $prog lib/configure.m4 >lib/configure
50 #                  chmod a+x lib/configure
51 #                  ok=yes
52 #                  break ;;
53 #    *) ;;
54 #  esac
55 #done
56 # Why not use --version ? (Lgb)
57 for prog in $M4 gm4 gnum4 m4 ; do
58   case `$prog --version 2>&1` in
59     *GNU*) echo "Building lib/configure"
60                    rm -f lib/configure
61                    $prog lib/configure.m4 >lib/configure
62                    chmod a+x lib/configure
63                    ok=yes
64                    break ;;
65     *) ;;
66   esac
67 done
68 if test $ok = no ; then
69     echo "GNU m4 not found -- aborting"
70     exit
71 fi
72
73 echo "Creating POTFILES.in..."
74 cat <<EOF > tmppot
75 #
76 # This file is automatically generated by autogen.sh. This command was
77 # used to extract the files from the sources:
78 #
79 # grep -E "_\(\".*\"\)" \`find src -name \*.[hHC]\` | \\
80 # awk 'BEGIN {FS= ":"} {print $1}' | sort | uniq
81 #
82 # This must be done when standing in lyx/
83 #
84 # This is all the files that contains internationalization strings.
85
86 EOF
87
88 grep -E "_\(\".*\"\)" `find src -name \*.[hHC]` | \
89 awk 'BEGIN {FS= ":"} {print $1}' | sort -f -d | uniq >> tmppot
90 mv tmppot po/POTFILES.in
91 echo "done"