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)
|
620
|
6 AM_INIT_AUTOMAKE(gftp,2.0.18rc1)
|
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
|
502
|
31 ALL_LINGUAS="am az ar be bg bn ca cs da de el en_CA en_GB es fi fr ga hr hu it ja ko mk ml ms nl no pa pl pt pt_BR ro ru sk sq sr sr@Latn sv ta th 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
|
328
|
44 AC_INTL_PRINTF
|
1
|
45
|
26
|
46 AM_MAINTAINER_MODE
|
|
47
|
1
|
48 AC_PROG_AWK
|
|
49 AC_PROG_INSTALL
|
|
50 AC_PROG_LN_S
|
|
51 AC_PROG_MAKE_SET
|
|
52
|
|
53 AC_HEADER_DIRENT
|
|
54 AC_HEADER_STDC
|
|
55 AC_HEADER_SYS_WAIT
|
460
|
56 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
|
57
|
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
|
81
|
75 if test "x$enable_gtk20" = "xyes" ; then
|
57
|
76 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.0.0, found_glib20=1, found_glib20=0)
|
|
77 else
|
|
78 found_glib20=0;
|
|
79 fi
|
|
80
|
|
81 if test "x$GFTP_TEXT" = "x" -a $found_glib20 = 0 ; then
|
26
|
82 AM_PATH_GLIB(1.2.3, , AC_MSG_ERROR(gFTP needs GLIB 1.2.3 or higher))
|
1
|
83 fi
|
|
84
|
93
|
85 EXTRA_LIBS=""
|
|
86
|
146
|
87 # FreeBSD needs this
|
236
|
88 AC_CHECK_LIB(util, openpty, [EXTRA_LIBS="-lutil"
|
|
89 AC_DEFINE(HAVE_OPENPTY, [1], [Define if you have the openpty function.]) ])
|
146
|
90
|
57
|
91 AC_CHECK_LIB(socket, socket, EXTRA_LIBS="-lsocket")
|
|
92
|
|
93 AC_CHECK_LIB(nsl, gethostbyname, EXTRA_LIBS="$EXTRA_LIBS -lnsl")
|
1
|
94
|
|
95 GFTP_TEXT=""
|
|
96 USE_READLINE="yes"
|
|
97 READLINE_LIBS=""
|
81
|
98 if test "x$enable_textport" = "xyes" ; then
|
230
|
99 GFTP_TEXT="gftp-text"
|
|
100
|
1
|
101 AC_MSG_CHECKING([whether to use readline])
|
|
102 AC_ARG_WITH(readline,
|
|
103 [ --with-readline turn on readline [default=yes, default tries -lncurses, -lcurses, -ltermcap]],
|
|
104 [case "${withval}" in
|
|
105 yes) USE_READLINE="yes" ; AC_MSG_RESULT([yes]) ;;
|
|
106 no) USE_READLINE="no" ; AC_MSG_RESULT([no]) ;;
|
|
107 only) USE_READLINE="yes"
|
|
108 EXTRA_LIBREADLINE_DEPS=" "
|
|
109 AC_MSG_RESULT([yes (using only readline)]) ;;
|
|
110 *) USE_READLINE="yes"
|
|
111 EXTRA_LIBREADLINE_DEPS="${withval}"
|
|
112 AC_MSG_RESULT([yes (using extra libraries ${withval})]) ;;
|
|
113 esac],[AC_MSG_RESULT([${USE_READLINE}])])
|
|
114
|
|
115 dnl Checks for libraries.
|
|
116 dnl When checking readline, check using extra libraries first.
|
|
117 dnl We want to protect against the link somehow succeeding, but only
|
|
118 dnl failing at runtime, as seems to happen on some BSD systems.
|
|
119 if test "$USE_READLINE" = yes ; then
|
|
120 if test "$EXTRA_LIBREADLINE_DEPS" = "" ; then
|
|
121 unset ac_cv_lib_readline_readline
|
|
122 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
|
|
123 HAVE_LIBREADLINE=false, -lncurses)
|
|
124 if test x${HAVE_LIBREADLINE} = xtrue ; then
|
|
125 echo " Using -lreadline -lncurses"
|
|
126 EXTRA_LIBREADLINE_DEPS=-lncurses
|
26
|
127 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline])
|
1
|
128 else
|
|
129 unset ac_cv_lib_readline_readline
|
|
130 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
|
|
131 HAVE_LIBREADLINE=false, -lcurses)
|
|
132 if test x${HAVE_LIBREADLINE} = xtrue ; then
|
|
133 echo " Using -lreadline -lcurses"
|
|
134 EXTRA_LIBREADLINE_DEPS=-lcurses
|
26
|
135 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline])
|
1
|
136 else
|
|
137 unset ac_cv_lib_readline_readline
|
|
138 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
|
|
139 HAVE_LIBREADLINE=false, -ltermcap)
|
|
140 if test x${HAVE_LIBREADLINE} = xtrue ; then
|
|
141 echo " Using -lreadline -ltermcap"
|
|
142 EXTRA_LIBREADLINE_DEPS=-ltermcap
|
26
|
143 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline])
|
1
|
144 else
|
|
145 unset ac_cv_lib_readline_readline
|
|
146 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
|
|
147 HAVE_LIBREADLINE=false)
|
|
148 if test x${HAVE_LIBREADLINE} = xtrue ; then
|
26
|
149 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline])
|
1
|
150 else
|
26
|
151 AC_DEFINE(HAVE_LIBREADLINE, [0], [Define if the text port uses readline])
|
1
|
152 fi
|
|
153 fi
|
|
154 fi
|
|
155 fi
|
|
156 else
|
|
157 unset ac_cv_lib_readline_readline
|
|
158 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
|
|
159 HAVE_LIBREADLINE=false, ${EXTRA_LIBREADLINE_DEPS})
|
|
160 if test x${HAVE_LIBREADLINE} = xtrue ; then
|
|
161 echo " Using -lreadline ${EXTRA_LIBREADLINE_DEPS}"
|
26
|
162 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline])
|
1
|
163 else
|
26
|
164 AC_DEFINE(HAVE_LIBREADLINE, [0], [Define if the text port uses readline])
|
1
|
165 fi
|
|
166 fi
|
|
167 else
|
|
168 HAVE_LIBREADLINE=false
|
26
|
169 AC_DEFINE(HAVE_LIBREADLINE, [0], [Define if the text port uses readline])
|
1
|
170 fi
|
|
171 if test x${HAVE_LIBREADLINE} = xtrue; then
|
|
172 READLINE_LIBS="-lreadline ${EXTRA_LIBREADLINE_DEPS}"
|
|
173 fi
|
|
174 fi
|
|
175
|
|
176 AC_CHECK_LIB(m, log10, EXTRA_LIBS="$EXTRA_LIBS -lm")
|
|
177
|
26
|
178 AM_WITH_DMALLOC
|
1
|
179
|
|
180 AC_SUBST(EXTRA_LIBS)
|
|
181 AC_SUBST(READLINE_LIBS)
|
|
182 AC_SUBST(GFTP_TEXT)
|
|
183
|
|
184 GFTP_GTK=""
|
|
185 PTHREAD_CFLAGS=""
|
|
186 PTHREAD_LIBS=""
|
33
|
187
|
|
188 # I don't have PKG_CHECK_MODULES or AM_PATH_GLIB check for gthread because
|
|
189 # the text port doesn't need to be compiled against the thread libraries
|
|
190 GTHREAD_LIBS=""
|
|
191
|
81
|
192 if test "x$enable_gtkport" = "xyes" ; then
|
|
193 if test $found_glib20 = 1 -a "x$enable_gtk20" = "xyes" ; then
|
57
|
194 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
|
195 fi
|
|
196
|
|
197 if test "x$GFTP_GTK" = "x" ; then
|
|
198 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
|
199 GTHREAD_LIBS="-lgthread"
|
|
200 else
|
|
201 GTHREAD_LIBS="-lgthread-2.0"
|
1
|
202 fi
|
|
203
|
|
204 if test "x$GFTP_GTK" = xgftp-gtk; then
|
480
|
205 case $host in
|
|
206 *-hpux*)
|
|
207 AC_CHECK_LIB(rt, sem_init)
|
649
|
208
|
|
209 # From H.Merijn Brand <h.m.brand@hccnet.nl>
|
|
210 echo '#define pthread_attr_init(x) __pthread_attr_init_system(x)' >>confdefs.h
|
|
211 echo '#define pthread_create(x) __pthread_create_system(x)' >>confdefs.h
|
480
|
212 ;;
|
|
213 esac
|
|
214
|
1
|
215 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIBS="-lpthread")
|
|
216
|
|
217 if test "x$PTHREAD_LIBS" = x ; then
|
|
218 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIBS="-lpthreads")
|
|
219 fi
|
|
220
|
|
221 if test "x$PTHREAD_LIBS" = x ; then
|
|
222 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIBS="-lc_r")
|
|
223 fi
|
|
224
|
|
225 if test "x$PTHREAD_LIBS" = x ; then
|
|
226 echo ;
|
|
227 echo "Error: Cannot find the pthread libraries. If you don't have them installed," ;
|
|
228 echo "your X libraries probably aren't thread safe either. You can download the" ;
|
|
229 echo "pthread library and the thread safe X libraries from my webpage at" ;
|
|
230 echo "http://www.gftp.org/. Note the pthread library and the thread safe" ;
|
|
231 echo "X libraries on my webpage are for Linux libc5 machines ONLY" ;
|
|
232 echo ;
|
|
233 exit
|
|
234 fi
|
|
235
|
|
236 PTHREAD_CFLAGS="-D_REENTRANT"
|
|
237
|
|
238 # I took some of these from the glib 1.3.3 configure.in
|
|
239 case $host in
|
|
240 *-aix*)
|
|
241 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE"
|
|
242 if test x"$GCC" = xyes; then
|
|
243 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -mthreads"
|
|
244 fi
|
|
245 ;;
|
|
246 *-freebsd*)
|
|
247 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE"
|
|
248
|
|
249 # FreeBSD 2.2.x shiped with gcc 2.7.2.x, which doesn't support
|
|
250 # -mthreads flag.
|
|
251 ;;
|
|
252 *-openbsd*)
|
|
253 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE"
|
|
254 if test "x$PTHREAD_LIBS" = "x-lc_r"; then
|
|
255 PTHREAD_LIBS="-pthread"
|
|
256 fi
|
|
257 ;;
|
|
258 *-sysv5uw7*) # UnixWare 7
|
|
259 if test "$GCC" != "yes"; then
|
|
260 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -Kthread"
|
|
261 else
|
|
262 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -pthread"
|
|
263 fi
|
|
264 ;;
|
|
265 *-dg-dgux*) # DG/UX
|
|
266 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_POSIX4A_DRAFT10_SOURCE"
|
|
267 esac
|
|
268 fi
|
|
269 fi
|
|
270 AC_SUBST(PTHREAD_CFLAGS)
|
|
271 AC_SUBST(PTHREAD_LIBS)
|
33
|
272 AC_SUBST(GTHREAD_LIBS)
|
1
|
273 AC_SUBST(GFTP_GTK)
|
|
274
|
215
|
275 SSL_LIBS=""
|
|
276 if test "x$enable_ssl" = "xyes" ; then
|
|
277 AC_CHECK_HEADERS(openssl/ssl.h ssl.h)
|
|
278
|
|
279 if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
|
|
280 AC_CHECK_LIB(ssl, SSL_library_init, SSL_LIBS="-lcrypto -lssl")
|
|
281
|
|
282 if test "x$SSL_LIBS" != "x" ; then
|
|
283 AC_DEFINE(USE_SSL, 1,
|
|
284 [define if you want to enable SSL support])
|
|
285 fi
|
|
286 fi
|
|
287 fi
|
|
288 AC_SUBST(SSL_LIBS)
|
|
289
|
166
|
290 AM_GNU_GETTEXT
|
1
|
291
|
307
|
292 AC_CHECK_PROG(DB2HTML, db2html, true, false)
|
|
293 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
|
|
294
|
663
|
295 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 intl/Makefile po/Makefile.in )
|