26
|
1 #!/bin/sh
|
|
2 # Run this to generate all the initial makefiles, etc.
|
|
3
|
|
4 srcdir=`dirname $0`
|
|
5 test -z "$srcdir" && srcdir=.
|
|
6
|
|
7 ORIGDIR=`pwd`
|
|
8 cd $srcdir
|
|
9 PROJECT=gFTP
|
|
10 TEST_TYPE=-f
|
|
11 FILE=lib/gftp.h
|
195
|
12 GETTEXTIZE=gettextize
|
26
|
13
|
|
14 DIE=0
|
|
15
|
195
|
16 if [ `whereis -b automake-1.4 > /dev/null 2>&1` ] ; then
|
|
17 AUTOMAKE=automake-1.4
|
|
18 ACLOCAL=aclocal-1.4
|
|
19 else
|
|
20 AUTOMAKE=automake
|
|
21 ACLOCAL=aclocal
|
|
22 fi
|
|
23
|
|
24 if [ `whereis -b autoconf2.13 > /dev/null 2>&1` ] ; then
|
|
25 AUTOCONF=autoconf2.13
|
|
26 AUTOHEADER=autoheader2.13
|
|
27 else
|
|
28 AUTOCONF=autoconf
|
|
29 AUTOHEADER=autoheader
|
|
30 fi
|
|
31
|
|
32 ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
|
26
|
33 echo
|
|
34 echo "You must have autoconf installed to compile $PROJECT."
|
|
35 echo "libtool the appropriate package for your distribution,"
|
|
36 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
|
|
37 DIE=1
|
|
38 }
|
|
39
|
|
40 have_automake=false
|
195
|
41 if $AUTOMAKE --version < /dev/null > /dev/null 2>&1 ; then
|
171
|
42 automake_version=`automake --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'`
|
26
|
43 case $automake_version in
|
|
44 1.2*|1.3*|1.4)
|
|
45 ;;
|
|
46 *)
|
|
47 have_automake=true
|
|
48 ;;
|
|
49 esac
|
|
50 fi
|
|
51 if $have_automake ; then : ; else
|
|
52 echo
|
|
53 echo "You must have automake 1.4-p1 installed to compile $PROJECT."
|
|
54 echo "Get ftp://ftp.gnu.org/pub/gnu/automake/automake-1.4-p1.tar.gz"
|
|
55 echo "(or a newer version if it is available)"
|
|
56 DIE=1
|
|
57 fi
|
|
58
|
195
|
59 gettext_version=`$GETTEXTIZE --version 2>/dev/null | grep 'GNU'`
|
|
60 if [ "x$gettext_version" = "x" ] ; then
|
26
|
61 echo
|
|
62 echo "GNU gettext must be installed to build GLib from CVS"
|
|
63 echo "GNU gettext is available from http://www.gnu.org/software/gettext/"
|
|
64 DIE=1
|
|
65 fi
|
|
66
|
|
67 if test "$DIE" -eq 1; then
|
|
68 exit 1
|
|
69 fi
|
|
70
|
|
71 test $TEST_TYPE $FILE || {
|
|
72 echo "You must run this script in the top-level $PROJECT directory"
|
|
73 exit 1
|
|
74 }
|
|
75
|
|
76 if test -z "$AUTOGEN_SUBDIR_MODE"; then
|
|
77 if test -z "$*"; then
|
|
78 echo "I am going to run ./configure with no arguments - if you wish "
|
|
79 echo "to pass any to it, please specify them on the $0 command line."
|
|
80 fi
|
|
81 fi
|
|
82
|
|
83 case $CC in
|
|
84 *xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
|
|
85 esac
|
|
86
|
195
|
87 intl=`$GETTEXTIZE --help 2>/dev/null | grep -- '--intl'`
|
|
88 if test -z "$intl"; then
|
|
89 GETTEXTIZE_FLAGS="-f -c"
|
|
90 else
|
|
91 GETTEXTIZE_FLAGS="-f -c --intl"
|
|
92 fi
|
26
|
93
|
195
|
94 echo "$GETTEXTIZE $GETTEXTIZE_FLAGS"
|
|
95 $GETTEXTIZE $GETTEXTIZE_FLAGS
|
|
96
|
|
97 echo "$ACLOCAL $ACLOCAL_FLAGS"
|
|
98 $ACLOCAL $ACLOCAL_FLAGS
|
26
|
99
|
|
100 # optionally feature autoheader
|
195
|
101 ($AUTOHEADER --version) < /dev/null > /dev/null 2>&1 && $AUTOHEADER
|
26
|
102
|
195
|
103 AUTOMAKE_FLAGS="-a -c $am_opt"
|
|
104 echo "$AUTOMAKE $AUTOMAKE_FLAGS"
|
|
105 $AUTOMAKE $AUTOMAKE_FLAGS
|
|
106
|
|
107 echo $AUTOCONF
|
|
108 $AUTOCONF
|
|
109
|
26
|
110 cd $ORIGDIR
|
|
111
|
|
112 if test -z "$AUTOGEN_SUBDIR_MODE"; then
|
387
|
113 CFLAGS="-Wall -ansi -D_GNU_SOURCE -O -g" $srcdir/configure "$@"
|
26
|
114
|
|
115 echo
|
|
116 echo "Now type 'make' to compile $PROJECT."
|
|
117 fi
|