Blame configure.ac

Packit Service 7866ab
dnl Process this file with autoconf to produce a configure script.
Packit Service 7866ab
AC_PREREQ([2.63])
Packit Service 7866ab
Packit Service 7866ab
dnl We're using a two digit number for the releases and
Packit Service 7866ab
dnl a three digit number for the development version
Packit Service 7866ab
m4_define(gtk_doc_version, 1.28)
Packit Service 7866ab
Packit Service 7866ab
AC_INIT([gtk-doc],[gtk_doc_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc],[gtk-doc])
Packit Service 7866ab
Packit Service 7866ab
AC_CONFIG_MACRO_DIR([m4])
Packit Service 7866ab
AC_CONFIG_SRCDIR([gtk-doc.pc.in])
Packit Service 7866ab
AC_CONFIG_AUX_DIR([build-aux])
Packit Service 7866ab
Packit Service 7866ab
AM_INIT_AUTOMAKE([1.11 check-news std-options -Wno-portability tar-ustar no-dist-gzip dist-xz])
Packit Service 7866ab
AM_MAINTAINER_MODE([enable])
Packit Service 7866ab
Packit Service 7866ab
# Support silent build rules, requires at least automake-1.11. Disable
Packit Service 7866ab
# by either passing --disable-silent-rules to configure or passing V=1
Packit Service 7866ab
# to make
Packit Service 7866ab
AM_SILENT_RULES([yes])
Packit Service 7866ab
Packit Service 7866ab
# Check for programs
Packit Service 7866ab
AC_PROG_CC
Packit Service 7866ab
Packit Service 7866ab
# Initialize libtool
Packit Service 7866ab
LT_PREREQ([2.2])
Packit Service 7866ab
LT_INIT
Packit Service 7866ab
Packit Service 7866ab
dnl Make sure we have pkg-config >= 0.19, so installing in $(datadir) is OK.
Packit Service 7866ab
PKG_PROG_PKG_CONFIG([0.19])
Packit Service 7866ab
Packit Service 7866ab
dnl
Packit Service 7866ab
dnl Check for Python.
Packit Service 7866ab
dnl
Packit Service 7866ab
AM_PATH_PYTHON([2.7])
Packit Service 7866ab
Packit Service 7866ab
dnl
Packit Service 7866ab
dnl Check for xsltproc
Packit Service 7866ab
dnl
Packit Service 7866ab
AC_PATH_PROG([XSLTPROC], [xsltproc])
Packit Service 7866ab
if test -z "$XSLTPROC"; then
Packit Service 7866ab
	AC_MSG_ERROR([xsltproc not found])
Packit Service 7866ab
fi
Packit Service 7866ab
Packit Service 7866ab
dnl
Packit Service 7866ab
dnl Check for dblatex/fop (for pdf output)
Packit Service 7866ab
dnl
Packit Service 7866ab
AC_PATH_PROG([DBLATEX], [dblatex])
Packit Service 7866ab
if test -z "$DBLATEX"; then
Packit Service 7866ab
	AC_PATH_PROG([FOP], [fop])
Packit Service 7866ab
	if test -z "$FOP"; then
Packit Service 7866ab
		AC_MSG_WARN([neither dblatex nor fop found, so no pdf output from xml])
Packit Service 7866ab
	fi
Packit Service 7866ab
fi
Packit Service 7866ab
Packit Service 7866ab
dnl check for DocBook DTD and stylesheets in the local catalog.
Packit Service 7866ab
JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.3//EN], [DocBook XML DTD V4.3])
Packit Service 7866ab
JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl], [DocBook XSL Stylesheets])
Packit Service 7866ab
Packit Service 7866ab
dnl
Packit Service 7866ab
dnl Check for syntax highlighters
Packit Service 7866ab
dnl
Packit Service 7866ab
AC_ARG_WITH([highlight],
Packit Service 7866ab
	AS_HELP_STRING([--with-highlight], [Select source code syntax highlighter (no|source-highlight|highlight|vim|auto)]),
Packit Service 7866ab
	, [with_highlight=auto])
