Check also <ntfs/*> include files when checking 'libntfs' availability.
[captive.git] / configure.in
1 # $Id$
2 # Source file to generate "./configure" to prepare package for compilation
3 # Copyright (C) 2002-2003 Jan Kratochvil <project-captive@jankratochvil.net>
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; exactly version 2 of June 1991 is required
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18
19 AC_INIT(src/libcaptive/Makefile-libcaptive.am)
20 dnl 2.53 for AM_GLIB_GNU_GETTEXT:
21 AC_PREREQ(2.53)
22 AM_INIT_AUTOMAKE(captive,1.0.2cvs)
23 AM_CONFIG_HEADER(config.h)
24 AM_MAINTAINER_MODE
25 dnl Call AC_PROG_CC before AC_ISC_POSIX.
26 AC_PROG_CC(gcc3 gcc-3.0 gcc cc)
27 AC_TRY_CPP([
28 #if __GNUC__ >= 3
29 #else
30 #error "GCC version 3.0+ required at least for ReactOS anonymous unions"
31 #endif
32 ],,[AC_MSG_ERROR([Captive requires GCC version 3.0+.])])
33 dnl Prevent "AC_TRY_COMPILE was called before AC_ISC_POSIX":
34 AC_ISC_POSIX
35 AC_SYS_LARGEFILE
36 AM_PROG_AS
37 AM_DISABLE_STATIC
38 AM_ENABLE_SHARED
39 AM_PROG_LIBTOOL
40
41 dnl Workaround for autoconf-2.57:
42 m4_pattern_allow([AC_MSG_WARN])
43 m4_pattern_allow([AC_CHECK_LIB])
44 m4_pattern_allow([AC_CHECK_HEADERS])
45
46 dnl gettext localization.
47 dnl Use simpler AM_GLIB_GNU_GETTEXT instead of AM_GNU_GETTEXT
48 dnl as we depend on glib and glib requires system installed gettext anyway.
49 dnl http://lists.gnome.org/archives/gtk-devel-list/2003-April/msg00066.html
50 dnl Special 'GETTEXT_PACKAGE' is required by glib gettext.
51 ALL_LINGUAS="cs"
52 GETTEXT_PACKAGE="$PACKAGE"
53 AC_SUBST(GETTEXT_PACKAGE)
54 AM_GLIB_GNU_GETTEXT
55
56 GTK_DOC_CHECK
57 dnl AM_CONDITIONAL needs to be here explicitely for doc/apiref/Makefile rebuild
58 AM_CONDITIONAL(ENABLE_GTK_DOC,[test x$enable_gtk_doc = xyes])
59 AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL,[test -n "$LIBTOOL"])
60
61 dnl Do not discard 'CFLAGS' settings as they may have been passed us by rpmbuild(8)
62
63 dnl Define MAINTAINER_MODE in config.h.
64 if test "$USE_MAINTAINER_MODE" = "yes";then
65         AC_DEFINE(MAINTAINER_MODE,,[Turn even some software behaviour according to MAINTAINER_MODE.])
66         CFLAGS="$CFLAGS -ggdb3 -Wall -Wstrict-prototypes -Wsign-compare"  ## FIXME: fix all sources: -Wsign-compare
67         fi
68 dnl Some Makefiles use additional tests etc.
69 AM_CONDITIONAL(MAINTAINER_MODE,[test "$USE_MAINTAINER_MODE" = "yes"])
70
71
72 AC_ARG_ENABLE(man-pages,
73                 [  --enable-man-pages=no/yes/auto   pod2man(1) required for man pages (def.=yes)],,enable_man_pages=yes)
74 AC_ARG_ENABLE(sbin-mountdir,
75                 [  --enable-sbin-mountdir=DIR       mount(8) 'mount.captive' directory (def.=/sbin)],,
76                 [ enable_sbin_mountdir="/sbin" ])
77 AC_ARG_ENABLE(sbin-mount-fs,
78                 [  --enable-sbin-mount-fs=FS1:FS2   sbin-mount pre-installed symlinks (def.=ntfs:fastfat:cdfs:ext2fsd)],,
79                 [ enable_sbin_mount_fs="ntfs:fastfat:cdfs:ext2fsd" ])
80 AC_ARG_ENABLE(sandbox-setuid,
81                 [  --enable-sandbox-setuid=USER     non-privileged user  for captive-sandbox-server (def.=captive)],
82                 [ CAPTIVE_SANDBOX_SETUID="$enableval" ],[ CAPTIVE_SANDBOX_SETUID="captive" ])
83 AC_ARG_ENABLE(sandbox-setgid,
84                 [  --enable-sandbox-setgid=GROUP    non-privileged group for captive-sandbox-server (def.=captive)],
85                 [ CAPTIVE_SANDBOX_SETGID="$enableval" ],[ CAPTIVE_SANDBOX_SETGID="captive" ])
86 AC_ARG_ENABLE(sandbox-chroot,
87                 [  --enable-sandbox-chroot=DIR      root-owned directory for captive-sandbox-server (def.=/var/lib/captive)],
88                 [ CAPTIVE_SANDBOX_CHROOT="$enableval" ],[ CAPTIVE_SANDBOX_CHROOT="/var/lib/captive" ])
89 AC_ARG_ENABLE(bug-replay,
90                 [  --enable-bug-replay=no/yes/auto  compile debugging tool (def.=auto)],,enable_bug_replay=auto)
91 AC_ARG_ENABLE(lufs,
92                 [  --enable-lufs=no/yes/auto        compile LUFS filesystem module (def.=auto)],,enable_lufs=auto)
93 AC_ARG_ENABLE(install-pkg,
94                 [  --enable-install-pkg=no/yes/auto compile installation utils (def.=auto)],,enable_install_pkg=auto)
95
96
97 # AC_ARG_ENABLE(sbin-mountdir,[--enable-sbin-mountdir=DIR],,[enable_sbin_mountdir="/sbin"])
98 AM_CONDITIONAL(ENABLE_SBIN_MOUNT,[test "$enable_sbin_mount" != "no"])
99 AC_SUBST(enable_sbin_mountdir)
100
101 # AC_ARG_ENABLE(sbin-mount-fs,[--enable-sbin-mount-fs=FS1:FS2],,[enable_sbin_mount_fs="ntfs:fastfat:cdfs:ext2fsd"])
102 AC_SUBST(enable_sbin_mount_fs)
103
104 # AC_ARG_ENABLE(sandbox-setuid,[--enable-sandbox-setuid=USER],,[CAPTIVE_SANDBOX_SETUID="captive"])
105 AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_SETUID,"$CAPTIVE_SANDBOX_SETUID",
106                 [non-privileged user  for captive-sandbox-server])
107
108 # AC_ARG_ENABLE(sandbox-setgid,[--enable-sandbox-setgid=GROUP],,[CAPTIVE_SANDBOX_SETGID="captive"])
109 AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_SETGID,"$CAPTIVE_SANDBOX_SETGID",
110                 [non-privileged group for captive-sandbox-server])
111
112 # AC_ARG_ENABLE(sandbox-chroot,[--enable-sandbox-chroot=DIR],,[CAPTIVE_SANDBOX_CHROOT="/var/lib/captive"])
113 AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_CHROOT,"$CAPTIVE_SANDBOX_CHROOT",
114                 [root-owned directory for captive-sandbox-server])
115 AC_SUBST(CAPTIVE_SANDBOX_CHROOT)
116
117 dnl Permit 'if NEVER' for Makefile.am-s; symbol 'FALSE' forbidden by automake
118 AM_CONDITIONAL(NEVER,false)
119
120 PERL=
121 AC_PATH_PROGS(PERL,perl5 perl)
122 if test '!' -f ./src/libcaptive/ke/exports.c -a -z "$PERL";then
123         AC_MSG_ERROR([perl(1) required as './src/libcaptive/ke/exports.c' is not found.])
124 fi
125 AM_CONDITIONAL(HAVE_PERL,test -n "$PERL")
126
127 POD2MAN=
128 AC_PATH_PROGS(POD2MAN,pod2man)
129 AM_CONDITIONAL(HAVE_POD2MAN,[ test -n "$POD2MAN" ])
130 if test x$enable_man_pages = xyes;then
131         if test -z "$POD2MAN";then
132                 AC_MSG_ERROR([captive requires pod2man(1) for man pages; try --disable-man-pages.])
133         fi
134         if test -z "$PERL";then
135                 AC_MSG_ERROR([captive requires perl(1) for man pages; try --disable-man-pages.])
136         fi
137 elif test x$enable_man_pages != xno;then
138         if test -z "$POD2MAN";then
139                 AC_MSG_WARN([captive requires pod2man(1) for man pages by --enable-man-pages; mans will not be installed.])
140         fi
141         if test -z "$PERL";then
142                 AC_MSG_WARN([captive requires perl(1) for man pages by --enable-man-pages; mans will not be installed.])
143         fi
144 fi
145 AM_CONDITIONAL(ENABLE_MAN_PAGES,[ test x$enable_man_pages != xno -a -n "$POD2MAN" -a -n "$PERL" ])
146
147 dnl Separate 'acconfig.h' is no longer recommended by autoconf
148 AH_TOP([
149 #ifndef _CAPTIVE_CONFIG_H
150 #define _CAPTIVE_CONFIG_H 1
151 ])
152 AH_BOTTOM([
153 /* Do not place any stuff to AH_TOP as some of its includes
154  * would discard the effect of _FILE_OFFSET_BITS by AC_SYS_LARGEFILE.
155  */
156
157 #ifdef ENABLE_NLS
158 /* <libintl.h> is taken from "$(top_srcdir)/intl" if system doesn't provide intl */
159 #       include <libintl.h>
160 #ifdef LIBCAPTIVE
161 #       define _(String) dgettext (PACKAGE,String)
162 #else
163 #       define _(String) gettext (String)
164 #endif /* LIBCAPTIVE */
165 #       ifdef gettext_noop
166 #               define N_(String) gettext_noop (String)
167 #       else
168 #               define N_(String) (String)
169 #       endif
170 #else /* !ENABLE_NLS */
171 /* Stubs that do something close enough.  */
172 #       define textdomain(String) (String)
173 #       define gettext(String) (String)
174 #       define dgettext(Domain,Message) (Message)
175 #       define dcgettext(Domain,Message,Type) (Message)
176 #       define bindtextdomain(Domain,Directory) (Domain)
177 #       define _(String) (String)
178 #       define N_(String) (String)
179 #endif /* !ENABLE_NLS */
180
181 #include <glib/gtypes.h>        /* for 'gchar' */
182 #define G_LOG_DOMAIN ((const gchar *)"Captive")
183
184 /* Ensure we have proper -I options: */
185 #if defined(CAPTIVE_USE_GNOME_VFS_MODULE) || defined(CAPTIVE_USE_GNOME_VFS)
186 #ifndef HAVE_GNOME_VFS_READ_ENTIRE_FILE
187 #include <libgnomevfs/gnome-vfs-result.h>
188 GnomeVFSResult gnome_vfs_read_entire_file(const char *uri,int *file_size,char **file_contents);
189 #endif
190 #endif
191
192 /* Supplemental definitions not possible in this file. */
193 #ifdef LIBCAPTIVE
194 #include "captive/config2.h"
195 #endif
196
197 #endif /* !_CAPTIVE_CONFIG_H */
198 ])
199
200 AM_PATH_GLIB_2_0(,,[AC_MSG_ERROR([Captive requires glib-2.0 library.])],[gmodule gobject])
201 dnl Force glib for the whole package
202 CFLAGS="$CFLAGS $GLIB_CFLAGS"
203 LIBS="$LIBS $GLIB_LIBS"
204
205 dnl popt
206 AC_CHECK_LIB(popt,poptParseArgvString,[POPT_LIBS="-lpopt"],[AC_MSG_ERROR([Captive requires popt library.])])
207 AC_SUBST(POPT_LIBS)
208
209 AC_ARG_WITH(readline,[  --with-readline=[no/yes/auto]   clients with line editing (def.=auto)],,with_readline=auto)
210 AC_CHECK_HEADERS(readline/history.h)
211 dnl Check for libraries, if needed by configuration options.
212 if test "$with_readline" != "no"
213 then
214         if test -d "/usr/lib/termcap"
215         then
216                 READLINE_LDFLAGS="$READLINE_LDFLAGS -L/usr/lib/termcap"
217         fi
218         have_libreadline=false
219         need_failed=""
220         for need in "" termcap ncurses; do
221                 if test "x$need" != "x"
222                 then
223                         captive_save_LIBS="$LIBS"
224                         AC_CHECK_LIB($need,main,,
225                                 [ need_failed="$need_failed $need"
226                                 continue ]
227                                 )
228                         LIBS="$captive_save_LIBS"
229                         lneed="-l$need"
230                 else
231                         lneed=""
232                 fi
233                 dnl Prevent AC_CHECK_LIB() here as it would _cache_ the value ignoring
234                 dnl our ever-changing "additiona libraries" parameter
235                 captive_save_LIBS="$LIBS"
236                 LIBS="-lreadline $lneed $READLINE_LIBS"
237                 AC_TRY_LINK(,[ main() ],
238                         [ have_libreadline=true
239                         READLINE_LIBS="$LIBS" ])
240                 LIBS="$captive_save_LIBS"
241                 if $have_libreadline
242                 then
243                         break
244                 fi
245         done
246         if $have_libreadline
247         then
248                 AC_DEFINE(HAVE_LIBREADLINE,,[Use functions from libreadline?])
249                 AC_CHECK_LIB(readline,add_history,
250                         AC_DEFINE(HAVE_ADD_HISTORY,,[Use 'history' extension of libreadline?]),,
251                         $READLINE_LIBS)
252         else
253                 for need in $need_failed; do
254                         AC_MSG_WARN(captive recommends $need library as your readline library
255                         probably needs it.)
256                 done
257                 if test "$with_readline" = "yes"
258                 then
259                         AC_MSG_ERROR([captive did not find the requested readline library for its client line editing capability.])
260                 else
261                         AC_MSG_WARN([captive recommends readline library for its client line editing capability.])
262                 fi
263         fi
264 fi
265 AC_SUBST(READLINE_LIBS)
266 AC_SUBST(READLINE_LDFLAGS)
267
268 PKG_CHECK_MODULES(GNOME_VFS_MODULE,gnome-vfs-module-2.0)
269 GNOME_VFS_MODULE_CFLAGS="$GNOME_VFS_MODULE_CFLAGS -DCAPTIVE_USE_GNOME_VFS_MODULE=1"
270 AC_SUBST(GNOME_VFS_MODULE_CFLAGS)
271 AC_SUBST(GNOME_VFS_MODULE_LIBS)
272 PKG_CHECK_MODULES(GNOME_VFS,gnome-vfs-2.0)
273 GNOME_VFS_CFLAGS="$GNOME_VFS_CFLAGS -DCAPTIVE_USE_GNOME_VFS=1"
274 AC_SUBST(GNOME_VFS_CFLAGS)
275 AC_SUBST(GNOME_VFS_LIBS)
276
277 # AC_ARG_ENABLE(bug-replay,[--enable-bug-replay=[no/yes/auto]],,enable_bug_replay=auto)
278 dnl Check for 2.5.9 for: http://bugzilla.gnome.org/show_bug.cgi?id=117702
279 dnl Check the version - impossible to reliably check the missing feature.
280 PKG_CHECK_MODULES(LIBXML,libxml-2.0 >= 2.5.9,[ have_libxml_buffering=true ],[
281         dnl Disable bug-replay(1) build if not met; --bug-pathname would be still OK.
282         PKG_CHECK_MODULES(LIBXML,libxml-2.0,[ have_libxml_buffering=false ])
283         ])
284 dnl We also condition 'HAVE_LIBXML_XMLREADER_H' by 'HAVE_LIBXML_BUFFERING'
285 dnl as we have no use for xmlreader without working libxml buffering of 2.5.9.
286 AM_CONDITIONAL(ENABLE_BUG_REPLAY,[$have_libxml_buffering && test x$enable_bug_replay != xno])
287 if $have_libxml_buffering;then
288         AC_DEFINE(HAVE_LIBXML_BUFFERING,,[libxml2 correctly reads textnodes by its xmlTextReader.])
289 else
290         if test x$enable_bug_replay = xyes;then
291                 AC_MSG_ERROR([captive require libxml2 at least 2.5.9 for --enable-bug-replay feature.])
292         elif test x$enable_bug_replay != xno;then
293                 AC_MSG_WARN([libxml2 at least 2.5.9 required --enable-bug-replay feature; disabled now.])
294         fi
295 fi
296 AC_SUBST(LIBXML_CFLAGS)
297 AC_SUBST(LIBXML_LIBS)
298
299 PKG_CHECK_MODULES(OPENSSL,openssl,,[
300         dnl At least Debian-3.0r1 has openssl but without its .pc module.
301         AC_CHECK_LIB(crypto,MD5,[
302                 OPENSSL_CFLAGS=""
303                 OPENSSL_LIBS="-lcrypto"
304                 ],[AC_MSG_ERROR([Captive requires crypto library (of openssl).])])
305         ])
306 AC_SUBST(OPENSSL_CFLAGS)
307 AC_SUBST(OPENSSL_LIBS)
308
309 # AC_ARG_ENABLE(lufs,[--enable-lufs=[no/yes/auto]],,enable_lufs=auto)
310 have_lufs_includes=false
311 PATH_LUFSMOUNT=""
312 if test x$enable_lufs != no;then
313         have_lufs_includes=true
314         dnl If ACTION-IF-NOT-FOUND is given, it is executed when one of the header
315         dnl files is not found.
316         AC_CHECK_HEADERS(lufs/fs.h lufs/proto.h,,[ have_lufs_includes=false ])
317         if test x$have_lufs_includes = xfalse;then
318                 if test x$enable_lufs = xyes;then
319                         AC_MSG_ERROR([LUFS client was requested (--enable-lufs) but no LUFS include files were found. Install 'lufs-*-*captive*' package.])
320                 else
321                         AC_MSG_WARN([LUFS client not being compiled as no LUFS include files were found. Install 'lufs-*-*captive*' package.])
322                 fi
323         fi
324         AC_CHECK_TYPES([struct lufs_sbattr],,[
325                 dnl FIXME: Include 'lufs' version when 'lufs_sbattr' gets integrated:
326                 if $have_lufs_includes && test x$enable_lufs = xyes;then
327                         AC_MSG_ERROR([Although LUFS include files were found they are too old. You may also use --enable-lufs=auto.])
328                 else
329                         AC_MSG_WARN([Although LUFS include files were found they are too old. df(1) will not show available NTFS disk space.])
330                 fi
331                 ],[#include <lufs/proto.h>])
332         AC_PATH_PROGS(PATH_LUFSMOUNT,lufsmount)
333         if test x$PATH_LUFSMOUNT = x;then
334                 if test x$enable_lufs = xyes;then
335                         AC_MSG_ERROR([LUFS client was requested (--enable-lufs) but no lufsmount(1) binary was found. Install 'lufs-*-*captive*' package.])
336                 else
337                         AC_MSG_WARN([LUFS client not being compiled as no lufsmount(1) binary was found. Install 'lufs-*-*captive*' package.])
338                 fi
339         fi
340 fi
341 AM_CONDITIONAL(ENABLE_LUFS,[ $have_lufs_includes && test x$PATH_LUFSMOUNT != x -a x$enable_lufs != no ])
342 AC_SUBST(PATH_LUFSMOUNT)
343
344 dnl for $(top_srcdir)/src/libcaptive/client/
345 dnl Do not use '[client server]' as $4 to prevent: configure: test: too many arguments
346 dnl  - currently this argument is not used by 'orbit2-config' in any way anyway
347 AM_PATH_ORBIT2(,,[AC_MSG_ERROR([Captive requires ORBit library.])])
348
349 AC_ARG_WITH(orbit-line,[  --with-orbit-line=[link/linc/auto]    Use 'link' for ORBit2 >=2.7.x+ (def.=auto)],,with_orbit_line=auto)
350 captive_save_CFLAGS="$CFLAGS"
351 captive_save_LIBS="$LIBS"
352 CFLAGS="$CFLAGS $ORBIT_CFLAGS"
353 LIBS="$LIBS $ORBIT_LIBS"
354 AC_CHECK_FUNC(link_get_tmpdir,[
355                 AC_DEFINE(HAVE_ORBIT_LINK,,[ORBit2 is 2.7.x+ and therefore includes its own 'link' library])
356                 found_orbit_line=link
357                 ],
358         found_orbit_line=linc
359         )
360 CFLAGS="$captive_save_CFLAGS"
361 LIBS="$captive_save_LIBS"
362 if test "x$with_orbit_line" != "xauto" -a "x$with_orbit_line" != "x$found_orbit_line";then
363         AC_MSG_ERROR([--with-orbit-line=$with_orbit_line specified but the detected line is $found_orbit_line])
364 fi
365
366 if test "x$found_orbit_line" = "xlinc";then
367         AM_PATH_LINC(,,[AC_MSG_ERROR([Captive requires linc library used by ORBit.])])
368 fi
369
370 # AC_ARG_ENABLE(install-pkg,[--enable-install-pkg=[no/yes/auto]],,enable_install_pkg=auto)
371 GLADE_W_INIT([
372         ./src/install/acquire/ui-gnome-interface.c
373         ./src/install/acquire/ui-gnome-interface.h
374         ./src/install/acquire/ui-gnome-callbacks.h
375         ./src/install/acquire/ui-gnome-support.c
376         ./src/install/acquire/ui-gnome-support.h
377         ],[$enable_install_pkg],[
378                 AC_CHECK_LIB(ntfs,ntfs_mount,[
379                         LIBNTFS_LIBS="-lntfs"
380
381                         have_libntfs_includes=true
382                         AC_CHECK_HEADERS
383                         AC_CHECK_HEADERS(ntfs/types.h ntfs/volume.h,,[ have_libntfs_includes=false ])
384                         if $have_libntfs_includes;then
385
386                                 captive_save_CPPFLAGS="$CPPFLAGS"
387                                 CPPFLAGS="$CPPFLAGS $LIBXML_CFLAGS"
388                                 AC_CHECK_HEADERS(libxml/xmlreader.h,
389                                         [ glade_addon=yes ],
390                                         [ AC_MSG_WARN([Captive requires libxml >= 2.4.29 for --enable-install-pkg.]) ])
391                                 CPPFLAGS="$captive_save_CPPFLAGS"
392
393                         else
394                                 AC_MSG_WARN([Captive requires ntfs/* include files (of ntfsprogs-devel) for --enable-install-pkg.])
395                         fi
396                         ],[ AC_MSG_WARN([Captive requires libntfs (of ntfsprogs-devel) for --enable-install-pkg.]) ])
397                 ])
398 AC_SUBST(GNOMEUI_CFLAGS)
399 AC_SUBST(GNOMEUI_LIBS)
400 AC_SUBST(LIBNTFS_LIBS)
401 dnl Do not: AM_CONDITIONAL(HAVE_LIBNTFS,[ test -n "$LIBNTFS_LIBS" ])
402 dnl as we do not need it as we are conditioned by ENABLE_INSTALL_PKG
403 AM_CONDITIONAL(HAVE_GLADE_WRITESOURCE,[ test "x$PATH_GLADE" != "x" ])
404 dnl Do not: AM_CONDITIONAL(BUILD_GLADESRC,[ test "xyes" = "x$BUILD_GLADESRC" ])
405 dnl as we do not need it as we are conditioned by ENABLE_INSTALL_PKG
406 GNOME_ADDON_LIBS=""
407 if test "x$BUILD_GLADESRC_TRUE" = "x"
408 then
409         AC_CHECK_LIB(Xi,XOpenDevice,GNOME_ADDON_LIBS="$GNOME_ADDON_LIBS -lXi")
410 fi
411 AC_SUBST(GNOME_ADDON_LIBS)
412 dnl $BUILD_GLADESRC is already conditioned by $enable_install_pkg by GLADE_W_INIT()
413 AM_CONDITIONAL(ENABLE_INSTALL_PKG,[ test "xyes" = "x$BUILD_GLADESRC" ])
414
415 dnl Do not use AC_REPLACE_FUNCS() as we need to link it selectively:
416 GNOME_VFS_READ_ENTIRE_FILE_O=""
417 captive_save_CFLAGS="$CFLAGS"
418 captive_save_LIBS="$LIBS"
419 CFLAGS="$CFLAGS $GNOME_VFS_MODULE_CFLAGS"
420 LIBS="$LIBS $GNOME_VFS_MODULE_LIBS"
421 AC_CHECK_FUNCS(gnome_vfs_read_entire_file,,
422         [ GNOME_VFS_READ_ENTIRE_FILE_O='gnome_vfs_read_entire_file.$(OBJEXT)' ])
423 CFLAGS="$captive_save_CFLAGS"
424 LIBS="$captive_save_LIBS"
425 AC_SUBST(GNOME_VFS_READ_ENTIRE_FILE_O)
426
427 AC_SUBST(CFLAGS)
428 AC_SUBST(LIBS)
429
430 dnl "Makefile" output files MUST have pathnames incl./excl. "./" prefix as specified!
431 dnl FIXME: Why the rule above was written here?
432 AC_OUTPUT([
433 captive.spec
434 ./src/libcaptive/captive.pod.pl
435 ./src/libcaptive/client/options.pod.pl
436 ./src/client/cmdline/captive-cmdline.pod.pl
437 ./src/client/lufs/lufs-captivefs.pod.pl
438 ./src/client/lufs/mount.captive.pod.pl
439 ./src/client/lufs/mount.captive
440 ./src/client/sandbox-server/captive-sandbox-server.pod.pl
441 ./src/install/fstab/captive-install-fstab.pod.pl
442 ./src/install/acquire/captive-install-acquire.pod.pl
443 ./src/client/gnomevfs/captive.conf
444 ./po/Makefile.in
445 ./macros/glade-w.sh
446 ./debian/changelog
447 Makefile
448 ./macros/Makefile
449 ./src/Makefile
450 ./src/libcaptive/Makefile
451 ./src/libcaptive/include/Makefile
452 ./src/libcaptive/include/captive/Makefile
453 ./src/libcaptive/include/reactos/Makefile
454 ./src/libcaptive/include/reactos/ddk/Makefile
455 ./src/libcaptive/include/reactos/ddk/i386/Makefile
456 ./src/libcaptive/include/reactos/internal/Makefile
457 ./src/libcaptive/include/reactos/internal/i386/Makefile
458 ./src/libcaptive/include/reactos/napi/Makefile
459 ./src/libcaptive/include/reactos/ntos/Makefile
460 ./src/libcaptive/reactos/Makefile
461 ./src/libcaptive/reactos/include/Makefile
462 ./src/libcaptive/reactos/hal/Makefile
463 ./src/libcaptive/reactos/hal/halx86/Makefile
464 ./src/libcaptive/reactos/ntoskrnl/Makefile
465 ./src/libcaptive/reactos/ntoskrnl/dbg/Makefile
466 ./src/libcaptive/reactos/ntoskrnl/ex/Makefile
467 ./src/libcaptive/reactos/ntoskrnl/fs/Makefile
468 ./src/libcaptive/reactos/ntoskrnl/io/Makefile
469 ./src/libcaptive/reactos/ntoskrnl/ke/Makefile
470 ./src/libcaptive/reactos/ntoskrnl/ldr/Makefile
471 ./src/libcaptive/reactos/ntoskrnl/mm/Makefile
472 ./src/libcaptive/reactos/ntoskrnl/nt/Makefile
473 ./src/libcaptive/reactos/ntoskrnl/ob/Makefile
474 ./src/libcaptive/reactos/ntoskrnl/ps/Makefile
475 ./src/libcaptive/reactos/ntoskrnl/rtl/Makefile
476 ./src/libcaptive/reactos/ntoskrnl/rtl/i386/Makefile
477 ./src/libcaptive/reactos/ntoskrnl/se/Makefile
478 ./src/libcaptive/halcaptive/Makefile
479 ./src/libcaptive/cc/Makefile
480 ./src/libcaptive/cm/Makefile
481 ./src/libcaptive/ex/Makefile
482 ./src/libcaptive/fs/Makefile
483 ./src/libcaptive/io/Makefile
484 ./src/libcaptive/kd/Makefile
485 ./src/libcaptive/ke/Makefile
486 ./src/libcaptive/ldr/Makefile
487 ./src/libcaptive/mm/Makefile
488 ./src/libcaptive/nt/Makefile
489 ./src/libcaptive/ob/Makefile
490 ./src/libcaptive/po/Makefile
491 ./src/libcaptive/ps/Makefile
492 ./src/libcaptive/rtl/Makefile
493 ./src/libcaptive/se/Makefile
494 ./src/libcaptive/storage/Makefile
495 ./src/libcaptive/sandbox/Makefile
496 ./src/libcaptive/client/Makefile
497 ./src/client/Makefile
498 ./src/client/bug-replay/Makefile
499 ./src/client/cmdline/Makefile
500 ./src/client/gnomevfs/Makefile
501 ./src/client/lufs/Makefile
502 ./src/client/sandbox-server/Makefile
503 ./src/install/Makefile
504 ./src/install/libcaptive-install/Makefile
505 ./src/install/fstab/Makefile
506 ./src/install/acquire/Makefile
507 ./src/TraceFS/Makefile
508 ./src/w32-mod/Makefile
509 ./doc/Makefile
510 ./doc/apiref/Makefile
511 ])
512
513 dnl FIXME: Why is "po/POTFILES" being substituted?
514 make -C src distfiles DISTFILES_PRINT=1 \
515                 |sed -n 's/^:DISTFILES: *\(.*\)$/\1/p'|tr ' ' '\n'|grep . >po/POTFILES.in
516 make -C po Makefile
517
518 echo done.