ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS/gnome-vfs2-2.3.8-1.src.rpm
[gnome-vfs-httpcaptive.git] / configure.in
1 AC_INIT(libgnomevfs/gnome-vfs.h)
2
3 # Making releases:
4 #   LIBGNOMEVFS_MICRO_VERSION += 1;
5 #   LIBGNOMEVFS_INTERFACE_AGE += 1;
6 # if any functions have been added, set LIBGNOMEVFS_INTERFACE_AGE to 0.
7 # if backwards compatibility has been broken,
8 # set LIBGNOMEVFS_BINARY_AGE and LIBGNOMEVFS_INTERFACE_AGE to 0.
9 #
10 LIBGNOMEVFS_MAJOR_VERSION=2
11 LIBGNOMEVFS_MINOR_VERSION=3
12 LIBGNOMEVFS_MICRO_VERSION=8
13 LIBGNOMEVFS_INTERFACE_AGE=8
14 # If you need a modifier for the version number. 
15 # Normally empty, but can be used to make "fixup" releases.
16 LIBGNOMEVFS_EXTRAVERSION=
17
18 dnl libtool versioning from libgnome
19
20 LIBGNOMEVFS_CURRENT=`expr 100 '*' $LIBGNOMEVFS_MINOR_VERSION + $LIBGNOMEVFS_MICRO_VERSION - $LIBGNOMEVFS_INTERFACE_AGE`
21 LIBGNOMEVFS_BINARY_AGE=`expr 100 '*' $LIBGNOMEVFS_MINOR_VERSION + $LIBGNOMEVFS_MICRO_VERSION`
22 LIBGNOMEVFS_REVISION=$LIBGNOMEVFS_INTERFACE_AGE
23 LIBGNOMEVFS_AGE=`expr $LIBGNOMEVFS_BINARY_AGE - $LIBGNOMEVFS_INTERFACE_AGE`
24 LIBGNOMEVFS_VERSION=$LIBGNOMEVFS_MAJOR_VERSION.$LIBGNOMEVFS_MINOR_VERSION.$LIBGNOMEVFS_MICRO_VERSION$LIBGNOMEVFS_EXTRAVERSION
25
26 AC_SUBST(LIBGNOMEVFS_CURRENT)
27 AC_SUBST(LIBGNOMEVFS_REVISION)
28 AC_SUBST(LIBGNOMEVFS_AGE)
29
30         
31 AM_CONFIG_HEADER(config.h)
32 AM_INIT_AUTOMAKE(gnome-vfs, $LIBGNOMEVFS_VERSION)
33
34 dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
35 AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS")
36
37 AM_MAINTAINER_MODE
38
39 GNOME_COMMON_INIT
40 GNOME_PLATFORM_GNOME_2(yes, force)
41
42 dnl touch NOINST_GOB
43 dnl AC_CONFIG_SUBDIRS(gob)
44
45 AC_ISC_POSIX
46 AC_PROG_CC
47 AC_PROG_CPP
48 AC_PROG_AWK
49 AC_LIBTOOL_WIN32_DLL
50 AM_PROG_LIBTOOL
51 AC_PROG_INTLTOOL
52
53 dnl Versions shared with the .spec file.
54 BONOBO_ACTIVATION_REQUIRED=1.0.0
55 BONOBO_REQUIRED=2.0.0
56 GCONF_REQUIRED=1.1.1
57 GLIB_REQUIRED=2.0.0
58 ORBIT_REQUIRED=2.4.0
59 XML_REQUIRED=2.2.8
60
61 AC_SUBST(BONOBO_ACTIVATION_REQUIRED)
62 AC_SUBST(BONOBO_REQUIRED)
63 AC_SUBST(GCONF_REQUIRED)
64 AC_SUBST(GLIB_REQUIRED)
65 AC_SUBST(LIBIDL_REQUIRED)
66 AC_SUBST(ORBIT_REQUIRED)
67 AC_SUBST(XML_REQUIRED)
68
69 PKG_CHECK_MODULES(MODULES_XML, glib-2.0 >= $GLIB_REQUIRED gmodule-2.0 >= $GLIB_REQUIRED gthread-2.0 >= $GLIB_REQUIRED libxml-2.0 >= $XML_REQUIRED)
70 AC_SUBST(MODULES_XML_CFLAGS)
71 AC_SUBST(MODULES_XML_LIBS)
72
73 PKG_CHECK_MODULES(MODULES, glib-2.0 >= $GLIB_REQUIRED gmodule-2.0 >= $GLIB_REQUIRED gthread-2.0 >= $GLIB_REQUIRED)
74 AC_SUBST(MODULES_LIBS)
75 AC_SUBST(MODULES_CFLAGS)
76
77 PKG_CHECK_MODULES(MODULES_FILE, glib-2.0 >= $GLIB_REQUIRED gmodule-2.0 >= $GLIB_REQUIRED gthread-2.0 >= $GLIB_REQUIRED)
78 AC_SUBST(MODULES_FILE_LIBS)
79 AC_SUBST(MODULES_FILE_CFLAGS)
80
81 PKG_CHECK_MODULES(MODULES_GCONF, glib-2.0 >= $GLIB_REQUIRED gmodule-2.0 >= $GLIB_REQUIRED gthread-2.0 >= $GLIB_REQUIRED gconf-2.0 >= $GCONF_REQUIRED)
82 AC_SUBST(MODULES_GCONF_CFLAGS)
83 AC_SUBST(MODULES_GCONF_LIBS)
84
85 PKG_CHECK_MODULES(MODULES_XML_GCONF, glib-2.0 >= $GLIB_REQUIRED gmodule-2.0 >= $GLIB_REQUIRED gthread-2.0 >= $GLIB_REQUIRED libxml-2.0 >= $XML_REQUIRED gconf-2.0 >= $GCONF_REQUIRED)
86 AC_SUBST(MODULES_XML_GCONF_CFLAGS)
87 AC_SUBST(MODULES_XML_GCONF_LIBS)
88
89 PKG_CHECK_MODULES(MONIKERS, libbonobo-2.0 >= $BONOBO_REQUIRED)
90 AC_SUBST(MONIKERS_CFLAGS)
91 AC_SUBST(MONIKERS_LIBS)
92
93 PKG_CHECK_MODULES(TEST, bonobo-activation-2.0 >= $BONOBO_ACTIVATION_REQUIRED gconf-2.0 >= $GCONF_REQUIRED gthread-2.0 >= $GLIB_REQUIRED)
94 AC_SUBST(TEST_LIBS)
95 AC_SUBST(TEST_CFLAGS)
96
97 ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
98 AC_SUBST(ORBIT_IDL)
99
100 BONOBO_IDLDIR="`$PKG_CONFIG --variable=idldir bonobo-activation-2.0`"
101 AC_SUBST(BONOBO_IDLDIR)
102
103 cflags_set=yes
104 GNOME_COMPILE_WARNINGS
105 VFS_CFLAGS="$warnCFLAGS $complCFLAGS"
106
107 GNOME_PTHREAD_CHECK
108 dnl semaphore functions are in librt.so on solaris
109 AC_CHECK_LIB(rt, sem_wait)
110
111 dnl Don't blindly #define them if they're typedef'ed in <sys/types.h>
112 AM_GNOME_SIZE_T
113 AM_GNOME_OFF_T
114
115 AC_CACHE_CHECK([for off64_t],
116         ac_cv_have_off64_t,
117         AC_TRY_COMPILE([
118 #               define _LARGEFILE64_SOURCE
119 #               include <sys/types.h>],
120                 [off64_t testoffset],
121         ac_cv_have_off64_t=yes,
122         ac_cv_have_off64_t=no))
123 if test x"$ac_cv_have_off64_t" = "xyes" ; then
124         AC_DEFINE(HAVE_OFF64_T)
125 fi
126
127 GETTEXT_PACKAGE=gnome-vfs-2.0
128 AC_SUBST(GETTEXT_PACKAGE)
129 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
130
131 ALL_LINGUAS="am ar az be bg bn bs ca cs cy da de el eo es et eu fa fi fr ga gl he hi hu id is it ja ko li lt lv mk ml mn ms nl nn no pl pt pt_BR ro ru sk sl sq sr sr@Latn sv tr uk vi wa yi zh_CN zh_TW"
132 AM_GLIB_GNU_GETTEXT
133
134 AC_CHECK_LIB(nsl, t_accept)
135 AC_CHECK_LIB(socket, socket)
136
137 AC_FUNC_ALLOCA
138 AC_CHECK_FUNCS(getdtablesize open64 lseek64 statvfs seteuid setegid setresuid setresgid readdir_r mbrtowc inet_pton getdelim)
139
140 dnl Specify the gconf configuration source, 
141 dnl default to xml::$(sysconfdir)/gconf/gconf.xml.defaults
142
143 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
144
145 if test x"$GCONFTOOL" = xno; then
146   AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
147 fi
148
149 AM_GCONF_SOURCE_2
150
151 dnl
152 dnl This is so that we find the 64bit type
153 dnl
154 AC_CHECK_SIZEOF(int)
155 AC_CHECK_SIZEOF(long)
156 AC_CHECK_SIZEOF(long long)
157
158 VFS_SIZE="unsigned long"
159 VFS_OFFSET="long"
160 VFS_SIZE_IS="UNSIGNED_LONG"
161 VFS_OFFSET_IS="LONG"
162 VFS_SIZE_PRINTF="lu"
163 VFS_OFFSET_PRINTF="ld"
164
165 dnl
166 dnl See if any of the types is 64 bits, and in case it is, use it
167 dnl Note: We test an (int) even though I think using (long) would be fine.
168 dnl       This is because glib does it this way for gint64 and so there
169 dnl       is probably a reason behind it
170 dnl
171 case 8 in
172 $ac_cv_sizeof_int)
173   VFS_SIZE="unsigned int"
174   VFS_OFFSET="int"
175   VFS_SIZE_IS="UNSIGNED_INT"
176   VFS_OFFSET_IS="INT"
177   VFS_SIZE_PRINTF="u"
178   VFS_OFFSET_PRINTF="d"
179   ;;
180 $ac_cv_sizeof_long)
181   # Nothing happens here, we are already using a long
182   ;;
183 $ac_cv_sizeof_long_long)
184   VFS_SIZE="unsigned long long"
185   VFS_OFFSET="long long"
186   VFS_SIZE_IS="UNSIGNED_LONG_LONG"
187   VFS_OFFSET_IS="LONG_LONG"
188   VFS_SIZE_PRINTF="Lu"
189   VFS_OFFSET_PRINTF="Ld"
190   ;;
191 esac
192
193 AC_SUBST(VFS_SIZE)
194 AC_SUBST(VFS_OFFSET)
195 AC_SUBST(VFS_SIZE_IS)
196 AC_SUBST(VFS_OFFSET_IS)
197 AC_SUBST(VFS_SIZE_PRINTF)
198 AC_SUBST(VFS_OFFSET_PRINTF)
199
200 AC_CHECK_HEADERS(sys/param.h sys/resource.h sys/vfs.h sys/mount.h sys/statvfs.h wctype.h)
201
202 dnl ====================================
203 dnl =
204 dnl = Profiling support
205 dnl =
206 dnl ====================================
207 ENABLE_PROFILER=
208 AC_ARG_ENABLE(profiler,
209 [  --enable-profiler            Enable profiler],
210 ENABLE_PROFILER=1
211 AC_DEFINE(ENABLE_PROFILER))
212
213 if test "x$ENABLE_PROFILER" = "x1"
214 then
215         CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES"
216         LDFLAGS="/gnome/PROFILE/lib/libprofiler.so -lpthread"
217 fi
218
219 AC_SUBST(ENABLE_PROFILER)
220 AM_CONDITIONAL(ENABLE_PROFILER, test "x$ENABLE_PROFILER" = "x1")
221 dnl ====================================
222
223 dnl turn warnings into errors to enforce clean code for cvs users (not in tarball)
224
225 AC_ARG_ENABLE(more-warnings,
226 [  --enable-more-warnings  Maximum compiler warnings],
227 set_more_warnings="$enableval",[
228 if test -f $srcdir/CVSVERSION; then
229         set_more_warnings=yes
230 else
231         set_more_warnings=no
232 fi
233 ])
234
235 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
236         echo "enable compile warnings = $set_more_warnings"
237         VFS_CFLAGS="-Wall -Werror \
238         -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
239         -Wnested-externs -Wpointer-arith"
240
241         for option in -Wno-strict-aliasing -Wno-sign-compare; do
242                 SAVE_CFLAGS="$CFLAGS"
243                 CFLAGS="$VFS_CFLAGS $option $CFLAGS"
244                 AC_MSG_CHECKING([whether gcc understands $option])
245                 AC_TRY_COMPILE([], [],
246                         has_option=yes,
247                         has_option=no,)
248                 CFLAGS="$SAVE_CFLAGS"
249                 if test $has_option = yes; then
250                   VFS_CFLAGS="$VFS_CFLAGS $option"
251                 fi
252                 AC_MSG_RESULT($has_option)
253                 unset has_option
254                 unset SAVE_CFLAGS
255         done
256         unset option
257 fi
258 AC_SUBST(VFS_CFLAGS)
259
260 dnl
261 dnl gnome vfs Documentation
262 dnl 
263 GNOME_VFS_DIR=`(cd $srcdir; pwd)`
264 AC_SUBST(GNOME_VFS_DIR)
265
266 VFS_LIBS="-lgnomevfs $VFS_GLIB_LIBS"
267 VFS_LIBDIR='-L${libdir}'
268 VFS_INCLUDEDIR='-I${includedir} -I${libdir}/vfs/include'" $VFS_GLIB_CFLAGS"
269 AC_SUBST(VFS_LIBDIR)
270 AC_SUBST(VFS_INCLUDEDIR)
271 AC_SUBST(VFS_LIBS)
272
273 dnl
274 dnl efs-method.c
275 dnl
276
277 dnl if test "x$libefs_disabled" = xyes; then 
278 dnl     LIBEFS_CONFIG=no
279 dnl else
280 dnl     AC_PATH_PROG(LIBEFS_CONFIG, libefs-config, no)
281 dnl fi
282 dnl 
283 dnl if test "x$LIBEFS_CONFIG" != xno; then
284 dnl     LIBEFS_LIBS=`$LIBEFS_CONFIG --libs`
285 dnl     LIBEFS_CFLAGS=`$LIBEFS_CONFIG --cflags`
286 dnl fi
287 dnl 
288
289 AM_CONDITIONAL(HAVE_LIBEFS, false) 
290 LIBEFS_LIBS=""
291 LIBEFS_CFLAGS=""
292 AC_SUBST(LIBEFS_LIBS)
293 AC_SUBST(LIBEFS_CFLAGS)
294
295 dnl
296 dnl ftp-method.c
297 dnl
298 AC_DEFUN(AC_STRUCT_LINGER, [
299 av_struct_linger=no
300 AC_MSG_CHECKING(struct linger is available)
301 AC_TRY_RUN([
302 #include <sys/types.h>
303 #include <sys/socket.h>
304
305 struct linger li;
306
307 main ()
308 {
309     li.l_onoff = 1;
310     li.l_linger = 120;
311     exit (0);
312 }
313 ],[
314 AC_DEFINE(HAVE_STRUCT_LINGER)
315 av_struct_linger=yes
316 ],[
317 av_struct_linger=no
318 ],[
319 av_struct_linger=no
320 ])
321 AC_MSG_RESULT($av_struct_linger)
322 ])
323
324 have_socket=no
325 AC_CHECK_FUNCS(socket, have_socket=yes)
326 if test $have_socket = no; then
327   # socket is not in the default libraries.  See if it's in some other.
328   for lib in bsd socket inet; do
329     AC_CHECK_LIB($lib, socket, [
330           LIBS="$LIBS -l$lib"
331           have_socket=yes
332           AC_DEFINE(HAVE_SOCKET)
333           break])
334   done
335 fi
336
337 have_gethostbyname=no
338 AC_CHECK_FUNC(gethostbyname, have_gethostbyname=yes)
339 if test $have_gethostbyname = no; then
340   # gethostbyname is not in the default libraries.  See if it's in some other.
341   for lib in bsd socket inet; do
342     AC_CHECK_LIB($lib, gethostbyname, [LIBS="$LIBS -l$lib"; have_gethostbyname=yes; break])
343   done
344 fi
345
346 AC_CHECK_LIB(bz2, bzCompressInit, AC_DEFINE(HAVE_OLDER_BZIP2))
347 AC_CHECK_HEADERS(bzlib.h,
348         BZ2_LIBS="$BZ2_LIBS -lbz2",
349         AC_MSG_ERROR([Gnome-vfs requires libbz2 to compile.])
350         )
351 AC_SUBST(BZ2_LIBS)
352
353 if test $have_socket = yes; then
354     AC_STRUCT_LINGER
355 fi
356
357 dnl modules/cdda
358
359 AM_CONDITIONAL(HAVE_CDDA, false)
360 AC_CHECK_HEADERS(cdda_interface.h cdda_paranoia.h, [
361         CDDA_LIBS="$CDDA_LIBS -lcdda_paranoia, -lcdda_interface"
362         AM_CONDITIONAL(HAVE_CDDA, true)
363 ])
364
365 dnl modules/cdemenu-desktop
366
367 AC_MSG_CHECKING(for Solaris platform)
368 case "$host" in
369         *solaris*) build_cdemenu_module=yes ;;
370         *) build_cdemenu_module=no ;;
371 esac
372 AC_MSG_RESULT([$build_cdemenu_module])
373 AM_CONDITIONAL(BUILD_CDEMENU_MODULE, test "$build_cdemenu_module" = "yes")
374
375 dnl ******************************
376 dnl OpenSSL
377 dnl ******************************
378
379 AC_ARG_ENABLE(openssl, [  --disable-openssl       build without openssl support])
380 if test "x$enable_openssl" != "xno"; then
381   PKG_CHECK_MODULES(OPENSSL, openssl, AM_CONDITIONAL(HAVE_SSL, true),[
382   AC_ARG_WITH(openssl-includes, [  --with-openssl-includes=PREFIX     Location of OpenSSL includes.],
383               with_openssl_includes="$withval", with_openssl_includes="/usr/include")
384   have_openssl_includes="no"
385   if test "x${with_openssl_includes}" != "xno"; then
386         CPPFLAGS_save="$CPPFLAGS"
387         
388         AC_MSG_CHECKING(for OpenSSL includes)
389         AC_MSG_RESULT("")
390         
391         CPPFLAGS="$CPPFLAGS -I$with_openssl_includes"
392         AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h, [ openssl_includes="yes" ])
393         CPPFLAGS="$CPPFLAGS_save"
394         
395         if test "x{$openssl_includes}" != "xno" -a "x{$openssl_includes}" != "x"; then
396                 have_openssl_includes="yes"
397                 if test "${with_openssl_includes}" != "/usr/include" ; then
398                         OPENSSL_CFLAGS="-I$with_openssl_includes"
399                 else
400                         OPENSSL_CFLAGS=""
401                 fi
402         else
403                 OPENSSL_CFLAGS=""
404         fi
405   else
406         AC_MSG_CHECKING(for OpenSSL includes)
407         AC_MSG_RESULT(no)
408   fi
409
410   AC_ARG_WITH(openssl-libs, [  --with-openssl-libs=PREFIX       Location of OpenSSL libs.],
411               with_openssl_libs="$withval", with_openssl_libs="/usr/lib")
412   msg_openssl="no"
413   if test "x${with_openssl_libs}" != "xno" -a "x${have_openssl_includes}" != "xno"; then
414         LDFLAGS_save="$LDFLAGS"
415         
416         AC_CACHE_CHECK([for OpenSSL libraries], openssl_libs,
417         [
418 dnl How can we test to see if we need to link to libld for sure?? 
419 dnl RedHat 6.2 seems to need to but Debian Woody doesn't
420                 LDFLAGS="$LDFLAGS -L$with_openssl_libs -lssl -lcrypto -ldl"
421                 AC_TRY_LINK_FUNC(SSL_read, openssl_libs="yes", openssl_libs="no")
422                 LDFLAGS="$LDFLAGS_save"
423         ])
424         if test "x${openssl_libs}" != "xno"; then
425                 AC_DEFINE(HAVE_OPENSSL)
426                 msg_openssl="yes"
427                 if test x$with_openssl_libs != x/usr/lib; then
428                         OPENSSL_LIBS="-L$with_openssl_libs -lssl -lcrypto"
429                 else
430                         OPENSSL_LIBS="-lssl -lcrypto"
431                 fi
432                 AM_CONDITIONAL(HAVE_SSL, true)
433         else
434                 OPENSSL_CFLAGS=""
435                 OPENSSL_LIBS=""
436                 AM_CONDITIONAL(HAVE_SSL, false)
437         fi
438   else
439         AC_MSG_CHECKING(for OpenSSL libraries)
440         AC_MSG_RESULT(no)
441   fi
442   ])
443   dnl end of PKG_CHECK_MODULES(openssl)
444 fi
445
446
447 dnl ****************************
448 dnl GNUTLS
449 dnl ****************************
450
451 AC_ARG_ENABLE(gnutls, [  --enable-gnutls         build with gnutls support])
452 if test "x$enable_gnutls" = "xyes"; then
453   if test "x${OPENSSL_LIBS}" != "x"; then
454     AC_MSG_ERROR([*** Can't use both openssl and gnutls at the same time. Please pick one only. ***])
455   else
456     AM_PATH_LIBGNUTLS(0.5.1, AC_DEFINE(HAVE_GNUTLS),
457                       AC_MSG_ERROR([Unable to find GNUTLS]))
458   fi
459 fi
460
461 PKG_CHECK_MODULES(LIBGNOMEVFS, glib-2.0 >= $GLIB_REQUIRED gmodule-2.0 >= $GLIB_REQUIRED gthread-2.0 >= $GLIB_REQUIRED gconf-2.0 >= $GCONF_REQUIRED bonobo-activation-2.0 >= $BONOBO_ACTIVATION_REQUIRED ORBit-2.0 >= $ORBIT_REQUIRED libxml-2.0 >= $XML_REQUIRED gnome-mime-data-2.0)
462 LIBGNOMEVFS_CFLAGS="$LIBGNOMEVFS_CFLAGS $OPENSSL_CFLAGS $LIBGNUTLS_CFLAGS"
463 LIBGNOMEVFS_LIBS="$LIBGNOMEVFS_LIBS $OPENSSL_LIBS $LIBGNUTLS_LIBS"
464 AC_SUBST(LIBGNOMEVFS_CFLAGS)
465 AC_SUBST(LIBGNOMEVFS_LIBS)
466
467   
468 dnl **********************
469 dnl *** Checks for FAM ***
470 dnl **********************
471
472 FAM_MISSING_WARNING="Gnome-vfs depends on FAM to provide notification when files are altered (either through filesystem polling, or a kernel notification mechanism). If Gnome-vfs is built without FAM support, directories viewed with Nautilus or other applications will not remain in synch with the actual filesystem when they are altered by external processes. Particularly if you are a distributor please compile Nautilus with FAM support. FAM is available from http://oss.sgi.com/projects/fam/. A patch to add Linux Kernel 2.4 directory notify support to FAM (highly desirable) is available from http://people.redhat.com/alexl/files/"
473 FAM_LIBS=
474 AC_CHECK_LIB(fam, FAMOpen,
475   [AC_CHECK_HEADERS(fam.h,
476     [AC_DEFINE(HAVE_FAM)
477      FAM_LIBS="-lfam"],
478     AC_MSG_WARN(*** FAM support will not be built (header files not found) $FAM_MISSING_WARNING ***))],
479   AC_MSG_WARN(*** FAM support will not be built (FAM library not found) $FAM_MISSING_WARNING ***))
480 AC_SUBST(FAM_LIBS)
481
482
483
484   
485 dnl **************************
486 dnl *** Checks for gtk-doc ***
487 dnl **************************
488
489 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
490
491 if test "x$with_html_dir" = "x" ; then
492   HTML_DIR='${datadir}/gtk-doc/html'
493 else
494   HTML_DIR=$with_html_dir
495 fi
496
497 AC_SUBST(HTML_DIR)
498
499 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
500
501 gtk_doc_min_version=0.10
502 if $GTKDOC ; then
503     gtk_doc_version=`gtkdoc-mkdb --version`
504     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
505
506     IFS="${IFS=         }"; gnome_vfs_save_IFS="$IFS"; IFS="."
507     set $gtk_doc_version
508     for min in $gtk_doc_min_version ; do
509         cur=$1; shift
510         if test -z $min ; then break; fi
511         if test -z $cur ; then GTKDOC=false; break; fi
512         if test $cur -gt $min ; then break ; fi
513         if test $cur -lt $min ; then GTKDOC=false; break ; fi
514     done
515     IFS="$gnome_vfs_save_IFS"
516     
517     if $GTKDOC ; then
518       AC_MSG_RESULT(yes)
519     else
520       AC_MSG_RESULT(no)
521     fi
522 fi
523
524 AC_CHECK_PROG(DB2HTML, db2html, true, false)
525 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
526
527 AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC)
528 AC_SUBST(HAVE_GTK_DOC)
529
530 dnl Let people disable the gtk-doc stuff.
531 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
532
533 if test "x$enable_gtk_doc" = xauto ; then
534   if test "x$GTKDOC" = xtrue ; then
535     enable_gtk_doc=yes
536   else
537     enable_gtk_doc=no 
538   fi
539 fi
540
541 dnl NOTE: We need to use a separate automake conditional for this
542 dnl       to make this work with the tarballs.
543 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
544
545 dnl ******************************
546 dnl *** End checks for gtk-doc ***
547 dnl ******************************
548
549
550 dnl borrowed from gnu findutils
551 dnl and relicensed as LGPL by the FSF
552
553 AC_ARG_WITH(afs,
554 [  --with-afs              support -fstype afs],
555 [  AC_DEFINE(AFS)
556   CPPFLAGS="$CPPFLAGS -I/usr/afsws/include"
557   LIBS="$LIBS -L/usr/afsws/lib -L/usr/afsws/lib/afs -lsys -lrx -llwp"])
558
559 AC_MSG_CHECKING(how to get filesystem type)
560 fstype=no
561 # The order of these tests is important.
562 AC_TRY_CPP([#include <sys/statvfs.h>
563 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
564 if test $fstype = no; then
565 AC_TRY_CPP([#include <sys/statfs.h>
566 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
567 fi
568 if test $fstype = no; then
569 AC_TRY_CPP([#include <sys/statfs.h>
570 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
571 fi
572 if test $fstype = no; then  
573 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
574 fi
575 if test $fstype = no; then  
576 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
577 fi
578 if test $fstype = no; then  
579 AC_TRY_CPP([#include <sys/mount.h>
580 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
581 fi
582 AC_MSG_RESULT($fstype)
583
584 dnl Check for libpopt
585
586 AC_CHECK_LIB(popt, poptGetArg, POPT_LIBS=-lpopt,
587         [AC_CHECK_HEADER(popt.h, , AC_MSG_ERROR([[
588 *** Couldn't find popt. Please download and install from
589 *** ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/ and try again.]]))])
590 AC_SUBST(POPT_LIBS)
591
592 dnl Final touch
593
594 AC_SUBST(CFLAGS)
595 AC_SUBST(CPPFLAGS)
596 AC_SUBST(LDFLAGS)
597
598 dnl This is needed by `test/vfs-run.in'
599 TOP_BUILDDIR="`pwd`"
600 AC_SUBST(TOP_BUILDDIR)
601
602 dnl ====================================================================
603 dnl Code for checking whether IPv6 is enabled on the system....
604 dnl ====================================================================
605 AC_MSG_CHECKING([whether to enable ipv6])
606 AC_ARG_ENABLE(ipv6, [ --enable-ipv6 enable IPv6 extensions], ,enable_ipv6=yes)
607 if test $enable_ipv6 = yes; then
608   save_libs=$LIBS
609
610   dnl ====================================================================
611   dnl Code for checking presence of AF_INET6 on the system.... 
612   dnl ====================================================================
613   AC_TRY_COMPILE([ 
614     #include <sys/types.h>
615     #include <sys/socket.h>], [
616     socket(AF_INET6, SOCK_STREAM, 0)
617     ],
618     have_ipv6=yes,
619     have_ipv6=no
620   )
621   AC_MSG_RESULT($have_ipv6)
622
623   dnl =================================================================
624   dnl Now we would check for specific functions like getaddrinfo.
625   dnl =================================================================
626   have_getaddrinfo=no
627   if test $have_ipv6 = yes; then
628     AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
629     if test $have_getaddrinfo != yes; then
630       # getaddrinfo is not in the default libraries.  See if it's in some other.
631       for lib in bsd socket inet; do
632         AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes; break])
633       done
634     fi
635     if test $have_getaddrinfo = yes; then
636       AC_DEFINE(ENABLE_IPV6)
637     fi
638   fi            
639 fi
640 dnl ==============================================================================
641 dnl End of IPv6 checks
642 dnl ==============================================================================
643 dnl Output files
644
645 AC_OUTPUT([
646 Makefile
647 gnome-vfs.spec
648 libgnomevfs/gnome-vfs-file-size.h
649 libgnomevfs/Makefile
650 modules/Makefile
651 modules/extfs/Makefile
652 modules/extfs/ar
653 modules/extfs/cpio
654 modules/extfs/deb
655 modules/extfs/lha
656 modules/extfs/rar
657 modules/extfs/zip
658 modules/extfs/zoo
659 modules/vfolder/Makefile
660 monikers/Makefile
661 schemas/Makefile
662 devel-docs/Makefile
663 devel-docs/gnome-vfs-tutorial/Makefile
664 po/Makefile.in
665 programs/Makefile
666 test/Makefile
667 test/vfs-run
668 doc/Makefile
669 gnome-vfs-2.0.pc
670 gnome-vfs-module-2.0.pc
671 ])
672
673 chmod u+x test/vfs-run
674
675 dnl <= Configuration summary =>
676
677 echo "<= gnome-vfs configuration summary :"
678 dnl <= Profile support? =>
679 case "X$ENABLE_PROFILER" in
680 X1)
681 echo "
682 Enable profiler         : YES"
683 ;;
684 *)
685 echo "
686 Enable profiler         : NO"
687 echo
688 ;;
689 esac
690
691 dnl <= CFLAGS and LDFLAGS =>
692 echo "
693 CFLAGS                  : $CFLAGS
694 LDFLAGS                 : $LDFLAGS"
695 echo