Packit Service 7866ab
Packit Service 7866ab
case $with_highlight in
Packit Service 7866ab
	no|source-highlight|highlight|vim|auto) ;;
Packit Service 7866ab
	*) AC_MSG_ERROR([Invalid value for syntax highlighting option.]) ;;
Packit Service 7866ab
esac
Packit Service 7866ab
Packit Service 7866ab
HIGHLIGHT_OPTIONS=""
Packit Service 7866ab
if test "$with_highlight" = "auto"; then
Packit Service 7866ab
	AC_PATH_PROG([HIGHLIGHT], [source-highlight])
Packit Service 7866ab
	if test -n "$HIGHLIGHT"; then
Packit Service 7866ab
		HIGHLIGHT_OPTIONS="-t4 -s\$SRC_LANG -cstyle.css --no-doc -i"
Packit Service 7866ab
	else
Packit Service 7866ab
		AC_PATH_PROG([HIGHLIGHT], [highlight])
Packit Service 7866ab
		if test -n "$HIGHLIGHT"; then
Packit Service 7866ab
			HIGHLIGHT_OPTIONS="--syntax=\$SRC_LANG --out-format=xhtml -f --class-name=gtkdoc "
Packit Service 7866ab
		else
Packit Service 7866ab
			AC_PATH_PROG([HIGHLIGHT], [vim])
Packit Service 7866ab
			if test -n "$HIGHLIGHT"; then
Packit Service 7866ab
				dnl vim is useless if it does not support syntax highlighting
Packit Service 7866ab
				AC_MSG_CHECKING([whether vim has +syntax feature])
Packit Service 7866ab
				if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
Packit Service 7866ab
					AC_MSG_RESULT([yes])
Packit Service 7866ab
				else
Packit Service 7866ab
					AC_MSG_RESULT([no])
Packit Service 7866ab
					HIGHLIGHT=
Packit Service 7866ab
				fi
Packit Service 7866ab
			fi
Packit Service 7866ab
		fi
Packit Service 7866ab
	fi
Packit Service 7866ab
else
Packit Service 7866ab
	if test "$with_highlight" != "no"; then
Packit Service 7866ab
		AC_PATH_PROG([HIGHLIGHT], [$with_highlight], [no])
Packit Service 7866ab
	fi
Packit Service 7866ab
Packit Service 7866ab
	case $with_highlight in
Packit Service 7866ab
		source-highlight) HIGHLIGHT_OPTIONS="-t4 -s\$SRC_LANG -cstyle.css --no-doc -i";;
Packit Service 7866ab
		highlight) HIGHLIGHT_OPTIONS="--syntax=\$SRC_LANG --out-format=xhtml -f --class-name=gtkdoc ";;
Packit Service 7866ab
		vim)
Packit Service 7866ab
			AC_MSG_CHECKING([whether vim has +syntax feature])
Packit Service 7866ab
			if $HIGHLIGHT --version | grep '+syntax' >/dev/null; then
Packit Service 7866ab
				AC_MSG_RESULT([yes])
Packit Service 7866ab
			else
Packit Service 7866ab
				AC_MSG_RESULT([no])
Packit Service 7866ab
				HIGHLIGHT=no
Packit Service 7866ab
			fi
Packit Service 7866ab
		;;
Packit Service 7866ab
	esac
Packit Service 7866ab
Packit Service 7866ab
	if test "$HIGHLIGHT" = "no" && test "$with_highlight" != "no"; then
Packit Service 7866ab
		AC_MSG_ERROR([Could not find requested syntax highlighter])
Packit Service 7866ab
	fi
