Bump Standards-Version to 3.9.6.
[debian/lxappearance.git] / configure.ac
CommitLineData
1469f737
DB
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
ae1f8f29 3AC_PREREQ([2.64])
35ab3ff2 4AC_INIT([lxappearance],[0.6.0],[http://lxde.org/])
f38be2ba 5AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign subdir-objects no-dist-gzip dist-xz])
1469f737 6
ae1f8f29
AG
7# intltool
8IT_PROG_INTLTOOL([0.40.0])
9
e7f9874d
DB
10# Support silent build rules. Disable by either passing --disable-silent-rules
11# to configure or passing V=1 to make
12AM_SILENT_RULES([yes])
13
1469f737 14AC_CONFIG_HEADERS([config.h])
d93d56d2 15AC_CONFIG_MACRO_DIR([.])
1469f737 16
ae1f8f29 17# C compiler
1469f737 18AC_PROG_CC
ae1f8f29
AG
19AC_PROG_INSTALL
20AM_PROG_CC_C_O
21AC_PROG_CC_STDC
1469f737
DB
22
23# Checks for libraries.
24
25# Checks for header files.
1469f737
DB
26
27# Checks for typedefs, structures, and compiler characteristics.
28
29# Checks for library functions.
30
1469f737 31
e7f9874d 32AC_ARG_ENABLE(man,
7f605299 33AS_HELP_STRING([--enable-man],[regenerate roff man pages from Docbook @<:@default=yes@:>@]),
e7f9874d
DB
34[case "${enableval}" in
35 yes) enable_man=yes ;;
36 no) enable_man=no ;;
37 *) AC_MSG_ERROR([bad value "${enableval}" for --enable-man, use "yes" (default) or "no".]) ;;
38esac],[])
39
40AC_ARG_ENABLE(more_warnings,
7f605299 41 [AS_HELP_STRING([--enable-more-warnings],
e7f9874d
DB
42 [Add more warnings @<:@default=no@:>@])],
43 [enable_more_warnings="${enableval}"],
44 [enable_more_warnings=no]
45)
46
47AC_ARG_ENABLE(gtk3,
7f605299 48AS_HELP_STRING([--enable-gtk3],[enable to use gtk-3.0 instead of gtk-2.0]),
e7f9874d
DB
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
1469f737
DB
55PKG_CHECK_MODULES(XLIB, "x11")
56AC_SUBST(XLIB_CFLAGS)
57AC_SUBST(XLIB_LIBS)
58
e7f9874d
DB
59if test "x$enable_gtk3" = "xyes" ; then
60 CFLAGS="$CFLAGS -DENABLE_GTK3"
d93d56d2 61 gtk_modules="gtk+-3.0 >= 3.0.0 gthread-2.0"
e7f9874d
DB
62else
63 gtk_modules="gtk+-2.0 >= 2.12.0 gthread-2.0"
64fi
65
1469f737
DB
66PKG_CHECK_MODULES(GTK, [$gtk_modules])
67AC_SUBST(GTK_CFLAGS)
68AC_SUBST(GTK_LIBS)
69
7f605299
DB
70AC_ARG_ENABLE(dbus,
71 [AS_HELP_STRING([--enable-dbus],
72 [Use Dbus support (usefull for lxsession > 0.4.9) @<:@default=no@:>@])],
73 [enable_dbus="${enableval}"],
74 [enable_dbus=no]
75)
76
77
78if test x"$enable_dbus" = x"yes"; then
79 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.95 dbus-glib-1 >= 0.70])
80 CFLAGS="$CFLAGS -DENABLE_DBUS"
81fi
82AC_SUBST(DBUS_CFLAGS)
83AC_SUBST(DBUS_LIBS)
84
85
86
1469f737
DB
87gmodule_modules="gmodule-export-2.0"
88PKG_CHECK_MODULES(GMODULE, [$gmodule_modules])
89AC_SUBST(GMODULE_CFLAGS)
90AC_SUBST(GMODULE_LIBS)
91
92# gio_modules="gthread-2.0 gio-unix-2.0 glib-2.0 >= 2.18.0"
93# PKG_CHECK_MODULES(GIO, [$gio_modules])
94# AC_SUBST(GIO_CFLAGS)
95# AC_SUBST(GIO_LIBS)
96
97# menu_modules="libmenu-cache >= 0.3.2"
98# PKG_CHECK_MODULES(MENU_CACHE, [$menu_modules])
99# AC_SUBST(MENU_CACHE_CFLAGS)
100# AC_SUBST(MENU_CACHE_LIBS)
101
e7f9874d
DB
102if test x"$enable_more_warnings" = x"yes"; then
103 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"
104fi
105AC_SUBST(ADDITIONAL_FLAGS)
106
d93d56d2
AG
107AC_ARG_ENABLE(debug,
108 [AC_HELP_STRING([--enable-debug],
109 [build lxappearance with debug support @<:@default=no@:>@])],
110 [enable_debug="${enableval}"],
111 [enable_debug=no]
1469f737 112)
e7f9874d 113
1469f737
DB
114if test "$enable_debug" = "yes"; then
115 # turn on debug and disable optimization
116 CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
d93d56d2
AG
117 case "$CC" in
118 gcc*)
119 CPPFLAGS="$CPPFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers"
120 ;;
121 *)
122 ;;
123 esac
124 dnl Be more strict on portability
125 CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=700"
1469f737
DB
126else
127 # turn off glib debug checks
128 CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
129fi
130
131# Generate po/LINGUAS on the fly rather than relying on translators
132# to maintain it manually. This also overcome the problem that Transifex
133# cannot add a language to po/LINGUAS if a new po file is submitted.
134rm -f $srcdir/po/LINGUAS
135for po_file in `ls $srcdir/po/*.po | sort`;
136do
137 lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
138 echo $lang >> $srcdir/po/LINGUAS
139done
140
141GETTEXT_PACKAGE=lxappearance
142AC_SUBST(GETTEXT_PACKAGE)
143AM_GLIB_GNU_GETTEXT
144AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
145
e7f9874d
DB
146if test x"$enable_man" = x"yes"; then
147 AC_PATH_PROG([XSLTPROC], [xsltproc])
148 if test -z "$XSLTPROC"; then
149 enable_man=no
150 fi
151
152 dnl check for DocBook DTD and stylesheets in the local catalog.
153 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
154 [DocBook XML DTD V4.1.2], [], enable_man=no)
155 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
156 [DocBook XSL Stylesheets >= 1.70.1], [], enable_man=no)
157fi
158
159AM_CONDITIONAL(ENABLE_MAN, test "x$enable_man" != "xno")
160
1469f737
DB
161AC_CONFIG_FILES([
162 Makefile
1469f737
DB
163 data/Makefile
164 data/ui/Makefile
d93d56d2 165 data/ui/about.glade
1469f737 166 data/lxappearance.pc
e7f9874d 167 man/Makefile
1469f737 168 po/Makefile.in
ae1f8f29 169 src/Makefile
1469f737
DB
170])
171
172AC_OUTPUT
173
ae1f8f29
AG
174echo
175echo lxappearance....................... : Version $VERSION
176echo
177echo Enable debug....................: "$enable_debug"
178echo Enable Dbus support.............: "$enable_dbus"
179echo Prefix..........................: $prefix
180echo
181echo The binary will be installed in $prefix/bin
182echo
183echo http://lxde.org/
184echo
185echo "Ready to make lxappearance. Type 'make' to continue."
186echo
187