Release v0.3.1.
[lxde/lxinput.git] / configure.in
CommitLineData
14f5ccb1
HJYP
1dnl Process this file with autoconf to produce a configure script.
2
3AC_INIT(configure.in)
9c51691f 4AM_INIT_AUTOMAKE(lxinput, 0.3.1)
14f5ccb1 5AM_CONFIG_HEADER(config.h)
22e5efb3
JL
6# Support silent build rules. Disable by either passing --disable-silent-rules
7# to configure or passing V=1 to make
8AM_SILENT_RULES([yes])
9
14f5ccb1
HJYP
10AM_MAINTAINER_MODE
11
12AC_ISC_POSIX
13AC_PROG_CC
14AM_PROG_CC_STDC
15AC_HEADER_STDC
16
17AM_GLIB_GNU_GETTEXT
18IT_PROG_INTLTOOL([0.40.0])
19
ffd0d770
JL
20AC_ARG_ENABLE(man,
21 [AC_HELP_STRING([--enable-man],
22 [regenerate roff man pages from Docbook @<:@default=no@:>@])],
23 [enable_man="${enableval}"],
24 [enable_man=no]
25)
26
27AC_ARG_ENABLE(more_warnings,
28 [AC_HELP_STRING([--enable-more-warnings],
29 [Add more warnings @<:@default=no@:>@])],
30 [enable_more_warnings="${enableval}"],
31 [enable_more_warnings=no]
32)
33
13d94b15
JL
34AC_ARG_ENABLE(gtk3,
35AC_HELP_STRING([--enable-gtk3],[enable to use gtk-3.0 instead of gtk-2.0]),
36[case "${enableval}" in
37 yes) enable_gtk3=yes ;;
38 no) enable_gtk3=no ;;
39 *) AC_MSG_ERROR([bad value "${enableval}" for --enable-gtk3, use "yes" (default) or "no".]) ;;
40esac],[])
41
42# Checks for libraries.
43if test "x$enable_gtk3" = "xyes" ; then
44 CFLAGS="$CFLAGS -DENABLE_GTK3"
45 gtk_modules="gtk+-3.0 >= 3.0.0"
46else
47 gtk_modules="gtk+-2.0 >= 2.12.0"
48fi
49PKG_CHECK_MODULES(GTK, [$gtk_modules])
14f5ccb1
HJYP
50AC_SUBST(GTK_CFLAGS)
51AC_SUBST(GTK_LIBS)
52
ff18e6bb
HJYP
53PKG_CHECK_MODULES(XLIB, "x11")
54AC_SUBST(XLIB_CFLAGS)
55AC_SUBST(XLIB_LIBS)
56
ffd0d770 57if test x"$enable_more_warnings" = x"yes"; then
3a0fc902
JL
58 ADDITIONAL_FLAGS="-Wall -Werror=all -Werror=format -Werror=implicit-function-declaration -Werror=implicit-int -Werror=missing-braces -Werror=parentheses -Werror=return-type -Werror=strict-aliasing -Werror=switch -Wuninitialized -Werror=unused-label -Werror=unused-value -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Werror=missing-declarations -Wredundant-decls -Wmissing-noreturn -Wpointer-arith -Wcast-align -Wwrite-strings -Werror=inline -Werror=format-nonliteral -Wformat-nonliteral -Werror=format-security -Wformat-security -Winit-self -Werror=missing-include-dirs -Werror=undef -Werror=aggregate-return -Wmissing-format-attribute -Werror=nested-externs -fno-strict-aliasing -fmessage-length=0 -Wp,-D_FORTIFY_SOURCE=2 -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES"
59fi
60AC_SUBST(ADDITIONAL_FLAGS)
61
46c1dfce
HJYP
62# Generate po/LINGUAS on the fly rather than relying on translators
63# to maintain it manually. This also overcome the problem that Transifex
64# cannot add a language to po/LINGUAS if a new po file is submitted.
65rm -f $srcdir/po/LINGUAS
66for po_file in `ls $srcdir/po/*.po | sort`;
67do
68 lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
69 echo $lang >> $srcdir/po/LINGUAS
70done
71
14f5ccb1
HJYP
72GETTEXT_PACKAGE=lxinput
73AC_SUBST(GETTEXT_PACKAGE)
46c1dfce 74AM_GLIB_GNU_GETTEXT
14f5ccb1
HJYP
75AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
76
1e9362df 77if test x"$enable_man" = x"yes"; then
ff18e6bb
HJYP
78 AC_PATH_PROG([XSLTPROC], [xsltproc])
79 if test -z "$XSLTPROC"; then
80 enable_man=no
81 fi
82
83 dnl check for DocBook DTD and stylesheets in the local catalog.
84 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
85 [DocBook XML DTD V4.1.2], [], enable_man=no)
86 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
87 [DocBook XSL Stylesheets >= 1.70.1], [], enable_man=no)
1e9362df
JH
88fi
89
90AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test "x$enable_man" != "xno")
91
14f5ccb1
HJYP
92AC_OUTPUT([
93Makefile
94src/Makefile
95po/Makefile.in
a93acddb 96man/Makefile
14f5ccb1 97])