Packit Service 7866ab
fi
Packit Service 7866ab
AC_SUBST([HIGHLIGHT_OPTIONS])
Packit Service 7866ab
Packit Service 7866ab
dnl
Packit Service 7866ab
dnl Set runtime package dirs so we can find the script containing common routines.
Packit Service 7866ab
dnl
Packit Service 7866ab
dnl From Autoconf Macro Archive:
Packit Service 7866ab
m4_define([AC_DEFINE_DIR], [
Packit Service 7866ab
	prefix_NONE=
Packit Service 7866ab
	exec_prefix_NONE=
Packit Service 7866ab
	test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
Packit Service 7866ab
	test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
Packit Service 7866ab
	eval ac_define_dir="\"[$]$2\""
Packit Service 7866ab
	eval ac_define_dir="\"$ac_define_dir\""
Packit Service 7866ab
	AC_SUBST($1, "$ac_define_dir")
Packit Service 7866ab
	test "$prefix_NONE" && prefix=NONE
Packit Service 7866ab
	test "$exec_prefix_NONE" && exec_prefix=NONE
Packit Service 7866ab
])
Packit Service 7866ab
PACKAGE_DATA_DIR="${datadir}/${PACKAGE}/data"
Packit Service 7866ab
AC_DEFINE_DIR([PACKAGE_DATA_DIR], [PACKAGE_DATA_DIR])
Packit Service 7866ab
PYTHON_PACKAGE_DIR="${datadir}/${PACKAGE}/python"
Packit Service 7866ab
AC_DEFINE_DIR([PYTHON_PACKAGE_DIR], [PYTHON_PACKAGE_DIR])
Packit Service 7866ab
Packit Service 7866ab
dnl Only use -Wall if we have gcc
Packit Service 7866ab
if test "x$GCC" = "xyes"; then
Packit Service 7866ab
	if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
Packit Service 7866ab
		CFLAGS="$CFLAGS -Wall"
Packit Service 7866ab
	fi
Packit Service 7866ab
fi
Packit Service 7866ab
Packit Service 7866ab
dnl if glib is available we can enable the tests
Packit Service 7866ab
PKG_CHECK_MODULES(TEST_DEPS, [glib-2.0 >= 2.6.0 gobject-2.0 >= 2.6.0],
Packit Service 7866ab
	[	glib_prefix="`$PKG_CONFIG --variable=prefix glib-2.0`"
Packit Service 7866ab
		gtk_doc_use_libtool="yes"
Packit Service 7866ab
		build_tests="yes"
Packit Service 7866ab
	],
Packit Service 7866ab
	[	gtk_doc_use_libtool="no"
Packit Service 7866ab
		build_tests="no"
Packit Service 7866ab
	]
Packit Service 7866ab
)
Packit Service 7866ab
AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL" -a x$gtk_doc_use_libtool = xyes )
Packit Service 7866ab
dnl this enables the rule in test/Makefile.am
Packit Service 7866ab
AM_CONDITIONAL(BUILD_TESTS, test x$build_tests = xyes)
Packit Service 7866ab
AC_SUBST(glib_prefix)
Packit Service 7866ab
Packit Service 7866ab
dnl enable runtime debugging code
Packit Service 7866ab
AC_MSG_CHECKING(whether to enable runtime debugging code)
Packit Service 7866ab
AC_ARG_ENABLE([debug],
Packit Service 7866ab
	AS_HELP_STRING([--enable-debug],
Packit Service 7866ab
	[enable runtime debugging code (default=no)]),,
Packit Service 7866ab
	[enable_debug="no"])
Packit Service 7866ab
AC_MSG_RESULT($enable_debug)
Packit Service 7866ab
Packit Service 7866ab
dnl check what date format we can use for the makefile tracing in tests
Packit Service 7866ab
dnl this is mostly to detect the date command on macosx that is quite cripled
Packit Service 7866ab
dnl  and broken too
Packit Service 7866ab
AC_MSG_CHECKING(whether date can output nanoseconds)
Packit Service 7866ab
date +%s.%N | grep -q 'N'
Packit Service 7866ab
if test "$?" = "1"; then
Packit Service 7866ab
  TS_FMT="+%s.%N"
