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