bootstrap
[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.1cvs)
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 AM_PATH_GLIB_2_0(,,[AC_MSG_ERROR([Captive requires glib-2.0 library.])])
37
38 GTK_DOC_CHECK
39
40 dnl discard -g -O2 settings
41 CFLAGS=
42
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 -Wall -Wstrict-prototypes -Wsign-compare"  ## FIXME: fix all sources: -Wsign-compare
47         fi
48 dnl Some Makefiles use additional tests etc.
49 AM_CONDITIONAL(MAINTAINER_MODE,[test "$USE_MAINTAINER_MODE" = "yes"])
50
51 dnl Permit 'if IS_FALSE' for Makefile.am-s; symbol 'FALSE' forbidden by automake
52 AM_CONDITIONAL(IS_FALSE,false)
53
54 AC_ARG_ENABLE(debug,[  --enable-debug=[no/yes]  turn on debugging messages [default=yes]],,enable_debug=yes)
55
56 if test "$enable_debug" != "no";then
57         CFLAGS="$CFLAGS -ggdb3"
58         fi
59
60 dnl Separate 'acconfig.h' is no longer recommended by autoconf
61 AH_TOP([
62 #ifndef _CAPTIVE_CONFIG_H
63 #define _CAPTIVE_CONFIG_H 1
64 ])
65 AH_BOTTOM([
66 #endif /* !_CAPTIVE_CONFIG_H */
67 ])
68
69 dnl ENABLE_NLS_HOOK name to guarantee inclusion AFTER '#undef ENABLE_NLS'
70 AH_VERBATIM([ENABLE_NLS_HOOK],[
71 #ifdef ENABLE_NLS
72 /* <libintl.h> is taken from "$(top_srcdir)/intl" if system doesn't provide intl */
73 #       include <libintl.h>
74 #ifdef LIBCAPTIVE
75 #       define _(String) dgettext (PACKAGE,String)
76 #else
77 #       define _(String) gettext (String)
78 #endif /* LIBSURPRISE */
79 #       ifdef gettext_noop
80 #               define N_(String) gettext_noop (String)
81 #       else
82 #               define N_(String) (String)
83 #       endif
84 #else /* !ENABLE_NLS */
85 /* Stubs that do something close enough.  */
86 #       define textdomain(String) (String)
87 #       define gettext(String) (String)
88 #       define dgettext(Domain,Message) (Message)
89 #       define dcgettext(Domain,Message,Type) (Message)
90 #       define bindtextdomain(Domain,Directory) (Domain)
91 #       define _(String) (String)
92 #       define N_(String) (String)
93 #endif /* !ENABLE_NLS */
94 ])
95
96 dnl Force glib for the whole package
97 CFLAGS="$CFLAGS $GLIB_CFLAGS"
98 AC_SUBST(CFLAGS)
99 LIBS="$LIBS $GLIB_LIBS"
100 AC_SUBST(LIBS)
101
102 dnl "Makefile" output files MUST have pathnames incl./excl. "./" prefix as specified!
103 AC_OUTPUT([
104 captive.spec
105 Makefile
106 ./macros/Makefile
107 ./po/Makefile.in
108 ./intl/Makefile
109 ./m4/Makefile
110 ./src/Makefile
111 ./src/libcaptive/Makefile
112 ./src/libcaptive/include/Makefile
113 ./src/libcaptive/include/captive/Makefile
114 ./src/libcaptive/include/reactos/Makefile
115 ./src/libcaptive/include/reactos/ddk/Makefile
116 ./src/libcaptive/include/reactos/ddk/i386/Makefile
117 ./src/libcaptive/include/reactos/internal/Makefile
118 ./src/libcaptive/include/reactos/internal/i386/Makefile
119 ./src/libcaptive/include/reactos/napi/Makefile
120 ./src/libcaptive/include/reactos/ntos/Makefile
121 ./src/libcaptive/reactos/Makefile
122 ./src/libcaptive/reactos/include/Makefile
123 ./src/libcaptive/reactos/ntoskrnl/Makefile
124 ./src/libcaptive/reactos/ntoskrnl/dbg/Makefile
125 ./src/libcaptive/reactos/ntoskrnl/ex/Makefile
126 ./src/libcaptive/reactos/ntoskrnl/io/Makefile
127 ./src/libcaptive/reactos/ntoskrnl/ke/Makefile
128 ./src/libcaptive/reactos/ntoskrnl/ldr/Makefile
129 ./src/libcaptive/reactos/ntoskrnl/ob/Makefile
130 ./src/libcaptive/reactos/ntoskrnl/ps/Makefile
131 ./src/libcaptive/reactos/ntoskrnl/rtl/Makefile
132 ./src/libcaptive/reactos/ntoskrnl/se/Makefile
133 ./src/libcaptive/halcaptive/Makefile
134 ./src/libcaptive/kd/Makefile
135 ./src/libcaptive/ke/Makefile
136 ./src/libcaptive/ldr/Makefile
137 ./src/libcaptive/mm/Makefile
138 ./src/libcaptive/ps/Makefile
139 ./src/libcaptive/rtl/Makefile
140 ./src/libcaptive/client/Makefile
141 ./src/client/Makefile
142 ./src/client/cmdline/Makefile
143 ./doc/Makefile
144 ./doc/apiref/Makefile
145 ])
146
147 dnl FIXME: Why is "po/POTFILES" being substituted?
148 make -C src distfiles DISTFILES_PRINT=1 \
149                 |sed -n 's/^:DISTFILES: *\(.*\)$/\1/p'|tr ' ' '\n'|grep . >po/POTFILES.in
150 cat po/POTFILES.in >po/POTFILES
151
152 echo done.