Packit Service 7866ab
  ELAPSED_FMT="+%H:%M:%S.%N"
Packit Service 7866ab
  AC_MSG_RESULT(yes)
Packit Service 7866ab
else
Packit Service 7866ab
  TS_FMT="+%s.0"
Packit Service 7866ab
  ELAPSED_FMT="+%H:%M:%S"
Packit Service 7866ab
  AC_MSG_RESULT(no)
Packit Service 7866ab
fi
Packit Service 7866ab
AC_SUBST(TS_FMT)
Packit Service 7866ab
AC_SUBST(ELAPSED_FMT)
Packit Service 7866ab
Packit Service 7866ab
AC_MSG_CHECKING(whether date can format dates)
Packit Service 7866ab
date >/dev/null 2>&1 --utc --date @1.1 $ELAPSED_FMT
Packit Service 7866ab
if test "$?" = "0"; then
Packit Service 7866ab
  DATE_FMT_CMD="date --utc $ELAPSED_FMT --date @0"
Packit Service 7866ab
  AC_MSG_RESULT(yes)
Packit Service 7866ab
else
Packit Service 7866ab
  DATE_FMT_CMD="echo "
Packit Service 7866ab
  AC_MSG_RESULT(no)
Packit Service 7866ab
fi
Packit Service 7866ab
AC_SUBST(DATE_FMT_CMD)
Packit Service 7866ab
Packit Service 7866ab
dnl
Packit Service 7866ab
dnl Documentation
Packit Service 7866ab
dnl
Packit Service 7866ab
AC_MSG_CHECKING([for yelp-tools])
Packit Service 7866ab
have_yelp_tools=no
Packit Service 7866ab
m4_ifdef([YELP_HELP_INIT],[
Packit Service 7866ab
AC_MSG_RESULT([yes])
Packit Service 7866ab
YELP_HELP_INIT
Packit Service 7866ab
have_yelp_tools=yes
Packit Service 7866ab
])
Packit Service 7866ab
if test "x$have_yelp_tools" != "xyes"; then
Packit Service 7866ab
  AC_MSG_RESULT([no])
