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)
|
780
|
6 AM_INIT_AUTOMAKE(gftp,2.0.19pre1)
|
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
|
869
|
31 AC_GNU_SOURCE
|
1
|
32 AC_CANONICAL_HOST
|
16
|
33 AC_PROG_CC
|
|
34 AC_AIX
|
|
35 AC_MINIX
|
|
36 AC_EXEEXT
|
|
37 AC_PROG_RANLIB
|
|
38 AC_SYS_LARGEFILE
|
|
39 dnl AC_ISC_POSIX
|
|
40 AM_C_PROTOTYPES
|
|
41 AC_C_CONST
|
|
42 AC_C_INLINE
|
328
|
43 AC_INTL_PRINTF
|
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
|
460
|
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 sys/mkdev.h inttypes.h)
|
1
|
56
|
684
|
57 dnl AM_TYPE_PTRDIFF_T
|
202
|
58 AC_TYPE_SOCKLEN_T
|
1
|
59 AC_TYPE_MODE_T
|
478
|
60 AC_TYPE_INTPTR_T
|
1
|
61 AC_TYPE_PID_T
|
|
62 AC_TYPE_SIZE_T
|
|
63 AC_HEADER_TIME
|
|
64 AC_STRUCT_TM
|
435
|
65 AC_CHECK_SIZEOF(off_t)
|
1
|
66
|
|
67 AC_FUNC_ALLOCA
|
|
68 AC_PROG_GCC_TRADITIONAL
|
|
69 AC_FUNC_MMAP
|
|
70 AC_TYPE_SIGNAL
|
|
71 AC_FUNC_STRFTIME
|
|
72 AC_FUNC_UTIME_NULL
|
213
|
73 AC_CHECK_FUNCS(gai_strerror getaddrinfo getcwd gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strstr strtod strtol uname grantpt openpty getdtablesize)
|
1
|
74
|
781
|
75 # This is needed by fsplib. This check is from configure.ac in that distribution.
|
|
76 AC_CHECK_TYPE(union semun, ,AC_DEFINE(_SEM_SEMUN_UNDEFINED,1,[Define if you do not have semun in sys/sem.h]),
|
|
77 [#include <sys/types.h>
|
|
78 #include <sys/ipc.h>
|
|
79 #include <sys/sem.h>
|
|
80 ])
|
|
81
|
81
|
82 if test "x$enable_gtk20" = "xyes" ; then
|
57
|
83 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.0.0, found_glib20=1, found_glib20=0)
|
|
84 else
|
|
85 found_glib20=0;
|
|
86 fi
|
|
87
|
|
88 if test "x$GFTP_TEXT" = "x" -a $found_glib20 = 0 ; then
|
26
|
89 AM_PATH_GLIB(1.2.3, , AC_MSG_ERROR(gFTP needs GLIB 1.2.3 or higher))
|
1
|
90 fi
|
|
91
|
93
|
92 EXTRA_LIBS=""
|
|
93
|
146
|
94 # FreeBSD needs this
|
236
|
95 AC_CHECK_LIB(util, openpty, [EXTRA_LIBS="-lutil"
|
|
96 AC_DEFINE(HAVE_OPENPTY, [1], [Define if you have the openpty function.]) ])
|
146
|
97
|
57
|
98 AC_CHECK_LIB(socket, socket, EXTRA_LIBS="-lsocket")
|
|
99
|
|
100 AC_CHECK_LIB(nsl, gethostbyname, EXTRA_LIBS="$EXTRA_LIBS -lnsl")
|
1
|
101
|
|
102 GFTP_TEXT=""
|
|
103 USE_READLINE="yes"
|
|
104 READLINE_LIBS=""
|
81
|
105 if test "x$enable_textport" = "xyes" ; then
|
230
|
106 GFTP_TEXT="gftp-text"
|
|
107
|
1
|
108 AC_MSG_CHECKING([whether to use readline])
|
|
109 AC_ARG_WITH(readline,
|
|
110 [ --with-readline turn on readline [default=yes, default tries -lncurses, -lcurses, -ltermcap]],
|
|
111 [case "${withval}" in
|
|
112 yes) USE_READLINE="yes" ; AC_MSG_RESULT([yes]) ;;
|
|
113 no) USE_READLINE="no" ; AC_MSG_RESULT([no]) ;;
|
|
114 only) USE_READLINE="yes"
|
|
115 EXTRA_LIBREADLINE_DEPS=" "
|
|
116 AC_MSG_RESULT([yes (using only readline)]) ;;
|
|
117 *) USE_READLINE="yes"
|
|
118 EXTRA_LIBREADLINE_DEPS="${withval}"
|
|
119 AC_MSG_RESULT([yes (using extra libraries ${withval})]) ;;
|
|
120 esac],[AC_MSG_RESULT([${USE_READLINE}])])
|
|
121
|
|
122 dnl Checks for libraries.
|
|
123 dnl When checking readline, check using extra libraries first.
|
|
124 dnl We want to protect against the link somehow succeeding, but only
|
|
125 dnl failing at runtime, as seems to happen on some BSD systems.
|
|
126 if test "$USE_READLINE" = yes ; then
|
|
127 if test "$EXTRA_LIBREADLINE_DEPS" = "" ; then
|
|
128 unset ac_cv_lib_readline_readline
|
|
129 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
|
|
130 HAVE_LIBREADLINE=false, -lncurses)
|
|
131 if test x${HAVE_LIBREADLINE} = xtrue ; then
|
|
132 echo " Using -lreadline -lncurses"
|
|
133 EXTRA_LIBREADLINE_DEPS=-lncurses
|
26
|
134 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline])
|
1
|
135 else
|
|
136 unset ac_cv_lib_readline_readline
|
|
137 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
|
|
138 HAVE_LIBREADLINE=false, -lcurses)
|
|
139 if test x${HAVE_LIBREADLINE} = xtrue ; then
|
|
140 echo " Using -lreadline -lcurses"
|
|
141 EXTRA_LIBREADLINE_DEPS=-lcurses
|
26
|
142 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline])
|
1
|
143 else
|
|
144 unset ac_cv_lib_readline_readline
|
|
145 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
|
|
146 HAVE_LIBREADLINE=false, -ltermcap)
|
|
147 if test x${HAVE_LIBREADLINE} = xtrue ; then
|
|
148 echo " Using -lreadline -ltermcap"
|
|
149 EXTRA_LIBREADLINE_DEPS=-ltermcap
|
26
|
150 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline])
|
1
|
151 else
|
|
152 unset ac_cv_lib_readline_readline
|
|
153 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
|
|
154 HAVE_LIBREADLINE=false)
|
|
155 if test x${HAVE_LIBREADLINE} = xtrue ; then
|
26
|
156 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline])
|
1
|
157 else
|
26
|
158 AC_DEFINE(HAVE_LIBREADLINE, [0], [Define if the text port uses readline])
|
1
|
159 fi
|
|
160 fi
|
|
161 fi
|
|
162 fi
|
|
163 else
|
|
164 unset ac_cv_lib_readline_readline
|
|
165 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
|
|
166 HAVE_LIBREADLINE=false, ${EXTRA_LIBREADLINE_DEPS})
|
|
167 if test x${HAVE_LIBREADLINE} = xtrue ; then
|
|
168 echo " Using -lreadline ${EXTRA_LIBREADLINE_DEPS}"
|
26
|
169 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline])
|
1
|
170 else
|
26
|
171 AC_DEFINE(HAVE_LIBREADLINE, [0], [Define if the text port uses readline])
|
1
|
172 fi
|
|
173 fi
|
|
174 else
|
|
175 HAVE_LIBREADLINE=false
|
26
|
176 AC_DEFINE(HAVE_LIBREADLINE, [0], [Define if the text port uses readline])
|
1
|
177 fi
|
|
178 if test x${HAVE_LIBREADLINE} = xtrue; then
|
|
179 READLINE_LIBS="-lreadline ${EXTRA_LIBREADLINE_DEPS}"
|
|
180 fi
|
|
181 fi
|
|
182
|
|
183 AC_CHECK_LIB(m, log10, EXTRA_LIBS="$EXTRA_LIBS -lm")
|
|
184
|
26
|
185 AM_WITH_DMALLOC
|
1
|
186
|
|
187 AC_SUBST(EXTRA_LIBS)
|
|
188 AC_SUBST(READLINE_LIBS)
|
|
189 AC_SUBST(GFTP_TEXT)
|
|
190
|
|
191 GFTP_GTK=""
|
|
192 PTHREAD_CFLAGS=""
|
|
193 PTHREAD_LIBS=""
|
33
|
194
|
|
195 # I don't have PKG_CHECK_MODULES or AM_PATH_GLIB check for gthread because
|
|
196 # the text port doesn't need to be compiled against the thread libraries
|
|
197 GTHREAD_LIBS=""
|
|
198
|
81
|
199 if test "x$enable_gtkport" = "xyes" ; then
|
|
200 if test $found_glib20 = 1 -a "x$enable_gtk20" = "xyes" ; then
|
57
|
201 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
|
202 fi
|
|
203
|
|
204 if test "x$GFTP_GTK" = "x" ; then
|
|
205 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
|
206 GTHREAD_LIBS="-lgthread"
|
|
207 else
|
|
208 GTHREAD_LIBS="-lgthread-2.0"
|
1
|
209 fi
|
|
210
|
|
211 if test "x$GFTP_GTK" = xgftp-gtk; then
|
480
|
212 case $host in
|
|
213 *-hpux*)
|
|
214 AC_CHECK_LIB(rt, sem_init)
|
649
|
215
|
|
216 # From H.Merijn Brand <h.m.brand@hccnet.nl>
|
|
217 echo '#define pthread_attr_init(x) __pthread_attr_init_system(x)' >>confdefs.h
|
|
218 echo '#define pthread_create(x) __pthread_create_system(x)' >>confdefs.h
|
480
|
219 ;;
|
|
220 esac
|
|
221
|
1
|
222 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIBS="-lpthread")
|
|
223
|
|
224 if test "x$PTHREAD_LIBS" = x ; then
|
|
225 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIBS="-lpthreads")
|
|
226 fi
|
|
227
|
|
228 if test "x$PTHREAD_LIBS" = x ; then
|
|
229 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIBS="-lc_r")
|
|
230 fi
|
|
231
|
|
232 if test "x$PTHREAD_LIBS" = x ; then
|
|
233 echo ;
|
|
234 echo "Error: Cannot find the pthread libraries. If you don't have them installed," ;
|
|
235 echo "your X libraries probably aren't thread safe either. You can download the" ;
|
|
236 echo "pthread library and the thread safe X libraries from my webpage at" ;
|
|
237 echo "http://www.gftp.org/. Note the pthread library and the thread safe" ;
|
|
238 echo "X libraries on my webpage are for Linux libc5 machines ONLY" ;
|
|
239 echo ;
|
|
240 exit
|
|
241 fi
|
|
242
|
|
243 PTHREAD_CFLAGS="-D_REENTRANT"
|
|
244
|
|
245 # I took some of these from the glib 1.3.3 configure.in
|
|
246 case $host in
|
|
247 *-aix*)
|
|
248 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE"
|
|
249 if test x"$GCC" = xyes; then
|
|
250 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -mthreads"
|
|
251 fi
|
|
252 ;;
|
|
253 *-freebsd*)
|
|
254 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE"
|
|
255
|
|
256 # FreeBSD 2.2.x shiped with gcc 2.7.2.x, which doesn't support
|
|
257 # -mthreads flag.
|
|
258 ;;
|
|
259 *-openbsd*)
|
|
260 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE"
|
|
261 if test "x$PTHREAD_LIBS" = "x-lc_r"; then
|
|
262 PTHREAD_LIBS="-pthread"
|
|
263 fi
|
|
264 ;;
|
|
265 *-sysv5uw7*) # UnixWare 7
|
|
266 if test "$GCC" != "yes"; then
|
|
267 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -Kthread"
|
|
268 else
|
|
269 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -pthread"
|
|
270 fi
|
|
271 ;;
|
|
272 *-dg-dgux*) # DG/UX
|
|
273 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_POSIX4A_DRAFT10_SOURCE"
|
|
274 esac
|
|
275 fi
|
|
276 fi
|
|
277 AC_SUBST(PTHREAD_CFLAGS)
|
|
278 AC_SUBST(PTHREAD_LIBS)
|
33
|
279 AC_SUBST(GTHREAD_LIBS)
|
1
|
280 AC_SUBST(GFTP_GTK)
|
|
281
|
215
|
282 SSL_LIBS=""
|
|
283 if test "x$enable_ssl" = "xyes" ; then
|
|
284 AC_CHECK_HEADERS(openssl/ssl.h ssl.h)
|
|
285
|
|
286 if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
|
|
287 AC_CHECK_LIB(ssl, SSL_library_init, SSL_LIBS="-lcrypto -lssl")
|
|
288
|
|
289 if test "x$SSL_LIBS" != "x" ; then
|
|
290 AC_DEFINE(USE_SSL, 1,
|
|
291 [define if you want to enable SSL support])
|
|
292 fi
|
|
293 fi
|
|
294 fi
|
|
295 AC_SUBST(SSL_LIBS)
|
|
296
|
166
|
297 AM_GNU_GETTEXT
|
1
|
298
|
307
|
299 AC_CHECK_PROG(DB2HTML, db2html, true, false)
|
|
300 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
|
|
301
|
900
|
302 AC_CONFIG_FILES(po/Makefile.in
|
|
303 intl/Makefile
|
|
304 Makefile
|
|
305 docs/Makefile
|
|
306 docs/sample.gftp/Makefile
|
|
307 lib/Makefile
|
|
308 lib/fsplib/Makefile
|
|
309 src/gftp
|
|
310 src/Makefile
|
|
311 src/uicommon/Makefile
|
|
312 src/gtk/Makefile
|
|
313 src/text/Makefile
|
|
314 gftp.spec
|
|
315 )
|
|
316 AC_OUTPUT
|