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