Fixed message typo.
[captive.git] / configure.ac
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 dnl Not yet present in: Red Hat autoconf-2.57-3
23 dnl AC_CONFIG_MACRO_DIR(macros)
24 AM_INIT_AUTOMAKE(captive,1.1.8cvs)
25 AM_CONFIG_HEADER(config.h)
26 AM_MAINTAINER_MODE
27 dnl Call AC_PROG_CC before AC_ISC_POSIX.
28 AC_PROG_CC(gcc3 gcc-3.0 gcc cc)
29 AC_TRY_CPP([
30 #if __GNUC__ >= 3
31 #else
32 #error "GCC version 3.0+ required at least for ReactOS anonymous unions"
33 #endif
34 ],,[AC_MSG_ERROR([Captive requires GCC version 3.0+.])])
35 dnl Prevent "AC_TRY_COMPILE was called before AC_ISC_POSIX":
36 AC_ISC_POSIX
37 AC_SYS_LARGEFILE
38 AM_PROG_AS
39 AM_DISABLE_STATIC
40 AM_ENABLE_SHARED
41 AM_PROG_LIBTOOL
42
43 dnl Workaround for autoconf-2.57:
44 m4_pattern_allow([AC_MSG_WARN])
45 m4_pattern_allow([AC_CHECK_LIB])
46 m4_pattern_allow([AC_CHECK_HEADERS])
47
48 dnl gettext localization.
49 dnl Use simpler AM_GLIB_GNU_GETTEXT instead of AM_GNU_GETTEXT
50 dnl as we depend on glib and glib requires system installed gettext anyway.
51 dnl http://lists.gnome.org/archives/gtk-devel-list/2003-April/msg00066.html
52 dnl Special 'GETTEXT_PACKAGE' is required by glib gettext.
53 ALL_LINGUAS="cs"
54 GETTEXT_PACKAGE="$PACKAGE"
55 AC_SUBST(GETTEXT_PACKAGE)
56 AM_GLIB_GNU_GETTEXT
57
58 GTK_DOC_CHECK
59 dnl AM_CONDITIONAL needs to be here explicitely for doc/apiref/Makefile rebuild
60 AM_CONDITIONAL(ENABLE_GTK_DOC,[test x$enable_gtk_doc = xyes])
61 AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL,[test -n "$LIBTOOL"])
62
63 dnl Do not discard 'CFLAGS' settings as they may have been passed us by rpmbuild(8)
64
65 dnl Define MAINTAINER_MODE in config.h.
66 if test "$USE_MAINTAINER_MODE" = "yes";then
67         AC_DEFINE(MAINTAINER_MODE,,[Turn even some software behaviour according to MAINTAINER_MODE.])
68         CFLAGS="$CFLAGS -ggdb3 -Wall -Wstrict-prototypes -Wsign-compare"  ## FIXME: fix all sources: -Wsign-compare
69         fi
70 dnl Some Makefiles use additional tests etc.
71 AM_CONDITIONAL(MAINTAINER_MODE,[test "$USE_MAINTAINER_MODE" = "yes"])
72
73
74 AC_ARG_ENABLE(man-pages,
75                 [  --enable-man-pages=no/yes/auto   pod2man(1) required for man pages (def.=yes)],,enable_man_pages=yes)
76 AC_ARG_ENABLE(sbin-mountdir,
77                 [  --enable-sbin-mountdir=DIR       mount(8) 'mount.captive' directory (def.=/sbin)],,
78                 [ enable_sbin_mountdir="/sbin" ])
79 AC_ARG_ENABLE(sbin-mount-fs,
80                 [  --enable-sbin-mount-fs=FS1:FS2   sbin-mount pre-installed symlinks (def.=ntfs:fastfat:cdfs:ext2fsd)],,
81                 [ enable_sbin_mount_fs="ntfs:fastfat:cdfs:ext2fsd" ])
82 AC_ARG_WITH(initddir,
83                 [  --with-initddir=DIR              directory for captive FUSE shutdown (def.=/etc/rc.d/init.d)],,with_initddir=/etc/rc.d/init.d)
84 AC_ARG_ENABLE(sandbox-setuid,
85                 [  --enable-sandbox-setuid=USER     non-privileged user  for captive-sandbox-server (def.=captive)],
86                 [ CAPTIVE_SANDBOX_SETUID="$enableval" ],[ CAPTIVE_SANDBOX_SETUID="captive" ])
87 AC_ARG_ENABLE(sandbox-setgid,
88                 [  --enable-sandbox-setgid=GROUP    non-privileged group for captive-sandbox-server (def.=captive)],
89                 [ CAPTIVE_SANDBOX_SETGID="$enableval" ],[ CAPTIVE_SANDBOX_SETGID="captive" ])
90 AC_ARG_ENABLE(sandbox-chroot,
91                 [  --enable-sandbox-chroot=DIR      root-owned directory for captive-sandbox-server (def.=/var/lib/captive)],
92                 [ CAPTIVE_SANDBOX_CHROOT="$enableval" ],[ CAPTIVE_SANDBOX_CHROOT="/var/lib/captive" ])
93 AC_ARG_ENABLE(bug-replay,
94                 [  --enable-bug-replay=no/yes/auto  compile debugging tool (def.=auto)],,enable_bug_replay=auto)
95 AC_ARG_ENABLE(lufs,
96                 [  --enable-lufs=no/yes/auto        compile LUFS filesystem module - DEPRECATED (def.=no)],,enable_lufs=no)
97 AC_ARG_ENABLE(fuse,
98                 [  --enable-fuse=no/yes/auto        compile FUSE filesystem module (def.=auto)],,enable_fuse=auto)
99 AC_ARG_ENABLE(install-pkg,
100                 [  --enable-install-pkg=no/yes/auto compile installation utils (def.=auto)],,enable_install_pkg=auto)
101 AC_ARG_ENABLE(standalone,
102                 [  --enable-standalone=no/yes       provide initialization for static-build (def.=no)],,enable_standalone=no)
103 AC_ARG_ENABLE(standalone-fonts,
104                 [  --enable-standalone-fonts=DIR    provide bundled Gnome fonts in directory (def.=no)],,enable_standalone_fonts=no)
105 AC_ARG_ENABLE(standalone-yum,
106                 [  --enable-standalone-yum=DIR      provide bundled yum(8) packaging configuration directory (def.=no)],,enable_standalone_yum=no)
107
108
109 # AC_ARG_ENABLE(sbin-mountdir,[--enable-sbin-mountdir=DIR],,[enable_sbin_mountdir="/sbin"])
110 AM_CONDITIONAL(ENABLE_SBIN_MOUNT,[test "$enable_sbin_mount" != "no"])
111 AC_SUBST(enable_sbin_mountdir)
112
113 # AC_ARG_ENABLE(sbin-mount-fs,[--enable-sbin-mount-fs=FS1:FS2],,[enable_sbin_mount_fs="ntfs:fastfat:cdfs:ext2fsd"])
114 AC_SUBST(enable_sbin_mount_fs)
115
116 # AC_ARG_ENABLE(sandbox-setuid,[--enable-sandbox-setuid=USER],,[CAPTIVE_SANDBOX_SETUID="captive"])
117 AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_SETUID,"$CAPTIVE_SANDBOX_SETUID",
118                 [non-privileged user  for captive-sandbox-server])
119 AC_SUBST(CAPTIVE_SANDBOX_SETUID)
120
121 # AC_ARG_ENABLE(sandbox-setgid,[--enable-sandbox-setgid=GROUP],,[CAPTIVE_SANDBOX_SETGID="captive"])
122 AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_SETGID,"$CAPTIVE_SANDBOX_SETGID",
123                 [non-privileged group for captive-sandbox-server])
124 AC_SUBST(CAPTIVE_SANDBOX_SETGID)
125
126 # AC_ARG_ENABLE(sandbox-chroot,[--enable-sandbox-chroot=DIR],,[CAPTIVE_SANDBOX_CHROOT="/var/lib/captive"])
127 AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_CHROOT,"$CAPTIVE_SANDBOX_CHROOT",
128                 [root-owned directory for captive-sandbox-server])
129 AC_SUBST(CAPTIVE_SANDBOX_CHROOT)
130
131 dnl Permit 'if NEVER' for Makefile.am-s; symbol 'FALSE' forbidden by automake
132 AM_CONDITIONAL(NEVER,false)
133
134 PERL=
135 AC_PATH_PROGS(PERL,perl5 perl)
136 if test '!' -f ./src/libcaptive/ke/exports.c -a -z "$PERL";then
137         AC_MSG_ERROR([perl(1) required as './src/libcaptive/ke/exports.c' is not found.])
138 fi
139 AM_CONDITIONAL(HAVE_PERL,test -n "$PERL")
140
141 POD2MAN=
142 AC_PATH_PROGS(POD2MAN,pod2man)
143 AM_CONDITIONAL(HAVE_POD2MAN,[ test -n "$POD2MAN" ])
144 if test x$enable_man_pages = xyes;then
145         if test -z "$POD2MAN";then
146                 AC_MSG_ERROR([captive requires pod2man(1) for man pages; try --disable-man-pages.])
147         fi
148         if test -z "$PERL";then
149                 AC_MSG_ERROR([captive requires perl(1) for man pages; try --disable-man-pages.])
150         fi
151 elif test x$enable_man_pages != xno;then
152         if test -z "$POD2MAN";then
153                 AC_MSG_WARN([captive requires pod2man(1) for man pages by --enable-man-pages; mans will not be installed.])
154         fi
155         if test -z "$PERL";then
156                 AC_MSG_WARN([captive requires perl(1) for man pages by --enable-man-pages; mans will not be installed.])
157         fi
158 fi
159 AM_CONDITIONAL(ENABLE_MAN_PAGES,[ test x$enable_man_pages != xno -a -n "$POD2MAN" -a -n "$PERL" ])
160
161 dnl Separate 'acconfig.h' is no longer recommended by autoconf
162 AH_TOP([
163 #ifndef _CAPTIVE_CONFIG_H
164 #define _CAPTIVE_CONFIG_H 1
165 ])
166 AH_BOTTOM([
167 /* Do not place any stuff to AH_TOP as some of its includes
168  * would discard the effect of _FILE_OFFSET_BITS by AC_SYS_LARGEFILE.
169  */
170
171 /* Supplemental definitions not possible in this file. */
172 #include "captive/config2.h"
173
174 #endif /* !_CAPTIVE_CONFIG_H */
175 ])
176
177 dnl Do not use PKG_CHECK_MODULES() as it would not set 'GLIB_GENMARSHAL' etc.
178 AM_PATH_GLIB_2_0(,,[AC_MSG_ERROR([Captive requires glib-2.0 library.])],[gmodule gobject gthread])
179 dnl Force glib for the whole package
180 CFLAGS="$CFLAGS $GLIB_CFLAGS"
181 LIBS="$LIBS $GLIB_LIBS"
182
183 dnl popt
184 AC_CHECK_LIB(popt,poptParseArgvString,[POPT_LIBS="-lpopt"],[AC_MSG_ERROR([Captive requires popt library.])])
185 AC_SUBST(POPT_LIBS)
186
187 AC_ARG_WITH(readline,[  --with-readline=[no/yes/auto]   clients with line editing (def.=auto)],,with_readline=auto)
188 AC_CHECK_HEADERS(readline/history.h)
189 dnl Check for libraries, if needed by configuration options.
190 if test "$with_readline" != "no"
191 then
192         if test -d "/usr/lib/termcap"
193         then
194                 READLINE_LDFLAGS="$READLINE_LDFLAGS -L/usr/lib/termcap"
195         fi
196         have_libreadline=false
197         need_failed=""
198         for need in "" termcap ncurses; do
199                 if test "x$need" != "x"
200                 then
201                         captive_save_LIBS="$LIBS"
202                         AC_CHECK_LIB($need,main,,
203                                 [ need_failed="$need_failed $need"
204                                 continue ]
205                                 )
206                         LIBS="$captive_save_LIBS"
207                         lneed="-l$need"
208                 else
209                         lneed=""
210                 fi
211                 dnl Prevent AC_CHECK_LIB() here as it would _cache_ the value ignoring
212                 dnl our ever-changing "additiona libraries" parameter
213                 captive_save_LIBS="$LIBS"
214                 LIBS="-lreadline $lneed $READLINE_LIBS"
215                 AC_TRY_LINK(,[ main() ],
216                         [ have_libreadline=true
217                         READLINE_LIBS="$LIBS" ])
218                 LIBS="$captive_save_LIBS"
219                 if $have_libreadline
220                 then
221                         break
222                 fi
223         done
224         if $have_libreadline
225         then
226                 AC_DEFINE(HAVE_LIBREADLINE,,[Use functions from libreadline?])
227                 AC_CHECK_LIB(readline,add_history,
228                         AC_DEFINE(HAVE_ADD_HISTORY,,[Use 'history' extension of libreadline?]),,
229                         $READLINE_LIBS)
230         else
231                 for need in $need_failed; do
232                         AC_MSG_WARN(captive recommends $need library as your readline library
233                         probably needs it.)
234                 done
235                 if test "$with_readline" = "yes"
236                 then
237                         AC_MSG_ERROR([captive did not find the requested readline library for its client line editing capability.])
238                 else
239                         AC_MSG_WARN([captive recommends readline library for its client line editing capability.])
240                 fi
241         fi
242 fi
243 AC_SUBST(READLINE_LIBS)
244 AC_SUBST(READLINE_LDFLAGS)
245
246 PKG_CHECK_MODULES(GNOME_VFS_MODULE,gnome-vfs-module-2.0)
247 GNOME_VFS_MODULE_CFLAGS="$GNOME_VFS_MODULE_CFLAGS -DCAPTIVE_USE_GNOME_VFS_MODULE=1"
248 AC_SUBST(GNOME_VFS_MODULE_CFLAGS)
249 AC_SUBST(GNOME_VFS_MODULE_LIBS)
250 PKG_CHECK_MODULES(GNOME_VFS,gnome-vfs-2.0)
251 GNOME_VFS_CFLAGS="$GNOME_VFS_CFLAGS -DCAPTIVE_USE_GNOME_VFS=1"
252 AC_SUBST(GNOME_VFS_CFLAGS)
253 AC_SUBST(GNOME_VFS_LIBS)
254
255 # AC_ARG_ENABLE(bug-replay,[--enable-bug-replay=[no/yes/auto]],,enable_bug_replay=auto)
256 dnl Check for 2.5.9 for: http://bugzilla.gnome.org/show_bug.cgi?id=117702
257 dnl Check the version - impossible to reliably check the missing feature.
258 PKG_CHECK_MODULES(LIBXML,libxml-2.0 >= 2.5.9,[ have_libxml_buffering=true ],[
259         dnl Disable bug-replay(1) build if not met; --bug-pathname would be still OK.
260         PKG_CHECK_MODULES(LIBXML,libxml-2.0,[ have_libxml_buffering=false ])
261         ])
262 dnl We also condition 'HAVE_LIBXML_XMLREADER_H' by 'HAVE_LIBXML_BUFFERING'
263 dnl as we have no use for xmlreader without working libxml buffering of 2.5.9.
264 AM_CONDITIONAL(ENABLE_BUG_REPLAY,[$have_libxml_buffering && test x$enable_bug_replay != xno])
265 if $have_libxml_buffering;then
266         AC_DEFINE(HAVE_LIBXML_BUFFERING,,[libxml2 correctly reads textnodes by its xmlTextReader.])
267 else
268         if test x$enable_bug_replay = xyes;then
269                 AC_MSG_ERROR([captive require libxml2 at least 2.5.9 for --enable-bug-replay feature.])
270         elif test x$enable_bug_replay != xno;then
271                 AC_MSG_WARN([libxml2 at least 2.5.9 required --enable-bug-replay feature; disabled now.])
272         fi
273 fi
274 AC_SUBST(LIBXML_CFLAGS)
275 AC_SUBST(LIBXML_LIBS)
276
277 PKG_CHECK_MODULES(OPENSSL,openssl,,[
278         dnl At least Debian-3.0r1 has openssl but without its .pc module.
279         AC_CHECK_LIB(crypto,MD5,[
280                 OPENSSL_CFLAGS=""
281                 OPENSSL_LIBS="-lcrypto"
282                 ],[AC_MSG_ERROR([Captive requires crypto library (of openssl).])])
283         ])
284 AC_SUBST(OPENSSL_CFLAGS)
285 AC_SUBST(OPENSSL_LIBS)
286
287 # AC_ARG_ENABLE(lufs,[--enable-lufs=[no/yes/auto]],,enable_lufs=no)
288 have_lufs_includes=false
289 # Although it would be more appropriate to use lufsmount(1) instead of lufsd(1)
290 # we use lufsd(1) as lufsmount(1) is just a dumb wrapper and it would cost us
291 # another big binary file for the static build package version.
292 PATH_LUFSD=""
293 if test x$enable_lufs != xno;then
294         have_lufs_includes=true
295         dnl If ACTION-IF-NOT-FOUND is given, it is executed when one of the header
296         dnl files is not found.
297         AC_CHECK_HEADERS(lufs/fs.h lufs/proto.h,,[ have_lufs_includes=false ])
298         if test x$have_lufs_includes = xfalse;then
299                 if test x$enable_lufs = xyes;then
300                         AC_MSG_ERROR([LUFS client was requested (--enable-lufs) but no LUFS include files were found. Install 'lufs-*-*captive*' package.])
301                 else
302                         AC_MSG_WARN([LUFS client not being compiled as no LUFS include files were found. Install 'lufs-*-*captive*' package.])
303                 fi
304         fi
305         AC_CHECK_TYPES([struct lufs_sbattr],,[
306                 dnl FIXME: Include 'lufs' version when 'lufs_sbattr' gets integrated:
307                 if $have_lufs_includes && test x$enable_lufs = xyes;then
308                         AC_MSG_ERROR([Although LUFS include files were found they are too old. You may also use --enable-lufs=auto.])
309                 else
310                         AC_MSG_WARN([Although LUFS include files were found they are too old. df(1) will not show available NTFS disk space.])
311                 fi
312                 ],[#include <lufs/proto.h>])
313         AC_PATH_PROGS(PATH_LUFSD,lufsd)
314         if test x$PATH_LUFSD = x;then
315                 if test x$enable_lufs = xyes;then
316                         AC_MSG_ERROR([LUFS client was requested (--enable-lufs) but no lufsd(1) binary was found. Install 'lufs-*-*captive*' package.])
317                 else
318                         AC_MSG_WARN([LUFS client not being compiled as no lufsd(1) binary was found. Install 'lufs-*-*captive*' package.])
319                 fi
320         fi
321 fi
322 AM_CONDITIONAL(ENABLE_LUFS,[ $have_lufs_includes && test x$PATH_LUFSD != x -a x$enable_lufs != no ])
323 if test x$ENABLE_LUFS_TRUE = x;then
324         AC_MSG_WARN([LUFS client is going to be compiled - LUFS is deprecated, FUSE module is recommended instead.])
325 fi
326 AC_SUBST(PATH_LUFSD)
327
328 # AC_ARG_ENABLE(fuse,[--enable-fuse=[no/yes/auto]],,enable_fuse=auto)
329 have_fuse=false
330 if test x$enable_fuse != xno;then
331         PKG_CHECK_MODULES(FUSE,fuse,[ have_fuse=true ],[
332                 if test x$enable_fuse = xyes;then
333                         AC_MSG_ERROR([FUSE client was requested (--enable-fuse) but no FUSE pkg-config(1) module was found. Install 'fuse-devel' package.])
334                 else
335                         AC_MSG_WARN([FUSE client not being compiled as no FUSE pkg-config(1) module was found. Install 'fuse-devel' package.])
336                 fi
337                 ])
338 fi
339 if $have_fuse;then
340         AC_CHECK_MEMBERS([struct stat.st_atim])
341         AC_CHECK_MEMBERS([struct stat.st_atimensec])
342         AC_CHECK_MEMBERS([struct stat.st_mtim])
343         AC_CHECK_MEMBERS([struct stat.st_mtimensec])
344         AC_CHECK_MEMBERS([struct stat.st_ctim])
345         AC_CHECK_MEMBERS([struct stat.st_ctimensec])
346 fi
347 AM_CONDITIONAL(ENABLE_FUSE,[ $have_fuse ])
348 # Avoid default backward compatibility mode - see the heading of: <fuse.h>
349 FUSE_CFLAGS="$FUSE_CFLAGS -DFUSE_USE_VERSION=22"
350 AC_SUBST(FUSE_CFLAGS)
351 AC_SUBST(FUSE_LIBS)
352
353 initddir=
354 if test x$with_initddir != xno;then
355         initddir="$with_initddir"
356 fi
357 AM_CONDITIONAL(WITH_INITDDIR,[ test x$with_initddir != xno ])
358 AC_SUBST(initddir)
359
360 if test x$ENABLE_LUFS_TRUE = x -a x$ENABLE_FUSE_TRUE = x;then
361         # mount.captive(8) file installation would conflict, that's all.
362         AC_MSG_ERROR([Compilation of both FUSE and LUFS modules is currently not supported - use '--disable-lufs'.])
363 fi
364
365 dnl for $(top_srcdir)/src/libcaptive/client/
366 dnl Do not use '[client server]' as $4 to prevent: configure: test: too many arguments
367 dnl  - currently this argument is not used by 'orbit2-config' in any way anyway
368 dnl Do not use PKG_CHECK_MODULES() as it would not set 'ORBIT_IDL' etc.
369 AM_PATH_ORBIT2(,,[AC_MSG_ERROR([Captive requires ORBit2 library.])])
370
371 AC_ARG_WITH(orbit-line,[  --with-orbit-line=[link/linc/auto]    Use 'link' for ORBit2 >=2.7.x+ (def.=auto)],,with_orbit_line=auto)
372 captive_save_CFLAGS="$CFLAGS"
373 captive_save_LIBS="$LIBS"
374 CFLAGS="$CFLAGS $ORBIT_CFLAGS"
375 LIBS="$LIBS $ORBIT_LIBS"
376 AC_CHECK_FUNC(link_get_tmpdir,[
377                 AC_DEFINE(HAVE_ORBIT_LINK,,[ORBit2 is 2.7.x+ and therefore includes its own 'link' library])
378                 found_orbit_line=link
379                 ],
380         found_orbit_line=linc
381         )
382 CFLAGS="$captive_save_CFLAGS"
383 LIBS="$captive_save_LIBS"
384 if test "x$with_orbit_line" != "xauto" -a "x$with_orbit_line" != "x$found_orbit_line";then
385         AC_MSG_ERROR([--with-orbit-line=$with_orbit_line specified but the detected line is $found_orbit_line])
386 fi
387
388 if test "x$found_orbit_line" = "xlinc";then
389         PKG_CHECK_MODULES(LINC,linc)
390 fi
391
392 captive_save_CPPFLAGS="$CPPFLAGS"
393 CPPFLAGS="$CPPFLAGS $LIBXML_CFLAGS"
394 have_libxml_xmlreader_h=false
395 AC_CHECK_HEADERS(libxml/xmlreader.h,[ have_libxml_xmlreader_h=true ],
396         [ AC_MSG_WARN([Captive requires libxml >= 2.4.29 for --enable-install-pkg.]) ])
397 AM_CONDITIONAL(HAVE_LIBXML_XMLREADER_H,[ $have_libxml_xmlreader_h ])
398 CPPFLAGS="$captive_save_CPPFLAGS"
399
400 have_libntfs_includes=true
401 # '#include "config.h"' may be required by <ntfs/*> include files.
402 # "config.h" may be already present while not yet being compilable.
403 rm -f config.h-ntfs_save
404 mv -f config.h config.h-ntfs_save 2>/dev/null
405 touch config.h
406 captive_save_CPPFLAGS="$CPPFLAGS"
407 CPPFLAGS="$CPPFLAGS -I."        # for "config.h" touched above
408 AC_CHECK_HEADERS(ntfs/types.h ntfs/volume.h,,[
409         have_libntfs_includes=false
410         AC_MSG_WARN([Captive requires ntfs/* include files (of ntfsprogs-devel) for --enable-install-pkg.])
411         ])
412 CPPFLAGS="$captive_save_CPPFLAGS"
413 rm -f config.h
414 mv -f config.h-ntfs_save config.h 2>/dev/null
415
416 LIBNTFS_LIBS=""
417 AC_CHECK_LIB(ntfs,ntfs_mount,[ LIBNTFS_LIBS="-lntfs" ],
418         [ AC_MSG_WARN([Captive requires libntfs (of ntfsprogs-devel) for --enable-install-pkg.]) ])
419 AC_SUBST(LIBNTFS_LIBS)
420
421 have_libgnomevfs_gnome_vfs_filesystem_entry_h=false
422 if test x$enable_standalone = xyes;then
423         captive_save_CPPFLAGS="$CPPFLAGS"
424         CPPFLAGS="$CPPFLAGS $GNOME_VFS_MODULE_CFLAGS"
425         AC_CHECK_HEADERS(libgnomevfs/gnome-vfs-filesystem-entry.h,
426                 [ have_libgnomevfs_gnome_vfs_filesystem_entry_h=true ],
427                 [ AC_MSG_WARN([Captive --enable-install-pkg with --enable-standalone requires patched GnomeVFS. See:
428         http://bugzilla.gnome.org/show_bug.cgi?id=47053]) ])
429         CPPFLAGS="$captive_save_CPPFLAGS"
430 fi
431
432 LIBNTFS_GNOMEVFS_LIBS=""
433 if test x$enable_standalone = xyes;then
434         LIBNTFS_GNOMEVFS_LIBS="-L/usr/lib/gnome-vfs-2.0/modules -lntfs-gnomevfs"
435         captive_save_CFLAGS="$CFLAGS"
436         captive_save_LIBS="$LIBS"
437         CFLAGS="$CFLAGS $GNOME_VFS_MODULE_CFLAGS"
438         LIBS="  $LIBS   $GNOME_VFS_MODULE_LIBS   $LIBNTFS_GNOMEVFS_LIBS"
439         AC_CHECK_FUNCS(vfs_module_init,,[
440                 LIBNTFS_GNOMEVFS_LIBS=""
441                 AC_MSG_WARN([Captive --enable-install-pkg with --enable-standalone requires GnomeVFS libntfs-gnomevfs.])
442                 ])
443         CFLAGS="$captive_save_CFLAGS"
444         LIBS="$captive_save_LIBS"
445 fi
446 AC_SUBST(LIBNTFS_GNOMEVFS_LIBS)
447
448 # AC_ARG_ENABLE(install-pkg,[--enable-install-pkg=[no/yes/auto]],,enable_install_pkg=auto)
449 have_gnome=false
450 GLADE_W_INIT([
451         ./src/install/acquire/ui-gnome-interface.c
452         ./src/install/acquire/ui-gnome-interface.h
453         ./src/install/acquire/ui-gnome-callbacks.h
454         ./src/install/acquire/ui-gnome-support.c
455         ./src/install/acquire/ui-gnome-support.h
456         ],[$enable_install_pkg],[
457                 if true \
458                                 && $have_libxml_xmlreader_h \
459                                 && $have_libntfs_includes \
460                                 && test -n "$LIBNTFS_LIBS" \
461                                 && ( test x$enable_standalone != xyes || ( true \
462                                         && $have_libgnomevfs_gnome_vfs_filesystem_entry_h \
463                                         && test -n "$LIBNTFS_GNOMEVFS_LIBS" \
464                                         ) ) \
465                                 ;then
466                         glade_addon=yes
467                 fi
468                 ])
469 if $have_gnome;then
470         GNOMEUI_CFLAGS="$GNOMEUI_CFLAGS -DCAPTIVE_USING_GNOMEUI"
471 fi
472 AC_SUBST(GNOMEUI_CFLAGS)
473 AC_SUBST(GNOMEUI_LIBS)
474 dnl Do not: AM_CONDITIONAL(HAVE_LIBNTFS,[ test -n "$LIBNTFS_LIBS" ])
475 dnl as we do not need it as we are conditioned by ENABLE_INSTALL_PKG
476 AM_CONDITIONAL(HAVE_GLADE_WRITESOURCE,[ test "x$PATH_GLADE" != "x" ])
477 dnl Do not: AM_CONDITIONAL(BUILD_GLADESRC,[ test "xyes" = "x$BUILD_GLADESRC" ])
478 dnl as we do not need it as we are conditioned by ENABLE_INSTALL_PKG
479 GNOME_ADDON_LIBS=""
480 if test "x$BUILD_GLADESRC_TRUE" = "x"
481 then
482         AC_CHECK_LIB(Xi,XOpenDevice,GNOME_ADDON_LIBS="$GNOME_ADDON_LIBS -lXi")
483 fi
484 AC_SUBST(GNOME_ADDON_LIBS)
485 dnl $BUILD_GLADESRC is already conditioned by $enable_install_pkg by GLADE_W_INIT()
486 AM_CONDITIONAL(ENABLE_INSTALL_PKG,[ test "xyes" = "x$BUILD_GLADESRC" ])
487
488 dnl Do not use AC_REPLACE_FUNCS() as we need to link it selectively:
489 GNOME_VFS_READ_ENTIRE_FILE_O=""
490 captive_save_CFLAGS="$CFLAGS"
491 captive_save_LIBS="$LIBS"
492 CFLAGS="$CFLAGS $GNOME_VFS_MODULE_CFLAGS"
493 LIBS="$LIBS $GNOME_VFS_MODULE_LIBS"
494 AC_CHECK_FUNCS(gnome_vfs_read_entire_file,,
495         [ GNOME_VFS_READ_ENTIRE_FILE_O='gnome_vfs_read_entire_file.$(OBJEXT)' ])
496 CFLAGS="$captive_save_CFLAGS"
497 LIBS="$captive_save_LIBS"
498 AC_SUBST(GNOME_VFS_READ_ENTIRE_FILE_O)
499
500 if test x$enable_standalone = xyes;then
501         AC_DEFINE(ENABLE_STANDALONE,,[Provide initialization for static-build])
502 fi
503 AM_CONDITIONAL(ENABLE_STANDALONE,[test x$enable_standalone = xyes])
504
505 fontsdir=
506 if test x$enable_standalone_fonts != xno;then
507         AC_DEFINE_UNQUOTED(STANDALONE_FONTSDIR,"$enable_standalone_fonts",
508                         [Fonts installation directory for static-build])
509         fontsdir="$enable_standalone_fonts"
510 fi
511 AC_SUBST(fontsdir)
512 AM_CONDITIONAL(ENABLE_STANDALONE_FONTS,[test "$enable_standalone_fonts" != "no"])
513 dnl $have_gnome should be provided by: GLADE_W_INIT()
514 if test x$have_gnome != xtrue -a x$have_gnome != xfalse;then
515         AC_MSG_ERROR([INTERNAL: [GLADE_W_INIT()] expected here])
516 fi
517 AM_CONDITIONAL(HAVE_GNOME,[test "$have_gnome" = "true"])
518
519 yum_repos_ddir=
520 if test x$enable_standalone_yum != xno;then
521         yum_repos_ddir="$enable_standalone_yum"
522 fi
523 AC_SUBST(yum_repos_ddir)
524 AM_CONDITIONAL(ENABLE_STANDALONE_YUM_REPOS_D,[test "$enable_standalone_yum" != "no"])
525
526 AC_SUBST(CFLAGS)
527 AC_SUBST(LIBS)
528
529 dnl "Makefile" output files MUST have pathnames incl./excl. "./" prefix as specified!
530 dnl FIXME: Why the rule above was written here?
531 AC_OUTPUT([
532 captive.spec
533 ./src/libcaptive/captive.pod.pl
534 ./src/libcaptive/client/options.pod.pl
535 ./src/client/cmdline/captive-cmdline.pod.pl
536 ./src/client/lufs/lufs-captivefs.pod.pl
537 ./src/client/lufs/mount.captive.pod.pl
538 ./src/client/lufs/mount.captive
539 ./src/client/fuse/mount.captive.pod.pl
540 ./src/client/sandbox-server/captive-sandbox-server.pod.pl
541 ./src/install/fstab/captive-install-fstab.pod.pl
542 ./src/install/acquire/captive-install-acquire.pod.pl
543 ./src/client/gnomevfs/captive.conf
544 ./po/Makefile.in
545 ./macros/glade-w.sh
546 ./debian/changelog
547 Makefile
548 ./macros/Makefile
549 ./src/Makefile
550 ./src/libcaptive/Makefile
551 ./src/libcaptive/include/Makefile
552 ./src/libcaptive/include/captive/Makefile
553 ./src/libcaptive/include/reactos/Makefile
554 ./src/libcaptive/include/reactos/ddk/Makefile
555 ./src/libcaptive/include/reactos/ddk/i386/Makefile
556 ./src/libcaptive/include/reactos/internal/Makefile
557 ./src/libcaptive/include/reactos/internal/i386/Makefile
558 ./src/libcaptive/include/reactos/napi/Makefile
559 ./src/libcaptive/include/reactos/ntos/Makefile
560 ./src/libcaptive/reactos/Makefile
561 ./src/libcaptive/reactos/include/Makefile
562 ./src/libcaptive/reactos/hal/Makefile
563 ./src/libcaptive/reactos/hal/halx86/Makefile
564 ./src/libcaptive/reactos/ntoskrnl/Makefile
565 ./src/libcaptive/reactos/ntoskrnl/dbg/Makefile
566 ./src/libcaptive/reactos/ntoskrnl/ex/Makefile
567 ./src/libcaptive/reactos/ntoskrnl/fs/Makefile
568 ./src/libcaptive/reactos/ntoskrnl/io/Makefile
569 ./src/libcaptive/reactos/ntoskrnl/ke/Makefile
570 ./src/libcaptive/reactos/ntoskrnl/ldr/Makefile
571 ./src/libcaptive/reactos/ntoskrnl/mm/Makefile
572 ./src/libcaptive/reactos/ntoskrnl/nt/Makefile
573 ./src/libcaptive/reactos/ntoskrnl/ob/Makefile
574 ./src/libcaptive/reactos/ntoskrnl/ps/Makefile
575 ./src/libcaptive/reactos/ntoskrnl/rtl/Makefile
576 ./src/libcaptive/reactos/ntoskrnl/rtl/i386/Makefile
577 ./src/libcaptive/reactos/ntoskrnl/se/Makefile
578 ./src/libcaptive/halcaptive/Makefile
579 ./src/libcaptive/captivemodid/Makefile
580 ./src/libcaptive/cc/Makefile
581 ./src/libcaptive/cm/Makefile
582 ./src/libcaptive/ex/Makefile
583 ./src/libcaptive/fs/Makefile
584 ./src/libcaptive/io/Makefile
585 ./src/libcaptive/kd/Makefile
586 ./src/libcaptive/ke/Makefile
587 ./src/libcaptive/ldr/Makefile
588 ./src/libcaptive/mm/Makefile
589 ./src/libcaptive/nt/Makefile
590 ./src/libcaptive/ob/Makefile
591 ./src/libcaptive/po/Makefile
592 ./src/libcaptive/ps/Makefile
593 ./src/libcaptive/rtl/Makefile
594 ./src/libcaptive/se/Makefile
595 ./src/libcaptive/storage/Makefile
596 ./src/libcaptive/sandbox/Makefile
597 ./src/libcaptive/client/Makefile
598 ./src/client/Makefile
599 ./src/client/bug-replay/Makefile
600 ./src/client/cmdline/Makefile
601 ./src/client/gnomevfs/Makefile
602 ./src/client/lufs/Makefile
603 ./src/client/fuse/Makefile
604 ./src/client/sandbox-server/Makefile
605 ./src/install/Makefile
606 ./src/install/libcaptive-install/Makefile
607 ./src/install/fstab/Makefile
608 ./src/install/acquire/Makefile
609 ./src/TraceFS/Makefile
610 ./src/w32-mod/Makefile
611 ./doc/Makefile
612 ./doc/apiref/Makefile
613 ./fonts/Makefile
614 ./fonts/fonts.conf
615 ./yum.repos.d/Makefile
616 ])
617
618 dnl FIXME: Why is "po/POTFILES" being substituted?
619 make -C src distfiles DISTFILES_PRINT=1 \
620                 |sed -n 's/^:DISTFILES: *\(.*\)$/\1/p'|tr ' ' '\n'|grep . >po/POTFILES.in
621 make -C po Makefile
622
623 echo done.