dnl PSPP - a program for statistical analysis.
-dnl Copyright (C) 2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2017, 2021 Free Software Foundation, Inc.
dnl
dnl This program is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
AC_GNU_SOURCE
AC_PROG_CC
gl_EARLY
+if test x"$cross_compiling" = x"yes"; then
+ if test x"$srcdir" = x"."; then
+ AC_ERROR([Cross compiling must be done out of source.])
+ fi
+fi
+
AM_PROG_CC_C_O
AC_LIBTOOL_WIN32_DLL
AC_LIBTOOL_DLOPEN
dnl Disable automatic po/ support, because PSPP provides its own po/ support.
AC_PROVIDE([AM_PO_SUBDIRS])
AM_GNU_GETTEXT([external], [need-ngettext])
+
LIBS="$LIBINTL $LIBS"
AC_CHECK_PROGS([MSGFMT], [msgfmt])
if test "x$MSGFMT" = x; then
if test "x$XGETTEXT" = x; then
PSPP_REQUIRED_PREREQ([xgettext (is usually provided with gettext)])
fi
-dnl appstream required for metainfo.its
-dnl if metainfo.its is not there, then the following small
-dnl file will not produce an outputfile
-$as_echo '<?xml version="1.0" encoding="UTF-8"?>' > test.metainfo.xml.in
-$as_echo '<component type="desktop">' >> test.metainfo.xml.in
-$as_echo '<name>Hallo</name>' >> test.metainfo.xml.in
-$as_echo '</component>' >> test.metainfo.xml.in
-xgettext -o mifc.po test.metainfo.xml.in
-if ! test -f ./mifc.po ; then
- PSPP_OPTIONAL_PREREQ([org.fsf.metainfo.xml will not be translated. Install gettext >=0.20 or appstream.])
+
+PSPP_CHECK_XGETTEXT
+
+if test "$pspp_cv_progrecent_xgettext" != "yes"; then
+ PSPP_REQUIRED_PREREQ([xgettext version 0.20 or greater])
fi
-rm -f mifc.po test.metainfo.xml.in
dnl Checks for libraries.
AC_SYS_LARGEFILE
AC_ARG_VAR([PSPPIRE_LDFLAGS], [linker flags to be used for linking the psppire binary only])
# Support for Cairo and Pango.
-AC_ARG_WITH([cairo],
- [AS_HELP_STRING(
- [--without-cairo],
- [Don't build support for charts (using Cairo and Pango);
- implies --without-gui])],
- [], [with_cairo=yes])
-AM_CONDITIONAL([HAVE_CAIRO], [test "$with_cairo" != no])
-if test "$with_cairo" != no; then
- PKG_CHECK_MODULES([CAIRO], [cairo >= 1.5 pango >= 1.22 pangocairo],
- [CPPFLAGS="$CPPFLAGS $CAIRO_CFLAGS"
- AC_DEFINE([HAVE_CAIRO], 1,
- [Define to 1 if Cairo and Pango are available.])],
- [PSPP_REQUIRED_PREREQ([cairo 1.5 or later and pango 1.22 or later (or use --without-cairo)])])
-fi
+PKG_CHECK_MODULES([CAIRO], [cairo >= 1.5 pango >= 1.22 pangocairo],
+ [CPPFLAGS="$CPPFLAGS $CAIRO_CFLAGS"],
+ [PSPP_REQUIRED_PREREQ([cairo 1.5 or later and pango 1.22 or later])])
dnl One of the tests uses xmllint.
AC_CACHE_CHECK([for an xmllint program which fits our needs],[ac_cv_path_XMLLINT],
[AS_HELP_STRING([--without-gui],
[Don't build the PSPPIRE GUI (using GTK+)])],
[], [with_gui=yes])
-AM_CONDITIONAL([building_gui],
- [test "$with_cairo" != no && test "$with_gui" != "no"])
-if test "$with_cairo" != no && test "$with_gui" != "no"; then
+AM_CONDITIONAL([building_gui], [test "$with_gui" != "no"])
+if test "$with_gui" != "no"; then
PKG_CHECK_MODULES([GTHREAD], [gthread-2.0], [],
[PSPP_REQUIRED_PREREQ([gthread 2.0 (or use --without-gui)])])