[SF#822] Use gtk_rc_get_default_files() for gtkrc file, so GTK2_RC_FILES is checked.
[lxde/lxappearance.git] / configure.ac
CommitLineData
0cd84ed6
HJYP
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
af8a1e47 3AC_PREREQ([2.64])
f699b1c6 4AC_INIT([lxappearance],[0.6.2],[http://lxde.org/])
53c66dba 5AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign subdir-objects no-dist-gzip dist-xz])
0cd84ed6 6
6a425f6b
JL
7# intltool
8IT_PROG_INTLTOOL([0.40.0])
9
8f1bbe3f
JL
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
29e7d940 14AC_CONFIG_HEADERS([config.h])
de6e5809 15AC_CONFIG_MACRO_DIR([.])
29e7d940 16
6a425f6b 17# C compiler
0cd84ed6 18AC_PROG_CC
6a425f6b
JL
19AC_PROG_INSTALL
20AM_PROG_CC_C_O
21AC_PROG_CC_STDC
0cd84ed6
HJYP
22
23# Checks for libraries.
24
25# Checks for header files.
0cd84ed6
HJYP
26
27# Checks for typedefs, structures, and compiler characteristics.
28
29# Checks for library functions.
30
0cd84ed6 31
62d4031f 32AC_ARG_ENABLE(man,
44b9b0f2 33AS_HELP_STRING([--enable-man],[regenerate roff man pages from Docbook @<:@default=yes@:>@]),
c7b7bbfe
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],[])
62d4031f 39
e2eadb8a 40AC_ARG_ENABLE(more_warnings,
44b9b0f2 41 [AS_HELP_STRING([--enable-more-warnings],
e2eadb8a
JL
42 [Add more warnings @<:@default=no@:>@])],
43 [enable_more_warnings="${enableval}"],
44 [enable_more_warnings=no]
45)
46
8108db6a 47AC_ARG_ENABLE(gtk3,
44b9b0f2 48AS_HELP_STRING([--enable-gtk3],[enable to use gtk-3.0 instead of gtk-2.0]),
8108db6a
JL
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"
46af9e71 61 gtk_modules="gtk+-3.0 >= 3.0.0 gthread-2.0"
8108db6a
JL
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
c847cfdc
JL
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
a9567f8c
JL
82AC_SUBST(DBUS_CFLAGS)
83AC_SUBST(DBUS_LIBS)
84
c847cfdc
JL
85
86
756f0a66
HJYP
87gmodule_modules="gmodule-export-2.0"
88PKG_CHECK_MODULES(GMODULE, [$gmodule_modules])
89AC_SUBST(GMODULE_CFLAGS)
90AC_SUBST(GMODULE_LIBS)
bf3144ba 91AC_SUBST(gtk_modules)
756f0a66 92
0cd84ed6
HJYP
93# gio_modules="gthread-2.0 gio-unix-2.0 glib-2.0 >= 2.18.0"
94# PKG_CHECK_MODULES(GIO, [$gio_modules])
95# AC_SUBST(GIO_CFLAGS)
96# AC_SUBST(GIO_LIBS)
97
98# menu_modules="libmenu-cache >= 0.3.2"
99# PKG_CHECK_MODULES(MENU_CACHE, [$menu_modules])
100# AC_SUBST(MENU_CACHE_CFLAGS)
101# AC_SUBST(MENU_CACHE_LIBS)
102
e2eadb8a 103if test x"$enable_more_warnings" = x"yes"; then
8f1bbe3f
JL
104 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"
105fi
106AC_SUBST(ADDITIONAL_FLAGS)
107
eda34173
AG
108AC_ARG_ENABLE(debug,
109 [AC_HELP_STRING([--enable-debug],
110 [build lxappearance with debug support @<:@default=no@:>@])],
111 [enable_debug="${enableval}"],
112 [enable_debug=no]
0cd84ed6 113)
62d4031f 114
0cd84ed6
HJYP
115if test "$enable_debug" = "yes"; then
116 # turn on debug and disable optimization
117 CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
eda34173
AG
118 case "$CC" in
119 gcc*)
120 CPPFLAGS="$CPPFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers"
121 ;;
122 *)
123 ;;
124 esac
125 dnl Be more strict on portability
126 CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=700"
0cd84ed6
HJYP
127else
128 # turn off glib debug checks
129 CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
130fi
131
132# Generate po/LINGUAS on the fly rather than relying on translators
133# to maintain it manually. This also overcome the problem that Transifex
134# cannot add a language to po/LINGUAS if a new po file is submitted.
135rm -f $srcdir/po/LINGUAS
136for po_file in `ls $srcdir/po/*.po | sort`;
137do
138 lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
139 echo $lang >> $srcdir/po/LINGUAS
140done
141
108e166e 142GETTEXT_PACKAGE=lxappearance
0cd84ed6
HJYP
143AC_SUBST(GETTEXT_PACKAGE)
144AM_GLIB_GNU_GETTEXT
145AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
146
62d4031f
JL
147if test x"$enable_man" = x"yes"; then
148 AC_PATH_PROG([XSLTPROC], [xsltproc])
149 if test -z "$XSLTPROC"; then
150 enable_man=no
151 fi
152
153 dnl check for DocBook DTD and stylesheets in the local catalog.
154 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
155 [DocBook XML DTD V4.1.2], [], enable_man=no)
156 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
157 [DocBook XSL Stylesheets >= 1.70.1], [], enable_man=no)
158fi
159
bb69b4af 160AM_CONDITIONAL(ENABLE_MAN, test "x$enable_man" != "xno")
62d4031f 161
0cd84ed6
HJYP
162AC_CONFIG_FILES([
163 Makefile
0cd84ed6
HJYP
164 data/Makefile
165 data/ui/Makefile
7f0236eb 166 data/ui/about.glade
756f0a66 167 data/lxappearance.pc
62d4031f 168 man/Makefile
0cd84ed6 169 po/Makefile.in
6a425f6b 170 src/Makefile
0cd84ed6
HJYP
171])
172
173AC_OUTPUT
174
6a425f6b
JL
175echo
176echo lxappearance....................... : Version $VERSION
177echo
178echo Enable debug....................: "$enable_debug"
179echo Enable Dbus support.............: "$enable_dbus"
180echo Prefix..........................: $prefix
181echo
182echo The binary will be installed in $prefix/bin
183echo
184echo http://lxde.org/
185echo
186echo "Ready to make lxappearance. Type 'make' to continue."
187echo
188