Rather than failing with an error when build is run with --enable-man=no, now printin...
[lxde/lxappearance.git] / configure.ac
CommitLineData
0cd84ed6
HJYP
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
3a7d812e 4prog_name = lxappearance
0cd84ed6
HJYP
5
6AC_PREREQ([2.63])
a871fc22 7AC_INIT([lxappearance], [0.5.0], [http://lxde.org/])
8f1bbe3f 8AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign])
8f1bbe3f
JL
9# Support silent build rules. Disable by either passing --disable-silent-rules
10# to configure or passing V=1 to make
11AM_SILENT_RULES([yes])
12
29e7d940
JL
13AM_MAINTAINER_MODE
14
15AC_CONFIG_HEADERS([config.h])
16
0cd84ed6
HJYP
17# Checks for programs.
18AC_PROG_CC
19# AM_PROG_LIBTOOL
20
21# Checks for libraries.
22
23# Checks for header files.
24AC_HEADER_STDC
25
26# Checks for typedefs, structures, and compiler characteristics.
27
28# Checks for library functions.
29
30# intltool
31IT_PROG_INTLTOOL([0.40.0])
32
62d4031f
JL
33AC_ARG_ENABLE(man,
34 [AC_HELP_STRING([--enable-man],
b16606c6 35 [regenerate roff man pages from Docbook @<:@default=yes@:>@])],
62d4031f 36 [enable_man="${enableval}"],
b16606c6 37 [enable_man=yes]
62d4031f
JL
38)
39
e2eadb8a
JL
40AC_ARG_ENABLE(more_warnings,
41 [AC_HELP_STRING([--enable-more-warnings],
42 [Add more warnings @<:@default=no@:>@])],
43 [enable_more_warnings="${enableval}"],
44 [enable_more_warnings=no]
45)
46
8108db6a
JL
47AC_ARG_ENABLE(gtk3,
48AC_HELP_STRING([--enable-gtk3],[enable to use gtk-3.0 instead of gtk-2.0]),
49[case "${enableval}" in
50 yes) enable_gtk3=yes ;;
51 no) enable_gtk3=no ;;
52 *) AC_MSG_ERROR([bad value "${enableval}" for --enable-gtk3, use "yes" (default) or "no".]) ;;
53esac],[])
54
9f90caed
HJYP
55PKG_CHECK_MODULES(XLIB, "x11")
56AC_SUBST(XLIB_CFLAGS)
57AC_SUBST(XLIB_LIBS)
0cd84ed6 58
8108db6a
JL
59if test "x$enable_gtk3" = "xyes" ; then
60 CFLAGS="$CFLAGS -DENABLE_GTK3"
61 gtk_modules="gtk+-3.0 >= 3.0.0"
62else
63 gtk_modules="gtk+-2.0 >= 2.12.0 gthread-2.0"
64fi
65
756f0a66 66PKG_CHECK_MODULES(GTK, [$gtk_modules])
0cd84ed6
HJYP
67AC_SUBST(GTK_CFLAGS)
68AC_SUBST(GTK_LIBS)
69
756f0a66
HJYP
70gmodule_modules="gmodule-export-2.0"
71PKG_CHECK_MODULES(GMODULE, [$gmodule_modules])
72AC_SUBST(GMODULE_CFLAGS)
73AC_SUBST(GMODULE_LIBS)
74
0cd84ed6
HJYP
75# gio_modules="gthread-2.0 gio-unix-2.0 glib-2.0 >= 2.18.0"
76# PKG_CHECK_MODULES(GIO, [$gio_modules])
77# AC_SUBST(GIO_CFLAGS)
78# AC_SUBST(GIO_LIBS)
79
80# menu_modules="libmenu-cache >= 0.3.2"
81# PKG_CHECK_MODULES(MENU_CACHE, [$menu_modules])
82# AC_SUBST(MENU_CACHE_CFLAGS)
83# AC_SUBST(MENU_CACHE_LIBS)
84
e2eadb8a 85if test x"$enable_more_warnings" = x"yes"; then
8f1bbe3f
JL
86 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"
87fi
88AC_SUBST(ADDITIONAL_FLAGS)
89
62d4031f
JL
90AC_ARG_ENABLE(man,
91 [AC_HELP_STRING([--enable-man],
92 [regenerate roff man pages from Docbook @<:@default=no@:>@])],
93 [enable_man="${enableval}"],
94 [enable_man=no]
0cd84ed6 95)
62d4031f 96
0cd84ed6
HJYP
97if test "$enable_debug" = "yes"; then
98 # turn on debug and disable optimization
99 CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
100else
101 # turn off glib debug checks
102 CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
103fi
104
105# Generate po/LINGUAS on the fly rather than relying on translators
106# to maintain it manually. This also overcome the problem that Transifex
107# cannot add a language to po/LINGUAS if a new po file is submitted.
108rm -f $srcdir/po/LINGUAS
109for po_file in `ls $srcdir/po/*.po | sort`;
110do
111 lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
112 echo $lang >> $srcdir/po/LINGUAS
113done
114
108e166e 115GETTEXT_PACKAGE=lxappearance
0cd84ed6
HJYP
116AC_SUBST(GETTEXT_PACKAGE)
117AM_GLIB_GNU_GETTEXT
118AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
119
62d4031f
JL
120if test x"$enable_man" = x"yes"; then
121 AC_PATH_PROG([XSLTPROC], [xsltproc])
122 if test -z "$XSLTPROC"; then
123 enable_man=no
124 fi
125
126 dnl check for DocBook DTD and stylesheets in the local catalog.
127 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
128 [DocBook XML DTD V4.1.2], [], enable_man=no)
129 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
130 [DocBook XSL Stylesheets >= 1.70.1], [], enable_man=no)
131fi
132
133AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test "x$enable_man" != "xno")
134
0cd84ed6
HJYP
135AC_CONFIG_FILES([
136 Makefile
137 src/Makefile
138 data/Makefile
139 data/ui/Makefile
39bff85f 140 data/ui/about.ui
756f0a66 141 data/lxappearance.pc
62d4031f 142 man/Makefile
0cd84ed6
HJYP
143 po/Makefile.in
144])
145
146AC_OUTPUT
147
148if test x"$sysconfdir" != x'/etc'; then
149 echo
150 echo
151 echo 'Error: sysconfdir is not /etc.'
152 echo 'Please consider passing --sysconfdir=/etc to configure.';
153 echo 'Otherwise default config files will be installed to wrong place.'
154 echo
155 echo
156else
157 echo
3a7d812e 158 echo lxappearance....................... : Version $VERSION
0cd84ed6
HJYP
159 echo
160 echo Enable debug....................: "$enable_debug"
161 echo Prefix..........................: $prefix
162 echo
163 echo The binary will be installed in $prefix/bin
164 echo
165 echo http://lxde.org/
166 echo
3a7d812e 167 echo "Ready to make lxappearance. Type 'make' to continue."
0cd84ed6
HJYP
168 echo
169fi