-*- mode: m4 -*- AC_PREREQ(2.52) AC_INIT(gal, 2.5.3, http://bugzilla.gnome.org/enter_bug.cgi?product=GAL) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) AM_MAINTAINER_MODE dnl dnl Due to the sed scripts being split on 90 line dnl blocks, this macro needs to be right at the beginning. dnl AC_PROG_INTLTOOL([0.27.1]) dnl if you change this you need to change the GETTEXT_PACKAGE dnl string below as well due to a bug in intltool. GAL_API_VERSION=2.6 dnl libtool versioning dnl increment if any interfaces have been added; set to 0 dnl if any interfaces have been removed. removal has dnl precedence over adding, so set to 0 if both happened. GAL_AGE=0 dnl increment any time the source changes; set to dnl 0 if you increment CURRENT GAL_REVISION=0 dnl increment if the interface has additions, changes, removals. GAL_CURRENT=0 AC_SUBST(GAL_API_VERSION) AC_SUBST(GAL_CURRENT) AC_SUBST(GAL_REVISION) AC_SUBST(GAL_AGE) AC_ISC_POSIX AC_PROG_CC AC_PROG_YACC AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL AC_STDC_HEADERS ## this should come after `AC_PROG_CC' GNOME_COMPILE_WARNINGS(yes) CFLAGS="$CFLAGS $warning_flags" dnl dnl alloca tests dnl test for both ac_cv_header_alloca_h and ac_cv_working_alloca_h so dnl we're compatible with both autoconf 2.1X and autoconf >= 2.50 dnl; AC_FUNC_ALLOCA if test X$ac_cv_working_alloca_h = Xyes || \ test X$ac_cv_header_alloca_h = Xyes ; then GAL_HAVE_ALLOCA_H=1 else GAL_HAVE_ALLOCA_H=0 fi AC_SUBST(GAL_HAVE_ALLOCA_H) ALL_LINGUAS="am ar az be bg bn bs ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gl gu hi hr hu id it ja ko lt lv mn ms nb ne nl nn no pa pl pt pt_BR ro ru rw sk sl sq sr sr@Latn sv ta th tr uk vi xh zh_CN zh_TW" GETTEXT_PACKAGE=gal-${GAL_API_VERSION} AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext]) AM_GLIB_GNU_GETTEXT gnomelocaledir='${prefix}/${DATADIRNAME}/locale' AC_SUBST(gnomelocaledir) AC_DEFINE_UNQUOTED(GNOME_EXPLICIT_TRANSLATION_DOMAIN, "${GETTEXT_PACKAGE}", [Translation domain name for gettext]) dnl ****************************** dnl Win32 check dnl ****************************** AC_MSG_CHECKING([for Win32]) case "$host" in *-*-mingw*) os_win32=yes LIBGAL_A11Y="" ;; *) os_win32=no LIBGAL_A11Y="-lgal-a11y-2.4" ;; esac AC_MSG_RESULT([$os_win32]) AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes]) AC_SUBST(LIBGAL_A11Y) dnl ************************************************** dnl * regex checking dnl ************************************************** AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,[REGEX_LIBS=-lregex],[AC_MSG_ERROR([No regex library found])])]) AC_SUBST(REGEX_LIBS) dnl ****************************** dnl iconv checking dnl ****************************** have_iconv=no AC_ARG_WITH(libiconv, [ --with-libiconv Prefix where libiconv is installed]) case $withval in /*) ICONV_CFLAGS="-I$withval/include" ICONV_LIBS="-L$withval/lib" ;; esac save_CFLAGS="$CFLAGS" save_LIBS="$LIBS" CFLAGS="$CFLAGS $ICONV_CFLAGS" LIBS="$LIBS $ICONV_LIBS -liconv" AC_CACHE_CHECK(for iconv in -liconv, ac_cv_libiconv, AC_TRY_LINK([ #include ], [ iconv_t cd; cd = iconv_open ("UTF-8", "ISO-8859-1"); ], ac_cv_libiconv=yes, ac_cv_libiconv=no)) if test $ac_cv_libiconv = yes; then ICONV_LIBS="$ICONV_LIBS -liconv" have_iconv=yes else CFLAGS="$save_CFLAGS" LIBS="$save_LIBS" AC_CHECK_FUNC(iconv, have_iconv=yes, have_iconv=no) fi if test $have_iconv = yes; then if test $ac_cv_libiconv = no; then AC_CHECK_FUNCS(gnu_get_libc_version) fi AC_CACHE_CHECK([if iconv() handles UTF-8], ac_cv_libiconv_utf8, AC_TRY_RUN([ #include #include #include #ifdef HAVE_GNU_GET_LIBC_VERSION #include #endif int main (int argc, char **argv) { const char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C"; const char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E"; char *transbuf = malloc (10), *trans = transbuf; iconv_t cd; size_t jp_len = strlen (jp), utf8_len = 10; size_t utf8_real_len = strlen (utf8); #ifdef HAVE_GNU_GET_LIBC_VERSION /* glibc 2.1.2's iconv is broken in hard to test ways. */ if (!strcmp (gnu_get_libc_version (), "2.1.2")) exit (1); #endif cd = iconv_open ("UTF-8", "ISO-2022-JP"); if (cd == (iconv_t) -1) exit (1); if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0) exit (1); if (memcmp (utf8, transbuf, utf8_real_len) != 0) exit (1); exit (0); }], ac_cv_libiconv_utf8=yes, [ac_cv_libiconv_utf8=no; have_iconv=no], [ac_cv_libiconv_utf8=no; have_iconv=no])) fi if test "$have_iconv" = no; then AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv]) fi AC_SUBST(ICONV_CFLAGS) AC_SUBST(ICONV_LIBS) CFLAGS="$CFLAGS -I$srcdir" AC_MSG_CHECKING(preferred charset formats for system iconv) AC_TRY_RUN([ #define CONFIGURE_IN #include "iconv-detect.c" ],[ AC_MSG_RESULT(found) ],[ AC_MSG_RESULT(not found) AC_WARN([ *** The iconv-detect program was unable to determine the *** preferred charset formats recognized by your system *** iconv library. It is suggested that you install a *** working iconv library such as the one found at *** ftp://ftp.gnu.org/pub/gnu/libiconv ]) ]) CFLAGS="$save_CFLAGS" LIBS="$save_LIBS" dnl Check to see if strftime supports the use of %l and %k AC_MSG_CHECKING(for %l and %k support in strftime) AC_TRY_RUN([ #include #include int main(int argc, char **argv) { char buf[10]; time_t rawtime; struct tm *timeinfo; time(&rawtime); timeinfo=localtime(&rawtime); strftime(buf, 10, "%l %k", timeinfo); if (strstr(buf, "l") || strstr(buf, "k")) exit(1); else exit(0); }],[ AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k]) ac_cv_lkstrftime=yes ],ac_cv_lkstrftime=no,ac_cv_lkstrftime=no]) AC_MSG_RESULT($ac_cv_lkstrftime) dnl Check for nl_langinfo and CODESET AC_MSG_CHECKING([for nl_langinfo (CODESET)]) AC_TRY_COMPILE([#include ], [char *codeset = nl_langinfo (CODESET);], AC_DEFINE(HAVE_CODESET,1,[Have nl_langinfo (CODESET)]) have_codeset=yes, have_codeset=no) AC_MSG_RESULT($have_codeset) # glib-genmarshal AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) dnl dnl Gtk-doc dnl GTK_DOC_CHECK([1.0]) dnl dnl For the various galConf.sh scripts generation. dnl GAL_LIBDIR='-L${libdir}' PKG_CHECK_MODULES(GAL, glib-2.0 >= 2.6 gtk+-2.0 >= 2.6 libgnomeprint-2.2 >= 2.2.0 libgnomeprintui-2.2 >= 2.2.1 libglade-2.0 libgnomeui-2.0 libgnomecanvas-2.0 >= 2.2.0.2 libxml-2.0) AC_SUBST(GAL_LIBDIR) AC_SUBST(GAL_CFLAGS) AC_SUBST(GAL_LIBS) PKG_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 >= 2.2.0.2 libxml-2.0) AC_SUBST(EXTRA_GNOME_LIBS) AC_SUBST(EXTRA_GNOME_CFLAGS) if test "$os_win32" != yes; then CFLAGS="$CFLAGS -D_REENTRANT" fi AC_OUTPUT([ Makefile gal/Makefile gal/a11y/Makefile gal/a11y/e-text/Makefile gal/a11y/e-table/Makefile gal/util/Makefile gal/widgets/Makefile gal/e-text/Makefile gal/e-table/Makefile gal/menus/Makefile gal/shortcut-bar/Makefile tests/Makefile docs/Makefile art/Makefile po/Makefile.in gal.spec gal-zip gal.pc stamp.h ])