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.9cvs)
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"])
66 AC_ARG_WITH(sandbox-setuid,
67 [ --with-sandbox-setuid=user non-privileged user for captive-sandbox-server (def.=captive)],
68 [ CAPTIVE_SANDBOX_SETUID="$withval" ],[ CAPTIVE_SANDBOX_SETUID="captive" ])
69 AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_SETUID,"$CAPTIVE_SANDBOX_SETUID",
70 [non-privileged user for captive-sandbox-server])
72 AC_ARG_WITH(sandbox-setgid,
73 [ --with-sandbox-setgid=group non-privileged group for captive-sandbox-server (def.=captive)],
74 [ CAPTIVE_SANDBOX_SETGID="$withval" ],[ CAPTIVE_SANDBOX_SETGID="captive" ])
75 AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_SETGID,"$CAPTIVE_SANDBOX_SETGID",
76 [non-privileged group for captive-sandbox-server])
78 AC_ARG_WITH(sandbox-chroot,
79 [ --with-sandbox-chroot=dir root-owned directory for captive-sandbox-server (def.=/var/lib/captive)],
80 [ CAPTIVE_SANDBOX_CHROOT="$withval" ],[ CAPTIVE_SANDBOX_CHROOT="/var/lib/captive" ])
81 AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_CHROOT,"$CAPTIVE_SANDBOX_CHROOT",
82 [root-owned directory for captive-sandbox-server])
83 AC_SUBST(CAPTIVE_SANDBOX_CHROOT)
85 dnl Permit 'if IS_FALSE' for Makefile.am-s; symbol 'FALSE' forbidden by automake
86 AM_CONDITIONAL(IS_FALSE,false)
88 dnl Separate 'acconfig.h' is no longer recommended by autoconf
90 #ifndef _CAPTIVE_CONFIG_H
91 #define _CAPTIVE_CONFIG_H 1
94 /* Do not place any stuff to AH_TOP as some of its includes
95 * would discard the effect of _FILE_OFFSET_BITS by AC_SYS_LARGEFILE.
99 /* <libintl.h> is taken from "$(top_srcdir)/intl" if system doesn't provide intl */
100 # include <libintl.h>
102 # define _(String) dgettext (PACKAGE,String)
104 # define _(String) gettext (String)
105 #endif /* LIBCAPTIVE */
107 # define N_(String) gettext_noop (String)
109 # define N_(String) (String)
111 #else /* !ENABLE_NLS */
112 /* Stubs that do something close enough. */
113 # define textdomain(String) (String)
114 # define gettext(String) (String)
115 # define dgettext(Domain,Message) (Message)
116 # define dcgettext(Domain,Message,Type) (Message)
117 # define bindtextdomain(Domain,Directory) (Domain)
118 # define _(String) (String)
119 # define N_(String) (String)
120 #endif /* !ENABLE_NLS */
122 #include <glib/gtypes.h> /* for 'gchar' */
123 #define G_LOG_DOMAIN ((const gchar *)"Captive")
125 /* Supplemental definitions not possible in this file. */
127 #include "captive/config2.h"
130 #endif /* !_CAPTIVE_CONFIG_H */
133 AM_PATH_GLIB_2_0(,,[AC_MSG_ERROR([Captive requires glib-2.0 library.])],[gmodule gobject])
134 dnl Force glib for the whole package
135 CFLAGS="$CFLAGS $GLIB_CFLAGS"
136 LIBS="$LIBS $GLIB_LIBS"
139 AC_CHECK_LIB(popt,poptParseArgvString,[POPT_LIBS="-lpopt"],[AC_MSG_ERROR([Captive requires popt library.])])
142 AC_ARG_WITH(readline, [ --with-readline=[no/yes/auto] cmdline client w/line editing [default=auto]],,with_readline=auto)
143 AC_CHECK_HEADERS(readline/history.h)
144 dnl Check for libraries, if needed by configuration options.
145 if test "$with_readline" != "no"
147 if test -d "/usr/lib/termcap"
149 READLINE_LDFLAGS="$READLINE_LDFLAGS -L/usr/lib/termcap"
151 have_libreadline=false
153 for need in "" termcap ncurses; do
154 if test "x$need" != "x"
156 captive_save_LIBS="$LIBS"
157 AC_CHECK_LIB($need, main,,
158 [ need_failed="$need_failed $need"
161 LIBS="$captive_save_LIBS"
166 dnl Prevent AC_CHECK_LIB() here as it would _cache_ the value ignoring
167 dnl our ever-changing "additiona libraries" parameter
168 captive_save_LIBS="$LIBS"
169 LIBS="-lreadline $lneed $READLINE_LIBS"
170 AC_TRY_LINK(,[ main() ],
171 [ have_libreadline=true
172 READLINE_LIBS="$LIBS" ])
173 LIBS="$captive_save_LIBS"
181 AC_DEFINE(HAVE_LIBREADLINE,,[Use functions from libreadline?])
182 AC_CHECK_LIB(readline, add_history,
183 AC_DEFINE(HAVE_ADD_HISTORY,,[Use 'history' extension of libreadline?]),,
186 for need in $need_failed; do
187 AC_MSG_WARN(captive recommends $need library as your readline library
190 if test "$with_readline" = "yes"
192 AC_MSG_ERROR([captive did not find the requested readline library for its cmdline client line editing capability.])
194 AC_MSG_WARN([captive recommends readline library for its cmdline client line editing capability.])
198 AC_SUBST(READLINE_LIBS)
199 AC_SUBST(READLINE_LDFLAGS)
201 PKG_CHECK_MODULES(GNOME_VFS_MODULE,gnome-vfs-module-2.0)
202 AC_SUBST(GNOME_VFS_MODULE_CFLAGS)
203 AC_SUBST(GNOME_VFS_MODULE_LIBS)
205 dnl Check for 2.5.9 for: http://bugzilla.gnome.org/show_bug.cgi?id=117702
206 dnl Check the version - impossible to reliably check the missing feature.
207 PKG_CHECK_MODULES(LIBXML,libxml-2.0 >= 2.5.9,[ have_libxml_buffering=true ],[
208 dnl Disable bug-replay(1) build if not met; --bug-pathname would be still OK.
209 PKG_CHECK_MODULES(LIBXML,libxml-2.0,[ have_libxml_buffering=false ])
211 dnl We also condition 'HAVE_LIBXML_XMLREADER_H' by 'HAVE_LIBXML_BUFFERING'
212 dnl as we have no use for xmlreader without working libxml buffering of 2.5.9.
213 AM_CONDITIONAL(HAVE_LIBXML_BUFFERING,$have_libxml_buffering)
214 if $have_libxml_buffering;then
215 AC_DEFINE(HAVE_LIBXML_BUFFERING,,[libxml2 correctly reads textnodes by its xmlTextReader.])
217 AC_SUBST(LIBXML_CFLAGS)
218 AC_SUBST(LIBXML_LIBS)
220 PKG_CHECK_MODULES(OPENSSL,openssl,,[
221 dnl At least Debian-3.0r1 has openssl but without its .pc module.
222 AC_CHECK_LIB(crypto,MD5,[
224 OPENSSL_LIBS="-lcrypto"
225 ],[AC_MSG_ERROR([Captive requires crypto library (of openssl).])])
227 AC_SUBST(OPENSSL_CFLAGS)
228 AC_SUBST(OPENSSL_LIBS)
230 have_lufs_includes=true
231 AC_CHECK_HEADERS(lufs/fs.h lufs/proto.h,,[ have_lufs_includes=false ])
232 AM_CONDITIONAL(HAVE_LUFS_INCLUDES,$have_lufs_includes)
234 dnl for $(top_srcdir)/src/libcaptive/sandbox/split-sandbox.c
235 AM_PATH_LINC(,,[AC_MSG_ERROR([Captive requires linc library used by ORBit.])])
237 dnl for $(top_srcdir)/src/libcaptive/client/
238 dnl Do not use '[client server]' as $4 to prevent: configure: test: too many arguments
239 dnl - currently this argument is not used by 'orbit2-config' in any way anyway
240 AM_PATH_ORBIT2(,,[AC_MSG_ERROR([Captive requires ORBit library.])])
246 dnl "Makefile" output files MUST have pathnames incl./excl. "./" prefix as specified!
253 ./src/libcaptive/Makefile
254 ./src/libcaptive/include/Makefile
255 ./src/libcaptive/include/captive/Makefile
256 ./src/libcaptive/include/reactos/Makefile
257 ./src/libcaptive/include/reactos/ddk/Makefile
258 ./src/libcaptive/include/reactos/ddk/i386/Makefile
259 ./src/libcaptive/include/reactos/internal/Makefile
260 ./src/libcaptive/include/reactos/internal/i386/Makefile
261 ./src/libcaptive/include/reactos/napi/Makefile
262 ./src/libcaptive/include/reactos/ntos/Makefile
263 ./src/libcaptive/reactos/Makefile
264 ./src/libcaptive/reactos/include/Makefile
265 ./src/libcaptive/reactos/hal/Makefile
266 ./src/libcaptive/reactos/hal/halx86/Makefile
267 ./src/libcaptive/reactos/ntoskrnl/Makefile
268 ./src/libcaptive/reactos/ntoskrnl/dbg/Makefile
269 ./src/libcaptive/reactos/ntoskrnl/ex/Makefile
270 ./src/libcaptive/reactos/ntoskrnl/fs/Makefile
271 ./src/libcaptive/reactos/ntoskrnl/io/Makefile
272 ./src/libcaptive/reactos/ntoskrnl/ke/Makefile
273 ./src/libcaptive/reactos/ntoskrnl/ldr/Makefile
274 ./src/libcaptive/reactos/ntoskrnl/mm/Makefile
275 ./src/libcaptive/reactos/ntoskrnl/nt/Makefile
276 ./src/libcaptive/reactos/ntoskrnl/ob/Makefile
277 ./src/libcaptive/reactos/ntoskrnl/ps/Makefile
278 ./src/libcaptive/reactos/ntoskrnl/rtl/Makefile
279 ./src/libcaptive/reactos/ntoskrnl/rtl/i386/Makefile
280 ./src/libcaptive/reactos/ntoskrnl/se/Makefile
281 ./src/libcaptive/halcaptive/Makefile
282 ./src/libcaptive/cc/Makefile
283 ./src/libcaptive/cm/Makefile
284 ./src/libcaptive/ex/Makefile
285 ./src/libcaptive/fs/Makefile
286 ./src/libcaptive/io/Makefile
287 ./src/libcaptive/kd/Makefile
288 ./src/libcaptive/ke/Makefile
289 ./src/libcaptive/ldr/Makefile
290 ./src/libcaptive/mm/Makefile
291 ./src/libcaptive/nt/Makefile
292 ./src/libcaptive/ob/Makefile
293 ./src/libcaptive/po/Makefile
294 ./src/libcaptive/ps/Makefile
295 ./src/libcaptive/rtl/Makefile
296 ./src/libcaptive/se/Makefile
297 ./src/libcaptive/storage/Makefile
298 ./src/libcaptive/sandbox/Makefile
299 ./src/libcaptive/client/Makefile
300 ./src/client/Makefile
301 ./src/client/bug-replay/Makefile
302 ./src/client/cmdline/Makefile
303 ./src/client/gnomevfs/Makefile
304 ./src/client/lufs/Makefile
305 ./src/client/sandbox-server/Makefile
306 ./src/TraceFS/Makefile
308 ./doc/apiref/Makefile
309 ./src/client/gnomevfs/captive.conf
312 dnl FIXME: Why is "po/POTFILES" being substituted?
313 make -C src distfiles DISTFILES_PRINT=1 \
314 |sed -n 's/^:DISTFILES: *\(.*\)$/\1/p'|tr ' ' '\n'|grep . >po/POTFILES.in