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
|
|
25 echo "GNU autoconf must be installed to build gFTP"
|
|
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
|
|
33 echo "GNU automake must be installed to build gFTP"
|
|
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
|
545
|
41 echo "GNU gettext must be installed to build gFTP"
|
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
|
545
|
70 GETTEXTIZE_FLAGS="-c --intl"
|
195
|
71 fi
|
26
|
72
|
195
|
73 echo "$GETTEXTIZE $GETTEXTIZE_FLAGS"
|
|
74 $GETTEXTIZE $GETTEXTIZE_FLAGS
|
|
75
|
|
76 echo "$ACLOCAL $ACLOCAL_FLAGS"
|
|
77 $ACLOCAL $ACLOCAL_FLAGS
|
26
|
78
|
|
79 # optionally feature autoheader
|
195
|
80 ($AUTOHEADER --version) < /dev/null > /dev/null 2>&1 && $AUTOHEADER
|
26
|
81
|
195
|
82 AUTOMAKE_FLAGS="-a -c $am_opt"
|
|
83 echo "$AUTOMAKE $AUTOMAKE_FLAGS"
|
|
84 $AUTOMAKE $AUTOMAKE_FLAGS
|
|
85
|
|
86 echo $AUTOCONF
|
|
87 $AUTOCONF
|
|
88
|
26
|
89 cd $ORIGDIR
|
|
90
|
|
91 if test -z "$AUTOGEN_SUBDIR_MODE"; then
|
553
|
92 CFLAGS="-Wall -W -Wno-long-long -Wno-unused-parameter -ansi -D_GNU_SOURCE -O -g" $srcdir/configure "$@"
|
26
|
93
|
|
94 echo
|
|
95 echo "Now type 'make' to compile $PROJECT."
|
|
96 fi
|