2 # Source file to generate "./configure" to prepare package for compilation
3 # Copyright (C) 2002 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 AM_INIT_AUTOMAKE(captive,0.2)
21 AM_CONFIG_HEADER(config.h)
23 #AM_ACLOCAL_INCLUDE(macros)
24 dnl Prevent "AC_TRY_COMPILE was called before AC_ISC_POSIX":
32 dnl gettext localization.
33 dnl FIXME: should we use AM_GLIB_GNU_GETTEXT of glib-gettext.m4 ?
38 dnl AM_CONDITIONAL needs to be here explicitely for doc/apiref/Makefile rebuild
39 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
41 dnl Do not discard 'CFLAGS' settings as they may have been passed us by rpmbuild(8)
43 dnl Define MAINTAINER_MODE in config.h.
44 if test "$USE_MAINTAINER_MODE" = "yes";then
45 AC_DEFINE(MAINTAINER_MODE,,[Turn even some software behaviour according to MAINTAINER_MODE.])
46 CFLAGS="$CFLAGS -ggdb3 -Wall -Wstrict-prototypes -Wsign-compare" ## FIXME: fix all sources: -Wsign-compare
48 dnl Some Makefiles use additional tests etc.
49 AM_CONDITIONAL(MAINTAINER_MODE,[test "$USE_MAINTAINER_MODE" = "yes"])
51 dnl Permit 'if IS_FALSE' for Makefile.am-s; symbol 'FALSE' forbidden by automake
52 AM_CONDITIONAL(IS_FALSE,false)
54 dnl Separate 'acconfig.h' is no longer recommended by autoconf
56 #ifndef _CAPTIVE_CONFIG_H
57 #define _CAPTIVE_CONFIG_H 1
59 #include <glib/gtypes.h> /* for 'gchar' */
60 #define G_LOG_DOMAIN ((const gchar *)"Captive")
62 /* Supplemental definitions not possible in this file. */
64 #include "captive/config2.h"
68 #endif /* !_CAPTIVE_CONFIG_H */
71 dnl ENABLE_NLS_HOOK name to guarantee inclusion AFTER '#undef ENABLE_NLS'
72 AH_VERBATIM([ENABLE_NLS_HOOK],[
74 /* <libintl.h> is taken from "$(top_srcdir)/intl" if system doesn't provide intl */
77 # define _(String) dgettext (PACKAGE,String)
79 # define _(String) gettext (String)
80 #endif /* LIBCAPTIVE */
82 # define N_(String) gettext_noop (String)
84 # define N_(String) (String)
86 #else /* !ENABLE_NLS */
87 /* Stubs that do something close enough. */
88 # define textdomain(String) (String)
89 # define gettext(String) (String)
90 # define dgettext(Domain,Message) (Message)
91 # define dcgettext(Domain,Message,Type) (Message)
92 # define bindtextdomain(Domain,Directory) (Domain)
93 # define _(String) (String)
94 # define N_(String) (String)
95 #endif /* !ENABLE_NLS */
98 AM_PATH_GLIB_2_0(,,[AC_MSG_ERROR([Captive requires glib-2.0 library.])],[gmodule gobject])
99 dnl Force glib for the whole package
100 CFLAGS="$CFLAGS $GLIB_CFLAGS"
101 LIBS="$LIBS $GLIB_LIBS"
104 AC_CHECK_LIB(popt,poptParseArgvString,[POPT_LIBS="-lpopt"],[AC_MSG_ERROR([Captive requires popt library.])])
107 AC_ARG_WITH(readline, [ --with-readline=[no/yes/auto] cmdline client w/line editing [default=auto]],,with_readline=auto)
108 AC_CHECK_HEADERS(readline/history.h)
109 dnl Check for libraries, if needed by configuration options.
110 if test "$with_readline" != "no"
112 if test -d "/usr/lib/termcap"
114 READLINE_LDFLAGS="$READLINE_LDFLAGS -L/usr/lib/termcap"
116 have_libreadline=false
118 for need in "" termcap ncurses; do
119 if test "x$need" != "x"
121 AC_CHECK_LIB($need, main,,
122 [ need_failed="$need_failed $need"
129 dnl Prevent AC_CHECK_LIB() here as it would _cache_ the value ignoring
130 dnl our ever-changing "additiona libraries" parameter
131 captive_save_LIBS="$LIBS"
132 LIBS="-lreadline $lneed $READLINE_LIBS"
133 AC_TRY_LINK(,[ main() ],
134 [ have_libreadline=true
135 READLINE_LIBS="$LIBS" ])
136 LIBS="$captive_save_LIBS"
144 AC_DEFINE(HAVE_LIBREADLINE,,[Use functions from libreadline?])
145 AC_CHECK_LIB(readline, add_history,
146 AC_DEFINE(HAVE_ADD_HISTORY,,[Use 'history' extension of libreadline?]),,
149 for need in $need_failed; do
150 AC_MSG_WARN(captive recommends $need library as your readline library
153 if test "$with_readline" = "yes"
155 AC_MSG_ERROR([captive did not find the requested readline library for its cmdline client line editing capability.])
157 AC_MSG_WARN([captive recommends readline library for its cmdline client line editing capability.])
161 AC_SUBST(READLINE_LIBS)
162 AC_SUBST(READLINE_LDFLAGS)
164 PKG_CHECK_MODULES(GNOME_VFS_MODULE,gnome-vfs-module-2.0)
165 AC_SUBST(GNOME_VFS_MODULE_CFLAGS)
166 AC_SUBST(GNOME_VFS_MODULE_LIBS)
168 dnl for $(top_srcdir)/src/libcaptive/sandbox/split-sandbox.c
169 AM_PATH_LINC(,,[AC_MSG_ERROR([Captive requires linc library used by ORBit.])])
171 dnl for $(top_srcdir)/src/libcaptive/client/
172 dnl Do not use '[client server]' as $4 to prevent: configure: test: too many arguments
173 dnl - currently this argument is not used by 'orbit2-config' in any way anyway
174 AM_PATH_ORBIT2(,,[AC_MSG_ERROR([Captive requires ORBit library.])])
180 dnl "Makefile" output files MUST have pathnames incl./excl. "./" prefix as specified!
189 ./src/libcaptive/Makefile
190 ./src/libcaptive/include/Makefile
191 ./src/libcaptive/include/captive/Makefile
192 ./src/libcaptive/include/reactos/Makefile
193 ./src/libcaptive/include/reactos/ddk/Makefile
194 ./src/libcaptive/include/reactos/ddk/i386/Makefile
195 ./src/libcaptive/include/reactos/internal/Makefile
196 ./src/libcaptive/include/reactos/internal/i386/Makefile
197 ./src/libcaptive/include/reactos/napi/Makefile
198 ./src/libcaptive/include/reactos/ntos/Makefile
199 ./src/libcaptive/reactos/Makefile
200 ./src/libcaptive/reactos/include/Makefile
201 ./src/libcaptive/reactos/hal/Makefile
202 ./src/libcaptive/reactos/hal/halx86/Makefile
203 ./src/libcaptive/reactos/ntoskrnl/Makefile
204 ./src/libcaptive/reactos/ntoskrnl/dbg/Makefile
205 ./src/libcaptive/reactos/ntoskrnl/ex/Makefile
206 ./src/libcaptive/reactos/ntoskrnl/fs/Makefile
207 ./src/libcaptive/reactos/ntoskrnl/io/Makefile
208 ./src/libcaptive/reactos/ntoskrnl/ke/Makefile
209 ./src/libcaptive/reactos/ntoskrnl/ldr/Makefile
210 ./src/libcaptive/reactos/ntoskrnl/mm/Makefile
211 ./src/libcaptive/reactos/ntoskrnl/nt/Makefile
212 ./src/libcaptive/reactos/ntoskrnl/ob/Makefile
213 ./src/libcaptive/reactos/ntoskrnl/ps/Makefile
214 ./src/libcaptive/reactos/ntoskrnl/rtl/Makefile
215 ./src/libcaptive/reactos/ntoskrnl/rtl/i386/Makefile
216 ./src/libcaptive/reactos/ntoskrnl/se/Makefile
217 ./src/libcaptive/halcaptive/Makefile
218 ./src/libcaptive/cc/Makefile
219 ./src/libcaptive/cm/Makefile
220 ./src/libcaptive/ex/Makefile
221 ./src/libcaptive/fs/Makefile
222 ./src/libcaptive/io/Makefile
223 ./src/libcaptive/kd/Makefile
224 ./src/libcaptive/ke/Makefile
225 ./src/libcaptive/ldr/Makefile
226 ./src/libcaptive/mm/Makefile
227 ./src/libcaptive/nt/Makefile
228 ./src/libcaptive/ob/Makefile
229 ./src/libcaptive/po/Makefile
230 ./src/libcaptive/ps/Makefile
231 ./src/libcaptive/rtl/Makefile
232 ./src/libcaptive/se/Makefile
233 ./src/libcaptive/storage/Makefile
234 ./src/libcaptive/sandbox/Makefile
235 ./src/libcaptive/client/Makefile
236 ./src/client/Makefile
237 ./src/client/cmdline/Makefile
238 ./src/client/libcaptive-gnomevfs/Makefile
240 ./doc/apiref/Makefile
241 ./src/client/libcaptive-gnomevfs/captive.conf
244 dnl FIXME: Why is "po/POTFILES" being substituted?
245 make -C src distfiles DISTFILES_PRINT=1 \
246 |sed -n 's/^:DISTFILES: *\(.*\)$/\1/p'|tr ' ' '\n'|grep . >po/POTFILES.in
247 cat po/POTFILES.in >po/POTFILES