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)
55 dnl Do not discard 'CFLAGS' settings as they may have been passed us by rpmbuild(8)
57 dnl Define MAINTAINER_MODE in config.h.
58 if test "$USE_MAINTAINER_MODE" = "yes";then
59 AC_DEFINE(MAINTAINER_MODE,,[Turn even some software behaviour according to MAINTAINER_MODE.])
60 CFLAGS="$CFLAGS -ggdb3 -Wall -Wstrict-prototypes -Wsign-compare" ## FIXME: fix all sources: -Wsign-compare
62 dnl Some Makefiles use additional tests etc.
63 AM_CONDITIONAL(MAINTAINER_MODE,[test "$USE_MAINTAINER_MODE" = "yes"])
65 AC_ARG_WITH(sandbox-setuid,
66 [ --with-sandbox-setuid=user non-privileged user for captive-sandbox-server (def.=captive)],
67 [ CAPTIVE_SANDBOX_SETUID="$withval" ],[ CAPTIVE_SANDBOX_SETUID="captive" ])
68 AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_SETUID,"$CAPTIVE_SANDBOX_SETUID",
69 [non-privileged user for captive-sandbox-server])
71 AC_ARG_WITH(sandbox-setgid,
72 [ --with-sandbox-setgid=group non-privileged group for captive-sandbox-server (def.=captive)],
73 [ CAPTIVE_SANDBOX_SETGID="$withval" ],[ CAPTIVE_SANDBOX_SETGID="captive" ])
74 AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_SETGID,"$CAPTIVE_SANDBOX_SETGID",
75 [non-privileged group for captive-sandbox-server])
77 AC_ARG_WITH(sandbox-chroot,
78 [ --with-sandbox-chroot=dir root-owned directory for captive-sandbox-server (def.=/var/lib/captive)],
79 [ CAPTIVE_SANDBOX_CHROOT="$withval" ],[ CAPTIVE_SANDBOX_CHROOT="/var/lib/captive" ])
80 AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_CHROOT,"$CAPTIVE_SANDBOX_CHROOT",
81 [root-owned directory for captive-sandbox-server])
83 dnl Permit 'if IS_FALSE' for Makefile.am-s; symbol 'FALSE' forbidden by automake
84 AM_CONDITIONAL(IS_FALSE,false)
86 dnl Separate 'acconfig.h' is no longer recommended by autoconf
88 #ifndef _CAPTIVE_CONFIG_H
89 #define _CAPTIVE_CONFIG_H 1
92 /* Do not place any stuff to AH_TOP as some of its includes
93 * would discard the effect of _FILE_OFFSET_BITS by AC_SYS_LARGEFILE.
97 /* <libintl.h> is taken from "$(top_srcdir)/intl" if system doesn't provide intl */
100 # define _(String) dgettext (PACKAGE,String)
102 # define _(String) gettext (String)
103 #endif /* LIBCAPTIVE */
105 # define N_(String) gettext_noop (String)
107 # define N_(String) (String)
109 #else /* !ENABLE_NLS */
110 /* Stubs that do something close enough. */
111 # define textdomain(String) (String)
112 # define gettext(String) (String)
113 # define dgettext(Domain,Message) (Message)
114 # define dcgettext(Domain,Message,Type) (Message)
115 # define bindtextdomain(Domain,Directory) (Domain)
116 # define _(String) (String)
117 # define N_(String) (String)
118 #endif /* !ENABLE_NLS */
120 #include <glib/gtypes.h> /* for 'gchar' */
121 #define G_LOG_DOMAIN ((const gchar *)"Captive")
123 /* Supplemental definitions not possible in this file. */
125 #include "captive/config2.h"
128 #endif /* !_CAPTIVE_CONFIG_H */
131 AM_PATH_GLIB_2_0(,,[AC_MSG_ERROR([Captive requires glib-2.0 library.])],[gmodule gobject])
132 dnl Force glib for the whole package
133 CFLAGS="$CFLAGS $GLIB_CFLAGS"
134 LIBS="$LIBS $GLIB_LIBS"
137 AC_CHECK_LIB(popt,poptParseArgvString,[POPT_LIBS="-lpopt"],[AC_MSG_ERROR([Captive requires popt library.])])
140 AC_ARG_WITH(readline, [ --with-readline=[no/yes/auto] cmdline client w/line editing [default=auto]],,with_readline=auto)
141 AC_CHECK_HEADERS(readline/history.h)
142 dnl Check for libraries, if needed by configuration options.
143 if test "$with_readline" != "no"
145 if test -d "/usr/lib/termcap"
147 READLINE_LDFLAGS="$READLINE_LDFLAGS -L/usr/lib/termcap"
149 have_libreadline=false
151 for need in "" termcap ncurses; do
152 if test "x$need" != "x"
154 captive_save_LIBS="$LIBS"
155 AC_CHECK_LIB($need, main,,
156 [ need_failed="$need_failed $need"
159 LIBS="$captive_save_LIBS"
164 dnl Prevent AC_CHECK_LIB() here as it would _cache_ the value ignoring
165 dnl our ever-changing "additiona libraries" parameter
166 captive_save_LIBS="$LIBS"
167 LIBS="-lreadline $lneed $READLINE_LIBS"
168 AC_TRY_LINK(,[ main() ],
169 [ have_libreadline=true
170 READLINE_LIBS="$LIBS" ])
171 LIBS="$captive_save_LIBS"
179 AC_DEFINE(HAVE_LIBREADLINE,,[Use functions from libreadline?])
180 AC_CHECK_LIB(readline, add_history,
181 AC_DEFINE(HAVE_ADD_HISTORY,,[Use 'history' extension of libreadline?]),,
184 for need in $need_failed; do
185 AC_MSG_WARN(captive recommends $need library as your readline library
188 if test "$with_readline" = "yes"
190 AC_MSG_ERROR([captive did not find the requested readline library for its cmdline client line editing capability.])
192 AC_MSG_WARN([captive recommends readline library for its cmdline client line editing capability.])
196 AC_SUBST(READLINE_LIBS)
197 AC_SUBST(READLINE_LDFLAGS)
199 PKG_CHECK_MODULES(GNOME_VFS_MODULE,gnome-vfs-module-2.0)
200 AC_SUBST(GNOME_VFS_MODULE_CFLAGS)
201 AC_SUBST(GNOME_VFS_MODULE_LIBS)
203 dnl Check for 2.5.9 for: http://bugzilla.gnome.org/show_bug.cgi?id=117702
204 dnl Check the version - impossible to reliably check the missing feature.
205 PKG_CHECK_MODULES(LIBXML,libxml-2.0 >= 2.5.9,[ have_libxml_buffering=true ],[
206 dnl Disable bug-replay(1) build if not met; --bug-pathname would be still OK.
207 PKG_CHECK_MODULES(LIBXML,libxml-2.0,[ have_libxml_buffering=false ])
209 dnl We also condition 'HAVE_LIBXML_XMLREADER_H' by 'HAVE_LIBXML_BUFFERING'
210 dnl as we have no use for xmlreader without working libxml buffering of 2.5.9.
211 AM_CONDITIONAL(HAVE_LIBXML_BUFFERING,$have_libxml_buffering)
212 if $have_libxml_buffering;then
213 AC_DEFINE(HAVE_LIBXML_BUFFERING,,[libxml2 correctly reads textnodes by its xmlTextReader.])
215 AC_SUBST(LIBXML_CFLAGS)
216 AC_SUBST(LIBXML_LIBS)
218 PKG_CHECK_MODULES(OPENSSL,openssl,,[
219 dnl At least Debian-3.0r1 has openssl but without its .pc module.
220 AC_CHECK_LIB(crypto,MD5,[
222 OPENSSL_LIBS="-lcrypto"
223 ],[AC_MSG_ERROR([Captive requires crypto library (of openssl).])])
225 AC_SUBST(OPENSSL_CFLAGS)
226 AC_SUBST(OPENSSL_LIBS)
228 dnl for $(top_srcdir)/src/libcaptive/sandbox/split-sandbox.c
229 AM_PATH_LINC(,,[AC_MSG_ERROR([Captive requires linc library used by ORBit.])])
231 dnl for $(top_srcdir)/src/libcaptive/client/
232 dnl Do not use '[client server]' as $4 to prevent: configure: test: too many arguments
233 dnl - currently this argument is not used by 'orbit2-config' in any way anyway
234 AM_PATH_ORBIT2(,,[AC_MSG_ERROR([Captive requires ORBit library.])])
240 dnl "Makefile" output files MUST have pathnames incl./excl. "./" prefix as specified!
247 ./src/libcaptive/Makefile
248 ./src/libcaptive/include/Makefile
249 ./src/libcaptive/include/captive/Makefile
250 ./src/libcaptive/include/reactos/Makefile
251 ./src/libcaptive/include/reactos/ddk/Makefile
252 ./src/libcaptive/include/reactos/ddk/i386/Makefile
253 ./src/libcaptive/include/reactos/internal/Makefile
254 ./src/libcaptive/include/reactos/internal/i386/Makefile
255 ./src/libcaptive/include/reactos/napi/Makefile
256 ./src/libcaptive/include/reactos/ntos/Makefile
257 ./src/libcaptive/reactos/Makefile
258 ./src/libcaptive/reactos/include/Makefile
259 ./src/libcaptive/reactos/hal/Makefile
260 ./src/libcaptive/reactos/hal/halx86/Makefile
261 ./src/libcaptive/reactos/ntoskrnl/Makefile
262 ./src/libcaptive/reactos/ntoskrnl/dbg/Makefile
263 ./src/libcaptive/reactos/ntoskrnl/ex/Makefile
264 ./src/libcaptive/reactos/ntoskrnl/fs/Makefile
265 ./src/libcaptive/reactos/ntoskrnl/io/Makefile
266 ./src/libcaptive/reactos/ntoskrnl/ke/Makefile
267 ./src/libcaptive/reactos/ntoskrnl/ldr/Makefile
268 ./src/libcaptive/reactos/ntoskrnl/mm/Makefile
269 ./src/libcaptive/reactos/ntoskrnl/nt/Makefile
270 ./src/libcaptive/reactos/ntoskrnl/ob/Makefile
271 ./src/libcaptive/reactos/ntoskrnl/ps/Makefile
272 ./src/libcaptive/reactos/ntoskrnl/rtl/Makefile
273 ./src/libcaptive/reactos/ntoskrnl/rtl/i386/Makefile
274 ./src/libcaptive/reactos/ntoskrnl/se/Makefile
275 ./src/libcaptive/halcaptive/Makefile
276 ./src/libcaptive/cc/Makefile
277 ./src/libcaptive/cm/Makefile
278 ./src/libcaptive/ex/Makefile
279 ./src/libcaptive/fs/Makefile
280 ./src/libcaptive/io/Makefile
281 ./src/libcaptive/kd/Makefile
282 ./src/libcaptive/ke/Makefile
283 ./src/libcaptive/ldr/Makefile
284 ./src/libcaptive/mm/Makefile
285 ./src/libcaptive/nt/Makefile
286 ./src/libcaptive/ob/Makefile
287 ./src/libcaptive/po/Makefile
288 ./src/libcaptive/ps/Makefile
289 ./src/libcaptive/rtl/Makefile
290 ./src/libcaptive/se/Makefile
291 ./src/libcaptive/storage/Makefile
292 ./src/libcaptive/sandbox/Makefile
293 ./src/libcaptive/client/Makefile
294 ./src/client/Makefile
295 ./src/client/bug-replay/Makefile
296 ./src/client/cmdline/Makefile
297 ./src/client/gnomevfs/Makefile
298 ./src/client/lufs/Makefile
299 ./src/client/sandbox-server/Makefile
300 ./src/TraceFS/Makefile
302 ./doc/apiref/Makefile
303 ./src/client/gnomevfs/captive.conf
306 dnl FIXME: Why is "po/POTFILES" being substituted?
307 make -C src distfiles DISTFILES_PRINT=1 \
308 |sed -n 's/^:DISTFILES: *\(.*\)$/\1/p'|tr ' ' '\n'|grep . >po/POTFILES.in