2011-01-10 07:25:56 -07:00
|
|
|
# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
|
2009-06-06 11:52:23 -06:00
|
|
|
|
|
|
|
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
2011-01-10 07:25:56 -07:00
|
|
|
# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
2009-06-06 11:52:23 -06:00
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
|
|
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
|
|
# PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
m4_ifndef([AC_AUTOCONF_VERSION],
|
|
|
|
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
2011-10-16 11:18:56 -06:00
|
|
|
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
|
|
|
|
[m4_warning([this file was generated for autoconf 2.68.
|
2009-06-06 11:52:23 -06:00
|
|
|
You have another version of autoconf. It may work, but is not guaranteed to.
|
|
|
|
If you have problems, you may need to regenerate the build system entirely.
|
|
|
|
To do so, use the procedure documented by the package, typically `autoreconf'.])])
|
|
|
|
|
|
|
|
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
|
|
|
|
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
|
|
|
|
#
|
|
|
|
# This file is free software, distributed under the terms of the GNU
|
|
|
|
# General Public License. As a special exception to the GNU General
|
|
|
|
# Public License, this file may be distributed as part of a program
|
|
|
|
# that contains a configuration script generated by Autoconf, under
|
|
|
|
# the same distribution terms as the rest of that program.
|
|
|
|
#
|
|
|
|
# This file can be copied and used freely without restrictions. It can
|
|
|
|
# be used in projects which are not available under the GNU Public License
|
|
|
|
# but which still want to provide support for the GNU gettext functionality.
|
|
|
|
#
|
|
|
|
# Macro to add for using GNU gettext.
|
|
|
|
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
|
|
|
|
#
|
|
|
|
# Modified to never use included libintl.
|
|
|
|
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
|
|
|
|
#
|
|
|
|
# Major rework to remove unused code
|
|
|
|
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
|
|
|
|
#
|
|
|
|
# Added better handling of ALL_LINGUAS from GNU gettext version
|
|
|
|
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
|
|
|
|
#
|
|
|
|
# Modified to require ngettext
|
|
|
|
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
|
|
|
|
#
|
|
|
|
# We need this here as well, since someone might use autoconf-2.5x
|
|
|
|
# to configure GLib then an older version to configure a package
|
|
|
|
# using AM_GLIB_GNU_GETTEXT
|
|
|
|
AC_PREREQ(2.53)
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl We go to great lengths to make sure that aclocal won't
|
|
|
|
dnl try to pull in the installed version of these macros
|
|
|
|
dnl when running aclocal in the glib directory.
|
|
|
|
dnl
|
|
|
|
m4_copy([AC_DEFUN],[glib_DEFUN])
|
|
|
|
m4_copy([AC_REQUIRE],[glib_REQUIRE])
|
|
|
|
dnl
|
|
|
|
dnl At the end, if we're not within glib, we'll define the public
|
|
|
|
dnl definitions in terms of our private definitions.
|
|
|
|
dnl
|
|
|
|
|
|
|
|
# GLIB_LC_MESSAGES
|
|
|
|
#--------------------
|
|
|
|
glib_DEFUN([GLIB_LC_MESSAGES],
|
|
|
|
[AC_CHECK_HEADERS([locale.h])
|
|
|
|
if test $ac_cv_header_locale_h = yes; then
|
|
|
|
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
|
|
|
|
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
|
|
|
|
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
|
|
|
|
if test $am_cv_val_LC_MESSAGES = yes; then
|
|
|
|
AC_DEFINE(HAVE_LC_MESSAGES, 1,
|
|
|
|
[Define if your <locale.h> file defines LC_MESSAGES.])
|
|
|
|
fi
|
|
|
|
fi])
|
|
|
|
|
|
|
|
# GLIB_PATH_PROG_WITH_TEST
|
|
|
|
#----------------------------
|
|
|
|
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
|
|
|
|
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
|
|
|
|
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
|
|
|
|
[# Extract the first word of "$2", so it can be a program name with args.
|
|
|
|
set dummy $2; ac_word=[$]2
|
|
|
|
AC_MSG_CHECKING([for $ac_word])
|
|
|
|
AC_CACHE_VAL(ac_cv_path_$1,
|
|
|
|
[case "[$]$1" in
|
|
|
|
/*)
|
|
|
|
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
|
|
|
for ac_dir in ifelse([$5], , $PATH, [$5]); do
|
|
|
|
test -z "$ac_dir" && ac_dir=.
|
|
|
|
if test -f $ac_dir/$ac_word; then
|
|
|
|
if [$3]; then
|
|
|
|
ac_cv_path_$1="$ac_dir/$ac_word"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
IFS="$ac_save_ifs"
|
|
|
|
dnl If no 4th arg is given, leave the cache variable unset,
|
|
|
|
dnl so AC_PATH_PROGS will keep looking.
|
|
|
|
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
|
|
|
|
])dnl
|
|
|
|
;;
|
|
|
|
esac])dnl
|
|
|
|
$1="$ac_cv_path_$1"
|
|
|
|
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
|
|
|
|
AC_MSG_RESULT([$]$1)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
AC_SUBST($1)dnl
|
|
|
|
])
|
|
|
|
|
|
|
|
# GLIB_WITH_NLS
|
|
|
|
#-----------------
|
|
|
|
glib_DEFUN([GLIB_WITH_NLS],
|
|
|
|
dnl NLS is obligatory
|
|
|
|
[USE_NLS=yes
|
|
|
|
AC_SUBST(USE_NLS)
|
|
|
|
|
|
|
|
gt_cv_have_gettext=no
|
|
|
|
|
|
|
|
CATOBJEXT=NONE
|
|
|
|
XGETTEXT=:
|
|
|
|
INTLLIBS=
|
|
|
|
|
|
|
|
AC_CHECK_HEADER(libintl.h,
|
|
|
|
[gt_cv_func_dgettext_libintl="no"
|
|
|
|
libintl_extra_libs=""
|
|
|
|
|
|
|
|
#
|
|
|
|
# First check in libc
|
|
|
|
#
|
|
|
|
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
|
|
|
|
[AC_TRY_LINK([
|
|
|
|
#include <libintl.h>
|
|
|
|
],
|
|
|
|
[return !ngettext ("","", 1)],
|
|
|
|
gt_cv_func_ngettext_libc=yes,
|
|
|
|
gt_cv_func_ngettext_libc=no)
|
|
|
|
])
|
|
|
|
|
|
|
|
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
|
|
|
|
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
|
|
|
|
[AC_TRY_LINK([
|
|
|
|
#include <libintl.h>
|
|
|
|
],
|
|
|
|
[return !dgettext ("","")],
|
|
|
|
gt_cv_func_dgettext_libc=yes,
|
|
|
|
gt_cv_func_dgettext_libc=no)
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
|
|
|
|
AC_CHECK_FUNCS(bind_textdomain_codeset)
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# If we don't have everything we want, check in libintl
|
|
|
|
#
|
|
|
|
if test "$gt_cv_func_dgettext_libc" != "yes" \
|
|
|
|
|| test "$gt_cv_func_ngettext_libc" != "yes" \
|
|
|
|
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
|
|
|
|
|
|
|
|
AC_CHECK_LIB(intl, bindtextdomain,
|
|
|
|
[AC_CHECK_LIB(intl, ngettext,
|
|
|
|
[AC_CHECK_LIB(intl, dgettext,
|
|
|
|
gt_cv_func_dgettext_libintl=yes)])])
|
|
|
|
|
|
|
|
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
|
|
|
|
AC_MSG_CHECKING([if -liconv is needed to use gettext])
|
|
|
|
AC_MSG_RESULT([])
|
|
|
|
AC_CHECK_LIB(intl, ngettext,
|
|
|
|
[AC_CHECK_LIB(intl, dcgettext,
|
|
|
|
[gt_cv_func_dgettext_libintl=yes
|
|
|
|
libintl_extra_libs=-liconv],
|
|
|
|
:,-liconv)],
|
|
|
|
:,-liconv)
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# If we found libintl, then check in it for bind_textdomain_codeset();
|
|
|
|
# we'll prefer libc if neither have bind_textdomain_codeset(),
|
|
|
|
# and both have dgettext and ngettext
|
|
|
|
#
|
|
|
|
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
|
|
|
|
glib_save_LIBS="$LIBS"
|
|
|
|
LIBS="$LIBS -lintl $libintl_extra_libs"
|
|
|
|
unset ac_cv_func_bind_textdomain_codeset
|
|
|
|
AC_CHECK_FUNCS(bind_textdomain_codeset)
|
|
|
|
LIBS="$glib_save_LIBS"
|
|
|
|
|
|
|
|
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
|
|
|
|
gt_cv_func_dgettext_libc=no
|
|
|
|
else
|
|
|
|
if test "$gt_cv_func_dgettext_libc" = "yes" \
|
|
|
|
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
|
|
|
|
gt_cv_func_dgettext_libintl=no
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$gt_cv_func_dgettext_libc" = "yes" \
|
|
|
|
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
|
|
|
|
gt_cv_have_gettext=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
|
|
|
|
INTLLIBS="-lintl $libintl_extra_libs"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$gt_cv_have_gettext" = "yes"; then
|
|
|
|
AC_DEFINE(HAVE_GETTEXT,1,
|
|
|
|
[Define if the GNU gettext() function is already present or preinstalled.])
|
|
|
|
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
|
|
|
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
|
|
|
|
if test "$MSGFMT" != "no"; then
|
|
|
|
glib_save_LIBS="$LIBS"
|
|
|
|
LIBS="$LIBS $INTLLIBS"
|
|
|
|
AC_CHECK_FUNCS(dcgettext)
|
|
|
|
MSGFMT_OPTS=
|
|
|
|
AC_MSG_CHECKING([if msgfmt accepts -c])
|
|
|
|
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
|
|
|
|
msgid ""
|
|
|
|
msgstr ""
|
|
|
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
|
|
"Project-Id-Version: test 1.0\n"
|
|
|
|
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
|
|
|
|
"Last-Translator: test <foo@bar.xx>\n"
|
|
|
|
"Language-Team: C <LL@li.org>\n"
|
|
|
|
"MIME-Version: 1.0\n"
|
|
|
|
"Content-Transfer-Encoding: 8bit\n"
|
|
|
|
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
|
|
|
|
AC_SUBST(MSGFMT_OPTS)
|
|
|
|
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
|
|
|
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
|
|
|
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
|
|
|
|
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
|
|
|
|
return _nl_msg_cat_cntr],
|
|
|
|
[CATOBJEXT=.gmo
|
|
|
|
DATADIRNAME=share],
|
|
|
|
[case $host in
|
|
|
|
*-*-solaris*)
|
|
|
|
dnl On Solaris, if bind_textdomain_codeset is in libc,
|
|
|
|
dnl GNU format message catalog is always supported,
|
|
|
|
dnl since both are added to the libc all together.
|
|
|
|
dnl Hence, we'd like to go with DATADIRNAME=share and
|
|
|
|
dnl and CATOBJEXT=.gmo in this case.
|
|
|
|
AC_CHECK_FUNC(bind_textdomain_codeset,
|
|
|
|
[CATOBJEXT=.gmo
|
|
|
|
DATADIRNAME=share],
|
|
|
|
[CATOBJEXT=.mo
|
|
|
|
DATADIRNAME=lib])
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
CATOBJEXT=.mo
|
|
|
|
DATADIRNAME=lib
|
|
|
|
;;
|
|
|
|
esac])
|
|
|
|
LIBS="$glib_save_LIBS"
|
|
|
|
INSTOBJEXT=.mo
|
|
|
|
else
|
|
|
|
gt_cv_have_gettext=no
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
if test "$gt_cv_have_gettext" = "yes" ; then
|
|
|
|
AC_DEFINE(ENABLE_NLS, 1,
|
|
|
|
[always defined to indicate that i18n is enabled])
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl Test whether we really found GNU xgettext.
|
|
|
|
if test "$XGETTEXT" != ":"; then
|
|
|
|
dnl If it is not GNU xgettext we define it as : so that the
|
|
|
|
dnl Makefiles still can work.
|
|
|
|
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
|
|
|
|
: ;
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(
|
|
|
|
[found xgettext program is not GNU xgettext; ignore it])
|
|
|
|
XGETTEXT=":"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# We need to process the po/ directory.
|
|
|
|
POSUB=po
|
|
|
|
|
|
|
|
AC_OUTPUT_COMMANDS(
|
|
|
|
[case "$CONFIG_FILES" in *po/Makefile.in*)
|
|
|
|
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
|
|
|
|
esac])
|
|
|
|
|
|
|
|
dnl These rules are solely for the distribution goal. While doing this
|
|
|
|
dnl we only have to keep exactly one list of the available catalogs
|
2011-01-10 07:25:56 -07:00
|
|
|
dnl in configure.ac.
|
2009-06-06 11:52:23 -06:00
|
|
|
for lang in $ALL_LINGUAS; do
|
|
|
|
GMOFILES="$GMOFILES $lang.gmo"
|
|
|
|
POFILES="$POFILES $lang.po"
|
|
|
|
done
|
|
|
|
|
|
|
|
dnl Make all variables we use known to autoconf.
|
|
|
|
AC_SUBST(CATALOGS)
|
|
|
|
AC_SUBST(CATOBJEXT)
|
|
|
|
AC_SUBST(DATADIRNAME)
|
|
|
|
AC_SUBST(GMOFILES)
|
|
|
|
AC_SUBST(INSTOBJEXT)
|
|
|
|
AC_SUBST(INTLLIBS)
|
|
|
|
AC_SUBST(PO_IN_DATADIR_TRUE)
|
|
|
|
AC_SUBST(PO_IN_DATADIR_FALSE)
|
|
|
|
AC_SUBST(POFILES)
|
|
|
|
AC_SUBST(POSUB)
|
|
|
|
])
|
|
|
|
|
|
|
|
# AM_GLIB_GNU_GETTEXT
|
|
|
|
# -------------------
|
|
|
|
# Do checks necessary for use of gettext. If a suitable implementation
|
|
|
|
# of gettext is found in either in libintl or in the C library,
|
|
|
|
# it will set INTLLIBS to the libraries needed for use of gettext
|
|
|
|
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
|
|
|
|
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
|
|
|
|
# on various variables needed by the Makefile.in.in installed by
|
|
|
|
# glib-gettextize.
|
|
|
|
dnl
|
|
|
|
glib_DEFUN([GLIB_GNU_GETTEXT],
|
|
|
|
[AC_REQUIRE([AC_PROG_CC])dnl
|
|
|
|
AC_REQUIRE([AC_HEADER_STDC])dnl
|
|
|
|
|
|
|
|
GLIB_LC_MESSAGES
|
|
|
|
GLIB_WITH_NLS
|
|
|
|
|
|
|
|
if test "$gt_cv_have_gettext" = "yes"; then
|
|
|
|
if test "x$ALL_LINGUAS" = "x"; then
|
|
|
|
LINGUAS=
|
|
|
|
else
|
|
|
|
AC_MSG_CHECKING(for catalogs to be installed)
|
|
|
|
NEW_LINGUAS=
|
|
|
|
for presentlang in $ALL_LINGUAS; do
|
|
|
|
useit=no
|
|
|
|
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
|
|
|
|
desiredlanguages="$LINGUAS"
|
|
|
|
else
|
|
|
|
desiredlanguages="$ALL_LINGUAS"
|
|
|
|
fi
|
|
|
|
for desiredlang in $desiredlanguages; do
|
|
|
|
# Use the presentlang catalog if desiredlang is
|
|
|
|
# a. equal to presentlang, or
|
|
|
|
# b. a variant of presentlang (because in this case,
|
|
|
|
# presentlang can be used as a fallback for messages
|
|
|
|
# which are not translated in the desiredlang catalog).
|
|
|
|
case "$desiredlang" in
|
|
|
|
"$presentlang"*) useit=yes;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
if test $useit = yes; then
|
|
|
|
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
LINGUAS=$NEW_LINGUAS
|
|
|
|
AC_MSG_RESULT($LINGUAS)
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl Construct list of names of catalog files to be constructed.
|
|
|
|
if test -n "$LINGUAS"; then
|
|
|
|
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
|
|
|
|
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
|
|
|
|
dnl Try to locate is.
|
|
|
|
MKINSTALLDIRS=
|
|
|
|
if test -n "$ac_aux_dir"; then
|
|
|
|
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
|
|
|
|
fi
|
|
|
|
if test -z "$MKINSTALLDIRS"; then
|
|
|
|
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
|
|
|
|
fi
|
|
|
|
AC_SUBST(MKINSTALLDIRS)
|
|
|
|
|
|
|
|
dnl Generate list of files to be processed by xgettext which will
|
|
|
|
dnl be included in po/Makefile.
|
|
|
|
test -d po || mkdir po
|
|
|
|
if test "x$srcdir" != "x."; then
|
|
|
|
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
|
|
|
|
posrcprefix="$srcdir/"
|
|
|
|
else
|
|
|
|
posrcprefix="../$srcdir/"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
posrcprefix="../"
|
|
|
|
fi
|
|
|
|
rm -f po/POTFILES
|
|
|
|
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
|
|
|
|
< $srcdir/po/POTFILES.in > po/POTFILES
|
|
|
|
])
|
|
|
|
|
|
|
|
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
|
|
|
|
# -------------------------------
|
|
|
|
# Define VARIABLE to the location where catalog files will
|
|
|
|
# be installed by po/Makefile.
|
|
|
|
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
|
|
|
|
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
|
|
|
|
glib_save_prefix="$prefix"
|
|
|
|
glib_save_exec_prefix="$exec_prefix"
|
|
|
|
glib_save_datarootdir="$datarootdir"
|
|
|
|
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
|
|
|
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
|
|
|
|
datarootdir=`eval echo "${datarootdir}"`
|
|
|
|
if test "x$CATOBJEXT" = "x.mo" ; then
|
|
|
|
localedir=`eval echo "${libdir}/locale"`
|
|
|
|
else
|
|
|
|
localedir=`eval echo "${datadir}/locale"`
|
|
|
|
fi
|
|
|
|
prefix="$glib_save_prefix"
|
|
|
|
exec_prefix="$glib_save_exec_prefix"
|
|
|
|
datarootdir="$glib_save_datarootdir"
|
|
|
|
AC_DEFINE_UNQUOTED($1, "$localedir",
|
|
|
|
[Define the location where the catalogs will be installed])
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Now the definitions that aclocal will find
|
|
|
|
dnl
|
2011-01-10 07:25:56 -07:00
|
|
|
ifdef(glib_configure_ac,[],[
|
2009-06-06 11:52:23 -06:00
|
|
|
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
|
|
|
|
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
|
|
|
|
])dnl
|
|
|
|
|
|
|
|
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
|
|
|
|
#
|
|
|
|
# Create a temporary file with TEST-FILE as its contents and pass the
|
|
|
|
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
|
|
|
|
# 0 and perform ACTION-IF-FAIL for any other exit status.
|
|
|
|
AC_DEFUN([GLIB_RUN_PROG],
|
|
|
|
[cat >conftest.foo <<_ACEOF
|
|
|
|
$2
|
|
|
|
_ACEOF
|
|
|
|
if AC_RUN_LOG([$1 conftest.foo]); then
|
|
|
|
m4_ifval([$3], [$3], [:])
|
|
|
|
m4_ifvaln([$4], [else $4])dnl
|
|
|
|
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
|
|
|
|
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
|
|
|
|
fi])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
|
|
|
|
# serial 40 IT_PROG_INTLTOOL
|
|
|
|
AC_DEFUN([IT_PROG_INTLTOOL], [
|
|
|
|
AC_PREREQ([2.50])dnl
|
|
|
|
AC_REQUIRE([AM_NLS])dnl
|
|
|
|
|
|
|
|
case "$am__api_version" in
|
|
|
|
1.[01234])
|
|
|
|
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if test -n "$1"; then
|
|
|
|
AC_MSG_CHECKING([for intltool >= $1])
|
|
|
|
|
|
|
|
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
|
|
|
|
INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
|
|
|
|
[INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
|
|
|
|
]
|
|
|
|
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
|
|
|
|
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
|
|
|
|
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
|
|
|
|
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
|
|
|
|
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
|
|
|
|
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
|
|
|
|
AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@'
|
|
|
|
INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
|
|
|
|
|
|
|
_IT_SUBST(INTLTOOL_DESKTOP_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_DIRECTORY_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_KEYS_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_PROP_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_OAF_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_PONG_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_SERVER_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_SHEET_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_SOUNDLIST_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_UI_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_XAM_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_KBD_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_XML_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_CAVES_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_SCHEMAS_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_THEME_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_SERVICE_RULE)
|
|
|
|
_IT_SUBST(INTLTOOL_POLICY_RULE)
|
|
|
|
|
|
|
|
# Check the gettext tools to make sure they are GNU
|
|
|
|
AC_PATH_PROG(XGETTEXT, xgettext)
|
|
|
|
AC_PATH_PROG(MSGMERGE, msgmerge)
|
|
|
|
AC_PATH_PROG(MSGFMT, msgfmt)
|
|
|
|
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
|
|
|
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
|
|
|
|
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
|
|
|
|
fi
|
|
|
|
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
|
|
|
|
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
|
|
|
|
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
|
|
|
|
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
|
|
|
|
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_PATH_PROG(INTLTOOL_PERL, perl)
|
|
|
|
if test -z "$INTLTOOL_PERL"; then
|
|
|
|
AC_MSG_ERROR([perl not found])
|
|
|
|
fi
|
|
|
|
AC_MSG_CHECKING([for perl >= 5.8.1])
|
|
|
|
$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1
|
|
|
|
if test $? -ne 0; then
|
|
|
|
AC_MSG_ERROR([perl 5.8.1 is required for intltool])
|
|
|
|
else
|
|
|
|
IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`"
|
|
|
|
AC_MSG_RESULT([$IT_PERL_VERSION])
|
|
|
|
fi
|
|
|
|
if test "x$2" != "xno-xml"; then
|
|
|
|
AC_MSG_CHECKING([for XML::Parser])
|
|
|
|
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
|
|
|
|
AC_MSG_RESULT([ok])
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([XML::Parser perl module is required for intltool])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Substitute ALL_LINGUAS so we can use it in po/Makefile
|
|
|
|
AC_SUBST(ALL_LINGUAS)
|
|
|
|
|
|
|
|
# Set DATADIRNAME correctly if it is not set yet
|
|
|
|
# (copied from glib-gettext.m4)
|
|
|
|
if test -z "$DATADIRNAME"; then
|
|
|
|
AC_LINK_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[]],
|
|
|
|
[[extern int _nl_msg_cat_cntr;
|
|
|
|
return _nl_msg_cat_cntr]])],
|
|
|
|
[DATADIRNAME=share],
|
|
|
|
[case $host in
|
|
|
|
*-*-solaris*)
|
|
|
|
dnl On Solaris, if bind_textdomain_codeset is in libc,
|
|
|
|
dnl GNU format message catalog is always supported,
|
|
|
|
dnl since both are added to the libc all together.
|
|
|
|
dnl Hence, we'd like to go with DATADIRNAME=share
|
|
|
|
dnl in this case.
|
|
|
|
AC_CHECK_FUNC(bind_textdomain_codeset,
|
|
|
|
[DATADIRNAME=share], [DATADIRNAME=lib])
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
[DATADIRNAME=lib]
|
|
|
|
;;
|
|
|
|
esac])
|
|
|
|
fi
|
|
|
|
AC_SUBST(DATADIRNAME)
|
|
|
|
|
|
|
|
IT_PO_SUBDIR([po])
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
# IT_PO_SUBDIR(DIRNAME)
|
|
|
|
# ---------------------
|
|
|
|
# All po subdirs have to be declared with this macro; the subdir "po" is
|
|
|
|
# declared by IT_PROG_INTLTOOL.
|
|
|
|
#
|
|
|
|
AC_DEFUN([IT_PO_SUBDIR],
|
|
|
|
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
|
|
|
|
dnl
|
2011-01-10 07:25:56 -07:00
|
|
|
dnl The following CONFIG_COMMANDS should be executed at the very end
|
2009-06-06 11:52:23 -06:00
|
|
|
dnl of config.status.
|
|
|
|
AC_CONFIG_COMMANDS_PRE([
|
|
|
|
AC_CONFIG_COMMANDS([$1/stamp-it], [
|
|
|
|
if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then
|
|
|
|
AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
|
|
|
|
fi
|
|
|
|
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
|
|
|
|
>"$1/stamp-it.tmp"
|
|
|
|
[sed '/^#/d
|
|
|
|
s/^[[].*] *//
|
|
|
|
/^[ ]*$/d
|
|
|
|
'"s|^| $ac_top_srcdir/|" \
|
|
|
|
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
|
|
|
|
]
|
|
|
|
[sed '/^POTFILES =/,/[^\\]$/ {
|
|
|
|
/^POTFILES =/!d
|
|
|
|
r $1/POTFILES
|
|
|
|
}
|
|
|
|
' "$1/Makefile.in" >"$1/Makefile"]
|
|
|
|
rm -f "$1/Makefile.tmp"
|
|
|
|
mv "$1/stamp-it.tmp" "$1/stamp-it"
|
|
|
|
])
|
|
|
|
])dnl
|
|
|
|
])
|
|
|
|
|
|
|
|
# _IT_SUBST(VARIABLE)
|
|
|
|
# -------------------
|
|
|
|
# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
|
|
|
|
#
|
|
|
|
AC_DEFUN([_IT_SUBST],
|
|
|
|
[
|
|
|
|
AC_SUBST([$1])
|
|
|
|
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
# deprecated macros
|
|
|
|
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
|
|
|
|
# A hint is needed for aclocal from Automake <= 1.9.4:
|
|
|
|
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
|
|
|
|
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# nls.m4 serial 5 (gettext-0.18)
|
|
|
|
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
|
|
|
|
dnl Inc.
|
2009-06-06 11:52:23 -06:00
|
|
|
dnl This file is free software; the Free Software Foundation
|
|
|
|
dnl gives unlimited permission to copy and/or distribute it,
|
|
|
|
dnl with or without modifications, as long as this notice is preserved.
|
|
|
|
dnl
|
|
|
|
dnl This file can can be used in projects which are not available under
|
|
|
|
dnl the GNU General Public License or the GNU Library General Public
|
|
|
|
dnl License but which still want to provide support for the GNU gettext
|
|
|
|
dnl functionality.
|
|
|
|
dnl Please note that the actual code of the GNU gettext library is covered
|
|
|
|
dnl by the GNU Library General Public License, and the rest of the GNU
|
|
|
|
dnl gettext package package is covered by the GNU General Public License.
|
|
|
|
dnl They are *not* in the public domain.
|
|
|
|
|
|
|
|
dnl Authors:
|
|
|
|
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
|
|
|
|
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
AC_PREREQ([2.50])
|
2009-06-06 11:52:23 -06:00
|
|
|
|
|
|
|
AC_DEFUN([AM_NLS],
|
|
|
|
[
|
|
|
|
AC_MSG_CHECKING([whether NLS is requested])
|
|
|
|
dnl Default is enabled NLS
|
2011-01-10 07:25:56 -07:00
|
|
|
AC_ARG_ENABLE([nls],
|
2009-06-06 11:52:23 -06:00
|
|
|
[ --disable-nls do not use Native Language Support],
|
|
|
|
USE_NLS=$enableval, USE_NLS=yes)
|
2011-01-10 07:25:56 -07:00
|
|
|
AC_MSG_RESULT([$USE_NLS])
|
|
|
|
AC_SUBST([USE_NLS])
|
2009-06-06 11:52:23 -06:00
|
|
|
])
|
|
|
|
|
2011-04-10 11:08:49 -06:00
|
|
|
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
|
|
|
# serial 1 (pkg-config-0.24)
|
|
|
|
#
|
|
|
|
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful, but
|
|
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
#
|
|
|
|
# As a special exception to the GNU General Public License, if you
|
|
|
|
# distribute this file as part of a program that contains a
|
|
|
|
# configuration script generated by Autoconf, you may include it under
|
|
|
|
# the same distribution terms that you use for the rest of that program.
|
|
|
|
|
|
|
|
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
|
|
|
|
# ----------------------------------
|
|
|
|
AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
|
|
|
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
|
2011-10-16 11:18:56 -06:00
|
|
|
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
|
|
|
|
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
|
2011-04-10 11:08:49 -06:00
|
|
|
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
|
|
|
|
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
|
|
|
|
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
|
|
|
|
|
|
|
|
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
|
|
|
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
|
|
|
fi
|
|
|
|
if test -n "$PKG_CONFIG"; then
|
|
|
|
_pkg_min_version=m4_default([$1], [0.9.0])
|
|
|
|
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
|
|
|
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
PKG_CONFIG=""
|
|
|
|
fi
|
|
|
|
fi[]dnl
|
|
|
|
])# PKG_PROG_PKG_CONFIG
|
|
|
|
|
|
|
|
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
|
|
|
#
|
|
|
|
# Check to see whether a particular set of modules exists. Similar
|
|
|
|
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
|
|
|
|
#
|
|
|
|
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
|
|
|
# only at the first occurence in configure.ac, so if the first place
|
|
|
|
# it's called might be skipped (such as if it is within an "if", you
|
|
|
|
# have to call PKG_CHECK_EXISTS manually
|
|
|
|
# --------------------------------------------------------------
|
|
|
|
AC_DEFUN([PKG_CHECK_EXISTS],
|
|
|
|
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
|
|
|
if test -n "$PKG_CONFIG" && \
|
|
|
|
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
|
|
|
|
m4_default([$2], [:])
|
|
|
|
m4_ifvaln([$3], [else
|
|
|
|
$3])dnl
|
|
|
|
fi])
|
|
|
|
|
|
|
|
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
|
|
|
|
# ---------------------------------------------
|
|
|
|
m4_define([_PKG_CONFIG],
|
|
|
|
[if test -n "$$1"; then
|
|
|
|
pkg_cv_[]$1="$$1"
|
|
|
|
elif test -n "$PKG_CONFIG"; then
|
|
|
|
PKG_CHECK_EXISTS([$3],
|
2011-10-16 11:18:56 -06:00
|
|
|
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
|
|
|
|
test "x$?" != "x0" && pkg_failed=yes ],
|
2011-04-10 11:08:49 -06:00
|
|
|
[pkg_failed=yes])
|
|
|
|
else
|
|
|
|
pkg_failed=untried
|
|
|
|
fi[]dnl
|
|
|
|
])# _PKG_CONFIG
|
|
|
|
|
|
|
|
# _PKG_SHORT_ERRORS_SUPPORTED
|
|
|
|
# -----------------------------
|
|
|
|
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
|
|
|
|
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
|
|
|
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
|
|
|
_pkg_short_errors_supported=yes
|
|
|
|
else
|
|
|
|
_pkg_short_errors_supported=no
|
|
|
|
fi[]dnl
|
|
|
|
])# _PKG_SHORT_ERRORS_SUPPORTED
|
|
|
|
|
|
|
|
|
|
|
|
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
|
|
|
# [ACTION-IF-NOT-FOUND])
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Note that if there is a possibility the first call to
|
|
|
|
# PKG_CHECK_MODULES might not happen, you should be sure to include an
|
|
|
|
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# --------------------------------------------------------------
|
|
|
|
AC_DEFUN([PKG_CHECK_MODULES],
|
|
|
|
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
|
|
|
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
|
|
|
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
|
|
|
|
|
|
|
pkg_failed=no
|
|
|
|
AC_MSG_CHECKING([for $1])
|
|
|
|
|
|
|
|
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
|
|
|
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
|
|
|
|
|
|
|
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
|
|
|
|
and $1[]_LIBS to avoid the need to call pkg-config.
|
|
|
|
See the pkg-config man page for more details.])
|
|
|
|
|
|
|
|
if test $pkg_failed = yes; then
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
_PKG_SHORT_ERRORS_SUPPORTED
|
|
|
|
if test $_pkg_short_errors_supported = yes; then
|
2011-10-16 11:18:56 -06:00
|
|
|
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
|
2011-04-10 11:08:49 -06:00
|
|
|
else
|
2011-10-16 11:18:56 -06:00
|
|
|
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
|
2011-04-10 11:08:49 -06:00
|
|
|
fi
|
|
|
|
# Put the nasty error message in config.log where it belongs
|
|
|
|
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
|
|
|
|
|
|
|
m4_default([$4], [AC_MSG_ERROR(
|
|
|
|
[Package requirements ($2) were not met:
|
|
|
|
|
|
|
|
$$1_PKG_ERRORS
|
|
|
|
|
|
|
|
Consider adjusting the PKG_CONFIG_PATH environment variable if you
|
|
|
|
installed software in a non-standard prefix.
|
|
|
|
|
2011-07-01 08:25:24 -06:00
|
|
|
_PKG_TEXT])[]dnl
|
2011-04-10 11:08:49 -06:00
|
|
|
])
|
|
|
|
elif test $pkg_failed = untried; then
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
m4_default([$4], [AC_MSG_FAILURE(
|
|
|
|
[The pkg-config script could not be found or is too old. Make sure it
|
|
|
|
is in your PATH or set the PKG_CONFIG environment variable to the full
|
|
|
|
path to pkg-config.
|
|
|
|
|
|
|
|
_PKG_TEXT
|
|
|
|
|
2011-07-01 08:25:24 -06:00
|
|
|
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
|
2011-04-10 11:08:49 -06:00
|
|
|
])
|
|
|
|
else
|
|
|
|
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
|
|
|
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
$3
|
|
|
|
fi[]dnl
|
|
|
|
])# PKG_CHECK_MODULES
|
|
|
|
|
2011-10-16 11:18:56 -06:00
|
|
|
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
|
|
|
|
dnl
|
|
|
|
dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
|
|
|
|
dnl
|
|
|
|
dnl Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
dnl copy of this software and associated documentation files (the "Software"),
|
|
|
|
dnl to deal in the Software without restriction, including without limitation
|
|
|
|
dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
dnl and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
dnl Software is furnished to do so, subject to the following conditions:
|
|
|
|
dnl
|
|
|
|
dnl The above copyright notice and this permission notice (including the next
|
|
|
|
dnl paragraph) shall be included in all copies or substantial portions of the
|
|
|
|
dnl Software.
|
|
|
|
dnl
|
|
|
|
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
dnl DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
# XORG_MACROS_VERSION(required-version)
|
|
|
|
# -------------------------------------
|
|
|
|
# Minimum version: 1.1.0
|
|
|
|
#
|
|
|
|
# If you're using a macro added in Version 1.1 or newer, include this in
|
|
|
|
# your configure.ac with the minimum required version, such as:
|
|
|
|
# XORG_MACROS_VERSION(1.1)
|
|
|
|
#
|
|
|
|
# To ensure that this macro is defined, also add:
|
|
|
|
# m4_ifndef([XORG_MACROS_VERSION],
|
|
|
|
# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# See the "minimum version" comment for each macro you use to see what
|
|
|
|
# version you require.
|
|
|
|
m4_defun([XORG_MACROS_VERSION],[
|
|
|
|
m4_define([vers_have], [1.15.0])
|
|
|
|
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
|
|
|
|
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
|
|
|
|
m4_if(m4_cmp(maj_have, maj_needed), 0,,
|
|
|
|
[m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
|
|
|
|
m4_if(m4_version_compare(vers_have, [$1]), -1,
|
|
|
|
[m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
|
|
|
|
m4_undefine([vers_have])
|
|
|
|
m4_undefine([maj_have])
|
|
|
|
m4_undefine([maj_needed])
|
|
|
|
]) # XORG_MACROS_VERSION
|
|
|
|
|
|
|
|
# XORG_PROG_RAWCPP()
|
|
|
|
# ------------------
|
|
|
|
# Minimum version: 1.0.0
|
|
|
|
#
|
|
|
|
# Find cpp program and necessary flags for use in pre-processing text files
|
|
|
|
# such as man pages and config files
|
|
|
|
AC_DEFUN([XORG_PROG_RAWCPP],[
|
|
|
|
AC_REQUIRE([AC_PROG_CPP])
|
|
|
|
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
|
|
|
|
[$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
|
|
|
|
|
|
|
|
# Check for flag to avoid builtin definitions - assumes unix is predefined,
|
|
|
|
# which is not the best choice for supporting other OS'es, but covers most
|
|
|
|
# of the ones we need for now.
|
|
|
|
AC_MSG_CHECKING([if $RAWCPP requires -undef])
|
|
|
|
AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
|
|
|
|
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
else
|
|
|
|
if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
|
|
|
|
RAWCPPFLAGS=-undef
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
# under Cygwin unix is still defined even with -undef
|
|
|
|
elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
|
|
|
|
RAWCPPFLAGS="-undef -ansi"
|
|
|
|
AC_MSG_RESULT([yes, with -ansi])
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
rm -f conftest.$ac_ext
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([if $RAWCPP requires -traditional])
|
|
|
|
AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
|
|
|
|
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
else
|
|
|
|
if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
|
|
|
|
RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
rm -f conftest.$ac_ext
|
|
|
|
AC_SUBST(RAWCPPFLAGS)
|
|
|
|
]) # XORG_PROG_RAWCPP
|
|
|
|
|
|
|
|
# XORG_MANPAGE_SECTIONS()
|
|
|
|
# -----------------------
|
|
|
|
# Minimum version: 1.0.0
|
|
|
|
#
|
|
|
|
# Determine which sections man pages go in for the different man page types
|
|
|
|
# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
|
|
|
|
# Not sure if there's any better way than just hardcoding by OS name.
|
|
|
|
# Override default settings by setting environment variables
|
|
|
|
# Added MAN_SUBSTS in version 1.8
|
|
|
|
# Added AC_PROG_SED in version 1.8
|
|
|
|
|
|
|
|
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
|
|
|
|
AC_REQUIRE([AC_CANONICAL_HOST])
|
|
|
|
AC_REQUIRE([AC_PROG_SED])
|
|
|
|
|
|
|
|
if test x$APP_MAN_SUFFIX = x ; then
|
|
|
|
APP_MAN_SUFFIX=1
|
|
|
|
fi
|
|
|
|
if test x$APP_MAN_DIR = x ; then
|
|
|
|
APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test x$LIB_MAN_SUFFIX = x ; then
|
|
|
|
LIB_MAN_SUFFIX=3
|
|
|
|
fi
|
|
|
|
if test x$LIB_MAN_DIR = x ; then
|
|
|
|
LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test x$FILE_MAN_SUFFIX = x ; then
|
|
|
|
case $host_os in
|
|
|
|
solaris*) FILE_MAN_SUFFIX=4 ;;
|
|
|
|
*) FILE_MAN_SUFFIX=5 ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
if test x$FILE_MAN_DIR = x ; then
|
|
|
|
FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test x$MISC_MAN_SUFFIX = x ; then
|
|
|
|
case $host_os in
|
|
|
|
solaris*) MISC_MAN_SUFFIX=5 ;;
|
|
|
|
*) MISC_MAN_SUFFIX=7 ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
if test x$MISC_MAN_DIR = x ; then
|
|
|
|
MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test x$DRIVER_MAN_SUFFIX = x ; then
|
|
|
|
case $host_os in
|
|
|
|
solaris*) DRIVER_MAN_SUFFIX=7 ;;
|
|
|
|
*) DRIVER_MAN_SUFFIX=4 ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
if test x$DRIVER_MAN_DIR = x ; then
|
|
|
|
DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test x$ADMIN_MAN_SUFFIX = x ; then
|
|
|
|
case $host_os in
|
|
|
|
solaris*) ADMIN_MAN_SUFFIX=1m ;;
|
|
|
|
*) ADMIN_MAN_SUFFIX=8 ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
if test x$ADMIN_MAN_DIR = x ; then
|
|
|
|
ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
AC_SUBST([APP_MAN_SUFFIX])
|
|
|
|
AC_SUBST([LIB_MAN_SUFFIX])
|
|
|
|
AC_SUBST([FILE_MAN_SUFFIX])
|
|
|
|
AC_SUBST([MISC_MAN_SUFFIX])
|
|
|
|
AC_SUBST([DRIVER_MAN_SUFFIX])
|
|
|
|
AC_SUBST([ADMIN_MAN_SUFFIX])
|
|
|
|
AC_SUBST([APP_MAN_DIR])
|
|
|
|
AC_SUBST([LIB_MAN_DIR])
|
|
|
|
AC_SUBST([FILE_MAN_DIR])
|
|
|
|
AC_SUBST([MISC_MAN_DIR])
|
|
|
|
AC_SUBST([DRIVER_MAN_DIR])
|
|
|
|
AC_SUBST([ADMIN_MAN_DIR])
|
|
|
|
|
|
|
|
XORG_MAN_PAGE="X Version 11"
|
|
|
|
AC_SUBST([XORG_MAN_PAGE])
|
|
|
|
MAN_SUBSTS="\
|
|
|
|
-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
|
|
|
|
-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
|
|
|
|
-e 's|__xservername__|Xorg|g' \
|
|
|
|
-e 's|__xconfigfile__|xorg.conf|g' \
|
|
|
|
-e 's|__projectroot__|\$(prefix)|g' \
|
|
|
|
-e 's|__apploaddir__|\$(appdefaultdir)|g' \
|
|
|
|
-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
|
|
|
|
-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
|
|
|
|
-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
|
|
|
|
-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
|
|
|
|
-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
|
|
|
|
-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
|
|
|
|
AC_SUBST([MAN_SUBSTS])
|
|
|
|
|
|
|
|
]) # XORG_MANPAGE_SECTIONS
|
|
|
|
|
|
|
|
# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
|
|
|
|
# ------------------------
|
|
|
|
# Minimum version: 1.7.0
|
|
|
|
#
|
|
|
|
# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
|
|
|
|
# provided by xorg-sgml-doctools, if installed.
|
|
|
|
AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
|
|
|
|
AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
|
|
|
|
XORG_SGML_PATH=
|
|
|
|
PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
|
|
|
|
[XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
|
|
|
|
[m4_ifval([$1],[:],
|
|
|
|
[if test x"$cross_compiling" != x"yes" ; then
|
|
|
|
AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
|
|
|
|
[XORG_SGML_PATH=$prefix/share/sgml])
|
|
|
|
fi])
|
|
|
|
])
|
|
|
|
|
|
|
|
# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
|
|
|
|
# the path and the name of the doc stylesheet
|
|
|
|
if test "x$XORG_SGML_PATH" != "x" ; then
|
|
|
|
AC_MSG_RESULT([$XORG_SGML_PATH])
|
|
|
|
STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
|
|
|
|
XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(XORG_SGML_PATH)
|
|
|
|
AC_SUBST(STYLESHEET_SRCDIR)
|
|
|
|
AC_SUBST(XSL_STYLESHEET)
|
|
|
|
AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
|
|
|
|
]) # XORG_CHECK_SGML_DOCTOOLS
|
|
|
|
|
|
|
|
# XORG_CHECK_LINUXDOC
|
|
|
|
# -------------------
|
|
|
|
# Minimum version: 1.0.0
|
|
|
|
#
|
|
|
|
# Defines the variable MAKE_TEXT if the necessary tools and
|
|
|
|
# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
|
|
|
|
# Whether or not the necessary tools and files are found can be checked
|
|
|
|
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
|
|
|
|
AC_DEFUN([XORG_CHECK_LINUXDOC],[
|
|
|
|
AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
|
|
|
|
AC_REQUIRE([XORG_WITH_PS2PDF])
|
|
|
|
|
|
|
|
AC_PATH_PROG(LINUXDOC, linuxdoc)
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether to build documentation])
|
|
|
|
|
|
|
|
if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
|
|
|
|
BUILDDOC=yes
|
|
|
|
else
|
|
|
|
BUILDDOC=no
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
|
|
|
|
|
|
|
|
AC_MSG_RESULT([$BUILDDOC])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether to build pdf documentation])
|
|
|
|
|
|
|
|
if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
|
|
|
|
BUILDPDFDOC=yes
|
|
|
|
else
|
|
|
|
BUILDPDFDOC=no
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
|
|
|
|
|
|
|
|
AC_MSG_RESULT([$BUILDPDFDOC])
|
|
|
|
|
|
|
|
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
|
|
|
|
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
|
|
|
|
MAKE_PDF="$PS2PDF"
|
|
|
|
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
|
|
|
|
|
|
|
|
AC_SUBST(MAKE_TEXT)
|
|
|
|
AC_SUBST(MAKE_PS)
|
|
|
|
AC_SUBST(MAKE_PDF)
|
|
|
|
AC_SUBST(MAKE_HTML)
|
|
|
|
]) # XORG_CHECK_LINUXDOC
|
|
|
|
|
|
|
|
# XORG_CHECK_DOCBOOK
|
|
|
|
# -------------------
|
|
|
|
# Minimum version: 1.0.0
|
|
|
|
#
|
|
|
|
# Checks for the ability to build output formats from SGML DocBook source.
|
|
|
|
# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
|
|
|
|
# indicates whether the necessary tools and files are found and, if set,
|
|
|
|
# $(MAKE_XXX) blah.sgml will produce blah.xxx.
|
|
|
|
AC_DEFUN([XORG_CHECK_DOCBOOK],[
|
|
|
|
AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
|
|
|
|
|
|
|
|
BUILDTXTDOC=no
|
|
|
|
BUILDPDFDOC=no
|
|
|
|
BUILDPSDOC=no
|
|
|
|
BUILDHTMLDOC=no
|
|
|
|
|
|
|
|
AC_PATH_PROG(DOCBOOKPS, docbook2ps)
|
|
|
|
AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
|
|
|
|
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
|
|
|
|
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether to build text documentation])
|
|
|
|
if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
|
|
|
|
test x$BUILD_TXTDOC != xno; then
|
|
|
|
BUILDTXTDOC=yes
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
|
|
|
|
AC_MSG_RESULT([$BUILDTXTDOC])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether to build PDF documentation])
|
|
|
|
if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
|
|
|
|
test x$BUILD_PDFDOC != xno; then
|
|
|
|
BUILDPDFDOC=yes
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
|
|
|
|
AC_MSG_RESULT([$BUILDPDFDOC])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether to build PostScript documentation])
|
|
|
|
if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
|
|
|
|
test x$BUILD_PSDOC != xno; then
|
|
|
|
BUILDPSDOC=yes
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
|
|
|
|
AC_MSG_RESULT([$BUILDPSDOC])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether to build HTML documentation])
|
|
|
|
if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
|
|
|
|
test x$BUILD_HTMLDOC != xno; then
|
|
|
|
BUILDHTMLDOC=yes
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
|
|
|
|
AC_MSG_RESULT([$BUILDHTMLDOC])
|
|
|
|
|
|
|
|
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
|
|
|
|
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
|
|
|
|
MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
|
|
|
|
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
|
|
|
|
|
|
|
|
AC_SUBST(MAKE_TEXT)
|
|
|
|
AC_SUBST(MAKE_PS)
|
|
|
|
AC_SUBST(MAKE_PDF)
|
|
|
|
AC_SUBST(MAKE_HTML)
|
|
|
|
]) # XORG_CHECK_DOCBOOK
|
|
|
|
|
|
|
|
# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
|
|
|
|
# ----------------
|
|
|
|
# Minimum version: 1.5.0
|
|
|
|
# Minimum version for optional DEFAULT argument: 1.11.0
|
|
|
|
#
|
|
|
|
# Documentation tools are not always available on all platforms and sometimes
|
|
|
|
# not at the appropriate level. This macro enables a module to test for the
|
|
|
|
# presence of the tool and obtain it's path in separate variables. Coupled with
|
|
|
|
# the --with-xmlto option, it allows maximum flexibilty in making decisions
|
|
|
|
# as whether or not to use the xmlto package. When DEFAULT is not specified,
|
|
|
|
# --with-xmlto assumes 'auto'.
|
|
|
|
#
|
|
|
|
# Interface to module:
|
|
|
|
# HAVE_XMLTO: used in makefiles to conditionally generate documentation
|
|
|
|
# XMLTO: returns the path of the xmlto program found
|
|
|
|
# returns the path set by the user in the environment
|
|
|
|
# --with-xmlto: 'yes' user instructs the module to use xmlto
|
|
|
|
# 'no' user instructs the module not to use xmlto
|
|
|
|
#
|
|
|
|
# Added in version 1.10.0
|
|
|
|
# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
|
|
|
|
# xmlto for text output requires either lynx, links, or w3m browsers
|
|
|
|
#
|
|
|
|
# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_WITH_XMLTO],[
|
|
|
|
AC_ARG_VAR([XMLTO], [Path to xmlto command])
|
|
|
|
m4_define([_defopt], m4_default([$2], [auto]))
|
|
|
|
AC_ARG_WITH(xmlto,
|
|
|
|
AS_HELP_STRING([--with-xmlto],
|
|
|
|
[Use xmlto to regenerate documentation (default: ]_defopt[)]),
|
|
|
|
[use_xmlto=$withval], [use_xmlto=]_defopt)
|
|
|
|
m4_undefine([_defopt])
|
|
|
|
|
|
|
|
if test "x$use_xmlto" = x"auto"; then
|
|
|
|
AC_PATH_PROG([XMLTO], [xmlto])
|
|
|
|
if test "x$XMLTO" = "x"; then
|
|
|
|
AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
|
|
|
|
have_xmlto=no
|
|
|
|
else
|
|
|
|
have_xmlto=yes
|
|
|
|
fi
|
|
|
|
elif test "x$use_xmlto" = x"yes" ; then
|
|
|
|
AC_PATH_PROG([XMLTO], [xmlto])
|
|
|
|
if test "x$XMLTO" = "x"; then
|
|
|
|
AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
|
|
|
|
fi
|
|
|
|
have_xmlto=yes
|
|
|
|
elif test "x$use_xmlto" = x"no" ; then
|
|
|
|
if test "x$XMLTO" != "x"; then
|
|
|
|
AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
|
|
|
|
fi
|
|
|
|
have_xmlto=no
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Test for a minimum version of xmlto, if provided.
|
|
|
|
m4_ifval([$1],
|
|
|
|
[if test "$have_xmlto" = yes; then
|
|
|
|
# scrape the xmlto version
|
|
|
|
AC_MSG_CHECKING([the xmlto version])
|
|
|
|
xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
|
|
|
|
AC_MSG_RESULT([$xmlto_version])
|
|
|
|
AS_VERSION_COMPARE([$xmlto_version], [$1],
|
|
|
|
[if test "x$use_xmlto" = xauto; then
|
|
|
|
AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
|
|
|
|
have_xmlto=no
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
|
|
|
|
fi])
|
|
|
|
fi])
|
|
|
|
|
|
|
|
# Test for the ability of xmlto to generate a text target
|
|
|
|
have_xmlto_text=no
|
|
|
|
cat > conftest.xml << "EOF"
|
|
|
|
EOF
|
|
|
|
AS_IF([test "$have_xmlto" = yes],
|
|
|
|
[AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
|
|
|
|
[have_xmlto_text=yes],
|
|
|
|
[AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
|
|
|
|
rm -f conftest.xml
|
|
|
|
AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
|
|
|
|
AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
|
|
|
|
]) # XORG_WITH_XMLTO
|
|
|
|
|
|
|
|
# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
|
|
|
|
# --------------------------------------------
|
|
|
|
# Minimum version: 1.12.0
|
|
|
|
# Minimum version for optional DEFAULT argument: 1.12.0
|
|
|
|
#
|
|
|
|
# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
|
|
|
|
# XML-based language used for the transformation of XML documents.
|
|
|
|
# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
|
|
|
|
# It is used under the cover by xmlto to generate html files from DocBook/XML.
|
|
|
|
# The XSLT processor is often used as a standalone tool for transformations.
|
|
|
|
# It should not be assumed that this tool is used only to work with documnetation.
|
|
|
|
# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
|
|
|
|
#
|
|
|
|
# Interface to module:
|
|
|
|
# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
|
|
|
|
# XSLTPROC: returns the path of the xsltproc program found
|
|
|
|
# returns the path set by the user in the environment
|
|
|
|
# --with-xsltproc: 'yes' user instructs the module to use xsltproc
|
|
|
|
# 'no' user instructs the module not to use xsltproc
|
|
|
|
# have_xsltproc: returns yes if xsltproc found in PATH or no
|
|
|
|
#
|
|
|
|
# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_WITH_XSLTPROC],[
|
|
|
|
AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
|
|
|
|
# Preserves the interface, should it be implemented later
|
|
|
|
m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
|
|
|
|
m4_define([_defopt], m4_default([$2], [auto]))
|
|
|
|
AC_ARG_WITH(xsltproc,
|
|
|
|
AS_HELP_STRING([--with-xsltproc],
|
|
|
|
[Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
|
|
|
|
[use_xsltproc=$withval], [use_xsltproc=]_defopt)
|
|
|
|
m4_undefine([_defopt])
|
|
|
|
|
|
|
|
if test "x$use_xsltproc" = x"auto"; then
|
|
|
|
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
|
|
|
if test "x$XSLTPROC" = "x"; then
|
|
|
|
AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
|
|
|
|
have_xsltproc=no
|
|
|
|
else
|
|
|
|
have_xsltproc=yes
|
|
|
|
fi
|
|
|
|
elif test "x$use_xsltproc" = x"yes" ; then
|
|
|
|
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
|
|
|
if test "x$XSLTPROC" = "x"; then
|
|
|
|
AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
|
|
|
|
fi
|
|
|
|
have_xsltproc=yes
|
|
|
|
elif test "x$use_xsltproc" = x"no" ; then
|
|
|
|
if test "x$XSLTPROC" != "x"; then
|
|
|
|
AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
|
|
|
|
fi
|
|
|
|
have_xsltproc=no
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
|
|
|
|
]) # XORG_WITH_XSLTPROC
|
|
|
|
|
|
|
|
# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
|
|
|
|
# ----------------------------------------
|
|
|
|
# Minimum version: 1.15.0
|
|
|
|
#
|
|
|
|
# PERL (Practical Extraction and Report Language) is a language optimized for
|
|
|
|
# scanning arbitrary text files, extracting information from those text files,
|
|
|
|
# and printing reports based on that information.
|
|
|
|
#
|
|
|
|
# When DEFAULT is not specified, --with-perl assumes 'auto'.
|
|
|
|
#
|
|
|
|
# Interface to module:
|
|
|
|
# HAVE_PERL: used in makefiles to conditionally scan text files
|
|
|
|
# PERL: returns the path of the perl program found
|
|
|
|
# returns the path set by the user in the environment
|
|
|
|
# --with-perl: 'yes' user instructs the module to use perl
|
|
|
|
# 'no' user instructs the module not to use perl
|
|
|
|
# have_perl: returns yes if perl found in PATH or no
|
|
|
|
#
|
|
|
|
# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_WITH_PERL],[
|
|
|
|
AC_ARG_VAR([PERL], [Path to perl command])
|
|
|
|
# Preserves the interface, should it be implemented later
|
|
|
|
m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
|
|
|
|
m4_define([_defopt], m4_default([$2], [auto]))
|
|
|
|
AC_ARG_WITH(perl,
|
|
|
|
AS_HELP_STRING([--with-perl],
|
|
|
|
[Use perl for extracting information from files (default: ]_defopt[)]),
|
|
|
|
[use_perl=$withval], [use_perl=]_defopt)
|
|
|
|
m4_undefine([_defopt])
|
|
|
|
|
|
|
|
if test "x$use_perl" = x"auto"; then
|
|
|
|
AC_PATH_PROG([PERL], [perl])
|
|
|
|
if test "x$PERL" = "x"; then
|
|
|
|
AC_MSG_WARN([perl not found - cannot extract information and report])
|
|
|
|
have_perl=no
|
|
|
|
else
|
|
|
|
have_perl=yes
|
|
|
|
fi
|
|
|
|
elif test "x$use_perl" = x"yes" ; then
|
|
|
|
AC_PATH_PROG([PERL], [perl])
|
|
|
|
if test "x$PERL" = "x"; then
|
|
|
|
AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
|
|
|
|
fi
|
|
|
|
have_perl=yes
|
|
|
|
elif test "x$use_perl" = x"no" ; then
|
|
|
|
if test "x$PERL" != "x"; then
|
|
|
|
AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
|
|
|
|
fi
|
|
|
|
have_perl=no
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
|
|
|
|
]) # XORG_WITH_PERL
|
|
|
|
|
|
|
|
# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
|
|
|
|
# ----------------
|
|
|
|
# Minimum version: 1.5.0
|
|
|
|
# Minimum version for optional DEFAULT argument: 1.11.0
|
|
|
|
#
|
|
|
|
# Documentation tools are not always available on all platforms and sometimes
|
|
|
|
# not at the appropriate level. This macro enables a module to test for the
|
|
|
|
# presence of the tool and obtain it's path in separate variables. Coupled with
|
|
|
|
# the --with-asciidoc option, it allows maximum flexibilty in making decisions
|
|
|
|
# as whether or not to use the asciidoc package. When DEFAULT is not specified,
|
|
|
|
# --with-asciidoc assumes 'auto'.
|
|
|
|
#
|
|
|
|
# Interface to module:
|
|
|
|
# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
|
|
|
|
# ASCIIDOC: returns the path of the asciidoc program found
|
|
|
|
# returns the path set by the user in the environment
|
|
|
|
# --with-asciidoc: 'yes' user instructs the module to use asciidoc
|
|
|
|
# 'no' user instructs the module not to use asciidoc
|
|
|
|
#
|
|
|
|
# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_WITH_ASCIIDOC],[
|
|
|
|
AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
|
|
|
|
m4_define([_defopt], m4_default([$2], [auto]))
|
|
|
|
AC_ARG_WITH(asciidoc,
|
|
|
|
AS_HELP_STRING([--with-asciidoc],
|
|
|
|
[Use asciidoc to regenerate documentation (default: ]_defopt[)]),
|
|
|
|
[use_asciidoc=$withval], [use_asciidoc=]_defopt)
|
|
|
|
m4_undefine([_defopt])
|
|
|
|
|
|
|
|
if test "x$use_asciidoc" = x"auto"; then
|
|
|
|
AC_PATH_PROG([ASCIIDOC], [asciidoc])
|
|
|
|
if test "x$ASCIIDOC" = "x"; then
|
|
|
|
AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
|
|
|
|
have_asciidoc=no
|
|
|
|
else
|
|
|
|
have_asciidoc=yes
|
|
|
|
fi
|
|
|
|
elif test "x$use_asciidoc" = x"yes" ; then
|
|
|
|
AC_PATH_PROG([ASCIIDOC], [asciidoc])
|
|
|
|
if test "x$ASCIIDOC" = "x"; then
|
|
|
|
AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
|
|
|
|
fi
|
|
|
|
have_asciidoc=yes
|
|
|
|
elif test "x$use_asciidoc" = x"no" ; then
|
|
|
|
if test "x$ASCIIDOC" != "x"; then
|
|
|
|
AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
|
|
|
|
fi
|
|
|
|
have_asciidoc=no
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
|
|
|
|
fi
|
|
|
|
m4_ifval([$1],
|
|
|
|
[if test "$have_asciidoc" = yes; then
|
|
|
|
# scrape the asciidoc version
|
|
|
|
AC_MSG_CHECKING([the asciidoc version])
|
|
|
|
asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
|
|
|
|
AC_MSG_RESULT([$asciidoc_version])
|
|
|
|
AS_VERSION_COMPARE([$asciidoc_version], [$1],
|
|
|
|
[if test "x$use_asciidoc" = xauto; then
|
|
|
|
AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
|
|
|
|
have_asciidoc=no
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
|
|
|
|
fi])
|
|
|
|
fi])
|
|
|
|
AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
|
|
|
|
]) # XORG_WITH_ASCIIDOC
|
|
|
|
|
|
|
|
# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
|
|
|
|
# --------------------------------
|
|
|
|
# Minimum version: 1.5.0
|
|
|
|
# Minimum version for optional DEFAULT argument: 1.11.0
|
|
|
|
#
|
|
|
|
# Documentation tools are not always available on all platforms and sometimes
|
|
|
|
# not at the appropriate level. This macro enables a module to test for the
|
|
|
|
# presence of the tool and obtain it's path in separate variables. Coupled with
|
|
|
|
# the --with-doxygen option, it allows maximum flexibilty in making decisions
|
|
|
|
# as whether or not to use the doxygen package. When DEFAULT is not specified,
|
|
|
|
# --with-doxygen assumes 'auto'.
|
|
|
|
#
|
|
|
|
# Interface to module:
|
|
|
|
# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
|
|
|
|
# DOXYGEN: returns the path of the doxygen program found
|
|
|
|
# returns the path set by the user in the environment
|
|
|
|
# --with-doxygen: 'yes' user instructs the module to use doxygen
|
|
|
|
# 'no' user instructs the module not to use doxygen
|
|
|
|
#
|
|
|
|
# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_WITH_DOXYGEN],[
|
|
|
|
AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
|
|
|
|
m4_define([_defopt], m4_default([$2], [auto]))
|
|
|
|
AC_ARG_WITH(doxygen,
|
|
|
|
AS_HELP_STRING([--with-doxygen],
|
|
|
|
[Use doxygen to regenerate documentation (default: ]_defopt[)]),
|
|
|
|
[use_doxygen=$withval], [use_doxygen=]_defopt)
|
|
|
|
m4_undefine([_defopt])
|
|
|
|
|
|
|
|
if test "x$use_doxygen" = x"auto"; then
|
|
|
|
AC_PATH_PROG([DOXYGEN], [doxygen])
|
|
|
|
if test "x$DOXYGEN" = "x"; then
|
|
|
|
AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
|
|
|
|
have_doxygen=no
|
|
|
|
else
|
|
|
|
have_doxygen=yes
|
|
|
|
fi
|
|
|
|
elif test "x$use_doxygen" = x"yes" ; then
|
|
|
|
AC_PATH_PROG([DOXYGEN], [doxygen])
|
|
|
|
if test "x$DOXYGEN" = "x"; then
|
|
|
|
AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
|
|
|
|
fi
|
|
|
|
have_doxygen=yes
|
|
|
|
elif test "x$use_doxygen" = x"no" ; then
|
|
|
|
if test "x$DOXYGEN" != "x"; then
|
|
|
|
AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
|
|
|
|
fi
|
|
|
|
have_doxygen=no
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
|
|
|
|
fi
|
|
|
|
m4_ifval([$1],
|
|
|
|
[if test "$have_doxygen" = yes; then
|
|
|
|
# scrape the doxygen version
|
|
|
|
AC_MSG_CHECKING([the doxygen version])
|
|
|
|
doxygen_version=`$DOXYGEN --version 2>/dev/null`
|
|
|
|
AC_MSG_RESULT([$doxygen_version])
|
|
|
|
AS_VERSION_COMPARE([$doxygen_version], [$1],
|
|
|
|
[if test "x$use_doxygen" = xauto; then
|
|
|
|
AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
|
|
|
|
have_doxygen=no
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
|
|
|
|
fi])
|
|
|
|
fi])
|
|
|
|
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
|
|
|
|
]) # XORG_WITH_DOXYGEN
|
|
|
|
|
|
|
|
# XORG_WITH_GROFF([DEFAULT])
|
|
|
|
# ----------------
|
|
|
|
# Minimum version: 1.6.0
|
|
|
|
# Minimum version for optional DEFAULT argument: 1.11.0
|
|
|
|
#
|
|
|
|
# Documentation tools are not always available on all platforms and sometimes
|
|
|
|
# not at the appropriate level. This macro enables a module to test for the
|
|
|
|
# presence of the tool and obtain it's path in separate variables. Coupled with
|
|
|
|
# the --with-groff option, it allows maximum flexibilty in making decisions
|
|
|
|
# as whether or not to use the groff package. When DEFAULT is not specified,
|
|
|
|
# --with-groff assumes 'auto'.
|
|
|
|
#
|
|
|
|
# Interface to module:
|
|
|
|
# HAVE_GROFF: used in makefiles to conditionally generate documentation
|
|
|
|
# HAVE_GROFF_MM: the memorandum macros (-mm) package
|
|
|
|
# HAVE_GROFF_MS: the -ms macros package
|
|
|
|
# GROFF: returns the path of the groff program found
|
|
|
|
# returns the path set by the user in the environment
|
|
|
|
# --with-groff: 'yes' user instructs the module to use groff
|
|
|
|
# 'no' user instructs the module not to use groff
|
|
|
|
#
|
|
|
|
# Added in version 1.9.0:
|
|
|
|
# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
|
|
|
|
# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
|
|
|
|
# psselect from the psutils package.
|
|
|
|
# the ghostcript package. Refer to the grohtml man pages
|
|
|
|
#
|
|
|
|
# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
|
|
|
|
#
|
|
|
|
# OS and distros often splits groff in a basic and full package, the former
|
|
|
|
# having the groff program and the later having devices, fonts and macros
|
|
|
|
# Checking for the groff executable is not enough.
|
|
|
|
#
|
|
|
|
# If macros are missing, we cannot assume that groff is useless, so we don't
|
|
|
|
# unset HAVE_GROFF or GROFF env variables.
|
|
|
|
# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_WITH_GROFF],[
|
|
|
|
AC_ARG_VAR([GROFF], [Path to groff command])
|
|
|
|
m4_define([_defopt], m4_default([$1], [auto]))
|
|
|
|
AC_ARG_WITH(groff,
|
|
|
|
AS_HELP_STRING([--with-groff],
|
|
|
|
[Use groff to regenerate documentation (default: ]_defopt[)]),
|
|
|
|
[use_groff=$withval], [use_groff=]_defopt)
|
|
|
|
m4_undefine([_defopt])
|
|
|
|
|
|
|
|
if test "x$use_groff" = x"auto"; then
|
|
|
|
AC_PATH_PROG([GROFF], [groff])
|
|
|
|
if test "x$GROFF" = "x"; then
|
|
|
|
AC_MSG_WARN([groff not found - documentation targets will be skipped])
|
|
|
|
have_groff=no
|
|
|
|
else
|
|
|
|
have_groff=yes
|
|
|
|
fi
|
|
|
|
elif test "x$use_groff" = x"yes" ; then
|
|
|
|
AC_PATH_PROG([GROFF], [groff])
|
|
|
|
if test "x$GROFF" = "x"; then
|
|
|
|
AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
|
|
|
|
fi
|
|
|
|
have_groff=yes
|
|
|
|
elif test "x$use_groff" = x"no" ; then
|
|
|
|
if test "x$GROFF" != "x"; then
|
|
|
|
AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
|
|
|
|
fi
|
|
|
|
have_groff=no
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# We have groff, test for the presence of the macro packages
|
|
|
|
if test "x$have_groff" = x"yes"; then
|
|
|
|
AC_MSG_CHECKING([for ${GROFF} -ms macros])
|
|
|
|
if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
|
|
|
|
groff_ms_works=yes
|
|
|
|
else
|
|
|
|
groff_ms_works=no
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT([$groff_ms_works])
|
|
|
|
AC_MSG_CHECKING([for ${GROFF} -mm macros])
|
|
|
|
if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
|
|
|
|
groff_mm_works=yes
|
|
|
|
else
|
|
|
|
groff_mm_works=no
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT([$groff_mm_works])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# We have groff, test for HTML dependencies, one command per package
|
|
|
|
if test "x$have_groff" = x"yes"; then
|
|
|
|
AC_PATH_PROGS(GS_PATH, [gs gswin32c])
|
|
|
|
AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
|
|
|
|
AC_PATH_PROG(PSSELECT_PATH, [psselect])
|
|
|
|
if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
|
|
|
|
have_groff_html=yes
|
|
|
|
else
|
|
|
|
have_groff_html=no
|
|
|
|
AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set Automake conditionals for Makefiles
|
|
|
|
AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
|
|
|
|
AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
|
|
|
|
AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
|
|
|
|
AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
|
|
|
|
]) # XORG_WITH_GROFF
|
|
|
|
|
|
|
|
# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
|
|
|
|
# ---------------------------------------
|
|
|
|
# Minimum version: 1.6.0
|
|
|
|
# Minimum version for optional DEFAULT argument: 1.11.0
|
|
|
|
# Minimum version for optional MIN-VERSION argument: 1.15.0
|
|
|
|
#
|
|
|
|
# Documentation tools are not always available on all platforms and sometimes
|
|
|
|
# not at the appropriate level. This macro enables a module to test for the
|
|
|
|
# presence of the tool and obtain it's path in separate variables. Coupled with
|
|
|
|
# the --with-fop option, it allows maximum flexibilty in making decisions
|
|
|
|
# as whether or not to use the fop package. When DEFAULT is not specified,
|
|
|
|
# --with-fop assumes 'auto'.
|
|
|
|
#
|
|
|
|
# Interface to module:
|
|
|
|
# HAVE_FOP: used in makefiles to conditionally generate documentation
|
|
|
|
# FOP: returns the path of the fop program found
|
|
|
|
# returns the path set by the user in the environment
|
|
|
|
# --with-fop: 'yes' user instructs the module to use fop
|
|
|
|
# 'no' user instructs the module not to use fop
|
|
|
|
#
|
|
|
|
# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_WITH_FOP],[
|
|
|
|
AC_ARG_VAR([FOP], [Path to fop command])
|
|
|
|
m4_define([_defopt], m4_default([$2], [auto]))
|
|
|
|
AC_ARG_WITH(fop,
|
|
|
|
AS_HELP_STRING([--with-fop],
|
|
|
|
[Use fop to regenerate documentation (default: ]_defopt[)]),
|
|
|
|
[use_fop=$withval], [use_fop=]_defopt)
|
|
|
|
m4_undefine([_defopt])
|
|
|
|
|
|
|
|
if test "x$use_fop" = x"auto"; then
|
|
|
|
AC_PATH_PROG([FOP], [fop])
|
|
|
|
if test "x$FOP" = "x"; then
|
|
|
|
AC_MSG_WARN([fop not found - documentation targets will be skipped])
|
|
|
|
have_fop=no
|
|
|
|
else
|
|
|
|
have_fop=yes
|
|
|
|
fi
|
|
|
|
elif test "x$use_fop" = x"yes" ; then
|
|
|
|
AC_PATH_PROG([FOP], [fop])
|
|
|
|
if test "x$FOP" = "x"; then
|
|
|
|
AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
|
|
|
|
fi
|
|
|
|
have_fop=yes
|
|
|
|
elif test "x$use_fop" = x"no" ; then
|
|
|
|
if test "x$FOP" != "x"; then
|
|
|
|
AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
|
|
|
|
fi
|
|
|
|
have_fop=no
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Test for a minimum version of fop, if provided.
|
|
|
|
m4_ifval([$1],
|
|
|
|
[if test "$have_fop" = yes; then
|
|
|
|
# scrape the fop version
|
|
|
|
AC_MSG_CHECKING([for fop minimum version])
|
|
|
|
fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
|
|
|
|
AC_MSG_RESULT([$fop_version])
|
|
|
|
AS_VERSION_COMPARE([$fop_version], [$1],
|
|
|
|
[if test "x$use_fop" = xauto; then
|
|
|
|
AC_MSG_WARN([fop version $fop_version found, but $1 needed])
|
|
|
|
have_fop=no
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
|
|
|
|
fi])
|
|
|
|
fi])
|
|
|
|
AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
|
|
|
|
]) # XORG_WITH_FOP
|
|
|
|
|
|
|
|
# XORG_WITH_PS2PDF([DEFAULT])
|
|
|
|
# ----------------
|
|
|
|
# Minimum version: 1.6.0
|
|
|
|
# Minimum version for optional DEFAULT argument: 1.11.0
|
|
|
|
#
|
|
|
|
# Documentation tools are not always available on all platforms and sometimes
|
|
|
|
# not at the appropriate level. This macro enables a module to test for the
|
|
|
|
# presence of the tool and obtain it's path in separate variables. Coupled with
|
|
|
|
# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
|
|
|
|
# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
|
|
|
|
# --with-ps2pdf assumes 'auto'.
|
|
|
|
#
|
|
|
|
# Interface to module:
|
|
|
|
# HAVE_PS2PDF: used in makefiles to conditionally generate documentation
|
|
|
|
# PS2PDF: returns the path of the ps2pdf program found
|
|
|
|
# returns the path set by the user in the environment
|
|
|
|
# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
|
|
|
|
# 'no' user instructs the module not to use ps2pdf
|
|
|
|
#
|
|
|
|
# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_WITH_PS2PDF],[
|
|
|
|
AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
|
|
|
|
m4_define([_defopt], m4_default([$1], [auto]))
|
|
|
|
AC_ARG_WITH(ps2pdf,
|
|
|
|
AS_HELP_STRING([--with-ps2pdf],
|
|
|
|
[Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
|
|
|
|
[use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
|
|
|
|
m4_undefine([_defopt])
|
|
|
|
|
|
|
|
if test "x$use_ps2pdf" = x"auto"; then
|
|
|
|
AC_PATH_PROG([PS2PDF], [ps2pdf])
|
|
|
|
if test "x$PS2PDF" = "x"; then
|
|
|
|
AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
|
|
|
|
have_ps2pdf=no
|
|
|
|
else
|
|
|
|
have_ps2pdf=yes
|
|
|
|
fi
|
|
|
|
elif test "x$use_ps2pdf" = x"yes" ; then
|
|
|
|
AC_PATH_PROG([PS2PDF], [ps2pdf])
|
|
|
|
if test "x$PS2PDF" = "x"; then
|
|
|
|
AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
|
|
|
|
fi
|
|
|
|
have_ps2pdf=yes
|
|
|
|
elif test "x$use_ps2pdf" = x"no" ; then
|
|
|
|
if test "x$PS2PDF" != "x"; then
|
|
|
|
AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
|
|
|
|
fi
|
|
|
|
have_ps2pdf=no
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
|
|
|
|
]) # XORG_WITH_PS2PDF
|
|
|
|
|
|
|
|
# XORG_ENABLE_DOCS (enable_docs=yes)
|
|
|
|
# ----------------
|
|
|
|
# Minimum version: 1.6.0
|
|
|
|
#
|
|
|
|
# Documentation tools are not always available on all platforms and sometimes
|
|
|
|
# not at the appropriate level. This macro enables a builder to skip all
|
|
|
|
# documentation targets except traditional man pages.
|
|
|
|
# Combined with the specific tool checking macros XORG_WITH_*, it provides
|
|
|
|
# maximum flexibilty in controlling documentation building.
|
|
|
|
# Refer to:
|
|
|
|
# XORG_WITH_XMLTO --with-xmlto
|
|
|
|
# XORG_WITH_ASCIIDOC --with-asciidoc
|
|
|
|
# XORG_WITH_DOXYGEN --with-doxygen
|
|
|
|
# XORG_WITH_FOP --with-fop
|
|
|
|
# XORG_WITH_GROFF --with-groff
|
|
|
|
# XORG_WITH_PS2PDF --with-ps2pdf
|
|
|
|
#
|
|
|
|
# Interface to module:
|
|
|
|
# ENABLE_DOCS: used in makefiles to conditionally generate documentation
|
|
|
|
# --enable-docs: 'yes' user instructs the module to generate docs
|
|
|
|
# 'no' user instructs the module not to generate docs
|
|
|
|
# parm1: specify the default value, yes or no.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_ENABLE_DOCS],[
|
|
|
|
m4_define([docs_default], m4_default([$1], [yes]))
|
|
|
|
AC_ARG_ENABLE(docs,
|
|
|
|
AS_HELP_STRING([--enable-docs],
|
|
|
|
[Enable building the documentation (default: ]docs_default[)]),
|
|
|
|
[build_docs=$enableval], [build_docs=]docs_default)
|
|
|
|
m4_undefine([docs_default])
|
|
|
|
AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
|
|
|
|
AC_MSG_CHECKING([whether to build documentation])
|
|
|
|
AC_MSG_RESULT([$build_docs])
|
|
|
|
]) # XORG_ENABLE_DOCS
|
|
|
|
|
|
|
|
# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
|
|
|
|
# ----------------
|
|
|
|
# Minimum version: 1.6.0
|
|
|
|
#
|
|
|
|
# This macro enables a builder to skip all developer documentation.
|
|
|
|
# Combined with the specific tool checking macros XORG_WITH_*, it provides
|
|
|
|
# maximum flexibilty in controlling documentation building.
|
|
|
|
# Refer to:
|
|
|
|
# XORG_WITH_XMLTO --with-xmlto
|
|
|
|
# XORG_WITH_ASCIIDOC --with-asciidoc
|
|
|
|
# XORG_WITH_DOXYGEN --with-doxygen
|
|
|
|
# XORG_WITH_FOP --with-fop
|
|
|
|
# XORG_WITH_GROFF --with-groff
|
|
|
|
# XORG_WITH_PS2PDF --with-ps2pdf
|
|
|
|
#
|
|
|
|
# Interface to module:
|
|
|
|
# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
|
|
|
|
# --enable-devel-docs: 'yes' user instructs the module to generate developer docs
|
|
|
|
# 'no' user instructs the module not to generate developer docs
|
|
|
|
# parm1: specify the default value, yes or no.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
|
|
|
|
m4_define([devel_default], m4_default([$1], [yes]))
|
|
|
|
AC_ARG_ENABLE(devel-docs,
|
|
|
|
AS_HELP_STRING([--enable-devel-docs],
|
|
|
|
[Enable building the developer documentation (default: ]devel_default[)]),
|
|
|
|
[build_devel_docs=$enableval], [build_devel_docs=]devel_default)
|
|
|
|
m4_undefine([devel_default])
|
|
|
|
AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
|
|
|
|
AC_MSG_CHECKING([whether to build developer documentation])
|
|
|
|
AC_MSG_RESULT([$build_devel_docs])
|
|
|
|
]) # XORG_ENABLE_DEVEL_DOCS
|
|
|
|
|
|
|
|
# XORG_ENABLE_SPECS (enable_specs=yes)
|
|
|
|
# ----------------
|
|
|
|
# Minimum version: 1.6.0
|
|
|
|
#
|
|
|
|
# This macro enables a builder to skip all functional specification targets.
|
|
|
|
# Combined with the specific tool checking macros XORG_WITH_*, it provides
|
|
|
|
# maximum flexibilty in controlling documentation building.
|
|
|
|
# Refer to:
|
|
|
|
# XORG_WITH_XMLTO --with-xmlto
|
|
|
|
# XORG_WITH_ASCIIDOC --with-asciidoc
|
|
|
|
# XORG_WITH_DOXYGEN --with-doxygen
|
|
|
|
# XORG_WITH_FOP --with-fop
|
|
|
|
# XORG_WITH_GROFF --with-groff
|
|
|
|
# XORG_WITH_PS2PDF --with-ps2pdf
|
|
|
|
#
|
|
|
|
# Interface to module:
|
|
|
|
# ENABLE_SPECS: used in makefiles to conditionally generate specs
|
|
|
|
# --enable-specs: 'yes' user instructs the module to generate specs
|
|
|
|
# 'no' user instructs the module not to generate specs
|
|
|
|
# parm1: specify the default value, yes or no.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_ENABLE_SPECS],[
|
|
|
|
m4_define([spec_default], m4_default([$1], [yes]))
|
|
|
|
AC_ARG_ENABLE(specs,
|
|
|
|
AS_HELP_STRING([--enable-specs],
|
|
|
|
[Enable building the specs (default: ]spec_default[)]),
|
|
|
|
[build_specs=$enableval], [build_specs=]spec_default)
|
|
|
|
m4_undefine([spec_default])
|
|
|
|
AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
|
|
|
|
AC_MSG_CHECKING([whether to build functional specifications])
|
|
|
|
AC_MSG_RESULT([$build_specs])
|
|
|
|
]) # XORG_ENABLE_SPECS
|
|
|
|
|
|
|
|
# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
|
|
|
|
# ----------------------------------------------
|
|
|
|
# Minimum version: 1.13.0
|
|
|
|
#
|
|
|
|
# This macro enables a builder to enable/disable unit testing
|
|
|
|
# It makes no assumption about the test cases implementation
|
|
|
|
# Test cases may or may not use Automake "Support for test suites"
|
|
|
|
# They may or may not use the software utility library GLib
|
|
|
|
#
|
|
|
|
# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
|
|
|
|
# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
|
|
|
|
# The variable enable_unit_tests is used by other macros in this file.
|
|
|
|
#
|
|
|
|
# Interface to module:
|
|
|
|
# ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests
|
|
|
|
# enable_unit_tests: used in configure.ac for additional configuration
|
|
|
|
# --enable-unit-tests: 'yes' user instructs the module to build tests
|
|
|
|
# 'no' user instructs the module not to build tests
|
|
|
|
# parm1: specify the default value, yes or no.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
|
|
|
|
AC_BEFORE([$0], [XORG_WITH_GLIB])
|
|
|
|
AC_BEFORE([$0], [XORG_LD_WRAP])
|
|
|
|
m4_define([_defopt], m4_default([$1], [auto]))
|
|
|
|
AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
|
|
|
|
[Enable building unit test cases (default: ]_defopt[)]),
|
|
|
|
[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
|
|
|
|
m4_undefine([_defopt])
|
|
|
|
AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
|
|
|
|
AC_MSG_CHECKING([whether to build unit test cases])
|
|
|
|
AC_MSG_RESULT([$enable_unit_tests])
|
|
|
|
]) # XORG_ENABLE_UNIT_TESTS
|
|
|
|
|
|
|
|
# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
|
|
|
|
# ----------------------------------------
|
|
|
|
# Minimum version: 1.13.0
|
|
|
|
#
|
|
|
|
# GLib is a library which provides advanced data structures and functions.
|
|
|
|
# This macro enables a module to test for the presence of Glib.
|
|
|
|
#
|
|
|
|
# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
|
|
|
|
# Otherwise the value of $enable_unit_tests is blank.
|
|
|
|
#
|
|
|
|
# Interface to module:
|
|
|
|
# HAVE_GLIB: used in makefiles to conditionally build targets
|
|
|
|
# with_glib: used in configure.ac to know if GLib has been found
|
|
|
|
# --with-glib: 'yes' user instructs the module to use glib
|
|
|
|
# 'no' user instructs the module not to use glib
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_WITH_GLIB],[
|
|
|
|
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
|
|
|
m4_define([_defopt], m4_default([$2], [auto]))
|
|
|
|
AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
|
|
|
|
[Use GLib library for unit testing (default: ]_defopt[)]),
|
|
|
|
[with_glib=$withval], [with_glib=]_defopt)
|
|
|
|
m4_undefine([_defopt])
|
|
|
|
|
|
|
|
have_glib=no
|
|
|
|
# Do not probe GLib if user explicitly disabled unit testing
|
|
|
|
if test "x$enable_unit_tests" != x"no"; then
|
|
|
|
# Do not probe GLib if user explicitly disabled it
|
|
|
|
if test "x$with_glib" != x"no"; then
|
|
|
|
m4_ifval(
|
|
|
|
[$1],
|
|
|
|
[PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
|
|
|
|
[PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Not having GLib when unit testing has been explicitly requested is an error
|
|
|
|
if test "x$enable_unit_tests" = x"yes"; then
|
|
|
|
if test "x$have_glib" = x"no"; then
|
|
|
|
AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Having unit testing disabled when GLib has been explicitly requested is an error
|
|
|
|
if test "x$enable_unit_tests" = x"no"; then
|
|
|
|
if test "x$with_glib" = x"yes"; then
|
|
|
|
AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Not having GLib when it has been explicitly requested is an error
|
|
|
|
if test "x$with_glib" = x"yes"; then
|
|
|
|
if test "x$have_glib" = x"no"; then
|
|
|
|
AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
|
|
|
|
]) # XORG_WITH_GLIB
|
|
|
|
|
|
|
|
# XORG_LD_WRAP
|
|
|
|
# ------------
|
|
|
|
# Minimum version: 1.13.0
|
|
|
|
#
|
|
|
|
# Check if linker supports -wrap, passed via compiler flags
|
|
|
|
#
|
|
|
|
# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
|
|
|
|
# Otherwise the value of $enable_unit_tests is blank.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_LD_WRAP],[
|
|
|
|
XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no])
|
|
|
|
# Not having ld wrap when unit testing has been explicitly requested is an error
|
|
|
|
if test "x$enable_unit_tests" = x"yes"; then
|
|
|
|
if test "x$have_ld_wrap" = x"no"; then
|
|
|
|
AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
|
|
|
|
#
|
|
|
|
]) # XORG_LD_WRAP
|
|
|
|
|
|
|
|
# XORG_CHECK_LINKER_FLAGS
|
|
|
|
# -----------------------
|
|
|
|
# SYNOPSIS
|
|
|
|
#
|
|
|
|
# XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
|
|
|
|
#
|
|
|
|
# DESCRIPTION
|
|
|
|
#
|
|
|
|
# Check whether the given linker FLAGS work with the current language's
|
|
|
|
# linker, or whether they give an error.
|
|
|
|
#
|
|
|
|
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
|
|
|
|
# success/failure.
|
|
|
|
#
|
|
|
|
# NOTE: Based on AX_CHECK_COMPILER_FLAGS.
|
|
|
|
#
|
|
|
|
# LICENSE
|
|
|
|
#
|
|
|
|
# Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
|
|
|
|
# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
|
|
|
|
# Copyright (c) 2009 Matteo Frigo
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU General Public License as published by the
|
|
|
|
# Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
# option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful, but
|
|
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
|
|
# Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
# As a special exception, the respective Autoconf Macro's copyright owner
|
|
|
|
# gives unlimited permission to copy, distribute and modify the configure
|
|
|
|
# scripts that are the output of Autoconf when processing the Macro. You
|
|
|
|
# need not follow the terms of the GNU General Public License when using
|
|
|
|
# or distributing such scripts, even though portions of the text of the
|
|
|
|
# Macro appear in them. The GNU General Public License (GPL) does govern
|
|
|
|
# all other use of the material that constitutes the Autoconf Macro.
|
|
|
|
#
|
|
|
|
# This special exception to the GPL applies to versions of the Autoconf
|
|
|
|
# Macro released by the Autoconf Archive. When you make and distribute a
|
|
|
|
# modified version of the Autoconf Macro, you may extend this special
|
|
|
|
# exception to the GPL to apply to your modified version as well.#
|
|
|
|
AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
|
|
|
|
[AC_MSG_CHECKING([whether the linker accepts $1])
|
|
|
|
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
|
|
|
|
AS_LITERAL_IF([$1],
|
|
|
|
[AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
|
|
|
|
ax_save_FLAGS=$LDFLAGS
|
|
|
|
LDFLAGS="$1"
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
|
|
|
|
AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
|
|
|
|
AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
|
|
|
|
LDFLAGS=$ax_save_FLAGS])],
|
|
|
|
[ax_save_FLAGS=$LDFLAGS
|
|
|
|
LDFLAGS="$1"
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
|
|
|
|
eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
|
|
|
|
eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
|
|
|
|
LDFLAGS=$ax_save_FLAGS])
|
|
|
|
eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
|
|
|
|
AC_MSG_RESULT($xorg_check_linker_flags)
|
|
|
|
if test "x$xorg_check_linker_flags" = xyes; then
|
|
|
|
m4_default([$2], :)
|
|
|
|
else
|
|
|
|
m4_default([$3], :)
|
|
|
|
fi
|
|
|
|
]) # XORG_CHECK_LINKER_FLAGS
|
|
|
|
|
|
|
|
# XORG_CHECK_MALLOC_ZERO
|
|
|
|
# ----------------------
|
|
|
|
# Minimum version: 1.0.0
|
|
|
|
#
|
|
|
|
# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
|
|
|
|
# malloc(0) returns NULL. Packages should add one of these cflags to
|
|
|
|
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
|
|
|
|
AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
|
|
|
|
AC_ARG_ENABLE(malloc0returnsnull,
|
|
|
|
AS_HELP_STRING([--enable-malloc0returnsnull],
|
|
|
|
[malloc(0) returns NULL (default: auto)]),
|
|
|
|
[MALLOC_ZERO_RETURNS_NULL=$enableval],
|
|
|
|
[MALLOC_ZERO_RETURNS_NULL=auto])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether malloc(0) returns NULL])
|
|
|
|
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
|
|
|
|
AC_RUN_IFELSE([AC_LANG_PROGRAM([
|
|
|
|
#include <stdlib.h>
|
|
|
|
],[
|
|
|
|
char *m0, *r0, *c0, *p;
|
|
|
|
m0 = malloc(0);
|
|
|
|
p = malloc(10);
|
|
|
|
r0 = realloc(p,0);
|
|
|
|
c0 = calloc(0,10);
|
|
|
|
exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
|
|
|
|
])],
|
|
|
|
[MALLOC_ZERO_RETURNS_NULL=yes],
|
|
|
|
[MALLOC_ZERO_RETURNS_NULL=no],
|
|
|
|
[MALLOC_ZERO_RETURNS_NULL=yes])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
|
|
|
|
|
|
|
|
if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
|
|
|
|
MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
|
|
|
|
XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
|
|
|
|
XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
|
|
|
|
else
|
|
|
|
MALLOC_ZERO_CFLAGS=""
|
|
|
|
XMALLOC_ZERO_CFLAGS=""
|
|
|
|
XTMALLOC_ZERO_CFLAGS=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST([MALLOC_ZERO_CFLAGS])
|
|
|
|
AC_SUBST([XMALLOC_ZERO_CFLAGS])
|
|
|
|
AC_SUBST([XTMALLOC_ZERO_CFLAGS])
|
|
|
|
]) # XORG_CHECK_MALLOC_ZERO
|
|
|
|
|
|
|
|
# XORG_WITH_LINT()
|
|
|
|
# ----------------
|
|
|
|
# Minimum version: 1.1.0
|
|
|
|
#
|
|
|
|
# This macro enables the use of a tool that flags some suspicious and
|
|
|
|
# non-portable constructs (likely to be bugs) in C language source code.
|
|
|
|
# It will attempt to locate the tool and use appropriate options.
|
|
|
|
# There are various lint type tools on different platforms.
|
|
|
|
#
|
|
|
|
# Interface to module:
|
|
|
|
# LINT: returns the path to the tool found on the platform
|
|
|
|
# or the value set to LINT on the configure cmd line
|
|
|
|
# also an Automake conditional
|
|
|
|
# LINT_FLAGS: an Automake variable with appropriate flags
|
|
|
|
#
|
|
|
|
# --with-lint: 'yes' user instructs the module to use lint
|
|
|
|
# 'no' user instructs the module not to use lint (default)
|
|
|
|
#
|
|
|
|
# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
|
|
|
|
# If the user sets the value of LINT_FLAGS, they are used verbatim.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_WITH_LINT],[
|
|
|
|
|
|
|
|
AC_ARG_VAR([LINT], [Path to a lint-style command])
|
|
|
|
AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
|
|
|
|
AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
|
|
|
|
[Use a lint-style source code checker (default: disabled)])],
|
|
|
|
[use_lint=$withval], [use_lint=no])
|
|
|
|
|
|
|
|
# Obtain platform specific info like program name and options
|
|
|
|
# The lint program on FreeBSD and NetBSD is different from the one on Solaris
|
|
|
|
case $host_os in
|
|
|
|
*linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
|
|
|
|
lint_name=splint
|
|
|
|
lint_options="-badflag"
|
|
|
|
;;
|
|
|
|
*freebsd* | *netbsd*)
|
|
|
|
lint_name=lint
|
|
|
|
lint_options="-u -b"
|
|
|
|
;;
|
|
|
|
*solaris*)
|
|
|
|
lint_name=lint
|
|
|
|
lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Test for the presence of the program (either guessed by the code or spelled out by the user)
|
|
|
|
if test "x$use_lint" = x"yes" ; then
|
|
|
|
AC_PATH_PROG([LINT], [$lint_name])
|
|
|
|
if test "x$LINT" = "x"; then
|
|
|
|
AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
|
|
|
|
fi
|
|
|
|
elif test "x$use_lint" = x"no" ; then
|
|
|
|
if test "x$LINT" != "x"; then
|
|
|
|
AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# User supplied flags override default flags
|
|
|
|
if test "x$LINT_FLAGS" != "x"; then
|
|
|
|
lint_options=$LINT_FLAGS
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST([LINT_FLAGS],[$lint_options])
|
|
|
|
AM_CONDITIONAL(LINT, [test "x$LINT" != x])
|
|
|
|
|
|
|
|
]) # XORG_WITH_LINT
|
|
|
|
|
|
|
|
# XORG_LINT_LIBRARY(LIBNAME)
|
|
|
|
# --------------------------
|
|
|
|
# Minimum version: 1.1.0
|
|
|
|
#
|
|
|
|
# Sets up flags for building lint libraries for checking programs that call
|
|
|
|
# functions in the library.
|
|
|
|
#
|
|
|
|
# Interface to module:
|
|
|
|
# LINTLIB - Automake variable with the name of lint library file to make
|
|
|
|
# MAKE_LINT_LIB - Automake conditional
|
|
|
|
#
|
|
|
|
# --enable-lint-library: - 'yes' user instructs the module to created a lint library
|
|
|
|
# - 'no' user instructs the module not to create a lint library (default)
|
|
|
|
|
|
|
|
AC_DEFUN([XORG_LINT_LIBRARY],[
|
|
|
|
AC_REQUIRE([XORG_WITH_LINT])
|
|
|
|
AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
|
|
|
|
[Create lint library (default: disabled)])],
|
|
|
|
[make_lint_lib=$enableval], [make_lint_lib=no])
|
|
|
|
|
|
|
|
if test "x$make_lint_lib" = x"yes" ; then
|
|
|
|
LINTLIB=llib-l$1.ln
|
|
|
|
if test "x$LINT" = "x"; then
|
|
|
|
AC_MSG_ERROR([Cannot make lint library without --with-lint])
|
|
|
|
fi
|
|
|
|
elif test "x$make_lint_lib" != x"no" ; then
|
|
|
|
AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(LINTLIB)
|
|
|
|
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
|
|
|
|
|
|
|
|
]) # XORG_LINT_LIBRARY
|
|
|
|
|
|
|
|
# XORG_COMPILER_BRAND
|
|
|
|
# -------------------
|
|
|
|
# Minimum version: 1.14.0
|
|
|
|
#
|
|
|
|
# Checks for various brands of compilers and sets flags as appropriate:
|
|
|
|
# GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
|
|
|
|
# clang compiler - sets CLANGCC to "yes"
|
|
|
|
# Intel compiler - sets INTELCC to "yes"
|
|
|
|
# Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_COMPILER_BRAND], [
|
|
|
|
AC_REQUIRE([AC_PROG_CC_C99])
|
|
|
|
AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
|
|
|
|
AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
|
|
|
|
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
|
|
|
|
]) # XORG_COMPILER_BRAND
|
|
|
|
|
|
|
|
# XORG_CWARNFLAGS
|
|
|
|
# ---------------
|
|
|
|
# Minimum version: 1.2.0
|
|
|
|
#
|
|
|
|
# Defines CWARNFLAGS to enable C compiler warnings.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_CWARNFLAGS], [
|
|
|
|
AC_REQUIRE([AC_PROG_CC_C99])
|
|
|
|
AC_REQUIRE([XORG_COMPILER_BRAND])
|
|
|
|
if test "x$GCC" = xyes ; then
|
|
|
|
CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
|
|
|
|
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
|
|
|
|
-Wbad-function-cast -Wformat=2"
|
|
|
|
case `$CC -dumpversion` in
|
|
|
|
3.4.* | 4.*)
|
|
|
|
CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
else
|
|
|
|
if test "x$SUNCC" = "xyes"; then
|
|
|
|
CWARNFLAGS="-v"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_SUBST(CWARNFLAGS)
|
|
|
|
]) # XORG_CWARNFLAGS
|
|
|
|
|
|
|
|
# XORG_STRICT_OPTION
|
|
|
|
# -----------------------
|
|
|
|
# Minimum version: 1.3.0
|
|
|
|
#
|
|
|
|
# Add configure option to enable strict compilation flags, such as treating
|
|
|
|
# warnings as fatal errors.
|
|
|
|
# If --enable-strict-compilation is passed to configure, adds strict flags to
|
|
|
|
# $CWARNFLAGS.
|
|
|
|
#
|
|
|
|
# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
|
|
|
|
# when strict compilation is unconditionally desired.
|
|
|
|
AC_DEFUN([XORG_STRICT_OPTION], [
|
|
|
|
# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
|
|
|
|
AC_REQUIRE([AC_PROG_CC_C99])
|
|
|
|
AC_REQUIRE([XORG_COMPILER_BRAND])
|
|
|
|
AC_REQUIRE([XORG_CWARNFLAGS])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(strict-compilation,
|
|
|
|
AS_HELP_STRING([--enable-strict-compilation],
|
|
|
|
[Enable all warnings from compiler and make them errors (default: disabled)]),
|
|
|
|
[STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
|
|
|
|
if test "x$GCC" = xyes ; then
|
|
|
|
STRICT_CFLAGS="-pedantic -Werror"
|
|
|
|
# Add -Werror=attributes if supported (gcc 4.2 & later)
|
|
|
|
AC_MSG_CHECKING([if $CC supports -Werror=attributes])
|
|
|
|
save_CFLAGS="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS $STRICT_CFLAGS -Werror=attributes"
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([return 0;])],
|
|
|
|
[STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes"
|
|
|
|
AC_MSG_RESULT([yes])],
|
|
|
|
[AC_MSG_RESULT([no])])
|
|
|
|
CFLAGS="$save_CFLAGS"
|
|
|
|
elif test "x$SUNCC" = "xyes"; then
|
|
|
|
STRICT_CFLAGS="-errwarn"
|
|
|
|
elif test "x$INTELCC" = "xyes"; then
|
|
|
|
STRICT_CFLAGS="-Werror"
|
|
|
|
fi
|
|
|
|
if test "x$STRICT_COMPILE" = "xyes"; then
|
|
|
|
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
|
|
|
|
fi
|
|
|
|
AC_SUBST([STRICT_CFLAGS])
|
|
|
|
AC_SUBST([CWARNFLAGS])
|
|
|
|
]) # XORG_STRICT_OPTION
|
|
|
|
|
|
|
|
# XORG_DEFAULT_OPTIONS
|
|
|
|
# --------------------
|
|
|
|
# Minimum version: 1.3.0
|
|
|
|
#
|
|
|
|
# Defines default options for X.Org modules.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
|
|
|
|
AC_REQUIRE([AC_PROG_INSTALL])
|
|
|
|
XORG_CWARNFLAGS
|
|
|
|
XORG_STRICT_OPTION
|
|
|
|
XORG_RELEASE_VERSION
|
|
|
|
XORG_CHANGELOG
|
|
|
|
XORG_INSTALL
|
|
|
|
XORG_MANPAGE_SECTIONS
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
|
|
|
|
[AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
|
|
|
|
]) # XORG_DEFAULT_OPTIONS
|
|
|
|
|
|
|
|
# XORG_INSTALL()
|
|
|
|
# ----------------
|
|
|
|
# Minimum version: 1.4.0
|
|
|
|
#
|
|
|
|
# Defines the variable INSTALL_CMD as the command to copy
|
|
|
|
# INSTALL from $prefix/share/util-macros.
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_INSTALL], [
|
|
|
|
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
|
|
|
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
|
|
|
|
INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
|
|
|
|
mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
|
|
|
|
|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
|
|
|
|
echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
|
|
|
|
AC_SUBST([INSTALL_CMD])
|
|
|
|
]) # XORG_INSTALL
|
|
|
|
dnl Copyright 2005 Red Hat, Inc
|
|
|
|
dnl
|
|
|
|
dnl Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
dnl documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
dnl the above copyright notice appear in all copies and that both that
|
|
|
|
dnl copyright notice and this permission notice appear in supporting
|
|
|
|
dnl documentation.
|
|
|
|
dnl
|
|
|
|
dnl The above copyright notice and this permission notice shall be included
|
|
|
|
dnl in all copies or substantial portions of the Software.
|
|
|
|
dnl
|
|
|
|
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
|
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
|
|
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
|
|
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
|
dnl OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
dnl
|
|
|
|
dnl Except as contained in this notice, the name of the copyright holders shall
|
|
|
|
dnl not be used in advertising or otherwise to promote the sale, use or
|
|
|
|
dnl other dealings in this Software without prior written authorization
|
|
|
|
dnl from the copyright holders.
|
|
|
|
dnl
|
|
|
|
|
|
|
|
# XORG_RELEASE_VERSION
|
|
|
|
# --------------------
|
|
|
|
# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
|
|
|
|
|
|
|
|
AC_DEFUN([XORG_RELEASE_VERSION],[
|
|
|
|
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
|
|
|
|
[`echo $PACKAGE_VERSION | cut -d . -f 1`],
|
|
|
|
[Major version of this package])
|
|
|
|
PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
|
|
|
|
if test "x$PVM" = "x"; then
|
|
|
|
PVM="0"
|
|
|
|
fi
|
|
|
|
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
|
|
|
|
[$PVM],
|
|
|
|
[Minor version of this package])
|
|
|
|
PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
|
|
|
|
if test "x$PVP" = "x"; then
|
|
|
|
PVP="0"
|
|
|
|
fi
|
|
|
|
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
|
|
|
|
[$PVP],
|
|
|
|
[Patch version of this package])
|
|
|
|
])
|
|
|
|
|
|
|
|
# XORG_CHANGELOG()
|
|
|
|
# ----------------
|
|
|
|
# Minimum version: 1.2.0
|
|
|
|
#
|
|
|
|
# Defines the variable CHANGELOG_CMD as the command to generate
|
|
|
|
# ChangeLog from git.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
AC_DEFUN([XORG_CHANGELOG], [
|
|
|
|
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
|
|
|
|
mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
|
|
|
|
|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
|
|
|
|
echo 'git directory not found: installing possibly empty changelog.' >&2)"
|
|
|
|
AC_SUBST([CHANGELOG_CMD])
|
|
|
|
]) # XORG_CHANGELOG
|
|
|
|
|
2009-06-06 11:52:23 -06:00
|
|
|
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
|
|
|
# AM_AUTOMAKE_VERSION(VERSION)
|
|
|
|
# ----------------------------
|
|
|
|
# Automake X.Y traces this macro to ensure aclocal.m4 has been
|
|
|
|
# generated from the m4 files accompanying Automake X.Y.
|
|
|
|
# (This private macro should not be called outside this file.)
|
|
|
|
AC_DEFUN([AM_AUTOMAKE_VERSION],
|
2011-01-10 07:25:56 -07:00
|
|
|
[am__api_version='1.11'
|
2009-06-06 11:52:23 -06:00
|
|
|
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
|
|
|
|
dnl require some minimum version. Point them to the right macro.
|
2011-01-10 07:25:56 -07:00
|
|
|
m4_if([$1], [1.11.1], [],
|
2009-06-06 11:52:23 -06:00
|
|
|
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
|
|
|
|
])
|
|
|
|
|
|
|
|
# _AM_AUTOCONF_VERSION(VERSION)
|
|
|
|
# -----------------------------
|
|
|
|
# aclocal traces this macro to find the Autoconf version.
|
|
|
|
# This is a private macro too. Using m4_define simplifies
|
|
|
|
# the logic in aclocal, which can simply ignore this definition.
|
|
|
|
m4_define([_AM_AUTOCONF_VERSION], [])
|
|
|
|
|
|
|
|
# AM_SET_CURRENT_AUTOMAKE_VERSION
|
|
|
|
# -------------------------------
|
|
|
|
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
|
|
|
|
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
|
|
|
|
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
2011-01-10 07:25:56 -07:00
|
|
|
[AM_AUTOMAKE_VERSION([1.11.1])dnl
|
2009-06-06 11:52:23 -06:00
|
|
|
m4_ifndef([AC_AUTOCONF_VERSION],
|
|
|
|
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
|
|
|
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
|
|
|
|
|
|
|
|
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
|
|
|
|
|
|
|
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
|
|
|
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
|
|
|
|
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
|
|
|
|
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
|
|
|
|
#
|
|
|
|
# Of course, Automake must honor this variable whenever it calls a
|
|
|
|
# tool from the auxiliary directory. The problem is that $srcdir (and
|
|
|
|
# therefore $ac_aux_dir as well) can be either absolute or relative,
|
|
|
|
# depending on how configure is run. This is pretty annoying, since
|
|
|
|
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
|
|
|
|
# source directory, any form will work fine, but in subdirectories a
|
|
|
|
# relative path needs to be adjusted first.
|
|
|
|
#
|
|
|
|
# $ac_aux_dir/missing
|
|
|
|
# fails when called from a subdirectory if $ac_aux_dir is relative
|
|
|
|
# $top_srcdir/$ac_aux_dir/missing
|
|
|
|
# fails if $ac_aux_dir is absolute,
|
|
|
|
# fails when called from a subdirectory in a VPATH build with
|
|
|
|
# a relative $ac_aux_dir
|
|
|
|
#
|
|
|
|
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
|
|
|
|
# are both prefixed by $srcdir. In an in-source build this is usually
|
|
|
|
# harmless because $srcdir is `.', but things will broke when you
|
|
|
|
# start a VPATH build or use an absolute $srcdir.
|
|
|
|
#
|
|
|
|
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
|
|
|
|
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
|
|
|
|
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
|
|
|
|
# and then we would define $MISSING as
|
|
|
|
# MISSING="\${SHELL} $am_aux_dir/missing"
|
|
|
|
# This will work as long as MISSING is not called from configure, because
|
|
|
|
# unfortunately $(top_srcdir) has no meaning in configure.
|
|
|
|
# However there are other variables, like CC, which are often used in
|
|
|
|
# configure, and could therefore not use this "fixed" $ac_aux_dir.
|
|
|
|
#
|
|
|
|
# Another solution, used here, is to always expand $ac_aux_dir to an
|
|
|
|
# absolute PATH. The drawback is that using absolute paths prevent a
|
|
|
|
# configured tree to be moved without reconfiguration.
|
|
|
|
|
|
|
|
AC_DEFUN([AM_AUX_DIR_EXPAND],
|
|
|
|
[dnl Rely on autoconf to set up CDPATH properly.
|
|
|
|
AC_PREREQ([2.50])dnl
|
|
|
|
# expand $ac_aux_dir to an absolute path
|
|
|
|
am_aux_dir=`cd $ac_aux_dir && pwd`
|
|
|
|
])
|
|
|
|
|
|
|
|
# AM_CONDITIONAL -*- Autoconf -*-
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
|
2009-06-06 11:52:23 -06:00
|
|
|
# Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# serial 9
|
2009-06-06 11:52:23 -06:00
|
|
|
|
|
|
|
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
|
|
|
|
# -------------------------------------
|
|
|
|
# Define a conditional.
|
|
|
|
AC_DEFUN([AM_CONDITIONAL],
|
|
|
|
[AC_PREREQ(2.52)dnl
|
|
|
|
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
|
|
|
|
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
|
|
|
|
AC_SUBST([$1_TRUE])dnl
|
|
|
|
AC_SUBST([$1_FALSE])dnl
|
|
|
|
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
|
|
|
|
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
|
2011-01-10 07:25:56 -07:00
|
|
|
m4_define([_AM_COND_VALUE_$1], [$2])dnl
|
2009-06-06 11:52:23 -06:00
|
|
|
if $2; then
|
|
|
|
$1_TRUE=
|
|
|
|
$1_FALSE='#'
|
|
|
|
else
|
|
|
|
$1_TRUE='#'
|
|
|
|
$1_FALSE=
|
|
|
|
fi
|
|
|
|
AC_CONFIG_COMMANDS_PRE(
|
|
|
|
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
|
|
|
|
AC_MSG_ERROR([[conditional "$1" was never defined.
|
|
|
|
Usually this means the macro was only invoked conditionally.]])
|
|
|
|
fi])])
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
|
2009-06-06 11:52:23 -06:00
|
|
|
# Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# serial 10
|
2009-06-06 11:52:23 -06:00
|
|
|
|
|
|
|
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
|
|
|
|
# written in clear, in which case automake, when reading aclocal.m4,
|
|
|
|
# will think it sees a *use*, and therefore will trigger all it's
|
|
|
|
# C support machinery. Also note that it means that autoscan, seeing
|
|
|
|
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
|
|
|
|
|
|
|
|
|
|
|
|
# _AM_DEPENDENCIES(NAME)
|
|
|
|
# ----------------------
|
|
|
|
# See how the compiler implements dependency checking.
|
|
|
|
# NAME is "CC", "CXX", "GCJ", or "OBJC".
|
|
|
|
# We try a few techniques and use that to set a single cache variable.
|
|
|
|
#
|
|
|
|
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
|
|
|
|
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
|
|
|
|
# dependency, and given that the user is not expected to run this macro,
|
|
|
|
# just rely on AC_PROG_CC.
|
|
|
|
AC_DEFUN([_AM_DEPENDENCIES],
|
|
|
|
[AC_REQUIRE([AM_SET_DEPDIR])dnl
|
|
|
|
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
|
|
|
|
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
|
|
|
|
AC_REQUIRE([AM_DEP_TRACK])dnl
|
|
|
|
|
|
|
|
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
|
|
|
|
[$1], CXX, [depcc="$CXX" am_compiler_list=],
|
|
|
|
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
|
|
|
|
[$1], UPC, [depcc="$UPC" am_compiler_list=],
|
|
|
|
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
|
|
|
|
[depcc="$$1" am_compiler_list=])
|
|
|
|
|
|
|
|
AC_CACHE_CHECK([dependency style of $depcc],
|
|
|
|
[am_cv_$1_dependencies_compiler_type],
|
|
|
|
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
|
|
|
|
# We make a subdir and do the tests there. Otherwise we can end up
|
|
|
|
# making bogus files that we don't know about and never remove. For
|
|
|
|
# instance it was reported that on HP-UX the gcc test will end up
|
|
|
|
# making a dummy file named `D' -- because `-MD' means `put the output
|
|
|
|
# in D'.
|
|
|
|
mkdir conftest.dir
|
|
|
|
# Copy depcomp to subdir because otherwise we won't find it if we're
|
|
|
|
# using a relative directory.
|
|
|
|
cp "$am_depcomp" conftest.dir
|
|
|
|
cd conftest.dir
|
|
|
|
# We will build objects and dependencies in a subdirectory because
|
|
|
|
# it helps to detect inapplicable dependency modes. For instance
|
|
|
|
# both Tru64's cc and ICC support -MD to output dependencies as a
|
|
|
|
# side effect of compilation, but ICC will put the dependencies in
|
|
|
|
# the current directory while Tru64 will put them in the object
|
|
|
|
# directory.
|
|
|
|
mkdir sub
|
|
|
|
|
|
|
|
am_cv_$1_dependencies_compiler_type=none
|
|
|
|
if test "$am_compiler_list" = ""; then
|
|
|
|
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
|
|
|
|
fi
|
2011-01-10 07:25:56 -07:00
|
|
|
am__universal=false
|
|
|
|
m4_case([$1], [CC],
|
|
|
|
[case " $depcc " in #(
|
|
|
|
*\ -arch\ *\ -arch\ *) am__universal=true ;;
|
|
|
|
esac],
|
|
|
|
[CXX],
|
|
|
|
[case " $depcc " in #(
|
|
|
|
*\ -arch\ *\ -arch\ *) am__universal=true ;;
|
|
|
|
esac])
|
|
|
|
|
2009-06-06 11:52:23 -06:00
|
|
|
for depmode in $am_compiler_list; do
|
|
|
|
# Setup a source with many dependencies, because some compilers
|
|
|
|
# like to wrap large dependency lists on column 80 (with \), and
|
|
|
|
# we should not choose a depcomp mode which is confused by this.
|
|
|
|
#
|
|
|
|
# We need to recreate these files for each test, as the compiler may
|
|
|
|
# overwrite some of them when testing with obscure command lines.
|
|
|
|
# This happens at least with the AIX C compiler.
|
|
|
|
: > sub/conftest.c
|
|
|
|
for i in 1 2 3 4 5 6; do
|
|
|
|
echo '#include "conftst'$i'.h"' >> sub/conftest.c
|
|
|
|
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
|
|
|
|
# Solaris 8's {/usr,}/bin/sh.
|
|
|
|
touch sub/conftst$i.h
|
|
|
|
done
|
|
|
|
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# We check with `-c' and `-o' for the sake of the "dashmstdout"
|
|
|
|
# mode. It turns out that the SunPro C++ compiler does not properly
|
|
|
|
# handle `-M -o', and we need to detect this. Also, some Intel
|
|
|
|
# versions had trouble with output in subdirs
|
|
|
|
am__obj=sub/conftest.${OBJEXT-o}
|
|
|
|
am__minus_obj="-o $am__obj"
|
2009-06-06 11:52:23 -06:00
|
|
|
case $depmode in
|
2011-01-10 07:25:56 -07:00
|
|
|
gcc)
|
|
|
|
# This depmode causes a compiler race in universal mode.
|
|
|
|
test "$am__universal" = false || continue
|
|
|
|
;;
|
2009-06-06 11:52:23 -06:00
|
|
|
nosideeffect)
|
|
|
|
# after this tag, mechanisms are not by side-effect, so they'll
|
|
|
|
# only be used when explicitly requested
|
|
|
|
if test "x$enable_dependency_tracking" = xyes; then
|
|
|
|
continue
|
|
|
|
else
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
;;
|
2011-01-10 07:25:56 -07:00
|
|
|
msvisualcpp | msvcmsys)
|
|
|
|
# This compiler won't grok `-c -o', but also, the minuso test has
|
|
|
|
# not run yet. These depmodes are late enough in the game, and
|
|
|
|
# so weak that their functioning should not be impacted.
|
|
|
|
am__obj=conftest.${OBJEXT-o}
|
|
|
|
am__minus_obj=
|
|
|
|
;;
|
2009-06-06 11:52:23 -06:00
|
|
|
none) break ;;
|
|
|
|
esac
|
|
|
|
if depmode=$depmode \
|
2011-01-10 07:25:56 -07:00
|
|
|
source=sub/conftest.c object=$am__obj \
|
2009-06-06 11:52:23 -06:00
|
|
|
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
|
2011-01-10 07:25:56 -07:00
|
|
|
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
|
2009-06-06 11:52:23 -06:00
|
|
|
>/dev/null 2>conftest.err &&
|
|
|
|
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
|
|
|
|
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
|
2011-01-10 07:25:56 -07:00
|
|
|
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
|
2009-06-06 11:52:23 -06:00
|
|
|
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
|
|
|
# icc doesn't choke on unknown options, it will just issue warnings
|
|
|
|
# or remarks (even with -Werror). So we grep stderr for any message
|
|
|
|
# that says an option was ignored or not supported.
|
|
|
|
# When given -MP, icc 7.0 and 7.1 complain thusly:
|
|
|
|
# icc: Command line warning: ignoring option '-M'; no argument required
|
|
|
|
# The diagnosis changed in icc 8.0:
|
|
|
|
# icc: Command line remark: option '-MP' not supported
|
|
|
|
if (grep 'ignoring option' conftest.err ||
|
|
|
|
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
|
|
|
|
am_cv_$1_dependencies_compiler_type=$depmode
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
rm -rf conftest.dir
|
|
|
|
else
|
|
|
|
am_cv_$1_dependencies_compiler_type=none
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
|
|
|
|
AM_CONDITIONAL([am__fastdep$1], [
|
|
|
|
test "x$enable_dependency_tracking" != xno \
|
|
|
|
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
# AM_SET_DEPDIR
|
|
|
|
# -------------
|
|
|
|
# Choose a directory name for dependency files.
|
|
|
|
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
|
|
|
|
AC_DEFUN([AM_SET_DEPDIR],
|
|
|
|
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
|
|
|
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
# AM_DEP_TRACK
|
|
|
|
# ------------
|
|
|
|
AC_DEFUN([AM_DEP_TRACK],
|
|
|
|
[AC_ARG_ENABLE(dependency-tracking,
|
|
|
|
[ --disable-dependency-tracking speeds up one-time build
|
|
|
|
--enable-dependency-tracking do not reject slow dependency extractors])
|
|
|
|
if test "x$enable_dependency_tracking" != xno; then
|
|
|
|
am_depcomp="$ac_aux_dir/depcomp"
|
|
|
|
AMDEPBACKSLASH='\'
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
|
|
|
AC_SUBST([AMDEPBACKSLASH])dnl
|
|
|
|
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
|
|
|
|
])
|
|
|
|
|
|
|
|
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
|
|
|
|
|
|
|
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
|
|
|
|
# Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
|
|
|
#serial 5
|
|
|
|
|
|
|
|
# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
|
|
|
# ------------------------------
|
|
|
|
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
|
|
|
[{
|
|
|
|
# Autoconf 2.62 quotes --file arguments for eval, but not when files
|
|
|
|
# are listed without --file. Let's play safe and only enable the eval
|
|
|
|
# if we detect the quoting.
|
|
|
|
case $CONFIG_FILES in
|
|
|
|
*\'*) eval set x "$CONFIG_FILES" ;;
|
|
|
|
*) set x $CONFIG_FILES ;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
for mf
|
|
|
|
do
|
|
|
|
# Strip MF so we end up with the name of the file.
|
|
|
|
mf=`echo "$mf" | sed -e 's/:.*$//'`
|
|
|
|
# Check whether this is an Automake generated Makefile or not.
|
|
|
|
# We used to match only the files named `Makefile.in', but
|
|
|
|
# some people rename them; so instead we look at the file content.
|
|
|
|
# Grep'ing the first line is not enough: some people post-process
|
|
|
|
# each Makefile.in and add a new line on top of each file to say so.
|
|
|
|
# Grep'ing the whole file is not good either: AIX grep has a line
|
|
|
|
# limit of 2048, but all sed's we know have understand at least 4000.
|
|
|
|
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
|
|
|
|
dirpart=`AS_DIRNAME("$mf")`
|
|
|
|
else
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
# Extract the definition of DEPDIR, am__include, and am__quote
|
|
|
|
# from the Makefile without running `make'.
|
|
|
|
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
|
|
|
test -z "$DEPDIR" && continue
|
|
|
|
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
|
|
|
test -z "am__include" && continue
|
|
|
|
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
|
|
|
# When using ansi2knr, U may be empty or an underscore; expand it
|
|
|
|
U=`sed -n 's/^U = //p' < "$mf"`
|
|
|
|
# Find all dependency output files, they are included files with
|
|
|
|
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
|
|
|
# simplest approach to changing $(DEPDIR) to its actual value in the
|
|
|
|
# expansion.
|
|
|
|
for file in `sed -n "
|
|
|
|
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
|
|
|
|
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
|
|
|
|
# Make sure the directory exists.
|
|
|
|
test -f "$dirpart/$file" && continue
|
|
|
|
fdir=`AS_DIRNAME(["$file"])`
|
|
|
|
AS_MKDIR_P([$dirpart/$fdir])
|
|
|
|
# echo "creating $dirpart/$file"
|
|
|
|
echo '# dummy' > "$dirpart/$file"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
}
|
|
|
|
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
|
|
|
|
|
|
|
|
|
|
|
# AM_OUTPUT_DEPENDENCY_COMMANDS
|
|
|
|
# -----------------------------
|
|
|
|
# This macro should only be invoked once -- use via AC_REQUIRE.
|
|
|
|
#
|
|
|
|
# This code is only required when automatic dependency tracking
|
|
|
|
# is enabled. FIXME. This creates each `.P' file that we will
|
|
|
|
# need in order to bootstrap the dependency handling code.
|
|
|
|
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
|
|
|
[AC_CONFIG_COMMANDS([depfiles],
|
|
|
|
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
|
|
|
|
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
|
|
|
|
])
|
|
|
|
|
|
|
|
# Do all the work for Automake. -*- Autoconf -*-
|
|
|
|
|
|
|
|
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
2011-01-10 07:25:56 -07:00
|
|
|
# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
|
2009-06-06 11:52:23 -06:00
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# serial 16
|
2009-06-06 11:52:23 -06:00
|
|
|
|
|
|
|
# This macro actually does too much. Some checks are only needed if
|
|
|
|
# your package does certain things. But this isn't really a big deal.
|
|
|
|
|
|
|
|
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
|
|
|
|
# AM_INIT_AUTOMAKE([OPTIONS])
|
|
|
|
# -----------------------------------------------
|
|
|
|
# The call with PACKAGE and VERSION arguments is the old style
|
|
|
|
# call (pre autoconf-2.50), which is being phased out. PACKAGE
|
|
|
|
# and VERSION should now be passed to AC_INIT and removed from
|
|
|
|
# the call to AM_INIT_AUTOMAKE.
|
|
|
|
# We support both call styles for the transition. After
|
|
|
|
# the next Automake release, Autoconf can make the AC_INIT
|
|
|
|
# arguments mandatory, and then we can depend on a new Autoconf
|
|
|
|
# release and drop the old call support.
|
|
|
|
AC_DEFUN([AM_INIT_AUTOMAKE],
|
2011-01-10 07:25:56 -07:00
|
|
|
[AC_PREREQ([2.62])dnl
|
2009-06-06 11:52:23 -06:00
|
|
|
dnl Autoconf wants to disallow AM_ names. We explicitly allow
|
|
|
|
dnl the ones we care about.
|
|
|
|
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
|
|
|
|
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
|
|
|
|
AC_REQUIRE([AC_PROG_INSTALL])dnl
|
|
|
|
if test "`cd $srcdir && pwd`" != "`pwd`"; then
|
|
|
|
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
|
|
|
|
# is not polluted with repeated "-I."
|
|
|
|
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
|
|
|
|
# test to see if srcdir already configured
|
|
|
|
if test -f $srcdir/config.status; then
|
|
|
|
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# test whether we have cygpath
|
|
|
|
if test -z "$CYGPATH_W"; then
|
|
|
|
if (cygpath --version) >/dev/null 2>/dev/null; then
|
|
|
|
CYGPATH_W='cygpath -w'
|
|
|
|
else
|
|
|
|
CYGPATH_W=echo
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_SUBST([CYGPATH_W])
|
|
|
|
|
|
|
|
# Define the identity of the package.
|
|
|
|
dnl Distinguish between old-style and new-style calls.
|
|
|
|
m4_ifval([$2],
|
|
|
|
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
|
|
|
|
AC_SUBST([PACKAGE], [$1])dnl
|
|
|
|
AC_SUBST([VERSION], [$2])],
|
|
|
|
[_AM_SET_OPTIONS([$1])dnl
|
|
|
|
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
|
|
|
|
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
|
|
|
|
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
|
|
|
|
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
|
|
|
|
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
|
|
|
|
|
|
|
|
_AM_IF_OPTION([no-define],,
|
|
|
|
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
|
|
|
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
|
|
|
|
|
|
|
|
# Some tools Automake needs.
|
|
|
|
AC_REQUIRE([AM_SANITY_CHECK])dnl
|
|
|
|
AC_REQUIRE([AC_ARG_PROGRAM])dnl
|
|
|
|
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
|
|
|
|
AM_MISSING_PROG(AUTOCONF, autoconf)
|
|
|
|
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
|
|
|
|
AM_MISSING_PROG(AUTOHEADER, autoheader)
|
|
|
|
AM_MISSING_PROG(MAKEINFO, makeinfo)
|
2011-01-10 07:25:56 -07:00
|
|
|
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
|
|
|
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
|
2009-06-06 11:52:23 -06:00
|
|
|
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
|
|
|
|
# We need awk for the "check" target. The system "awk" is bad on
|
|
|
|
# some platforms.
|
|
|
|
AC_REQUIRE([AC_PROG_AWK])dnl
|
|
|
|
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
|
|
|
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
|
|
|
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
|
2011-01-10 07:25:56 -07:00
|
|
|
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
|
|
|
|
[_AM_PROG_TAR([v7])])])
|
2009-06-06 11:52:23 -06:00
|
|
|
_AM_IF_OPTION([no-dependencies],,
|
|
|
|
[AC_PROVIDE_IFELSE([AC_PROG_CC],
|
2011-01-10 07:25:56 -07:00
|
|
|
[_AM_DEPENDENCIES(CC)],
|
|
|
|
[define([AC_PROG_CC],
|
|
|
|
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
|
2009-06-06 11:52:23 -06:00
|
|
|
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
2011-01-10 07:25:56 -07:00
|
|
|
[_AM_DEPENDENCIES(CXX)],
|
|
|
|
[define([AC_PROG_CXX],
|
|
|
|
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
|
2009-06-06 11:52:23 -06:00
|
|
|
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
|
2011-01-10 07:25:56 -07:00
|
|
|
[_AM_DEPENDENCIES(OBJC)],
|
|
|
|
[define([AC_PROG_OBJC],
|
|
|
|
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
|
2009-06-06 11:52:23 -06:00
|
|
|
])
|
2011-01-10 07:25:56 -07:00
|
|
|
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
|
|
|
|
dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
|
|
|
|
dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
|
|
|
|
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
|
|
|
|
AC_CONFIG_COMMANDS_PRE(dnl
|
|
|
|
[m4_provide_if([_AM_COMPILER_EXEEXT],
|
|
|
|
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
|
2009-06-06 11:52:23 -06:00
|
|
|
])
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
|
|
|
|
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
|
|
|
|
dnl mangled by Autoconf and run in a shell conditional statement.
|
|
|
|
m4_define([_AC_COMPILER_EXEEXT],
|
|
|
|
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
|
|
|
|
|
2009-06-06 11:52:23 -06:00
|
|
|
|
|
|
|
# When config.status generates a header, we must update the stamp-h file.
|
|
|
|
# This file resides in the same directory as the config header
|
|
|
|
# that is generated. The stamp files are numbered to have different names.
|
|
|
|
|
|
|
|
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
|
|
|
|
# loop where config.status creates the headers, so we can generate
|
|
|
|
# our stamp files there.
|
|
|
|
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
|
|
|
|
[# Compute $1's index in $config_headers.
|
|
|
|
_am_arg=$1
|
|
|
|
_am_stamp_count=1
|
|
|
|
for _am_header in $config_headers :; do
|
|
|
|
case $_am_header in
|
|
|
|
$_am_arg | $_am_arg:* )
|
|
|
|
break ;;
|
|
|
|
* )
|
|
|
|
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
|
2009-06-06 11:52:23 -06:00
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
|
|
|
# AM_PROG_INSTALL_SH
|
|
|
|
# ------------------
|
|
|
|
# Define $install_sh.
|
|
|
|
AC_DEFUN([AM_PROG_INSTALL_SH],
|
|
|
|
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
2011-01-10 07:25:56 -07:00
|
|
|
if test x"${install_sh}" != xset; then
|
|
|
|
case $am_aux_dir in
|
|
|
|
*\ * | *\ *)
|
|
|
|
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
|
|
|
|
*)
|
|
|
|
install_sh="\${SHELL} $am_aux_dir/install-sh"
|
|
|
|
esac
|
|
|
|
fi
|
2009-06-06 11:52:23 -06:00
|
|
|
AC_SUBST(install_sh)])
|
|
|
|
|
|
|
|
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
|
|
|
# serial 2
|
|
|
|
|
|
|
|
# Check whether the underlying file-system supports filenames
|
|
|
|
# with a leading dot. For instance MS-DOS doesn't.
|
|
|
|
AC_DEFUN([AM_SET_LEADING_DOT],
|
|
|
|
[rm -rf .tst 2>/dev/null
|
|
|
|
mkdir .tst 2>/dev/null
|
|
|
|
if test -d .tst; then
|
|
|
|
am__leading_dot=.
|
|
|
|
else
|
|
|
|
am__leading_dot=_
|
|
|
|
fi
|
|
|
|
rmdir .tst 2>/dev/null
|
|
|
|
AC_SUBST([am__leading_dot])])
|
|
|
|
|
|
|
|
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
|
|
|
|
# From Jim Meyering
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
|
2009-06-06 11:52:23 -06:00
|
|
|
# Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# serial 5
|
2009-06-06 11:52:23 -06:00
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# AM_MAINTAINER_MODE([DEFAULT-MODE])
|
|
|
|
# ----------------------------------
|
|
|
|
# Control maintainer-specific portions of Makefiles.
|
|
|
|
# Default is to disable them, unless `enable' is passed literally.
|
|
|
|
# For symmetry, `disable' may be passed as well. Anyway, the user
|
|
|
|
# can override the default with the --enable/--disable switch.
|
2009-06-06 11:52:23 -06:00
|
|
|
AC_DEFUN([AM_MAINTAINER_MODE],
|
2011-01-10 07:25:56 -07:00
|
|
|
[m4_case(m4_default([$1], [disable]),
|
|
|
|
[enable], [m4_define([am_maintainer_other], [disable])],
|
|
|
|
[disable], [m4_define([am_maintainer_other], [enable])],
|
|
|
|
[m4_define([am_maintainer_other], [enable])
|
|
|
|
m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
|
|
|
|
AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
|
|
|
|
dnl maintainer-mode's default is 'disable' unless 'enable' is passed
|
|
|
|
AC_ARG_ENABLE([maintainer-mode],
|
|
|
|
[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
|
2009-06-06 11:52:23 -06:00
|
|
|
(and sometimes confusing) to the casual installer],
|
2011-01-10 07:25:56 -07:00
|
|
|
[USE_MAINTAINER_MODE=$enableval],
|
|
|
|
[USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
|
2009-06-06 11:52:23 -06:00
|
|
|
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
|
2011-01-10 07:25:56 -07:00
|
|
|
AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
|
2009-06-06 11:52:23 -06:00
|
|
|
MAINT=$MAINTAINER_MODE_TRUE
|
2011-01-10 07:25:56 -07:00
|
|
|
AC_SUBST([MAINT])dnl
|
2009-06-06 11:52:23 -06:00
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
|
|
|
|
|
|
|
|
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
|
2009-06-06 11:52:23 -06:00
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# serial 4
|
2009-06-06 11:52:23 -06:00
|
|
|
|
|
|
|
# AM_MAKE_INCLUDE()
|
|
|
|
# -----------------
|
|
|
|
# Check to see how make treats includes.
|
|
|
|
AC_DEFUN([AM_MAKE_INCLUDE],
|
|
|
|
[am_make=${MAKE-make}
|
|
|
|
cat > confinc << 'END'
|
|
|
|
am__doit:
|
2011-01-10 07:25:56 -07:00
|
|
|
@echo this is the am__doit target
|
2009-06-06 11:52:23 -06:00
|
|
|
.PHONY: am__doit
|
|
|
|
END
|
|
|
|
# If we don't find an include directive, just comment out the code.
|
|
|
|
AC_MSG_CHECKING([for style of include used by $am_make])
|
|
|
|
am__include="#"
|
|
|
|
am__quote=
|
|
|
|
_am_result=none
|
|
|
|
# First try GNU make style include.
|
|
|
|
echo "include confinc" > confmf
|
2011-01-10 07:25:56 -07:00
|
|
|
# Ignore all kinds of additional output from `make'.
|
|
|
|
case `$am_make -s -f confmf 2> /dev/null` in #(
|
|
|
|
*the\ am__doit\ target*)
|
|
|
|
am__include=include
|
|
|
|
am__quote=
|
|
|
|
_am_result=GNU
|
|
|
|
;;
|
|
|
|
esac
|
2009-06-06 11:52:23 -06:00
|
|
|
# Now try BSD make style include.
|
|
|
|
if test "$am__include" = "#"; then
|
|
|
|
echo '.include "confinc"' > confmf
|
2011-01-10 07:25:56 -07:00
|
|
|
case `$am_make -s -f confmf 2> /dev/null` in #(
|
|
|
|
*the\ am__doit\ target*)
|
|
|
|
am__include=.include
|
|
|
|
am__quote="\""
|
|
|
|
_am_result=BSD
|
|
|
|
;;
|
|
|
|
esac
|
2009-06-06 11:52:23 -06:00
|
|
|
fi
|
|
|
|
AC_SUBST([am__include])
|
|
|
|
AC_SUBST([am__quote])
|
|
|
|
AC_MSG_RESULT([$_am_result])
|
|
|
|
rm -f confinc confmf
|
|
|
|
])
|
|
|
|
|
|
|
|
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
|
2009-06-06 11:52:23 -06:00
|
|
|
# Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# serial 6
|
2009-06-06 11:52:23 -06:00
|
|
|
|
|
|
|
# AM_MISSING_PROG(NAME, PROGRAM)
|
|
|
|
# ------------------------------
|
|
|
|
AC_DEFUN([AM_MISSING_PROG],
|
|
|
|
[AC_REQUIRE([AM_MISSING_HAS_RUN])
|
|
|
|
$1=${$1-"${am_missing_run}$2"}
|
|
|
|
AC_SUBST($1)])
|
|
|
|
|
|
|
|
|
|
|
|
# AM_MISSING_HAS_RUN
|
|
|
|
# ------------------
|
|
|
|
# Define MISSING if not defined so far and test if it supports --run.
|
|
|
|
# If it does, set am_missing_run to use it, otherwise, to nothing.
|
|
|
|
AC_DEFUN([AM_MISSING_HAS_RUN],
|
|
|
|
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
|
|
|
AC_REQUIRE_AUX_FILE([missing])dnl
|
2011-01-10 07:25:56 -07:00
|
|
|
if test x"${MISSING+set}" != xset; then
|
|
|
|
case $am_aux_dir in
|
|
|
|
*\ * | *\ *)
|
|
|
|
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
|
|
|
|
*)
|
|
|
|
MISSING="\${SHELL} $am_aux_dir/missing" ;;
|
|
|
|
esac
|
|
|
|
fi
|
2009-06-06 11:52:23 -06:00
|
|
|
# Use eval to expand $SHELL
|
|
|
|
if eval "$MISSING --run true"; then
|
|
|
|
am_missing_run="$MISSING --run "
|
|
|
|
else
|
|
|
|
am_missing_run=
|
|
|
|
AC_MSG_WARN([`missing' script is too old or missing])
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
|
|
|
# AM_PROG_MKDIR_P
|
|
|
|
# ---------------
|
|
|
|
# Check for `mkdir -p'.
|
|
|
|
AC_DEFUN([AM_PROG_MKDIR_P],
|
|
|
|
[AC_PREREQ([2.60])dnl
|
|
|
|
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
|
|
|
|
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
|
|
|
|
dnl while keeping a definition of mkdir_p for backward compatibility.
|
|
|
|
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
|
|
|
|
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
|
|
|
|
dnl Makefile.ins that do not define MKDIR_P, so we do our own
|
|
|
|
dnl adjustment using top_builddir (which is defined more often than
|
|
|
|
dnl MKDIR_P).
|
|
|
|
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
|
|
|
|
case $mkdir_p in
|
|
|
|
[[\\/$]]* | ?:[[\\/]]*) ;;
|
|
|
|
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
|
|
|
|
esac
|
|
|
|
])
|
|
|
|
|
|
|
|
# Helper functions for option handling. -*- Autoconf -*-
|
|
|
|
|
|
|
|
# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
|
|
|
# serial 4
|
|
|
|
|
|
|
|
# _AM_MANGLE_OPTION(NAME)
|
|
|
|
# -----------------------
|
|
|
|
AC_DEFUN([_AM_MANGLE_OPTION],
|
|
|
|
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
|
|
|
|
|
|
|
|
# _AM_SET_OPTION(NAME)
|
|
|
|
# ------------------------------
|
|
|
|
# Set option NAME. Presently that only means defining a flag for this option.
|
|
|
|
AC_DEFUN([_AM_SET_OPTION],
|
|
|
|
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
|
|
|
|
|
|
|
|
# _AM_SET_OPTIONS(OPTIONS)
|
|
|
|
# ----------------------------------
|
|
|
|
# OPTIONS is a space-separated list of Automake options.
|
|
|
|
AC_DEFUN([_AM_SET_OPTIONS],
|
|
|
|
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
|
|
|
|
|
|
|
|
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
|
|
|
|
# -------------------------------------------
|
|
|
|
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
|
|
|
AC_DEFUN([_AM_IF_OPTION],
|
|
|
|
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
|
|
|
|
|
|
|
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
|
2009-06-06 11:52:23 -06:00
|
|
|
# Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# serial 5
|
2009-06-06 11:52:23 -06:00
|
|
|
|
|
|
|
# AM_SANITY_CHECK
|
|
|
|
# ---------------
|
|
|
|
AC_DEFUN([AM_SANITY_CHECK],
|
|
|
|
[AC_MSG_CHECKING([whether build environment is sane])
|
|
|
|
# Just in case
|
|
|
|
sleep 1
|
|
|
|
echo timestamp > conftest.file
|
2011-01-10 07:25:56 -07:00
|
|
|
# Reject unsafe characters in $srcdir or the absolute working directory
|
|
|
|
# name. Accept space and tab only in the latter.
|
|
|
|
am_lf='
|
|
|
|
'
|
|
|
|
case `pwd` in
|
|
|
|
*[[\\\"\#\$\&\'\`$am_lf]]*)
|
|
|
|
AC_MSG_ERROR([unsafe absolute working directory name]);;
|
|
|
|
esac
|
|
|
|
case $srcdir in
|
|
|
|
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
|
|
|
|
AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
|
|
|
|
esac
|
|
|
|
|
2009-06-06 11:52:23 -06:00
|
|
|
# Do `set' in a subshell so we don't clobber the current shell's
|
|
|
|
# arguments. Must try -L first in case configure is actually a
|
|
|
|
# symlink; some systems play weird games with the mod time of symlinks
|
|
|
|
# (eg FreeBSD returns the mod time of the symlink's containing
|
|
|
|
# directory).
|
|
|
|
if (
|
2011-01-10 07:25:56 -07:00
|
|
|
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
|
2009-06-06 11:52:23 -06:00
|
|
|
if test "$[*]" = "X"; then
|
|
|
|
# -L didn't work.
|
2011-01-10 07:25:56 -07:00
|
|
|
set X `ls -t "$srcdir/configure" conftest.file`
|
2009-06-06 11:52:23 -06:00
|
|
|
fi
|
|
|
|
rm -f conftest.file
|
|
|
|
if test "$[*]" != "X $srcdir/configure conftest.file" \
|
|
|
|
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
|
|
|
|
|
|
|
|
# If neither matched, then we have a broken ls. This can happen
|
|
|
|
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
|
|
|
# broken ls alias from the environment. This has actually
|
|
|
|
# happened. Such a system could not be considered "sane".
|
|
|
|
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
|
|
|
alias in your environment])
|
|
|
|
fi
|
|
|
|
|
|
|
|
test "$[2]" = conftest.file
|
|
|
|
)
|
|
|
|
then
|
|
|
|
# Ok.
|
|
|
|
:
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([newly created file is older than distributed files!
|
|
|
|
Check your system clock])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT(yes)])
|
|
|
|
|
|
|
|
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
|
|
|
# AM_PROG_INSTALL_STRIP
|
|
|
|
# ---------------------
|
|
|
|
# One issue with vendor `install' (even GNU) is that you can't
|
|
|
|
# specify the program used to strip binaries. This is especially
|
|
|
|
# annoying in cross-compiling environments, where the build's strip
|
|
|
|
# is unlikely to handle the host's binaries.
|
|
|
|
# Fortunately install-sh will honor a STRIPPROG variable, so we
|
|
|
|
# always use install-sh in `make install-strip', and initialize
|
|
|
|
# STRIPPROG with the value of the STRIP variable (set by the user).
|
|
|
|
AC_DEFUN([AM_PROG_INSTALL_STRIP],
|
|
|
|
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
|
|
|
# Installed binaries are usually stripped using `strip' when the user
|
|
|
|
# run `make install-strip'. However `strip' might not be the right
|
|
|
|
# tool to use in cross-compilation environments, therefore Automake
|
|
|
|
# will honor the `STRIP' environment variable to overrule this program.
|
|
|
|
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
|
|
|
|
if test "$cross_compiling" != no; then
|
|
|
|
AC_CHECK_TOOL([STRIP], [strip], :)
|
|
|
|
fi
|
|
|
|
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
|
|
|
|
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
|
2009-06-06 11:52:23 -06:00
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# serial 2
|
|
|
|
|
2009-06-06 11:52:23 -06:00
|
|
|
# _AM_SUBST_NOTMAKE(VARIABLE)
|
|
|
|
# ---------------------------
|
|
|
|
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
|
|
|
|
# This macro is traced by Automake.
|
|
|
|
AC_DEFUN([_AM_SUBST_NOTMAKE])
|
|
|
|
|
2011-01-10 07:25:56 -07:00
|
|
|
# AM_SUBST_NOTMAKE(VARIABLE)
|
|
|
|
# ---------------------------
|
|
|
|
# Public sister of _AM_SUBST_NOTMAKE.
|
|
|
|
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
|
|
|
|
|
2009-06-06 11:52:23 -06:00
|
|
|
# Check how to create a tarball. -*- Autoconf -*-
|
|
|
|
|
|
|
|
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
|
|
|
# serial 2
|
|
|
|
|
|
|
|
# _AM_PROG_TAR(FORMAT)
|
|
|
|
# --------------------
|
|
|
|
# Check how to create a tarball in format FORMAT.
|
|
|
|
# FORMAT should be one of `v7', `ustar', or `pax'.
|
|
|
|
#
|
|
|
|
# Substitute a variable $(am__tar) that is a command
|
|
|
|
# writing to stdout a FORMAT-tarball containing the directory
|
|
|
|
# $tardir.
|
|
|
|
# tardir=directory && $(am__tar) > result.tar
|
|
|
|
#
|
|
|
|
# Substitute a variable $(am__untar) that extract such
|
|
|
|
# a tarball read from stdin.
|
|
|
|
# $(am__untar) < result.tar
|
|
|
|
AC_DEFUN([_AM_PROG_TAR],
|
|
|
|
[# Always define AMTAR for backward compatibility.
|
|
|
|
AM_MISSING_PROG([AMTAR], [tar])
|
|
|
|
m4_if([$1], [v7],
|
|
|
|
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
|
|
|
|
[m4_case([$1], [ustar],, [pax],,
|
|
|
|
[m4_fatal([Unknown tar format])])
|
|
|
|
AC_MSG_CHECKING([how to create a $1 tar archive])
|
|
|
|
# Loop over all known methods to create a tar archive until one works.
|
|
|
|
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
|
|
|
|
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
|
|
|
# Do not fold the above two line into one, because Tru64 sh and
|
|
|
|
# Solaris sh will not grok spaces in the rhs of `-'.
|
|
|
|
for _am_tool in $_am_tools
|
|
|
|
do
|
|
|
|
case $_am_tool in
|
|
|
|
gnutar)
|
|
|
|
for _am_tar in tar gnutar gtar;
|
|
|
|
do
|
|
|
|
AM_RUN_LOG([$_am_tar --version]) && break
|
|
|
|
done
|
|
|
|
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
|
|
|
|
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
|
|
|
|
am__untar="$_am_tar -xf -"
|
|
|
|
;;
|
|
|
|
plaintar)
|
|
|
|
# Must skip GNU tar: if it does not support --format= it doesn't create
|
|
|
|
# ustar tarball either.
|
|
|
|
(tar --version) >/dev/null 2>&1 && continue
|
|
|
|
am__tar='tar chf - "$$tardir"'
|
|
|
|
am__tar_='tar chf - "$tardir"'
|
|
|
|
am__untar='tar xf -'
|
|
|
|
;;
|
|
|
|
pax)
|
|
|
|
am__tar='pax -L -x $1 -w "$$tardir"'
|
|
|
|
am__tar_='pax -L -x $1 -w "$tardir"'
|
|
|
|
am__untar='pax -r'
|
|
|
|
;;
|
|
|
|
cpio)
|
|
|
|
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
|
|
|
|
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
|
|
|
|
am__untar='cpio -i -H $1 -d'
|
|
|
|
;;
|
|
|
|
none)
|
|
|
|
am__tar=false
|
|
|
|
am__tar_=false
|
|
|
|
am__untar=false
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# If the value was cached, stop now. We just wanted to have am__tar
|
|
|
|
# and am__untar set.
|
|
|
|
test -n "${am_cv_prog_tar_$1}" && break
|
|
|
|
|
|
|
|
# tar/untar a dummy directory, and stop if the command works
|
|
|
|
rm -rf conftest.dir
|
|
|
|
mkdir conftest.dir
|
|
|
|
echo GrepMe > conftest.dir/file
|
|
|
|
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
|
|
|
|
rm -rf conftest.dir
|
|
|
|
if test -s conftest.tar; then
|
|
|
|
AM_RUN_LOG([$am__untar <conftest.tar])
|
|
|
|
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
rm -rf conftest.dir
|
|
|
|
|
|
|
|
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
|
|
|
|
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
|
|
|
|
AC_SUBST([am__tar])
|
|
|
|
AC_SUBST([am__untar])
|
|
|
|
]) # _AM_PROG_TAR
|
|
|
|
|