2 # Source file to generate "./configure" to prepare package for compilation
3 # Copyright (C) 2002-2003 Jan Kratochvil <project-captive@jankratochvil.net>
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
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.
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
19 AC_INIT(src/libcaptive/Makefile-libcaptive.am)
20 dnl 2.53 for AM_GLIB_GNU_GETTEXT:
22 AM_INIT_AUTOMAKE(captive,0.9)
23 AM_CONFIG_HEADER(config.h)
25 dnl Call AC_PROG_CC before AC_ISC_POSIX.
26 AC_PROG_CC(gcc3 gcc-3.0 gcc cc)
30 #error "GCC version 3.0+ required at least for ReactOS anonymous unions"
32 ],,[AC_MSG_ERROR([Captive requires GCC version 3.0+.])])
33 dnl Prevent "AC_TRY_COMPILE was called before AC_ISC_POSIX":
41 dnl gettext localization.
42 dnl Use simpler AM_GLIB_GNU_GETTEXT instead of AM_GNU_GETTEXT
43 dnl as we depend on glib and glib requires system installed gettext anyway.
44 dnl http://lists.gnome.org/archives/gtk-devel-list/2003-April/msg00066.html
45 dnl Special 'GETTEXT_PACKAGE' is required by glib gettext.
47 GETTEXT_PACKAGE="$PACKAGE"
48 AC_SUBST(GETTEXT_PACKAGE)
52 dnl AM_CONDITIONAL needs to be here explicitely for doc/apiref/Makefile rebuild
53 AM_CONDITIONAL(ENABLE_GTK_DOC,[test x$enable_gtk_doc = xyes])
54 AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL,[test -n "$LIBTOOL"])
56 dnl Do not discard 'CFLAGS' settings as they may have been passed us by rpmbuild(8)
58 dnl Define MAINTAINER_MODE in config.h.
59 if test "$USE_MAINTAINER_MODE" = "yes";then
60 AC_DEFINE(MAINTAINER_MODE,,[Turn even some software behaviour according to MAINTAINER_MODE.])
61 CFLAGS="$CFLAGS -ggdb3 -Wall -Wstrict-prototypes -Wsign-compare" ## FIXME: fix all sources: -Wsign-compare
63 dnl Some Makefiles use additional tests etc.
64 AM_CONDITIONAL(MAINTAINER_MODE,[test "$USE_MAINTAINER_MODE" = "yes"])
67 AC_ARG_ENABLE(man-pages,
68 [ --enable-man-pages=no/yes/auto pod2man(1) required for man pages (def.=yes)],,enable_man_pages=yes)
69 AC_ARG_ENABLE(sbin-mountdir,
70 [ --enable-sbin-mountdir=DIR mount(8) 'mount.captive' directory (def.=/sbin)],,
71 [ enable_sbin_mountdir="/sbin" ])
72 AC_ARG_ENABLE(sbin-mount-fs,
73 [ --enable-sbin-mount-fs=FS1:FS2 sbin-mount pre-installed symlinks (def.=ntfs:fastfat:cdfs:ext2fsd)],,
74 [ enable_sbin_mount_fs="ntfs:fastfat:cdfs:ext2fsd" ])
75 AC_ARG_ENABLE(sandbox-setuid,
76 [ --enable-sandbox-setuid=USER non-privileged user for captive-sandbox-server (def.=captive)],
77 [ CAPTIVE_SANDBOX_SETUID="$enableval" ],[ CAPTIVE_SANDBOX_SETUID="captive" ])
78 AC_ARG_ENABLE(sandbox-setgid,
79 [ --enable-sandbox-setgid=GROUP non-privileged group for captive-sandbox-server (def.=captive)],
80 [ CAPTIVE_SANDBOX_SETGID="$enableval" ],[ CAPTIVE_SANDBOX_SETGID="captive" ])
81 AC_ARG_ENABLE(sandbox-chroot,
82 [ --enable-sandbox-chroot=DIR root-owned directory for captive-sandbox-server (def.=/var/lib/captive)],
83 [ CAPTIVE_SANDBOX_CHROOT="$enableval" ],[ CAPTIVE_SANDBOX_CHROOT="/var/lib/captive" ])
84 AC_ARG_ENABLE(bug-replay,
85 [ --enable-bug-replay=no/yes/auto compile debugging tool (def.=auto)],,enable_bug_replay=auto)
87 [ --enable-lufs=no/yes/auto compile LUFS filesystem module (def.=auto)],,enable_lufs=auto)
88 AC_ARG_ENABLE(install-pkg,
89 [ --enable-install-pkg=no/yes/auto compile installation utils (def.=auto)],,enable_install_pkg=auto)
92 # AC_ARG_ENABLE(sbin-mountdir,[--enable-sbin-mountdir=DIR],,[enable_sbin_mountdir="/sbin"])
93 AM_CONDITIONAL(ENABLE_SBIN_MOUNT,[test "$enable_sbin_mount" != "no"])
94 AC_SUBST(enable_sbin_mountdir)
96 # AC_ARG_ENABLE(sbin-mount-fs,[--enable-sbin-mount-fs=FS1:FS2],,[enable_sbin_mount_fs="ntfs:fastfat:cdfs:ext2fsd"])
97 AC_SUBST(enable_sbin_mount_fs)
99 # AC_ARG_ENABLE(sandbox-setuid,[--enable-sandbox-setuid=USER],,[CAPTIVE_SANDBOX_SETUID="captive"])
100 AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_SETUID,"$CAPTIVE_SANDBOX_SETUID",
101 [non-privileged user for captive-sandbox-server])
103 # AC_ARG_ENABLE(sandbox-setgid,[--enable-sandbox-setgid=GROUP],,[CAPTIVE_SANDBOX_SETGID="captive"])
104 AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_SETGID,"$CAPTIVE_SANDBOX_SETGID",
105 [non-privileged group for captive-sandbox-server])
107 # AC_ARG_ENABLE(sandbox-chroot,[--enable-sandbox-chroot=DIR],,[CAPTIVE_SANDBOX_CHROOT="/var/lib/captive"])
108 AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_CHROOT,"$CAPTIVE_SANDBOX_CHROOT",
109 [root-owned directory for captive-sandbox-server])
110 AC_SUBST(CAPTIVE_SANDBOX_CHROOT)
112 dnl Permit 'if NEVER' for Makefile.am-s; symbol 'FALSE' forbidden by automake
113 AM_CONDITIONAL(NEVER,false)
116 AC_PATH_PROGS(PERL,perl5 perl)
117 if test '!' -f ./src/libcaptive/ke/exports.c -a -z "$PERL";then
118 AC_MSG_ERROR([perl(1) required as './src/libcaptive/ke/exports.c' is not found.])
120 AM_CONDITIONAL(HAVE_PERL,test -n "$PERL")
123 AC_PATH_PROGS(POD2MAN,pod2man)
124 AM_CONDITIONAL(HAVE_POD2MAN,[ test -n "$POD2MAN" ])
125 if test x$enable_man_pages = xyes;then
126 if test -z "$POD2MAN";then
127 AC_MSG_ERROR([captive requires pod2man(1) for man pages; try --disable-man-pages.])
129 if test -z "$PERL";then
130 AC_MSG_ERROR([captive requires perl(1) for man pages; try --disable-man-pages.])
132 elif test x$enable_man_pages != xno;then
133 if test -z "$POD2MAN";then
134 AC_MSG_WARN([captive requires pod2man(1) for man pages by --enable-man-pages; mans will not be installed.])
136 if test -z "$PERL";then
137 AC_MSG_WARN([captive requires perl(1) for man pages by --enable-man-pages; mans will not be installed.])
140 AM_CONDITIONAL(ENABLE_MAN_PAGES,[ test x$enable_man_pages != xno -a -n "$POD2MAN" -a -n "$PERL" ])
142 dnl Separate 'acconfig.h' is no longer recommended by autoconf
144 #ifndef _CAPTIVE_CONFIG_H
145 #define _CAPTIVE_CONFIG_H 1
148 /* Do not place any stuff to AH_TOP as some of its includes
149 * would discard the effect of _FILE_OFFSET_BITS by AC_SYS_LARGEFILE.
153 /* <libintl.h> is taken from "$(top_srcdir)/intl" if system doesn't provide intl */
154 # include <libintl.h>
156 # define _(String) dgettext (PACKAGE,String)
158 # define _(String) gettext (String)
159 #endif /* LIBCAPTIVE */
161 # define N_(String) gettext_noop (String)
163 # define N_(String) (String)
165 #else /* !ENABLE_NLS */
166 /* Stubs that do something close enough. */
167 # define textdomain(String) (String)
168 # define gettext(String) (String)
169 # define dgettext(Domain,Message) (Message)
170 # define dcgettext(Domain,Message,Type) (Message)
171 # define bindtextdomain(Domain,Directory) (Domain)
172 # define _(String) (String)
173 # define N_(String) (String)
174 #endif /* !ENABLE_NLS */
176 #include <glib/gtypes.h> /* for 'gchar' */
177 #define G_LOG_DOMAIN ((const gchar *)"Captive")
179 /* Supplemental definitions not possible in this file. */
181 #include "captive/config2.h"
184 #endif /* !_CAPTIVE_CONFIG_H */
187 AM_PATH_GLIB_2_0(,,[AC_MSG_ERROR([Captive requires glib-2.0 library.])],[gmodule gobject])
188 dnl Force glib for the whole package
189 CFLAGS="$CFLAGS $GLIB_CFLAGS"
190 LIBS="$LIBS $GLIB_LIBS"
193 AC_CHECK_LIB(popt,poptParseArgvString,[POPT_LIBS="-lpopt"],[AC_MSG_ERROR([Captive requires popt library.])])
196 AC_ARG_WITH(readline,[ --with-readline=[no/yes/auto] clients with line editing (def.=auto)],,with_readline=auto)
197 AC_CHECK_HEADERS(readline/history.h)
198 dnl Check for libraries, if needed by configuration options.
199 if test "$with_readline" != "no"
201 if test -d "/usr/lib/termcap"
203 READLINE_LDFLAGS="$READLINE_LDFLAGS -L/usr/lib/termcap"
205 have_libreadline=false
207 for need in "" termcap ncurses; do
208 if test "x$need" != "x"
210 captive_save_LIBS="$LIBS"
211 AC_CHECK_LIB($need,main,,
212 [ need_failed="$need_failed $need"
215 LIBS="$captive_save_LIBS"
220 dnl Prevent AC_CHECK_LIB() here as it would _cache_ the value ignoring
221 dnl our ever-changing "additiona libraries" parameter
222 captive_save_LIBS="$LIBS"
223 LIBS="-lreadline $lneed $READLINE_LIBS"
224 AC_TRY_LINK(,[ main() ],
225 [ have_libreadline=true
226 READLINE_LIBS="$LIBS" ])
227 LIBS="$captive_save_LIBS"
235 AC_DEFINE(HAVE_LIBREADLINE,,[Use functions from libreadline?])
236 AC_CHECK_LIB(readline,add_history,
237 AC_DEFINE(HAVE_ADD_HISTORY,,[Use 'history' extension of libreadline?]),,
240 for need in $need_failed; do
241 AC_MSG_WARN(captive recommends $need library as your readline library
244 if test "$with_readline" = "yes"
246 AC_MSG_ERROR([captive did not find the requested readline library for its client line editing capability.])
248 AC_MSG_WARN([captive recommends readline library for its client line editing capability.])
252 AC_SUBST(READLINE_LIBS)
253 AC_SUBST(READLINE_LDFLAGS)
255 PKG_CHECK_MODULES(GNOME_VFS_MODULE,gnome-vfs-module-2.0)
256 AC_SUBST(GNOME_VFS_MODULE_CFLAGS)
257 AC_SUBST(GNOME_VFS_MODULE_LIBS)
258 PKG_CHECK_MODULES(GNOME_VFS,gnome-vfs-2.0)
259 AC_SUBST(GNOME_VFS_CFLAGS)
260 AC_SUBST(GNOME_VFS_LIBS)
262 # AC_ARG_ENABLE(bug-replay,[--enable-bug-replay=[no/yes/auto]],,enable_bug_replay=auto)
263 dnl Check for 2.5.9 for: http://bugzilla.gnome.org/show_bug.cgi?id=117702
264 dnl Check the version - impossible to reliably check the missing feature.
265 PKG_CHECK_MODULES(LIBXML,libxml-2.0 >= 2.5.9,[ have_libxml_buffering=true ],[
266 dnl Disable bug-replay(1) build if not met; --bug-pathname would be still OK.
267 PKG_CHECK_MODULES(LIBXML,libxml-2.0,[ have_libxml_buffering=false ])
269 dnl We also condition 'HAVE_LIBXML_XMLREADER_H' by 'HAVE_LIBXML_BUFFERING'
270 dnl as we have no use for xmlreader without working libxml buffering of 2.5.9.
271 AM_CONDITIONAL(ENABLE_BUG_REPLAY,[$have_libxml_buffering && test x$enable_bug_replay != xno])
272 if $have_libxml_buffering;then
273 AC_DEFINE(HAVE_LIBXML_BUFFERING,,[libxml2 correctly reads textnodes by its xmlTextReader.])
275 if test x$enable_bug_replay = xyes;then
276 AC_MSG_ERROR([captive require libxml2 at least 2.5.9 for --enable-bug-replay feature.])
277 elif test x$enable_bug_replay != xno;then
278 AC_MSG_WARN([libxml2 at least 2.5.9 required --enable-bug-replay feature; disabled now.])
281 AC_SUBST(LIBXML_CFLAGS)
282 AC_SUBST(LIBXML_LIBS)
284 PKG_CHECK_MODULES(OPENSSL,openssl,,[
285 dnl At least Debian-3.0r1 has openssl but without its .pc module.
286 AC_CHECK_LIB(crypto,MD5,[
288 OPENSSL_LIBS="-lcrypto"
289 ],[AC_MSG_ERROR([Captive requires crypto library (of openssl).])])
291 AC_SUBST(OPENSSL_CFLAGS)
292 AC_SUBST(OPENSSL_LIBS)
294 # AC_ARG_ENABLE(lufs,[--enable-lufs=[no/yes/auto]],,enable_lufs=auto)
295 if test x$enable_lufs != no;then
296 have_lufs_includes=true
297 dnl If ACTION-IF-NOT-FOUND is given, it is executed when one of the header
298 dnl files is not found.
299 AC_CHECK_HEADERS(lufs/fs.h lufs/proto.h,,[ have_lufs_includes=false ])
300 if test x$have_lufs_includes = xfalse;then
301 if test x$enable_lufs = xyes;then
302 AC_MSG_ERROR([LUFS client was requested (--enable-lufs) but no LUFS include files were found. Install 'lufs-*-*captive*' package.])
304 AC_MSG_WARN([LUFS client not being compiled as no LUFS include files were found. Install 'lufs-*-*captive*' package.])
307 AC_CHECK_TYPES([struct lufs_sbattr],,[
308 dnl FIXME: Include 'lufs' version when 'lufs_sbattr' gets integrated:
309 if $have_lufs_includes && test x$enable_lufs = xyes;then
310 AC_MSG_ERROR([Although LUFS include files were found they are too old. You may also use --enable-lufs=auto.])
312 AC_MSG_WARN([Although LUFS include files were found they are too old. df(1) will not show available NTFS disk space.])
314 ],[#include <lufs/proto.h>])
316 AM_CONDITIONAL(ENABLE_LUFS,[ $have_lufs_includes && test x$enable_lufs != no ])
318 dnl for $(top_srcdir)/src/libcaptive/sandbox/split-sandbox.c
319 AM_PATH_LINC(,,[AC_MSG_ERROR([Captive requires linc library used by ORBit.])])
321 dnl for $(top_srcdir)/src/libcaptive/client/
322 dnl Do not use '[client server]' as $4 to prevent: configure: test: too many arguments
323 dnl - currently this argument is not used by 'orbit2-config' in any way anyway
324 AM_PATH_ORBIT2(,,[AC_MSG_ERROR([Captive requires ORBit library.])])
326 # AC_ARG_ENABLE(install-pkg,[--enable-install-pkg=[no/yes/auto]],,enable_install_pkg=auto)
328 ./src/install/acquire/ui-gnome-interface.c
329 ./src/install/acquire/ui-gnome-interface.h
330 ./src/install/acquire/ui-gnome-callbacks.h
331 ./src/install/acquire/ui-gnome-support.c
332 ./src/install/acquire/ui-gnome-support.h
333 ],[$enable_install_pkg],[
334 AC_CHECK_LIB(ntfs,ntfs_mount,[
335 LIBNTFS_LIBS="-lntfs"
339 AC_SUBST(GNOMEUI_CFLAGS)
340 AC_SUBST(GNOMEUI_LIBS)
341 AC_SUBST(LIBNTFS_LIBS)
342 # Do not: AM_CONDITIONAL(HAVE_LIBNTFS,[ test -n "$LIBNTFS_LIBS" ])
343 # as we do not need it as we are conditioned by ENABLE_INSTALL_PKG
344 AM_CONDITIONAL(HAVE_GLADE_WRITESOURCE,[ test "x$PATH_GLADE" != "x" ])
345 # Do not: AM_CONDITIONAL(BUILD_GLADESRC,[ test "xyes" = "x$BUILD_GLADESRC" ])
346 # as we do not need it as we are conditioned by ENABLE_INSTALL_PKG
348 if test "x$BUILD_GLADESRC_TRUE" = "x"
350 AC_CHECK_LIB(Xi,XOpenDevice,GNOME_ADDON_LIBS="$GNOME_ADDON_LIBS -lXi")
352 AC_SUBST(GNOME_ADDON_LIBS)
353 AM_CONDITIONAL(ENABLE_INSTALL_PKG,[ test "xyes" = "x$BUILD_GLADESRC" ])
359 dnl "Makefile" output files MUST have pathnames incl./excl. "./" prefix as specified!
360 dnl FIXME: Why the rule above was written here?
363 ./src/libcaptive/captive.pod.pl
364 ./src/libcaptive/client/options.pod.pl
365 ./src/client/cmdline/captive-cmdline.pod.pl
366 ./src/client/lufs/lufs-captivefs.pod.pl
367 ./src/client/lufs/mount.captive.pod.pl
368 ./src/client/lufs/mount.captive
369 ./src/client/sandbox-server/captive-sandbox-server.pod.pl
370 ./src/install/fstab/captive-install-fstab.pod.pl
371 ./src/install/acquire/captive-install-acquire.pod.pl
372 ./src/client/gnomevfs/captive.conf
379 ./src/libcaptive/Makefile
380 ./src/libcaptive/include/Makefile
381 ./src/libcaptive/include/captive/Makefile
382 ./src/libcaptive/include/reactos/Makefile
383 ./src/libcaptive/include/reactos/ddk/Makefile
384 ./src/libcaptive/include/reactos/ddk/i386/Makefile
385 ./src/libcaptive/include/reactos/internal/Makefile
386 ./src/libcaptive/include/reactos/internal/i386/Makefile
387 ./src/libcaptive/include/reactos/napi/Makefile
388 ./src/libcaptive/include/reactos/ntos/Makefile
389 ./src/libcaptive/reactos/Makefile
390 ./src/libcaptive/reactos/include/Makefile
391 ./src/libcaptive/reactos/hal/Makefile
392 ./src/libcaptive/reactos/hal/halx86/Makefile
393 ./src/libcaptive/reactos/ntoskrnl/Makefile
394 ./src/libcaptive/reactos/ntoskrnl/dbg/Makefile
395 ./src/libcaptive/reactos/ntoskrnl/ex/Makefile
396 ./src/libcaptive/reactos/ntoskrnl/fs/Makefile
397 ./src/libcaptive/reactos/ntoskrnl/io/Makefile
398 ./src/libcaptive/reactos/ntoskrnl/ke/Makefile
399 ./src/libcaptive/reactos/ntoskrnl/ldr/Makefile
400 ./src/libcaptive/reactos/ntoskrnl/mm/Makefile
401 ./src/libcaptive/reactos/ntoskrnl/nt/Makefile
402 ./src/libcaptive/reactos/ntoskrnl/ob/Makefile
403 ./src/libcaptive/reactos/ntoskrnl/ps/Makefile
404 ./src/libcaptive/reactos/ntoskrnl/rtl/Makefile
405 ./src/libcaptive/reactos/ntoskrnl/rtl/i386/Makefile
406 ./src/libcaptive/reactos/ntoskrnl/se/Makefile
407 ./src/libcaptive/halcaptive/Makefile
408 ./src/libcaptive/cc/Makefile
409 ./src/libcaptive/cm/Makefile
410 ./src/libcaptive/ex/Makefile
411 ./src/libcaptive/fs/Makefile
412 ./src/libcaptive/io/Makefile
413 ./src/libcaptive/kd/Makefile
414 ./src/libcaptive/ke/Makefile
415 ./src/libcaptive/ldr/Makefile
416 ./src/libcaptive/mm/Makefile
417 ./src/libcaptive/nt/Makefile
418 ./src/libcaptive/ob/Makefile
419 ./src/libcaptive/po/Makefile
420 ./src/libcaptive/ps/Makefile
421 ./src/libcaptive/rtl/Makefile
422 ./src/libcaptive/se/Makefile
423 ./src/libcaptive/storage/Makefile
424 ./src/libcaptive/sandbox/Makefile
425 ./src/libcaptive/client/Makefile
426 ./src/client/Makefile
427 ./src/client/bug-replay/Makefile
428 ./src/client/cmdline/Makefile
429 ./src/client/gnomevfs/Makefile
430 ./src/client/lufs/Makefile
431 ./src/client/sandbox-server/Makefile
432 ./src/install/Makefile
433 ./src/install/libcaptive-install/Makefile
434 ./src/install/fstab/Makefile
435 ./src/install/acquire/Makefile
436 ./src/TraceFS/Makefile
437 ./src/w32-mod/Makefile
439 ./doc/apiref/Makefile
442 dnl FIXME: Why is "po/POTFILES" being substituted?
443 make -C src distfiles DISTFILES_PRINT=1 \
444 |sed -n 's/^:DISTFILES: *\(.*\)$/\1/p'|tr ' ' '\n'|grep . >po/POTFILES.in