1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411
|
# This the autoconf script for the gimp-help project.
# The GPL version 2 applies to it, which you may get from
# http://www.gnu.org/.
AC_PREREQ(2.54)
m4_define([help_major_version], [3])
m4_define([help_minor_version], [0])
m4_define([help_micro_version], [2])
m4_define([help_version], [help_major_version.help_minor_version.help_micro_version])
m4_define([python3_required_version], [3.6.0])
AC_INIT([GIMP-Help], [help_version])
# Apparently this macro must be called before "AM_INIT_AUTOMAKE"
AC_CANONICAL_BUILD
case $build_os in
*cygwin*|mingw*) IS_CYGWIN=yes;;
*) IS_CYGWIN=no;;
esac
# for use in Makefile.am
AM_CONDITIONAL(CYGWIN, test $IS_CYGWIN = yes)
# for use in Makefile
#AC_SUBST(IS_CYGWIN)
AC_CONFIG_SRCDIR([src/gimp.xml])
AC_CONFIG_MACRO_DIR([m4macros])
AC_CONFIG_COMMANDS(
[stylesheets],
[test "${srcdir:-.}" != "${builddir:-.}" &&
{ test -d stylesheets || mkdir stylesheets; } &&
cp -f $srcdir/stylesheets/*.xsl $srcdir/stylesheets/*.dtd $srcdir/stylesheets/languageVocab.xml $srcdir/stylesheets/entities.xml stylesheets/]
)
# XXX: use this if 'configure' (instead of 'config.status') should do it:
#AC_CONFIG_COMMANDS_POST([
# test "${srcdir:-.}" != "${builddir:-.}" &&
# { test -d stylesheets || mkdir stylesheets; } &&
# cp -f $srcdir/stylesheets/*.xsl $srcdir/stylesheets/*.dtd $srcdir/stylesheets/languageVocab.xml $srcdir/stylesheets/entities.xml stylesheets/
#])
AM_INIT_AUTOMAKE([1.16 tar-pax dist-bzip2 -Wall -Wno-portability])
AM_MAINTAINER_MODE
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_PROG_MAKE_SET
AC_PROG_SED
# You can set the LINGUAS or LANGUAGES environment variable to
# control what languages are built:
# LINGUAS will be re restricted to languages in ALL_LINGUAS
# LANGUAGES will override ALL_LINGUAS
#
if test "x$ALL_LINGUAS" = "x"; then
ALL_LINGUAS="bg ca cs da de el en en_GB eo es fa fi fr hr hu it ja ko lt nl nn pl pt pt_BR ro ru sk sl sv tr uk zh_CN"
else
ALL_LINGUAS=`echo "$ALL_LINGUAS" | $SED -e 's/[,] */ /g'`
fi
AC_SUBST(ALL_LINGUAS)
# It doesn't make sense to disable HTML build.
AC_ARG_ENABLE(build, AS_HELP_STRING([--disable-build], [obsolete]), , )
#AM_CONDITIONAL(GIMP_HELP_BUILD, true)
#AC_ARG_ENABLE(i18n,
# AS_HELP_STRING([--disable-i18n],
# [don't build translated HTML files (with xml2po & gettext)]),
# , enable_i18n=yes)
#AM_CONDITIONAL(GIMP_HELP_I18N, test "$enable_i18n" = "yes")
test "$ALL_LINGUAS" != "en" && enable_i18n=yes || enable_i18n=no
# Check for GNU make.
AC_MSG_CHECKING([whether ${MAKE-make} is GNU make])
if (${MAKE-make} --version) < /dev/null > /dev/null 2>&1; then
if (${MAKE-make} --version) 2> /dev/null | grep 'GNU Make' > /dev/null 2>&1; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_WARN([
** It seems that the make utility is not GNU Make. Since this project
** makes use of GNU Make extensions, you may run into build problems.
** Please use GNU Make if possible.
])
fi
else
AC_MSG_ERROR([${MAKE-make} not found])
fi
# Search for the XSLT processor
AC_PATH_PROG(XSLTPROC, xsltproc)
if test -z "$XSLTPROC"; then
AC_MSG_ERROR([
** Couldn't find xsltproc(1). You will need it to build the help files.
** See the file 'INSTALL' for more help.])
fi
# Search for xmllint
AC_PATH_PROG(XMLLINT, xmllint)
if test -z "$XMLLINT" && test "x$enable_build" = "xyes"; then
AC_MSG_WARN([cannot find xmllint(1), XML will not be validated])
fi
AM_CONDITIONAL(HAVE_XMLLINT, test -n "$XMLLINT")
XMLLINTFLAGS="--nonet"
AC_SUBST(XMLLINTFLAGS)
# Search for dblatex
AC_PATH_PROG(DBLATEX, dblatex)
if test -z "$DBLATEX"; then
AC_MSG_WARN([cannot find dblatex(1), PDF generation disabled])
fi
AM_CONDITIONAL(HAVE_DBLATEX, test -n "$DBLATEX")
DBLATEXFLAGS="--backend=xetex --style=db2latex --verbose"
AC_SUBST(DBLATEXFLAGS)
# Search for rsvg-convert used for building quickreference PDF's
AC_PATH_PROG(SVG2PDF, rsvg-convert)
if test -z "$SVG2PDF"; then
AC_MSG_NOTICE([cannot find rsvg-convert(1), Quickreference PDF generation disabled])
fi
AM_CONDITIONAL(HAVE_SVG2PDF, test -n "$SVG2PDF")
SVG2PDF_FLAGS="-a -f pdf"
AC_SUBST(SVG2PDF_FLAGS)
# Use our customized xml2po
AM_PATH_PYTHON3(python3_required_version, libxml2, ,)
XML2PO='$(PYTHON) $(top_srcdir)/tools/xml2po.py'
XML2POFLAGS='--mode=gimphelp --base=$(top_srcdir)/'
AC_SUBST(XML2PO)
AC_SUBST(XML2POFLAGS)
# Search for gettext tools
AC_PATH_PROG(MSGFMT, msgfmt)
if test -z "$MSGFMT" && test "x$enable_i18n" = "xyes"; then
# print warning only for the main i18n tools xml2po & msgfmt
AC_MSG_WARN([cannot find msgfmt])
missing_i18n_tools=${missing_i18n_tools:+"${missing_i18n_tools} "}msgfmt
fi
MSGFMTFLAGS="--check --use-fuzzy --statistics"
AC_SUBST(MSGFMTFLAGS)
AC_PATH_PROG(MSGINIT, msginit)
if test -z "$MSGINIT" && test "x$enable_i18n" = "xyes"; then
missing_i18n_tools=${missing_i18n_tools:+"${missing_i18n_tools} "}msginit
fi
MSGINITFLAGS='--no-translator --width=$(MSGWIDTH)'
AC_SUBST(MSGINITFLAGS)
AC_PATH_PROG(MSGMERGE, msgmerge)
if test -z "$MSGMERGE" && test "x$enable_i18n" = "xyes"; then
missing_i18n_tools=${missing_i18n_tools:+"${missing_i18n_tools} "}msgmerge
fi
MSGMERGEFLAGS='--quiet --width=$(MSGWIDTH)'
AC_SUBST(MSGMERGEFLAGS)
AC_PATH_PROG(MSGUNIQ, msguniq)
if test -z "$MSGUNIQ" && test "x$enable_i18n" = "xyes"; then
missing_i18n_tools=${missing_i18n_tools:+"${missing_i18n_tools} "}msguniq
fi
MSGUNIQFLAGS=
AC_SUBST(MSGUNIQFLAGS)
AC_PATH_PROG(MSGCAT, msgcat)
if test -z "$MSGCAT" && test "x$enable_i18n" = "xyes"; then
missing_i18n_tools=${missing_i18n_tools:+"${missing_i18n_tools} "}msgcat
fi
MSGCATFLAGS='--width=$(MSGWIDTH)'
AC_SUBST(MSGCATFLAGS)
MSGWIDTH=79
AC_SUBST(MSGWIDTH)
AC_MSG_CHECKING([if building the Windows installer])
AC_ARG_ENABLE(windows-installer,
[ --enable-windows-installer
generate files needed for the Windows installer
(default=no)],,
enable_windows_installer=no)
AC_MSG_RESULT([$enable_windows_installer])
AM_CONDITIONAL(BUILD_WINDOWS_INSTALLER, test "x$enable_windows_installer" != xno)
# Not calling:
# IT_PROG_INTLTOOL(intltool_required_version)
# on purpose because it tries to init po/ and we don't want this as we
# handle our main docs po files differently. So checking the tools we
# need individually for po-windows-installer/.
if test "x$enable_windows_installer" != xno; then
AC_PATH_PROG(INTLTOOL_MERGE, intltool-merge)
if test -z "$INTLTOOL_MERGE"; then
AC_MSG_ERROR([
** Couldn't find intltool-merge(8). It is necessary to build the
** language files for the Windows installer.
** Install the intltool or configure with --disable-windows-installer])
fi
fi
# The below tools are only necessary to build `make update-po` in
# po-windows-intaller/.
AC_PATH_PROG(INTLTOOL_UPDATE, intltool-update)
if test -z "$INTLTOOL_UPDATE" && test "x$enable_i18n" = "xyes"; then
AC_MSG_WARN([
** Couldn't find intltool-update(8). You will not be able to run
** `make update-po` in po-windows-intaller/.])
fi
AC_PATH_PROG(INTLTOOL_EXTRACT, intltool-extract)
if test -z "$INTLTOOL_EXTRACT" && test "x$enable_i18n" = "xyes"; then
AC_MSG_WARN([
** Couldn't find intltool-extract(8). You will not be able to run
** `make update-po` in po-windows-intaller/.])
fi
# Optional: dot to create build system map
AC_PATH_PROG(DOT, dot)
#if test -z "$DOT"; then
# AC_MSG_NOTICE([cannot find dot(1), creating build system PNG disabled])
#fi
AM_CONDITIONAL(HAVE_DOT, test -n "$DOT")
#test -z "$missing_i18n_tools" && HAVE_I18N_TOOLS=yes || HAVE_I18N_TOOLS=no
#AC_SUBST(HAVE_I18N_TOOLS)
AM_CONDITIONAL(HAVE_I18N_TOOLS, test -z "$missing_i18n_tools")
test -z "$missing_i18n_tools" || test "$missing_i18n_tools" = "xml2po" &&
HAVE_GETTEXT_TOOLS=yes || HAVE_GETTEXT_TOOLS=no
AM_CONDITIONAL(HAVE_GETTEXT_TOOLS, test "$HAVE_GETTEXT_TOOLS" = "yes")
#AC_SUBST(HAVE_GETTEXT_TOOLS)
# Optionally allow xsltproc to access DTDs over the network
AC_ARG_ENABLE(network,
AS_HELP_STRING([--enable-network],
[allow xsltproc to fetch DTDs/entities over the network]))
if test "x$enable_network" != "xyes"; then
XSLTFLAGS="$XSLTFLAGS --nonet"
fi
AC_SUBST(XSLTFLAGS)
# Optionally allow to build a language selector. A HTML menu is
# rendered based on ALL_LINGUAS below the header navigation in the HTML
# output.
AC_ARG_ENABLE(languageMenu,
AS_HELP_STRING([--enable-languageMenu],
[Compile the HTML output with a language selector.]))
if test "x$enable_languageMenu" = "xyes"; then
XSLTFLAGS="$XSLTFLAGS --stringparam gimp.help.languageselector 1"
fi
AC_SUBST(XSLTFLAGS)
# Optionally search for pngnq and pngcrush, which are helpful for
# creating distributions
AC_PATH_PROG(PNGNQ, pngnq)
if test -z "$PNGNQ"; then
AC_MSG_WARN([cannot find pngnq,
images will not be optimized during distribution creation])
fi
AC_PATH_PROG(PNGCRUSH, pngcrush)
if test -z "$PNGCRUSH"; then
AC_MSG_WARN([cannot find pngcrush,
images will not be optimized during distribution creation])
fi
AM_CONDITIONAL(HAVE_PNGOPTIMIZERS, test -n "$PNGNQ" && test -n "$PNGCRUSH")
# Default to the correct way of identifying stylesheets.
# People need an XML catalog to resolve this to a local file.
STYLEBASE='http://docbook.sourceforge.net/release/xsl/current'
# Allow to explicitly specify the stylesheet location
# in case the XML catalog doesn't exist or is broken.
AC_ARG_WITH(xsl,
AS_HELP_STRING([--with-xsl=<basedir>],
[path to the base of the DocBook Modular Stylesheets
(deprecated - fix your DocBook Stylesheets package!)
]))
if test "x$with_xsl" != "x"; then
STYLEBASE="$with_xsl"
AC_CHECK_FILE($STYLEBASE/xhtml/docbook.xsl, ,
AC_MSG_ERROR([** Couldn't find docbook.xsl in $STYLEBASE/xhtml]))
fi
AC_SUBST(STYLEBASE)
# We need the GIMP data directory to install the help files.
AC_ARG_WITH(gimp,
AS_HELP_STRING([--without-gimp],
[skip check for gimp3, install into PREFIX]))
if test "x$with_gimp" != "xno"; then
# Note: AC_MSG_ERROR() must be bracket-quoted, or else errors result
PKG_CHECK_MODULES(GIMP, gimp-3.0, , [AC_MSG_ERROR([
** Couldn't find a GIMP-3.0 installation. If you want to skip this check and
** install the help files to the configured prefix, use the --without-gimp
** configure option. Note that GIMP will then only find the help files if it
** is installed in the same prefix. See the file 'INSTALL' for more help.])])
gimpdatadir=`$PKG_CONFIG --variable=gimpdatadir gimp-3.0`
else
gimpdatadir=`pkg-config --variable=gimpdatadir gimp-3.0` ||
gimpdatadir='$(datadir)/gimp/3.0'
fi
AC_SUBST(gimpdatadir)
if test -n "$missing_i18n_tools" && test "$enable_i18n" = "yes"; then
AC_MSG_WARN([
** Couldn't find some tools needed to build translated help files.
** You will be able to build the English manual, but no translations.])
ALL_LINGUAS=en
fi
AC_CONFIG_FILES([
build/Makefile
build/windows/Makefile
build/windows/installer/Makefile
build/windows/installer/lang/Makefile
m4macros/Makefile
Makefile
po-windows-installer/Makefile.in
quickreference/Makefile
stylesheets/plainhtml.xsl
stylesheets/htmlalternate.xsl
])
# By default, autoconf will create only po/Makefile.
# This code is used to create the POTFILES and Makefile for all
# additional gettext catalogs.
m4_define([generate_po_makefile], [
AC_MSG_NOTICE([Generating POTFILES and Makefile for $1])
AC_CONFIG_COMMANDS([$1/stamp-it],
[[
if ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ; then
as_fn_error $? "$1/Makefile.in.in was not created by intltoolize." "$LINENO" 5
fi
rm -f "$1/stamp-it" "$1/POTFILES"
sed -e '/^#/d' -e 's/^[[].*] *//' \
-e '/^[ ]*$/d' \
-e "s|^| $ac_top_srcdir/|" \
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" && \
sed -e "/^# This comment gets stripped out/ {" \
-e 'r $1/POTFILES' \
-e "d" -e "}" \
"$1/Makefile.in" >"$1/Makefile" && \
touch "$1/stamp-it"
]])
])
generate_po_makefile([po-windows-installer])
AC_OUTPUT
AC_MSG_RESULT([
Languages: $ALL_LINGUAS
Installation prefix: $gimpdatadir ])
if test -n "$missing_i18n_tools" && test "$enable_i18n" = "yes"; then
AC_MSG_RESULT([ Missing translation tools: $missing_i18n_tools ])
fi
|