Do not discard 'CFLAGS' settings as they may have been passed us by rpmbuild(8).
[captive.git] / configure.in
1 # $Id$
2 # Source file to generate "./configure" to prepare package for compilation
3 # Copyright (C) 2002 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 AM_INIT_AUTOMAKE(captive,0.2cvs)
21 AM_CONFIG_HEADER(config.h)
22 AM_MAINTAINER_MODE
23 #AM_ACLOCAL_INCLUDE(macros)
24 dnl Prevent "AC_TRY_COMPILE was called before AC_ISC_POSIX":
25 AC_ISC_POSIX
26 AC_PROG_CC
27 AM_ENABLE_STATIC
28 AM_DISABLE_SHARED
29 AM_PROG_LIBTOOL
30
31 dnl gettext localization.
32 dnl FIXME: should we use AM_GLIB_GNU_GETTEXT of glib-gettext.m4 ?
33 ALL_LINGUAS="cs"
34 AM_GNU_GETTEXT
35
36 GTK_DOC_CHECK
37
38 dnl Do not discard 'CFLAGS' settings as they may have been passed us by rpmbuild(8)
39
40 dnl Define MAINTAINER_MODE in config.h.
41 if test "$USE_MAINTAINER_MODE" = "yes";then
42         AC_DEFINE(MAINTAINER_MODE,,[Turn even some software behaviour according to MAINTAINER_MODE.])
43         CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wsign-compare"  ## FIXME: fix all sources: -Wsign-compare
44         fi
45 dnl Some Makefiles use additional tests etc.
46 AM_CONDITIONAL(MAINTAINER_MODE,[test "$USE_MAINTAINER_MODE" = "yes"])
47
48 dnl Permit 'if IS_FALSE' for Makefile.am-s; symbol 'FALSE' forbidden by automake
49 AM_CONDITIONAL(IS_FALSE,false)
50
51 AC_ARG_ENABLE(debug,[  --enable-debug=[no/yes]  turn on debugging messages [default=yes]],,enable_debug=yes)
52
53 if test "$enable_debug" != "no";then
54         CFLAGS="$CFLAGS -ggdb3"
55         fi
56
57 dnl Separate 'acconfig.h' is no longer recommended by autoconf
58 AH_TOP([
59 #ifndef _CAPTIVE_CONFIG_H
60 #define _CAPTIVE_CONFIG_H 1
61
62 #include <glib/gtypes.h>        /* for 'gchar' */
63 #define G_LOG_DOMAIN ((const gchar *)"Captive")
64
65 /* Supplemental definitions not possible in this file. */
66 #ifdef LIBCAPTIVE
67 #include "captive/config2.h"
68 #endif
69 ])
70 AH_BOTTOM([
71 #endif /* !_CAPTIVE_CONFIG_H */
72 ])
73
74 dnl ENABLE_NLS_HOOK name to guarantee inclusion AFTER '#undef ENABLE_NLS'
75 AH_VERBATIM([ENABLE_NLS_HOOK],[
76 #ifdef ENABLE_NLS
77 /* <libintl.h> is taken from "$(top_srcdir)/intl" if system doesn't provide intl */
78 #       include <libintl.h>
79 #ifdef LIBCAPTIVE
80 #       define _(String) dgettext (PACKAGE,String)
81 #else
82 #       define _(String) gettext (String)
83 #endif /* LIBSURPRISE */
84 #       ifdef gettext_noop
85 #               define N_(String) gettext_noop (String)
86 #       else
87 #               define N_(String) (String)
88 #       endif
89 #else /* !ENABLE_NLS */
90 /* Stubs that do something close enough.  */
91 #       define textdomain(String) (String)
92 #       define gettext(String) (String)
93 #       define dgettext(Domain,Message) (Message)
94 #       define dcgettext(Domain,Message,Type) (Message)
95 #       define bindtextdomain(Domain,Directory) (Domain)
96 #       define _(String) (String)
97 #       define N_(String) (String)
98 #endif /* !ENABLE_NLS */
99 ])
100
101 AM_PATH_GLIB_2_0(,,[AC_MSG_ERROR([Captive requires glib-2.0 library.])],[gmodule gobject])
102 dnl Force glib for the whole package
103 CFLAGS="$CFLAGS $GLIB_CFLAGS"
104 LIBS="$LIBS $GLIB_LIBS"
105
106 dnl popt
107 AC_CHECK_LIB(popt,poptParseArgvString,,[AC_MSG_ERROR([Captive requires popt library.])])
108
109 PKG_CHECK_MODULES(GNOME_VFS_MODULE,gnome-vfs-module-2.0)
110 CFLAGS="$CFLAGS $GNOME_VFS_MODULE_CFLAGS"
111 LIBS="$LIBS $GNOME_VFS_MODULE_LIBS"
112
113 dnl for $(top_srcdir)/src/libcaptive/sandbox/split-sandbox.c
114 AM_PATH_LINC(,,[AC_MSG_ERROR([Captive requires linc library used by ORBit.])])
115
116 dnl for $(top_srcdir)/src/libcaptive/client/
117 dnl Do not use '[client server]' as $4 to prevent: configure: test: too many arguments
118 dnl  - currently this argument is not used by 'orbit2-config' in any way anyway
119 AM_PATH_ORBIT2(,,[AC_MSG_ERROR([Captive requires ORBit library.])])
120
121
122 AC_SUBST(CFLAGS)
123 AC_SUBST(LIBS)
124
125 dnl "Makefile" output files MUST have pathnames incl./excl. "./" prefix as specified!
126 AC_OUTPUT([
127 captive.spec
128 Makefile
129 ./macros/Makefile
130 ./po/Makefile.in
131 ./intl/Makefile
132 ./m4/Makefile
133 ./src/Makefile
134 ./src/libcaptive/Makefile
135 ./src/libcaptive/include/Makefile
136 ./src/libcaptive/include/captive/Makefile
137 ./src/libcaptive/include/reactos/Makefile
138 ./src/libcaptive/include/reactos/ddk/Makefile
139 ./src/libcaptive/include/reactos/ddk/i386/Makefile
140 ./src/libcaptive/include/reactos/internal/Makefile
141 ./src/libcaptive/include/reactos/internal/i386/Makefile
142 ./src/libcaptive/include/reactos/napi/Makefile
143 ./src/libcaptive/include/reactos/ntos/Makefile
144 ./src/libcaptive/reactos/Makefile
145 ./src/libcaptive/reactos/include/Makefile
146 ./src/libcaptive/reactos/hal/Makefile
147 ./src/libcaptive/reactos/hal/halx86/Makefile
148 ./src/libcaptive/reactos/ntoskrnl/Makefile
149 ./src/libcaptive/reactos/ntoskrnl/dbg/Makefile
150 ./src/libcaptive/reactos/ntoskrnl/ex/Makefile
151 ./src/libcaptive/reactos/ntoskrnl/fs/Makefile
152 ./src/libcaptive/reactos/ntoskrnl/io/Makefile
153 ./src/libcaptive/reactos/ntoskrnl/ke/Makefile
154 ./src/libcaptive/reactos/ntoskrnl/ldr/Makefile
155 ./src/libcaptive/reactos/ntoskrnl/mm/Makefile
156 ./src/libcaptive/reactos/ntoskrnl/ob/Makefile
157 ./src/libcaptive/reactos/ntoskrnl/ps/Makefile
158 ./src/libcaptive/reactos/ntoskrnl/rtl/Makefile
159 ./src/libcaptive/reactos/ntoskrnl/se/Makefile
160 ./src/libcaptive/halcaptive/Makefile
161 ./src/libcaptive/cc/Makefile
162 ./src/libcaptive/cm/Makefile
163 ./src/libcaptive/ex/Makefile
164 ./src/libcaptive/fs/Makefile
165 ./src/libcaptive/io/Makefile
166 ./src/libcaptive/kd/Makefile
167 ./src/libcaptive/ke/Makefile
168 ./src/libcaptive/ldr/Makefile
169 ./src/libcaptive/mm/Makefile
170 ./src/libcaptive/ob/Makefile
171 ./src/libcaptive/ps/Makefile
172 ./src/libcaptive/rtl/Makefile
173 ./src/libcaptive/se/Makefile
174 ./src/libcaptive/storage/Makefile
175 ./src/libcaptive/sandbox/Makefile
176 ./src/libcaptive/client/Makefile
177 ./src/client/Makefile
178 ./src/client/cmdline/Makefile
179 ./src/client/libcaptive-gnomevfs/Makefile
180 ./doc/Makefile
181 ./doc/apiref/Makefile
182 ./src/client/libcaptive-gnomevfs/captive.conf
183 ])
184
185 dnl FIXME: Why is "po/POTFILES" being substituted?
186 make -C src distfiles DISTFILES_PRINT=1 \
187                 |sed -n 's/^:DISTFILES: *\(.*\)$/\1/p'|tr ' ' '\n'|grep . >po/POTFILES.in
188 cat po/POTFILES.in >po/POTFILES
189
190 echo done.