Move o_redraw_single() from libgeda to gschem
[geda-gaf/peter-b.git] / libgeda / autogen.sh
blobe29a856172af9cafb3df060fafc374f7a20f0410
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
4 # This file came from glade-2.0.0 with modifications for gEDA/gaf.
5 # Ales Hvezda 11/09/2003
7 srcdir=`dirname $0`
8 test -z "$srcdir" && srcdir=.
9 configure_script=configure.ac
11 # Automake required version
12 AM_1=1 # Major number
13 AM_2=6
14 AM_3=0 # Minor number
16 DIE=0
18 (test -f $srcdir/$configure_script) || {
19 echo -n "**Error**: Directory [ $srcdir ] does not look like the"
20 echo " top-level package directory"
21 exit 1
24 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
25 echo
26 echo "**Error**: You must have \`autoconf' installed."
27 echo "Download the appropriate package for your distribution,"
28 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
29 DIE=1
32 (grep "^AM_PROG_LIBTOOL" $srcdir/$configure_script >/dev/null) && {
33 (libtool --version) < /dev/null > /dev/null 2>&1 || {
34 echo
35 echo "**Error**: You must have \`libtool' installed."
36 echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
37 DIE=1
41 (grep "^AM_GNU_GETTEXT" $srcdir/$configure_script >/dev/null) && {
42 (grep "sed.*POTFILES" $srcdir/$configure_script) > /dev/null || \
43 (autopoint --version) < /dev/null > /dev/null 2>&1 || {
44 echo
45 echo "**Error**: You must have \`gettext' installed."
46 echo "You can get it from: http://www.gnu.org/software/gettext"
47 DIE=1
51 (automake --version) < /dev/null > /dev/null 2>&1 || {
52 echo
53 echo "**Error**: You must have \`automake' installed."
54 echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
55 DIE=1
56 NO_AUTOMAKE=yes
59 # check automake version. Test came from gpsd version 2.34. cnieves 2007-02-10
60 if [ -z "$NO_AUTOMAKE" ]; then
61 AM_VERSION=`automake --version | sed -n -e 's#[^0-9]* \([0-9]*\)\.\([0-9]*\)\.*\([0-9]*\).*$#\1 \2 \3#p'`
62 AM_V1=`echo $AM_VERSION | awk '{print $1}'`
63 AM_V2=`echo $AM_VERSION | awk '{print $2}'`
64 AM_V3=`echo $AM_VERSION | awk '{print $3}'`
66 if [ "$AM_1" -gt "$AM_V1" ]; then
67 AM_ERROR=1
68 else
69 if [ "$AM_1" -eq "$AM_V1" ]; then
70 if [ "$AM_2" -gt "$AM_V2" ]; then
71 AM_ERROR=1
72 else
73 if [ "$AM_2" -eq "$AM_V2" ]; then
74 if [ -n "$AM_V3" -a "$AM_3" -gt "$AM_V3" ]; then
75 AM_ERROR=1
82 if [ -n "$AM_ERROR" ]; then
83 echo
84 echo "**Error**: Found automake version $AM_V1.$AM_V2.$AM_V3"
85 echo "You must have \`automake' version $AM_1.$AM_2.$AM_3 or greater installed."
86 echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
87 DIE=1
88 fi
93 # if no automake, don't bother testing for aclocal
94 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
95 echo
96 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
97 echo "installed doesn't appear recent enough."
98 echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
99 DIE=1
102 if test "$DIE" -eq 1; then
103 exit 1
106 # Don't run configure automatically.
107 #if test -z "$*"; then
108 # echo "**Warning**: I am going to run \`configure' with no arguments."
109 # echo "If you wish to pass any to it, please specify them on the"
110 # echo \`$0\'" command line."
111 # echo
114 case $CC in
115 xlc )
116 am_opt=--include-deps;;
117 esac
119 for coin in $srcdir/$configure_script
121 dr=`dirname $coin`
122 if test -f $dr/NO-AUTO-GEN; then
123 echo skipping $dr -- flagged as no auto-gen
124 else
125 echo processing $dr
126 ( cd $dr
128 aclocalinclude="$ACLOCAL_FLAGS"
130 if grep "^AM_GNU_GETTEXT" $configure_script >/dev/null; then
131 echo "autogen.sh running: autopoint ..."
132 echo "no" | autopoint --force
133 #echo "Creating $dr/po/Makevars ..."
134 #mv -f $dr/po/Makevars.template $dr/po/Makevars
136 if grep "^AM_PROG_LIBTOOL" $configure_script >/dev/null; then
137 if test -z "$NO_LIBTOOLIZE" ; then
138 echo "autogen.sh running: libtoolize ..."
139 libtoolize --force --copy
142 echo "autogen.sh running: aclocal $aclocalinclude ..."
143 aclocal $aclocalinclude
144 if grep "^AM_CONFIG_HEADER" $configure_script >/dev/null; then
145 echo "autogen.sh running: autoheader ..."
146 autoheader
148 echo "autogen.sh running: automake $am_opt ..."
149 automake --copy --add-missing --gnu $am_opt
150 echo "autogen.sh running: autoconf ..."
151 autoconf
154 done
157 # Don't run configure.
158 #conf_flags="--enable-maintainer-mode"
160 #if test x$NOCONFIGURE = x; then
161 # echo Running $srcdir/configure $conf_flags "$@" ...
162 # $srcdir/configure $conf_flags "$@" \
163 # && echo Now type \`make\' to compile. || exit 1
164 #else
165 # echo Skipping configure process.