26
|
1 #!/bin/sh
|
|
2 # Run this to generate all the initial makefiles, etc.
|
545
|
3 # This was derived from Glib's autogen.sh
|
26
|
4
|
|
5 srcdir=`dirname $0`
|
|
6 test -z "$srcdir" && srcdir=.
|
|
7
|
|
8 ORIGDIR=`pwd`
|
|
9 cd $srcdir
|
|
10 PROJECT=gFTP
|
|
11 TEST_TYPE=-f
|
|
12 FILE=lib/gftp.h
|
195
|
13 GETTEXTIZE=gettextize
|
26
|
14
|
|
15 DIE=0
|
|
16
|
545
|
17 AUTOMAKE=automake
|
|
18 ACLOCAL=aclocal
|
|
19 AUTOCONF=autoconf
|
|
20 AUTOHEADER=autoheader
|
195
|
21
|
545
|
22 autoconf_version=`$AUTOCONF --version 2>/dev/null`
|
|
23 if [ "x$autoconf_version" = "x" ] ; then
|
|
24 echo
|
663
|
25 echo "GNU autoconf must be installed to build $PROJECT"
|
545
|
26 echo "GNU autoconf is available from http://www.gnu.org/software/autoconf/"
|
|
27 DIE=1
|
195
|
28 fi
|
|
29
|
545
|
30 automake_version=`$AUTOMAKE --version 2>/dev/null`
|
|
31 if [ "x$automake_version" = "x" ] ; then
|
|
32 echo
|
663
|
33 echo "GNU automake must be installed to build $PROJECT"
|
545
|
34 echo "GNU automake is available from http://www.gnu.org/software/automake/"
|
|
35 DIE=1
|
26
|
36 fi
|
|
37
|
195
|
38 gettext_version=`$GETTEXTIZE --version 2>/dev/null | grep 'GNU'`
|
|
39 if [ "x$gettext_version" = "x" ] ; then
|
26
|
40 echo
|
663
|
41 echo "GNU gettext must be installed to build $PROJECT"
|
26
|
42 echo "GNU gettext is available from http://www.gnu.org/software/gettext/"
|
|
43 DIE=1
|
|
44 fi
|
|
45
|
|
46 if test "$DIE" -eq 1; then
|
|
47 exit 1
|
|
48 fi
|
|
49
|
|
50 test $TEST_TYPE $FILE || {
|
|
51 echo "You must run this script in the top-level $PROJECT directory"
|
|
52 exit 1
|
|
53 }
|
|
54
|
|
55 if test -z "$AUTOGEN_SUBDIR_MODE"; then
|
|
56 if test -z "$*"; then
|
|
57 echo "I am going to run ./configure with no arguments - if you wish "
|
|
58 echo "to pass any to it, please specify them on the $0 command line."
|
|
59 fi
|
|
60 fi
|
|
61
|
|
62 case $CC in
|
|
63 *xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
|
|
64 esac
|
|
65
|
195
|
66 intl=`$GETTEXTIZE --help 2>/dev/null | grep -- '--intl'`
|
|
67 if test -z "$intl"; then
|
545
|
68 GETTEXTIZE_FLAGS="-c"
|
195
|
69 else
|
869
|
70 GETTEXTIZE_FLAGS="-c --intl -f"
|
195
|
71 fi
|
26
|
72
|
195
|
73 echo "$GETTEXTIZE $GETTEXTIZE_FLAGS"
|
|
74 $GETTEXTIZE $GETTEXTIZE_FLAGS
|
|
75
|
901
|
76 mv Makefile.am~ Makefile.am
|
|
77 mv configure.in~ configure.in
|
|
78
|
888
|
79 ACLOCAL_FLAGS="-I m4"
|
195
|
80 echo "$ACLOCAL $ACLOCAL_FLAGS"
|
|
81 $ACLOCAL $ACLOCAL_FLAGS
|
26
|
82
|
|
83 # optionally feature autoheader
|
195
|
84 ($AUTOHEADER --version) < /dev/null > /dev/null 2>&1 && $AUTOHEADER
|
26
|
85
|
195
|
86 AUTOMAKE_FLAGS="-a -c $am_opt"
|
|
87 echo "$AUTOMAKE $AUTOMAKE_FLAGS"
|
|
88 $AUTOMAKE $AUTOMAKE_FLAGS
|
|
89
|
|
90 echo $AUTOCONF
|
|
91 $AUTOCONF
|
|
92
|
26
|
93 cd $ORIGDIR
|
|
94
|
|
95 if test -z "$AUTOGEN_SUBDIR_MODE"; then
|
553
|
96 CFLAGS="-Wall -W -Wno-long-long -Wno-unused-parameter -ansi -D_GNU_SOURCE -O -g" $srcdir/configure "$@"
|
26
|
97
|
|
98 echo
|
|
99 echo "Now type 'make' to compile $PROJECT."
|
|
100 fi
|