Packit Service 7866ab
fi
Packit Service 7866ab
AM_CONDITIONAL([HAVE_YELP_TOOLS],[test x$have_yelp_tools = xyes])
Packit Service 7866ab
Packit Service 7866ab
# cmake/GtkDocConfig.cmake is handled in the Makefile, not here.
Packit Service 7866ab
AC_CONFIG_FILES([Makefile
Packit Service 7866ab
gtk-doc.pc
Packit Service 7866ab
cmake/Makefile
Packit Service 7866ab
cmake/GtkDocConfigVersion.cmake
Packit Service 7866ab
gtkdoc/config.py
Packit Service 7866ab
help/Makefile
Packit Service 7866ab
help/manual/Makefile
Packit Service 7866ab
tests/Makefile
Packit Service 7866ab
tests/annotations/Makefile
Packit Service 7866ab
tests/annotations/src/Makefile
Packit Service 7866ab
tests/annotations/docs/Makefile
Packit Service 7866ab
tests/bugs/Makefile
Packit Service 7866ab
tests/bugs/src/Makefile
Packit Service 7866ab
tests/bugs/docs/Makefile
Packit Service 7866ab
tests/empty/Makefile
Packit Service 7866ab
tests/empty/src/Makefile
Packit Service 7866ab
tests/empty/docs/Makefile
Packit Service 7866ab
tests/fail/Makefile
Packit Service 7866ab
tests/fail/src/Makefile
Packit Service 7866ab
tests/fail/docs/Makefile
Packit Service 7866ab
tests/gobject/Makefile
Packit Service 7866ab
tests/gobject/src/Makefile
Packit Service 7866ab
tests/gobject/docs/Makefile
Packit Service 7866ab
tests/program/Makefile
Packit Service 7866ab
tests/program/src/Makefile
Packit Service 7866ab
tests/program/docs/Makefile
Packit Service 7866ab
tests/repro/Makefile
Packit Service 7866ab
tests/repro/src/Makefile
Packit Service 7866ab
tests/repro/docs/Makefile
Packit Service 7866ab
])
Packit Service 7866ab
Packit Service 7866ab
dnl run chmod on these after parsing them.
Packit Service 7866ab
AC_CONFIG_FILES([gtkdoc-check],    [chmod +x gtkdoc-check])
Packit Service 7866ab
AC_CONFIG_FILES([gtkdoc-depscan],  [chmod +x gtkdoc-depscan])
Packit Service 7866ab
AC_CONFIG_FILES([gtkdoc-fixxref],  [chmod +x gtkdoc-fixxref])
Packit Service 7866ab
AC_CONFIG_FILES([gtkdoc-mkdb],     [chmod +x gtkdoc-mkdb])
Packit Service 7866ab
AC_CONFIG_FILES([gtkdoc-mkhtml],   [chmod +x gtkdoc-mkhtml])
Packit Service 7866ab
AC_CONFIG_FILES([gtkdoc-mkhtml2],  [chmod +x gtkdoc-mkhtml2])
Packit Service 7866ab
AC_CONFIG_FILES([gtkdoc-mkman],    [chmod +x gtkdoc-mkman])
Packit Service 7866ab
AC_CONFIG_FILES([gtkdoc-mkpdf],    [chmod +x gtkdoc-mkpdf])
Packit Service 7866ab
AC_CONFIG_FILES([gtkdoc-rebase],   [chmod +x gtkdoc-rebase])
Packit Service 7866ab
AC_CONFIG_FILES([gtkdoc-scan],     [chmod +x gtkdoc-scan])
Packit Service 7866ab
AC_CONFIG_FILES([gtkdoc-scangobj], [chmod +x gtkdoc-scangobj])
Packit Service 7866ab
AC_CONFIG_FILES([gtkdocize],       [chmod +x gtkdocize])
Packit Service 7866ab
AC_CONFIG_FILES([tests/tools.sh],  [chmod +x tests/tools.sh])
Packit Service 7866ab
AC_OUTPUT
Packit Service 7866ab
Packit Service 7866ab
AC_MSG_NOTICE([
Packit Service 7866ab
gtk-doc was configured with the following options:
Packit Service 7866ab
==================================================])
Packit Service 7866ab
Packit Service 7866ab
test -n "$DBLATEX$FOP" \
Packit Service 7866ab
    && AC_MSG_NOTICE([** PDF support enabled, using $DBLATEX$FOP]) \
Packit Service 7866ab
    || AC_MSG_NOTICE([   PDF support disabled, no dblatex or fop available])
Packit Service 7866ab
test -n "$HIGHLIGHT" \
Packit Service 7866ab
    && AC_MSG_NOTICE([** Syntax highlighting of examples enabled, using $HIGHLIGHT]) \
Packit Service 7866ab
    || AC_MSG_NOTICE([   Syntax highlighting of examples disabled])
Packit Service 7866ab
test "x$build_tests" != "xno" \
Packit Service 7866ab
    && AC_MSG_NOTICE([** Building regression tests]) \
Packit Service 7866ab
    || AC_MSG_NOTICE([   Skipping regression tests])
Packit Service 7866ab
test "x$enable_debug" != "xno" \
Packit Service 7866ab
    && AC_MSG_NOTICE([** Debug tracing enabled]) \
Packit Service 7866ab
    || AC_MSG_NOTICE([   Debug tracing disabled])
Packit Service 7866ab
test "x$have_yelp_tools" != "xno" \
Packit Service 7866ab
    && AC_MSG_NOTICE([** Documentation enabled]) \
Packit Service 7866ab
    || AC_MSG_NOTICE([   Documentation disabled])