Mercurial > gftp.yaz
annotate configure.in @ 256:04f462c2ff98
2003-08-12 Christian Rose <menthos@menthos.com>
* sv.po: Updated Swedish translation.
author | menthos |
---|---|
date | Tue, 12 Aug 2003 13:03:31 +0000 |
parents | 9db114fe50c6 |
children | dbf13a10be13 |
rev | line source |
---|---|
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) | |
243 | 6 AM_INIT_AUTOMAKE(gftp,2.0.15rc2) |
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 | |
252
9db114fe50c6
Adding Language Malayalam(ml) to Language list of these modules
sajith_vk
parents:
250
diff
changeset
|
31 ALL_LINGUAS="am ar be bg ca cs da de es fi fr hu it ja ko mk ml ms nl no pl pt pt_BR ro ru sr sr@Latn sv tr uk zh_CN zh_TW" |
1 | 32 |
16 | 33 AC_DEFINE(_GNU_SOURCE, 1, [Define for setting a GNU environment]) |
34 | |
1 | 35 AC_CANONICAL_HOST |
16 | 36 AC_PROG_CC |
37 AC_AIX | |
38 AC_MINIX | |
39 AC_EXEEXT | |
40 AC_PROG_RANLIB | |
41 AC_SYS_LARGEFILE | |
42 dnl AC_ISC_POSIX | |
43 AM_C_PROTOTYPES | |
44 AC_C_CONST | |
45 AC_C_INLINE | |
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 | |
178 | 57 AC_CHECK_HEADERS(fcntl.h libutil.h limits.h malloc.h pty.h strings.h sys/ioctl.h sys/time.h unistd.h) |
1 | 58 |
202 | 59 AC_TYPE_SOCKLEN_T |
1 | 60 AC_TYPE_MODE_T |
61 AC_TYPE_PID_T | |
62 AC_TYPE_SIZE_T | |
63 AC_HEADER_TIME | |
64 AC_STRUCT_TM | |
65 | |
66 AC_FUNC_ALLOCA | |
67 AC_PROG_GCC_TRADITIONAL | |
68 AC_FUNC_MMAP | |
69 AC_TYPE_SIGNAL | |
70 AC_FUNC_STRFTIME | |
71 AC_FUNC_UTIME_NULL | |
213 | 72 AC_CHECK_FUNCS(gai_strerror getaddrinfo getcwd gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strstr strtod strtol uname grantpt openpty getdtablesize) |
1 | 73 |
81 | 74 if test "x$enable_gtk20" = "xyes" ; then |
57 | 75 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.0.0, found_glib20=1, found_glib20=0) |
76 else | |
77 found_glib20=0; | |
78 fi | |
79 | |
80 if test "x$GFTP_TEXT" = "x" -a $found_glib20 = 0 ; then | |
26 | 81 AM_PATH_GLIB(1.2.3, , AC_MSG_ERROR(gFTP needs GLIB 1.2.3 or higher)) |
1 | 82 fi |
83 | |
93 | 84 EXTRA_LIBS="" |
85 | |
146 | 86 # FreeBSD needs this |
236 | 87 AC_CHECK_LIB(util, openpty, [EXTRA_LIBS="-lutil" |
88 AC_DEFINE(HAVE_OPENPTY, [1], [Define if you have the openpty function.]) ]) | |
146 | 89 |
57 | 90 AC_CHECK_LIB(socket, socket, EXTRA_LIBS="-lsocket") |
91 | |
92 AC_CHECK_LIB(nsl, gethostbyname, EXTRA_LIBS="$EXTRA_LIBS -lnsl") | |
1 | 93 |
94 GFTP_TEXT="" | |
95 USE_READLINE="yes" | |
96 READLINE_LIBS="" | |
81 | 97 if test "x$enable_textport" = "xyes" ; then |
230 | 98 GFTP_TEXT="gftp-text" |
99 | |
1 | 100 AC_MSG_CHECKING([whether to use readline]) |
101 AC_ARG_WITH(readline, | |
102 [ --with-readline turn on readline [default=yes, default tries -lncurses, -lcurses, -ltermcap]], | |
103 [case "${withval}" in | |
104 yes) USE_READLINE="yes" ; AC_MSG_RESULT([yes]) ;; | |
105 no) USE_READLINE="no" ; AC_MSG_RESULT([no]) ;; | |
106 only) USE_READLINE="yes" | |
107 EXTRA_LIBREADLINE_DEPS=" " | |
108 AC_MSG_RESULT([yes (using only readline)]) ;; | |
109 *) USE_READLINE="yes" | |
110 EXTRA_LIBREADLINE_DEPS="${withval}" | |
111 AC_MSG_RESULT([yes (using extra libraries ${withval})]) ;; | |
112 esac],[AC_MSG_RESULT([${USE_READLINE}])]) | |
113 | |
114 dnl Checks for libraries. | |
115 dnl When checking readline, check using extra libraries first. | |
116 dnl We want to protect against the link somehow succeeding, but only | |
117 dnl failing at runtime, as seems to happen on some BSD systems. | |
118 if test "$USE_READLINE" = yes ; then | |
119 if test "$EXTRA_LIBREADLINE_DEPS" = "" ; then | |
120 unset ac_cv_lib_readline_readline | |
121 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, | |
122 HAVE_LIBREADLINE=false, -lncurses) | |
123 if test x${HAVE_LIBREADLINE} = xtrue ; then | |
124 echo " Using -lreadline -lncurses" | |
125 EXTRA_LIBREADLINE_DEPS=-lncurses | |
26 | 126 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) |
1 | 127 else |
128 unset ac_cv_lib_readline_readline | |
129 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, | |
130 HAVE_LIBREADLINE=false, -lcurses) | |
131 if test x${HAVE_LIBREADLINE} = xtrue ; then | |
132 echo " Using -lreadline -lcurses" | |
133 EXTRA_LIBREADLINE_DEPS=-lcurses | |
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, -ltermcap) | |
139 if test x${HAVE_LIBREADLINE} = xtrue ; then | |
140 echo " Using -lreadline -ltermcap" | |
141 EXTRA_LIBREADLINE_DEPS=-ltermcap | |
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) | |
147 if test x${HAVE_LIBREADLINE} = xtrue ; then | |
26 | 148 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) |
1 | 149 else |
26 | 150 AC_DEFINE(HAVE_LIBREADLINE, [0], [Define if the text port uses readline]) |
1 | 151 fi |
152 fi | |
153 fi | |
154 fi | |
155 else | |
156 unset ac_cv_lib_readline_readline | |
157 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, | |
158 HAVE_LIBREADLINE=false, ${EXTRA_LIBREADLINE_DEPS}) | |
159 if test x${HAVE_LIBREADLINE} = xtrue ; then | |
160 echo " Using -lreadline ${EXTRA_LIBREADLINE_DEPS}" | |
26 | 161 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) |
1 | 162 else |
26 | 163 AC_DEFINE(HAVE_LIBREADLINE, [0], [Define if the text port uses readline]) |
1 | 164 fi |
165 fi | |
166 else | |
167 HAVE_LIBREADLINE=false | |
26 | 168 AC_DEFINE(HAVE_LIBREADLINE, [0], [Define if the text port uses readline]) |
1 | 169 fi |
170 if test x${HAVE_LIBREADLINE} = xtrue; then | |
171 READLINE_LIBS="-lreadline ${EXTRA_LIBREADLINE_DEPS}" | |
172 fi | |
173 fi | |
174 | |
175 AC_CHECK_LIB(m, log10, EXTRA_LIBS="$EXTRA_LIBS -lm") | |
176 | |
26 | 177 AM_WITH_DMALLOC |
1 | 178 |
179 AC_SUBST(EXTRA_LIBS) | |
180 AC_SUBST(READLINE_LIBS) | |
181 AC_SUBST(GFTP_TEXT) | |
182 | |
183 GFTP_GTK="" | |
184 PTHREAD_CFLAGS="" | |
185 PTHREAD_LIBS="" | |
33 | 186 |
187 # I don't have PKG_CHECK_MODULES or AM_PATH_GLIB check for gthread because | |
188 # the text port doesn't need to be compiled against the thread libraries | |
189 GTHREAD_LIBS="" | |
190 | |
81 | 191 if test "x$enable_gtkport" = "xyes" ; then |
192 if test $found_glib20 = 1 -a "x$enable_gtk20" = "xyes" ; then | |
57 | 193 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 | 194 fi |
195 | |
196 if test "x$GFTP_GTK" = "x" ; then | |
197 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 | 198 GTHREAD_LIBS="-lgthread" |
199 else | |
200 GTHREAD_LIBS="-lgthread-2.0" | |
1 | 201 fi |
202 | |
203 if test "x$GFTP_GTK" = xgftp-gtk; then | |
204 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIBS="-lpthread") | |
205 | |
206 if test "x$PTHREAD_LIBS" = x ; then | |
207 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIBS="-lpthreads") | |
208 fi | |
209 | |
210 if test "x$PTHREAD_LIBS" = x ; then | |
211 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIBS="-lc_r") | |
212 fi | |
213 | |
214 if test "x$PTHREAD_LIBS" = x ; then | |
215 echo ; | |
216 echo "Error: Cannot find the pthread libraries. If you don't have them installed," ; | |
217 echo "your X libraries probably aren't thread safe either. You can download the" ; | |
218 echo "pthread library and the thread safe X libraries from my webpage at" ; | |
219 echo "http://www.gftp.org/. Note the pthread library and the thread safe" ; | |
220 echo "X libraries on my webpage are for Linux libc5 machines ONLY" ; | |
221 echo ; | |
222 exit | |
223 fi | |
224 | |
225 PTHREAD_CFLAGS="-D_REENTRANT" | |
226 | |
227 # I took some of these from the glib 1.3.3 configure.in | |
228 case $host in | |
229 *-hpux*) | |
230 # From H.Merijn Brand <h.m.brand@hccnet.nl> | |
250 | 231 echo '#define pthread_attr_init(x) __pthread_attr_init_system(x)' >>confdefs.h |
1 | 232 ;; |
233 *-aix*) | |
234 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE" | |
235 if test x"$GCC" = xyes; then | |
236 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -mthreads" | |
237 fi | |
238 ;; | |
239 *-freebsd*) | |
240 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE" | |
241 | |
242 # FreeBSD 2.2.x shiped with gcc 2.7.2.x, which doesn't support | |
243 # -mthreads flag. | |
244 ;; | |
245 *-openbsd*) | |
246 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE" | |
247 if test "x$PTHREAD_LIBS" = "x-lc_r"; then | |
248 PTHREAD_LIBS="-pthread" | |
249 fi | |
250 ;; | |
251 *-sysv5uw7*) # UnixWare 7 | |
252 if test "$GCC" != "yes"; then | |
253 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -Kthread" | |
254 else | |
255 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -pthread" | |
256 fi | |
257 ;; | |
258 *-dg-dgux*) # DG/UX | |
259 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_POSIX4A_DRAFT10_SOURCE" | |
260 esac | |
261 fi | |
262 fi | |
263 AC_SUBST(PTHREAD_CFLAGS) | |
264 AC_SUBST(PTHREAD_LIBS) | |
33 | 265 AC_SUBST(GTHREAD_LIBS) |
1 | 266 AC_SUBST(GFTP_GTK) |
267 | |
215 | 268 SSL_LIBS="" |
269 if test "x$enable_ssl" = "xyes" ; then | |
270 AC_CHECK_HEADERS(openssl/ssl.h ssl.h) | |
271 | |
272 if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then | |
273 AC_CHECK_LIB(ssl, SSL_library_init, SSL_LIBS="-lcrypto -lssl") | |
274 | |
275 if test "x$SSL_LIBS" != "x" ; then | |
276 AC_DEFINE(USE_SSL, 1, | |
277 [define if you want to enable SSL support]) | |
278 fi | |
279 fi | |
280 fi | |
281 AC_SUBST(SSL_LIBS) | |
282 | |
166 | 283 AM_GNU_GETTEXT |
1 | 284 |
230 | 285 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 ) |