annotate autogen.sh @ 509:b78a91d0779e

Move get_exec_time() to debug.{c,h}.
author zas_
date Thu, 24 Apr 2008 09:43:23 +0000
parents 53cfc5af7fd7
children c0dda0ffb931
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1 #!/bin/sh
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
2 # Run this to generate all the initial makefiles, etc.
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
3
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
4 #this was originally taken from the gnome macros/autogen.sh scripts
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
5
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
6 srcdir=`dirname $0`
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
7 test -z "$srcdir" && srcdir=.
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
8
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
9 (test -f $srcdir/configure.in \
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
10 && test -f $srcdir/src/main.c \
281
9995c5fb202a gqview.h -> main.h
zas_
parents: 197
diff changeset
11 && test -f $srcdir/src/main.h) || {
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
12 echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
197
e3f10b6046ab more renames
nadvornik
parents: 11
diff changeset
13 echo " top-level geeqie directory"
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
14 exit 1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
15 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
16
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
17 DIE=0
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
18
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
19 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
20 echo
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
21 echo "**Error**: You must have \`autoconf' installed."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
22 echo "Download the appropriate package for your distribution,"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
23 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
24 DIE=1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
25 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
26
11
3c3b40dbde11 ########
gqview
parents: 1
diff changeset
27 grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
28 grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
11
3c3b40dbde11 ########
gqview
parents: 1
diff changeset
29 (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || {
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
30 echo
11
3c3b40dbde11 ########
gqview
parents: 1
diff changeset
31 echo "**Error**: You must have \`glib-gettextize' installed."
3c3b40dbde11 ########
gqview
parents: 1
diff changeset
32 echo "glib-gettextize is a part of glib"
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
33 DIE=1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
34 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
35 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
36
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
37 # if no automake, don't bother testing for aclocal
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
38 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
39 echo
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
40 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
41 echo "installed doesn't appear recent enough."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
42 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
43 echo "(or a newer version if it is available)"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
44 DIE=1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
45 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
46
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
47 if test "$DIE" -eq 1; then
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
48 exit 1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
49 fi
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
50
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
51 if test -z "$*"; then
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
52 echo "**Warning**: I am going to run \`configure' with no arguments."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
53 echo "If you wish to pass any to it, please specify them on the"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
54 echo \`$0\'" command line."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
55 echo
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
56 fi
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
57
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
58 case $CC in
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
59 xlc )
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
60 am_opt=--include-deps;;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
61 esac
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
62
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
63 for coin in `find $srcdir -name configure.in -print`
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
64 do
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
65 dr=`dirname $coin`
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
66 if test -f $dr/NO-AUTO-GEN; then
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
67 echo skipping $dr -- flagged as no auto-gen
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
68 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
69 echo processing $dr
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
70 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
71 ( cd $dr
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
72 aclocalinclude="$ACLOCAL_FLAGS"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
73 for k in $macrodirs; do
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
74 if test -d $k; then
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
75 aclocalinclude="$aclocalinclude -I $k"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
76 ##else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
77 ## echo "**Warning**: No such directory \`$k'. Ignored."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
78 fi
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
79 done
11
3c3b40dbde11 ########
gqview
parents: 1
diff changeset
80 if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
81 if grep "sed.*POTFILES" configure.in >/dev/null; then
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
82 : do nothing -- we still have an old unmodified configure.in
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
83 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
84 echo "Creating $dr/aclocal.m4 ..."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
85 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
11
3c3b40dbde11 ########
gqview
parents: 1
diff changeset
86 echo "Running glib-gettextize..."
3c3b40dbde11 ########
gqview
parents: 1
diff changeset
87 echo "no" | glib-gettextize --force --copy
420
53cfc5af7fd7 Add the possibility to update only one translation file using,
zas_
parents: 281
diff changeset
88 if [ -r po/Makefile.in.in.patch ]; then
53cfc5af7fd7 Add the possibility to update only one translation file using,
zas_
parents: 281
diff changeset
89 patch po/Makefile.in.in < po/Makefile.in.in.patch
53cfc5af7fd7 Add the possibility to update only one translation file using,
zas_
parents: 281
diff changeset
90 fi
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
91 echo "Making $dr/aclocal.m4 writable ..."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
92 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
93 fi
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
94 fi
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
95 echo "Running aclocal $aclocalinclude ..."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
96 aclocal $aclocalinclude
11
3c3b40dbde11 ########
gqview
parents: 1
diff changeset
97 if grep "^AC_CONFIG_HEADER" configure.in >/dev/null; then
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
98 echo "Running autoheader..."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
99 autoheader
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
100 fi
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
101 echo "Running automake --gnu $am_opt ..."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
102 automake --add-missing --gnu $am_opt
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
103 echo "Running autoconf ..."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
104 autoconf
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
105 )
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
106 fi
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
107 done
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
108
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
109 conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
110
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
111 if test x$NOCONFIGURE = x; then
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
112 echo Running $srcdir/configure $conf_flags "$@" ...
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
113 $srcdir/configure $conf_flags "$@" \
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
114 && echo Now type \`make\' to compile $PKG_NAME
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
115 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
116 echo Skipping configure process.
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
117 fi