Mercurial > gftp.yaz
annotate configure.in @ 31:d930e06af9ae
2002-10-03 Brian Masney <masneyb@gftp.org>
* src/gtk/gftp-gtk.c - call g_thread_init (NULL)
* src/gtk/delete_dialog.c, src/gtk/misc-gtk.c, src/gtk/transfer.c -
call gdk_threads_enter() and gdk_threads_leave()
author | masneyb |
---|---|
date | Thu, 03 Oct 2002 12:05:54 +0000 |
parents | b3e16d1f19c9 |
children | c8ec7877432e |
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) | |
6 AM_INIT_AUTOMAKE(gftp,2.0.13) | |
7 | |
8 AC_ARG_ENABLE(gtk20, [ --enable-gtk20 Try and compile with GTK+ 2.0 if available], enable_gtk20=1, enable_gtk20=0) | |
9 AC_ARG_ENABLE(gtkport, [ --disable-gtkport Disable compiling the GTK+ port], enable_gtkport=0, enable_gtkport=1) | |
10 AC_ARG_ENABLE(textport, [ --disable-textport Disable compiling the text port], enable_textport=0, enable_textport=1) | |
11 AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc Enable the dmalloc library], enable_dmalloc=1, enable_dmalloc=0) | |
12 | |
13 AC_SUBST(PACKAGE) | |
14 AC_SUBST(VERSION) | |
15 AC_SUBST(PREFIX) | |
16 | |
18
6b2e606554aa
2002-09-11 Marius Andreiana <mandreiana@yahoo.com>
mandreiana
parents:
16
diff
changeset
|
17 ALL_LINGUAS="bg cs da de es fi fr it ja ko nl no pl pt_BR ro ru sv tr zh_CN zh_TW" |
1 | 18 |
16 | 19 AC_DEFINE(_GNU_SOURCE, 1, [Define for setting a GNU environment]) |
20 | |
1 | 21 AC_CANONICAL_HOST |
16 | 22 AC_PROG_CC |
23 AC_AIX | |
24 AC_MINIX | |
25 AC_EXEEXT | |
26 AC_PROG_RANLIB | |
27 AC_SYS_LARGEFILE | |
28 dnl AC_ISC_POSIX | |
29 AM_C_PROTOTYPES | |
30 AC_C_CONST | |
31 AC_C_INLINE | |
1 | 32 |
26 | 33 AM_MAINTAINER_MODE |
34 | |
1 | 35 AC_PROG_AWK |
36 AC_PROG_INSTALL | |
37 AC_PROG_LN_S | |
38 AC_PROG_MAKE_SET | |
39 | |
40 AC_HEADER_DIRENT | |
41 AC_HEADER_STDC | |
42 AC_HEADER_SYS_WAIT | |
43 AC_CHECK_HEADERS(fcntl.h limits.h malloc.h strings.h sys/ioctl.h sys/time.h unistd.h) | |
44 | |
45 AC_TYPE_MODE_T | |
46 AC_TYPE_PID_T | |
47 AC_TYPE_SIZE_T | |
48 AC_HEADER_TIME | |
49 AC_STRUCT_TM | |
50 | |
51 AC_FUNC_ALLOCA | |
52 AC_PROG_GCC_TRADITIONAL | |
53 AC_FUNC_MMAP | |
54 AC_TYPE_SIGNAL | |
55 AC_FUNC_STRFTIME | |
56 AC_FUNC_UTIME_NULL | |
57 AC_CHECK_FUNCS(gai_strerror getaddrinfo getcwd gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strstr strtod strtol uname) | |
58 | |
26 | 59 if test "x$GFTP_TEXT" = "x" -a "x$enable_gtk20" = "x0" ; then |
60 AM_PATH_GLIB(1.2.3, , AC_MSG_ERROR(gFTP needs GLIB 1.2.3 or higher)) | |
1 | 61 fi |
62 | |
26 | 63 if test "x$enable_gtk20" = "x1" ; then |
64 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.0.0) | |
1 | 65 fi |
66 | |
67 GFTP_TEXT="" | |
68 EXTRA_LIBS="" | |
69 USE_READLINE="yes" | |
70 READLINE_LIBS="" | |
71 if test "x$enable_textport" = "x1" ; then | |
72 AC_CHECK_LIB(socket, socket, EXTRA_LIBS="-lsocket") | |
73 | |
74 AC_CHECK_LIB(nsl, gethostbyname, EXTRA_LIBS="$EXTRA_LIBS -lnsl") | |
75 | |
76 AC_MSG_CHECKING([whether to use readline]) | |
77 AC_ARG_WITH(readline, | |
78 [ --with-readline turn on readline [default=yes, default tries -lncurses, -lcurses, -ltermcap]], | |
79 [case "${withval}" in | |
80 yes) USE_READLINE="yes" ; AC_MSG_RESULT([yes]) ;; | |
81 no) USE_READLINE="no" ; AC_MSG_RESULT([no]) ;; | |
82 only) USE_READLINE="yes" | |
83 EXTRA_LIBREADLINE_DEPS=" " | |
84 AC_MSG_RESULT([yes (using only readline)]) ;; | |
85 *) USE_READLINE="yes" | |
86 EXTRA_LIBREADLINE_DEPS="${withval}" | |
87 AC_MSG_RESULT([yes (using extra libraries ${withval})]) ;; | |
88 esac],[AC_MSG_RESULT([${USE_READLINE}])]) | |
89 | |
90 dnl Checks for libraries. | |
91 dnl When checking readline, check using extra libraries first. | |
92 dnl We want to protect against the link somehow succeeding, but only | |
93 dnl failing at runtime, as seems to happen on some BSD systems. | |
94 if test "$USE_READLINE" = yes ; then | |
95 if test "$EXTRA_LIBREADLINE_DEPS" = "" ; then | |
96 unset ac_cv_lib_readline_readline | |
97 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, | |
98 HAVE_LIBREADLINE=false, -lncurses) | |
99 if test x${HAVE_LIBREADLINE} = xtrue ; then | |
100 echo " Using -lreadline -lncurses" | |
101 EXTRA_LIBREADLINE_DEPS=-lncurses | |
26 | 102 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) |
1 | 103 else |
104 unset ac_cv_lib_readline_readline | |
105 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, | |
106 HAVE_LIBREADLINE=false, -lcurses) | |
107 if test x${HAVE_LIBREADLINE} = xtrue ; then | |
108 echo " Using -lreadline -lcurses" | |
109 EXTRA_LIBREADLINE_DEPS=-lcurses | |
26 | 110 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) |
1 | 111 else |
112 unset ac_cv_lib_readline_readline | |
113 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, | |
114 HAVE_LIBREADLINE=false, -ltermcap) | |
115 if test x${HAVE_LIBREADLINE} = xtrue ; then | |
116 echo " Using -lreadline -ltermcap" | |
117 EXTRA_LIBREADLINE_DEPS=-ltermcap | |
26 | 118 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) |
1 | 119 else |
120 unset ac_cv_lib_readline_readline | |
121 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, | |
122 HAVE_LIBREADLINE=false) | |
123 if test x${HAVE_LIBREADLINE} = xtrue ; then | |
26 | 124 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) |
1 | 125 else |
26 | 126 AC_DEFINE(HAVE_LIBREADLINE, [0], [Define if the text port uses readline]) |
1 | 127 fi |
128 fi | |
129 fi | |
130 fi | |
131 else | |
132 unset ac_cv_lib_readline_readline | |
133 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, | |
134 HAVE_LIBREADLINE=false, ${EXTRA_LIBREADLINE_DEPS}) | |
135 if test x${HAVE_LIBREADLINE} = xtrue ; then | |
136 echo " Using -lreadline ${EXTRA_LIBREADLINE_DEPS}" | |
26 | 137 AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) |
1 | 138 else |
26 | 139 AC_DEFINE(HAVE_LIBREADLINE, [0], [Define if the text port uses readline]) |
1 | 140 fi |
141 fi | |
142 else | |
143 HAVE_LIBREADLINE=false | |
26 | 144 AC_DEFINE(HAVE_LIBREADLINE, [0], [Define if the text port uses readline]) |
1 | 145 fi |
146 if test x${HAVE_LIBREADLINE} = xtrue; then | |
147 READLINE_LIBS="-lreadline ${EXTRA_LIBREADLINE_DEPS}" | |
148 GFTP_TEXT="gftp-text" | |
149 fi | |
150 fi | |
151 | |
152 AC_CHECK_LIB(m, log10, EXTRA_LIBS="$EXTRA_LIBS -lm") | |
153 | |
26 | 154 AM_WITH_DMALLOC |
1 | 155 |
156 AC_SUBST(EXTRA_LIBS) | |
157 AC_SUBST(READLINE_LIBS) | |
158 AC_SUBST(GFTP_TEXT) | |
159 | |
160 GFTP_GTK="" | |
161 PTHREAD_CFLAGS="" | |
162 PTHREAD_LIBS="" | |
163 if test "x$enable_gtkport" = "x1" ; then | |
164 if test "x$enable_gtk20" = "x1" ; then | |
165 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 1.3.8, GFTP_GTK=gftp-gtk) | |
166 fi | |
167 | |
168 if test "x$GFTP_GTK" = "x" ; then | |
169 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)) | |
170 fi | |
171 | |
172 if test "x$GFTP_GTK" = xgftp-gtk; then | |
173 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIBS="-lpthread") | |
174 | |
175 if test "x$PTHREAD_LIBS" = x ; then | |
176 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIBS="-lpthreads") | |
177 fi | |
178 | |
179 if test "x$PTHREAD_LIBS" = x ; then | |
180 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIBS="-lc_r") | |
181 fi | |
182 | |
183 if test "x$PTHREAD_LIBS" = x ; then | |
184 echo ; | |
185 echo "Error: Cannot find the pthread libraries. If you don't have them installed," ; | |
186 echo "your X libraries probably aren't thread safe either. You can download the" ; | |
187 echo "pthread library and the thread safe X libraries from my webpage at" ; | |
188 echo "http://www.gftp.org/. Note the pthread library and the thread safe" ; | |
189 echo "X libraries on my webpage are for Linux libc5 machines ONLY" ; | |
190 echo ; | |
191 exit | |
192 fi | |
193 | |
194 PTHREAD_CFLAGS="-D_REENTRANT" | |
195 | |
196 # I took some of these from the glib 1.3.3 configure.in | |
197 case $host in | |
198 *-hpux*) | |
199 # From H.Merijn Brand <h.m.brand@hccnet.nl> | |
200 echo '#define pthread_attr_init(x) __pthread_attr_init_system(x)' | |
201 +>>confdefs.h | |
202 ;; | |
203 *-aix*) | |
204 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE" | |
205 if test x"$GCC" = xyes; then | |
206 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -mthreads" | |
207 fi | |
208 ;; | |
209 *-freebsd*) | |
210 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE" | |
211 | |
212 # FreeBSD 2.2.x shiped with gcc 2.7.2.x, which doesn't support | |
213 # -mthreads flag. | |
214 ;; | |
215 *-openbsd*) | |
216 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE" | |
217 if test "x$PTHREAD_LIBS" = "x-lc_r"; then | |
218 PTHREAD_LIBS="-pthread" | |
219 fi | |
220 ;; | |
221 *-sysv5uw7*) # UnixWare 7 | |
222 if test "$GCC" != "yes"; then | |
223 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -Kthread" | |
224 else | |
225 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -pthread" | |
226 fi | |
227 ;; | |
228 *-dg-dgux*) # DG/UX | |
229 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_POSIX4A_DRAFT10_SOURCE" | |
230 esac | |
231 fi | |
232 fi | |
233 AC_SUBST(PTHREAD_CFLAGS) | |
234 AC_SUBST(PTHREAD_LIBS) | |
235 AC_SUBST(GFTP_GTK) | |
236 | |
28 | 237 AM_GNU_GETTEXT |
1 | 238 |
26 | 239 AC_OUTPUT(Makefile docs/Makefile docs/sample.gftp/Makefile src/gftp src/Makefile src/gtk/Makefile src/text/Makefile lib/Makefile gftp.spec) |