annotate autogen.sh @ 767:e73d30e0c896

Make utf8_validate_or_convert() to always allocate a new string.
author zas_
date Fri, 30 May 2008 08:36:23 +0000
parents 36afa9f48cac
children 267943c58be1
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
686
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 420
diff changeset
27 (grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.in >/dev/null) && {
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 420
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."
686
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 420
diff changeset
32 echo "glib-gettextize is a part of glib."
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 420
diff changeset
33 echo "You can get it from: ftp://ftp.gtk.org/pub/gtk"
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
34 DIE=1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
35 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
36 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
37
686
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 420
diff changeset
38 (automake --version) < /dev/null > /dev/null 2>&1 || {
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 420
diff changeset
39 echo
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 420
diff changeset
40 echo "**Error**: You must have \`automake' installed."
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 420
diff changeset
41 echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 420
diff changeset
42 DIE=1
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 420
diff changeset
43 NO_AUTOMAKE=yes
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 420
diff changeset
44 }
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 420
diff changeset
45
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
46 # if no automake, don't bother testing for aclocal
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
47 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
48 echo
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
49 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
50 echo "installed doesn't appear recent enough."
686
c0dda0ffb931 configure.in was rewritten:
bruclik
parents: 420
diff changeset
51 echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
52 DIE=1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
53 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
54
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
55 if test "$DIE" -eq 1; then
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
56 exit 1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
57 fi
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
58
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
59 if test -z "$*"; then
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
60 echo "**Warning**: I am going to run \`configure' with no arguments."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
61 echo "If you wish to pass any to it, please specify them on the"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
62 echo \`$0\'" command line."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
63 echo
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
64 fi
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
65
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
66 case $CC in
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
67 xlc )
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
68 am_opt=--include-deps;;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
69 esac
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
70
688
36afa9f48cac Create auxdir if needed.
zas_
parents: 686
diff changeset
71 auxdir="`sed -ne 's/^[ \t]*A._CONFIG_AUX_DIR *( *\([^ )]*\).*/\1/p' $srcdir/configure.in`"
36afa9f48cac Create auxdir if needed.
zas_
parents: 686
diff changeset
72 if test -n "$auxdir"; then
36afa9f48cac Create auxdir if needed.
zas_
parents: 686
diff changeset
73 if test ! -d "$srcdir/$auxdir"; then
36afa9f48cac Create auxdir if needed.
zas_
parents: 686
diff changeset
74 mkdir -p "$srcdir/$auxdir"
36afa9f48cac Create auxdir if needed.
zas_
parents: 686
diff changeset
75 fi fi
36afa9f48cac Create auxdir if needed.
zas_
parents: 686
diff changeset
76
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
77 for coin in `find $srcdir -name configure.in -print`
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
78 do
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
79 dr=`dirname $coin`
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
80 if test -f $dr/NO-AUTO-GEN; then
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
81 echo skipping $dr -- flagged as no auto-gen
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
82 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
83 echo processing $dr
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
84 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
85 ( cd $dr
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
86 aclocalinclude="$ACLOCAL_FLAGS"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
87 for k in $macrodirs; do
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
88 if test -d $k; then
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
89 aclocalinclude="$aclocalinclude -I $k"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
90 ##else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
91 ## echo "**Warning**: No such directory \`$k'. Ignored."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
92 fi
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
93 done
11
3c3b40dbde11 ########
gqview
parents: 1
diff changeset
94 if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
95 if grep "sed.*POTFILES" configure.in >/dev/null; then
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
96 : do nothing -- we still have an old unmodified configure.in
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
97 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
98 echo "Creating $dr/aclocal.m4 ..."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
99 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
11
3c3b40dbde11 ########
gqview
parents: 1
diff changeset
100 echo "Running glib-gettextize..."
3c3b40dbde11 ########
gqview
parents: 1
diff changeset
101 echo "no" | glib-gettextize --force --copy
420
53cfc5af7fd7 Add the possibility to update only one translation file using,
zas_
parents: 281
diff changeset
102 if [ -r po/Makefile.in.in.patch ]; then
53cfc5af7fd7 Add the possibility to update only one translation file using,
zas_
parents: 281
diff changeset
103 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
104 fi
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
105 echo "Making $dr/aclocal.m4 writable ..."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
106 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
107 fi
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
108 fi
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
109 echo "Running aclocal $aclocalinclude ..."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
110 aclocal $aclocalinclude
11
3c3b40dbde11 ########
gqview
parents: 1
diff changeset
111 if grep "^AC_CONFIG_HEADER" configure.in >/dev/null; then
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
112 echo "Running autoheader..."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
113 autoheader
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
114 fi
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
115 echo "Running automake --gnu $am_opt ..."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
116 automake --add-missing --gnu $am_opt
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
117 echo "Running autoconf ..."
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
118 autoconf
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
119 )
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
120 fi
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
121 done
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
122
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
123 conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
124
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
125 if test x$NOCONFIGURE = x; then
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
126 echo Running $srcdir/configure $conf_flags "$@" ...
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
127 $srcdir/configure $conf_flags "$@" \
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
128 && echo Now type \`make\' to compile $PKG_NAME
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
129 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
130 echo Skipping configure process.
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
131 fi