source: trunk/third/gal2/configure.in @ 20121

Revision 20121, 7.8 KB checked in by ghudson, 21 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r20120, which included commits to RCS files with non-trunk default branches.
Line 
1-*- mode: m4 -*-
2AC_PREREQ(2.52)
3AC_INIT(gal, 1.99.10,
4        http://bugzilla.ximian.com/enter_bug.cgi?product=GAL)
5
6AM_CONFIG_HEADER(config.h)
7
8AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
9
10AM_MAINTAINER_MODE
11
12dnl
13dnl Due to the sed scripts being split on 90 line
14dnl blocks, this macro needs to be right at the beggining.
15dnl
16AC_PROG_INTLTOOL
17
18dnl if you change this you need to change the GETTEXT_PACKAGE
19dnl string below as well due to a bug in intltool.
20GAL_API_VERSION=2.0
21
22dnl libtool versioning
23
24dnl gal-1.99.10 = 0
25dnl increment if any interfaces have been added; set to 0
26dnl  if any interfaces have been removed. removal has
27dnl  precedence over adding, so set to 0 if both happened.
28GAL_AGE=0
29
30dnl gal-1.99.10 = 1
31dnl increment any time the source changes; set to
32dnl  0 if you increment CURRENT
33GAL_REVISION=1
34
35dnl gal-1.99.10 = 5
36dnl increment if the interface has additions, changes, removals.
37GAL_CURRENT=5
38
39AC_SUBST(GAL_API_VERSION)
40AC_SUBST(GAL_CURRENT)
41AC_SUBST(GAL_REVISION)
42AC_SUBST(GAL_AGE)
43
44AC_ISC_POSIX
45AC_PROG_CC
46AC_PROG_YACC
47AC_LIBTOOL_WIN32_DLL
48AM_PROG_LIBTOOL
49AC_PROG_INTLTOOL
50AC_STDC_HEADERS
51
52## this should come after `AC_PROG_CC'
53GNOME_COMPILE_WARNINGS
54
55dnl
56dnl alloca tests
57dnl test for both ac_cv_header_alloca_h and ac_cv_working_alloca_h so
58dnl we're compatible with both autoconf 2.1X and autoconf >= 2.50
59dnl;
60AC_FUNC_ALLOCA
61if      test X$ac_cv_working_alloca_h = Xyes || \
62        test X$ac_cv_header_alloca_h = Xyes ; then
63        GAL_HAVE_ALLOCA_H=1
64else
65        GAL_HAVE_ALLOCA_H=0
66fi
67AC_SUBST(GAL_HAVE_ALLOCA_H)
68
69AC_SUBST(CFLAGS)
70AC_SUBST(CPPFLAGS)
71AC_SUBST(LDFLAGS)
72
73ALL_LINGUAS="am az be ca cs da de el en_GB es eu fi fr gl hu it ja ko lt lv ms nl nn no pl pt pt_BR ro ru sk sl sr sr@Latn sv ta tr uk vi zh_CN zh_TW"
74
75dnl we have to work around a intltool bug here so we must define GETTEXT_PACKAGE
76dnl as a simple string instead of trying to do variable substition.  See
77dnl http://bugzilla.ximian.com/show_bug.cgi?id=37784
78dnl GETTEXT_PACKAGE=gal-${GAL_API_VERSION}
79GETTEXT_PACKAGE=gal-AC_PACKAGE_VERSION
80AC_SUBST(GETTEXT_PACKAGE)
81AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
82AM_GLIB_GNU_GETTEXT
83
84gnomelocaledir='${prefix}/${DATADIRNAME}/locale'
85AC_SUBST(gnomelocaledir)
86
87AC_DEFINE_UNQUOTED(GNOME_EXPLICIT_TRANSLATION_DOMAIN, "${GETTEXT_PACKAGE}", [Translation domain name for gettext])
88
89dnl ******************************
90dnl iconv checking
91dnl ******************************
92have_iconv=no
93AC_ARG_WITH(libiconv, [  --with-libiconv         Prefix where libiconv is installed])
94case $withval in
95/*)
96    ICONV_CFLAGS="-I$withval/include"
97    ICONV_LIBS="-L$withval/lib"
98    ;;
99esac
100
101save_CFLAGS="$CFLAGS"
102save_LIBS="$LIBS"
103CFLAGS="$CFLAGS $ICONV_CFLAGS"
104LIBS="$LIBS $ICONV_LIBS -liconv"
105AC_CACHE_CHECK(for iconv in -liconv, ac_cv_libiconv, AC_TRY_LINK([
106#include <iconv.h>
107], [
108        iconv_t cd;
109        cd = iconv_open ("UTF-8", "ISO-8859-1");
110], ac_cv_libiconv=yes, ac_cv_libiconv=no))
111if test $ac_cv_libiconv = yes; then
112        ICONV_LIBS="$ICONV_LIBS -liconv"
113        have_iconv=yes
114else
115        CFLAGS="$save_CFLAGS"
116        LIBS="$save_LIBS"
117        AC_CHECK_FUNC(iconv, have_iconv=yes, have_iconv=no)
118fi
119
120if test $have_iconv = yes; then
121        if test $ac_cv_libiconv = no; then
122                AC_CHECK_FUNCS(gnu_get_libc_version)
123        fi
124        AC_CACHE_CHECK([if iconv() handles UTF-8], ac_cv_libiconv_utf8, AC_TRY_RUN([
125#include <iconv.h>
126#include <stdlib.h>
127#include <string.h>
128#ifdef HAVE_GNU_GET_LIBC_VERSION
129#include <gnu/libc-version.h>
130#endif
131
132int main (int argc, char **argv)
133{
134        const char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
135        const char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
136        char *transbuf = malloc (10), *trans = transbuf;
137        iconv_t cd;
138        size_t jp_len = strlen (jp), utf8_len = 10;
139        size_t utf8_real_len = strlen (utf8);
140
141#ifdef HAVE_GNU_GET_LIBC_VERSION
142        /* glibc 2.1.2's iconv is broken in hard to test ways. */
143        if (!strcmp (gnu_get_libc_version (), "2.1.2"))
144                exit (1);
145#endif
146
147        cd = iconv_open ("UTF-8", "ISO-2022-JP");
148        if (cd == (iconv_t) -1)
149                exit (1);
150        if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
151                exit (1);
152        if (memcmp (utf8, transbuf, utf8_real_len) != 0)
153                exit (1);
154
155        exit (0);
156}], ac_cv_libiconv_utf8=yes, [ac_cv_libiconv_utf8=no; have_iconv=no], [ac_cv_libiconv_utf8=no; have_iconv=no]))
157fi
158
159if test "$have_iconv" = no; then
160        AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv])
161fi
162AC_SUBST(ICONV_CFLAGS)
163AC_SUBST(ICONV_LIBS)
164
165CFLAGS="$CFLAGS -I$srcdir"
166
167AC_MSG_CHECKING(preferred charset formats for system iconv)
168AC_TRY_RUN([
169#define CONFIGURE_IN
170#include "iconv-detect.c"
171],[
172        AC_MSG_RESULT(found)
173],[
174        AC_MSG_RESULT(not found)
175        AC_WARN([
176        *** The iconv-detect program was unable to determine the
177        *** preferred charset formats recognized by your system
178        *** iconv library. It is suggested that you install a
179        *** working iconv library such as the one found at
180        *** ftp://ftp.gnu.org/pub/gnu/libiconv
181        ])
182])
183
184CFLAGS="$save_CFLAGS"
185LIBS="$save_LIBS"
186
187dnl Check to see if strftime supports the use of %l and %k
188
189AC_MSG_CHECKING(for %l and %k support in strftime)
190AC_TRY_RUN([
191#include <string.h>
192#include <time.h>
193
194int main(int argc, char **argv)
195{
196        char buf[10];
197        time_t rawtime;
198        struct tm *timeinfo;
199
200        time(&rawtime);
201        timeinfo=localtime(&rawtime);
202        strftime(buf, 10, "%l %k", timeinfo);
203
204        if (strstr(buf, "l") || strstr(buf, "k"))
205                exit(1);
206        else
207                exit(0);
208}],[
209AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k])
210ac_cv_lkstrftime=yes
211],ac_cv_lkstrftime=no,ac_cv_lkstrftime=no])
212AC_MSG_RESULT($ac_cv_lkstrftime)
213
214dnl Check for nl_langinfo and CODESET
215
216AC_MSG_CHECKING([for nl_langinfo (CODESET)])
217AC_TRY_COMPILE([#include <langinfo.h>],
218        [char *codeset = nl_langinfo (CODESET);],
219   AC_DEFINE(HAVE_CODESET,1,[Have nl_langinfo (CODESET)])
220   have_codeset=yes,
221   have_codeset=no)
222AC_MSG_RESULT($have_codeset)
223
224# glib-genmarshal
225AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
226
227dnl
228dnl Gtk-doc
229dnl
230AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
231
232if test x$enable_gtk_doc = xauto ; then
233  if test x$GTKDOC = xtrue ; then
234    enable_gtk_doc=yes
235  else
236    enable_gtk_doc=no
237  fi
238fi
239dnl NOTE: We need to use a separate automake conditional for this
240dnl       to make this work with the tarballs.
241AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
242
243AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
244if test "x$with_html_dir" = "x" ; then
245  HTML_DIR='${datadir}/gal-${GAL_API_VERSION}/html'
246else
247  HTML_DIR=$with_html_dir
248fi
249
250AC_SUBST(HTML_DIR)
251
252AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
253
254dnl
255dnl For the various galConf.sh scripts generation.
256dnl
257GAL_LIBDIR='-L${libdir}'
258PKG_CHECK_MODULES(GAL, libgnomeprint-2.2 >= 2.2.0 libgnomeprintui-2.2 >= 2.2.1 libglade-2.0 libgnomeui-2.0 libgnomecanvas-2.0 libxml-2.0)
259GAL_CFLAGS="$GAL_CFLAGS $ICONV_CFLAGS"
260GAL_LIBS="$GAL_LIBS -lgal-2.0 $ICONV_LIBS"
261AC_SUBST(GAL_LIBDIR)
262AC_SUBST(GAL_CFLAGS)
263AC_SUBST(GAL_LIBS)
264
265PKG_CHECK_MODULES(EXTRA_GNOME, libgnomeprint-2.2 >= 2.2.0 libgnomeprintui-2.2 >= 2.2.1 libglade-2.0 libgnomeui-2.0 libgnomecanvas-2.0 libxml-2.0)
266AC_SUBST(EXTRA_GNOME_LIBS)
267AC_SUBST(EXTRA_GNOME_CFLAGS)
268
269AC_MSG_CHECKING(libgnomecanvas and gtk2 compatibility)
270  if $PKG_CONFIG --atleast-version 2.2.0 gtk+-2.0 ; then
271    if $PKG_CONFIG --atleast-version 2.2.0.2 libgnomecanvas-2.0 ; then
272        AC_MSG_RESULT(okay)
273    else
274        AC_MSG_ERROR([*** libgnomecanvas-2.2.0.2 or newer is required with gtk-2.2. ])
275    fi
276  else
277    AC_MSG_RESULT(okay)
278  fi
279
280
281CFLAGS="$CFLAGS -D_REENTRANT"
282
283AC_OUTPUT([
284Makefile
285gal/Makefile
286gal/a11y/Makefile
287gal/a11y/e-text/Makefile
288gal/a11y/e-table/Makefile
289gal/util/Makefile
290gal/widgets/Makefile
291gal/e-text/Makefile
292gal/e-table/Makefile
293gal/menus/Makefile
294gal/shortcut-bar/Makefile
295tests/Makefile
296docs/Makefile
297art/Makefile
298po/Makefile.in
299gal.spec
300gal-2.0.pc
301stamp.h
302])
Note: See TracBrowser for help on using the repository browser.