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