1
|
1 dnl Process this file with autoconf to produce a configure script.
|
|
2
|
|
3 AC_INIT(lib/gftp.h)
|
|
4
|
|
5 AM_CONFIG_HEADER(config.h)
|
325
|
6 AM_INIT_AUTOMAKE(gftp,2.0.17pre0)
|
1
|
7
|
81
|
8 AC_ARG_ENABLE(gtk20,
|
|
9 [ --disable-gtk20 Don't look for GTK+ 2.0 libraries],
|
|
10 enable_gtk20=$enableval,
|
|
11 enable_gtk20="yes")
|
|
12
|
|
13 AC_ARG_ENABLE(gtkport,
|
|
14 [ --disable-gtkport Disable compiling the GTK+ port],
|
|
15 enable_gtkport=$enableval,
|
|
16 enable_gtkport="yes")
|
|
17
|
|
18 AC_ARG_ENABLE(textport,
|
|
19 [ --disable-textport Disable compiling the text port],
|
|
20 enable_textport=$enableval,
|
|
21 enable_textport="yes")
|
215
|
22 AC_ARG_ENABLE(ssl,
|
|
23 [ --disable-ssl Disable SSL support],
|
|
24 enable_ssl=$enableval,
|
|
25 enable_ssl="yes")
|
1
|
26
|
|
27 AC_SUBST(PACKAGE)
|
|
28 AC_SUBST(VERSION)
|
|
29 AC_SUBST(PREFIX)
|
|
30
|
309
|
31 ALL_LINGUAS="am az ar be bg bn ca cs da de el es fi fr hr hu it ja ko mk ml ms nl no pl pt pt_BR ro ru sk sr sr@Latn sv tr uk zh_CN zh_TW"
|
1
|
32
|
|
33 AC_CANONICAL_HOST
|
16
|
34 AC_PROG_CC
|
|
35 AC_AIX
|
|
36 AC_MINIX
|
|
37 AC_EXEEXT
|
|
38 AC_PROG_RANLIB
|
|
39 AC_SYS_LARGEFILE
|
|
40 dnl AC_ISC_POSIX
|
|
41 AM_C_PROTOTYPES
|
|
42 AC_C_CONST
|
|
43 AC_C_INLINE
|
1
|
44
|
26
|
45 AM_MAINTAINER_MODE
|
|
46
|
1
|
47 AC_PROG_AWK
|
|
48 AC_PROG_INSTALL
|
|
49 AC_PROG_LN_S
|
|
50 AC_PROG_MAKE_SET
|
|
51
|
|
52 AC_HEADER_DIRENT
|
|
53 AC_HEADER_STDC
|
|
54 AC_HEADER_SYS_WAIT
|
325
|
55 AC_CHECK_HEADERS(fcntl.h libutil.h limits.h malloc.h pty.h strings.h sys/ioctl.h sys/time.h unistd.h stdint.h)
|
1
|
56
|
202
|
57 AC_TYPE_SOCKLEN_T
|
1
|
58 AC_TYPE_MODE_T
|
|
59 AC_TYPE_PID_T
|
|
60 AC_TYPE_SIZE_T
|
|
61 AC_HEADER_TIME
|
|
62 AC_STRUCT_TM
|
|
63
|
|
64 AC_FUNC_ALLOCA
|
|
65 AC_PROG_GCC_TRADITIONAL
|
|
66 AC_FUNC_MMAP
|
|
67 AC_TYPE_SIGNAL
|
|
68 AC_FUNC_STRFTIME
|
|
69 AC_FUNC_UTIME_NULL
|
213
|
70 AC_CHECK_FUNCS(gai_strerror getaddrinfo getcwd gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strstr strtod strtol uname grantpt openpty getdtablesize)
|
1
|
71
|
81
|
72 if test "x$enable_gtk20" = "xyes" ; then
|
57
|
73 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.0.0, found_glib20=1, found_glib20=0)
|
|
74 else
|
|
75 found_glib20=0;
|
|
76 fi
|
|
77
|
|
78 if test "x$GFTP_TEXT" = "x" -a $found_glib20 = 0 ; then
|
26
|
79 AM_PATH_GLIB(1.2.3, , AC_MSG_ERROR(gFTP needs GLIB 1.2.3 or higher))
|
1
|
80 fi
|
|
81
|
93
|
82 EXTRA_LIBS=""
|
|
83
|
146
|
84 # FreeBSD needs this
|
236
|
85 AC_CHECK_LIB(util, openpty, [EXTRA_LIBS="-lutil"
|
|
86 AC_DEFINE(HAVE_OPENPTY, [1], [Define if you have the openpty function.]) ])
|
146
|
87
|
57
|
88 AC_CHECK_LIB(socket, socket, EXTRA_LIBS="-lsocket")
|
|
89
|
|
90 AC_CHECK_LIB(nsl, gethostbyname, EXTRA_LIBS="$EXTRA_LIBS -lnsl")
|
1
|
91
|
|
92 GFTP_TEXT=""
|
|
93 USE_READLINE="yes"
|
|
94 READLINE_LIBS=""
|
81
|
95 if test "x$enable_textport" = "xyes" ; then
|
230
|
96 GFTP_TEXT="gftp-text"
|
|
97
|
1
|
98 AC_MSG_CHECKING([whether to use readline])
|
|
99 AC_ARG_WITH(readline,
|
|
100 [ --with-readline turn on readline [default=yes, default tries -lncurses, -lcurses, -ltermcap]],
|
|
101 [case "${withval}" in
|
|
102 yes) USE_READLINE="yes" ; AC_MSG_RESULT([yes]) ;;
|
|
103 no) USE_READLINE="no" ; AC_MSG_RESULT([no]) ;;
|
|
104 only) USE_READLINE="yes"
|
|
105 EXTRA_LIBREADLINE_DEPS=" "
|
|
106 AC_MSG_RESULT([yes (using only readline)]) ;;
|
|
107 *) USE_READLINE="yes"
|
|
108 EXTRA_LIBREADLINE_DEPS="${withval}"
|
|
109 AC_MSG_RESULT([yes (using extra libraries ${withval})]) ;;
|
|
110 esac],[AC_MSG_RESULT([${USE_READLINE}])])
|
|
111
|
|
112 dnl Checks for libraries.
|
|
113 dnl When checking readline, check using extra libraries first.
|
|
114 dnl We want to protect against the link somehow succeeding, but only
|
|
115 dnl failing at runtime, as seems to happen on some BSD systems.
|
|
116 if test "$USE_READLINE" = yes ; then
|
|
117 if test "$EXTRA_LIBREADLINE_DEPS" = "" ; then
|
|
118 unset ac_cv_lib_readline_readline
|
|
119 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
|
|
120 HAVE_LIBREADLINE=false, -lncurses)
|
|
121 if test x${HAVE_LIBREADLINE} = xtrue ; then
|
|
122 echo " Using -lreadline -lncurses"
|
|
123 EXTRA_LIBREADLINE_DEPS=-lncurses
|
26
|
124 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline])
|
1
|
125 else
|
|
126 unset ac_cv_lib_readline_readline
|
|
127 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
|
|
128 HAVE_LIBREADLINE=false, -lcurses)
|
|
129 if test x${HAVE_LIBREADLINE} = xtrue ; then
|
|
130 echo " Using -lreadline -lcurses"
|
|
131 EXTRA_LIBREADLINE_DEPS=-lcurses
|
26
|
132 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline])
|
1
|
133 else
|
|
134 unset ac_cv_lib_readline_readline
|
|
135 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
|
|
136 HAVE_LIBREADLINE=false, -ltermcap)
|
|
137 if test x${HAVE_LIBREADLINE} = xtrue ; then
|
|
138 echo " Using -lreadline -ltermcap"
|
|
139 EXTRA_LIBREADLINE_DEPS=-ltermcap
|
26
|
140 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline])
|
1
|
141 else
|
|
142 unset ac_cv_lib_readline_readline
|
|
143 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
|
|
144 HAVE_LIBREADLINE=false)
|
|
145 if test x${HAVE_LIBREADLINE} = xtrue ; then
|
26
|
146 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline])
|
1
|
147 else
|
26
|
148 AC_DEFINE(HAVE_LIBREADLINE, [0], [Define if the text port uses readline])
|
1
|
149 fi
|
|
150 fi
|
|
151 fi
|
|
152 fi
|
|
153 else
|
|
154 unset ac_cv_lib_readline_readline
|
|
155 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
|
|
156 HAVE_LIBREADLINE=false, ${EXTRA_LIBREADLINE_DEPS})
|
|
157 if test x${HAVE_LIBREADLINE} = xtrue ; then
|
|
158 echo " Using -lreadline ${EXTRA_LIBREADLINE_DEPS}"
|
26
|
159 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline])
|
1
|
160 else
|
26
|
161 AC_DEFINE(HAVE_LIBREADLINE, [0], [Define if the text port uses readline])
|
1
|
162 fi
|
|
163 fi
|
|
164 else
|
|
165 HAVE_LIBREADLINE=false
|
26
|
166 AC_DEFINE(HAVE_LIBREADLINE, [0], [Define if the text port uses readline])
|
1
|
167 fi
|
|
168 if test x${HAVE_LIBREADLINE} = xtrue; then
|
|
169 READLINE_LIBS="-lreadline ${EXTRA_LIBREADLINE_DEPS}"
|
|
170 fi
|
|
171 fi
|
|
172
|
|
173 AC_CHECK_LIB(m, log10, EXTRA_LIBS="$EXTRA_LIBS -lm")
|
|
174
|
26
|
175 AM_WITH_DMALLOC
|
1
|
176
|
|
177 AC_SUBST(EXTRA_LIBS)
|
|
178 AC_SUBST(READLINE_LIBS)
|
|
179 AC_SUBST(GFTP_TEXT)
|
|
180
|
|
181 GFTP_GTK=""
|
|
182 PTHREAD_CFLAGS=""
|
|
183 PTHREAD_LIBS=""
|
33
|
184
|
|
185 # I don't have PKG_CHECK_MODULES or AM_PATH_GLIB check for gthread because
|
|
186 # the text port doesn't need to be compiled against the thread libraries
|
|
187 GTHREAD_LIBS=""
|
|
188
|
81
|
189 if test "x$enable_gtkport" = "xyes" ; then
|
|
190 if test $found_glib20 = 1 -a "x$enable_gtk20" = "xyes" ; then
|
57
|
191 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.0.0, GFTP_GTK=gftp-gtk, AC_MSG_ERROR(You have GLIB 2.0 installed but I cannot find GTK+ 2.0. Run configure with --disable-gtk20 or install GTK+ 2.0))
|
1
|
192 fi
|
|
193
|
|
194 if test "x$GFTP_GTK" = "x" ; then
|
|
195 AM_PATH_GTK(1.2.3, GFTP_GTK=gftp-gtk, AC_MSG_WARN(gFTP needs GTK+ 1.2.3 or higher for the graphical version. Only building the text version))
|
33
|
196 GTHREAD_LIBS="-lgthread"
|
|
197 else
|
|
198 GTHREAD_LIBS="-lgthread-2.0"
|
1
|
199 fi
|
|
200
|
|
201 if test "x$GFTP_GTK" = xgftp-gtk; then
|
|
202 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIBS="-lpthread")
|
|
203
|
|
204 if test "x$PTHREAD_LIBS" = x ; then
|
|
205 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIBS="-lpthreads")
|
|
206 fi
|
|
207
|
|
208 if test "x$PTHREAD_LIBS" = x ; then
|
|
209 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIBS="-lc_r")
|
|
210 fi
|
|
211
|
|
212 if test "x$PTHREAD_LIBS" = x ; then
|
|
213 echo ;
|
|
214 echo "Error: Cannot find the pthread libraries. If you don't have them installed," ;
|
|
215 echo "your X libraries probably aren't thread safe either. You can download the" ;
|
|
216 echo "pthread library and the thread safe X libraries from my webpage at" ;
|
|
217 echo "http://www.gftp.org/. Note the pthread library and the thread safe" ;
|
|
218 echo "X libraries on my webpage are for Linux libc5 machines ONLY" ;
|
|
219 echo ;
|
|
220 exit
|
|
221 fi
|
|
222
|
|
223 PTHREAD_CFLAGS="-D_REENTRANT"
|
|
224
|
|
225 # I took some of these from the glib 1.3.3 configure.in
|
|
226 case $host in
|
|
227 *-hpux*)
|
|
228 # From H.Merijn Brand <h.m.brand@hccnet.nl>
|
250
|
229 echo '#define pthread_attr_init(x) __pthread_attr_init_system(x)' >>confdefs.h
|
1
|
230 ;;
|
|
231 *-aix*)
|
|
232 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE"
|
|
233 if test x"$GCC" = xyes; then
|
|
234 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -mthreads"
|
|
235 fi
|
|
236 ;;
|
|
237 *-freebsd*)
|
|
238 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE"
|
|
239
|
|
240 # FreeBSD 2.2.x shiped with gcc 2.7.2.x, which doesn't support
|
|
241 # -mthreads flag.
|
|
242 ;;
|
|
243 *-openbsd*)
|
|
244 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE"
|
|
245 if test "x$PTHREAD_LIBS" = "x-lc_r"; then
|
|
246 PTHREAD_LIBS="-pthread"
|
|
247 fi
|
|
248 ;;
|
|
249 *-sysv5uw7*) # UnixWare 7
|
|
250 if test "$GCC" != "yes"; then
|
|
251 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -Kthread"
|
|
252 else
|
|
253 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -pthread"
|
|
254 fi
|
|
255 ;;
|
|
256 *-dg-dgux*) # DG/UX
|
|
257 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_POSIX4A_DRAFT10_SOURCE"
|
|
258 esac
|
|
259 fi
|
|
260 fi
|
|
261 AC_SUBST(PTHREAD_CFLAGS)
|
|
262 AC_SUBST(PTHREAD_LIBS)
|
33
|
263 AC_SUBST(GTHREAD_LIBS)
|
1
|
264 AC_SUBST(GFTP_GTK)
|
|
265
|
215
|
266 SSL_LIBS=""
|
|
267 if test "x$enable_ssl" = "xyes" ; then
|
|
268 AC_CHECK_HEADERS(openssl/ssl.h ssl.h)
|
|
269
|
|
270 if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
|
|
271 AC_CHECK_LIB(ssl, SSL_library_init, SSL_LIBS="-lcrypto -lssl")
|
|
272
|
|
273 if test "x$SSL_LIBS" != "x" ; then
|
|
274 AC_DEFINE(USE_SSL, 1,
|
|
275 [define if you want to enable SSL support])
|
|
276 fi
|
|
277 fi
|
|
278 fi
|
|
279 AC_SUBST(SSL_LIBS)
|
|
280
|
166
|
281 AM_GNU_GETTEXT
|
1
|
282
|
307
|
283 AC_CHECK_PROG(DB2HTML, db2html, true, false)
|
|
284 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
|
|
285
|
325
|
286 AC_OUTPUT(Makefile docs/Makefile docs/sample.gftp/Makefile lib/Makefile src/gftp src/Makefile src/gtk/Makefile src/text/Makefile gftp.spec intl/Makefile po/Makefile.in )
|