Write gtkrc file in gtk3 directory
[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],
35 [regenerate roff man pages from Docbook @<:@default=no@:>@])],
36 [enable_man="${enableval}"],
37 [enable_man=no]
38)
39
9f90caed
HJYP
40PKG_CHECK_MODULES(XLIB, "x11")
41AC_SUBST(XLIB_CFLAGS)
42AC_SUBST(XLIB_LIBS)
0cd84ed6 43
ff19d42c 44gtk_modules="gtk+-2.0 >= 2.12.0 gthread-2.0"
756f0a66 45PKG_CHECK_MODULES(GTK, [$gtk_modules])
0cd84ed6
HJYP
46AC_SUBST(GTK_CFLAGS)
47AC_SUBST(GTK_LIBS)
48
756f0a66
HJYP
49gmodule_modules="gmodule-export-2.0"
50PKG_CHECK_MODULES(GMODULE, [$gmodule_modules])
51AC_SUBST(GMODULE_CFLAGS)
52AC_SUBST(GMODULE_LIBS)
53
0cd84ed6
HJYP
54# gio_modules="gthread-2.0 gio-unix-2.0 glib-2.0 >= 2.18.0"
55# PKG_CHECK_MODULES(GIO, [$gio_modules])
56# AC_SUBST(GIO_CFLAGS)
57# AC_SUBST(GIO_LIBS)
58
59# menu_modules="libmenu-cache >= 0.3.2"
60# PKG_CHECK_MODULES(MENU_CACHE, [$menu_modules])
61# AC_SUBST(MENU_CACHE_CFLAGS)
62# AC_SUBST(MENU_CACHE_LIBS)
63
8f1bbe3f
JL
64# Pass --enable-maintainer-mode to enable more CFLAGS
65if test "$USE_MAINTAINER_MODE" = "yes"; then
66 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"
67fi
68AC_SUBST(ADDITIONAL_FLAGS)
69
62d4031f
JL
70AC_ARG_ENABLE(man,
71 [AC_HELP_STRING([--enable-man],
72 [regenerate roff man pages from Docbook @<:@default=no@:>@])],
73 [enable_man="${enableval}"],
74 [enable_man=no]
0cd84ed6 75)
62d4031f 76
0cd84ed6
HJYP
77if test "$enable_debug" = "yes"; then
78 # turn on debug and disable optimization
79 CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
80else
81 # turn off glib debug checks
82 CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
83fi
84
85# Generate po/LINGUAS on the fly rather than relying on translators
86# to maintain it manually. This also overcome the problem that Transifex
87# cannot add a language to po/LINGUAS if a new po file is submitted.
88rm -f $srcdir/po/LINGUAS
89for po_file in `ls $srcdir/po/*.po | sort`;
90do
91 lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
92 echo $lang >> $srcdir/po/LINGUAS
93done
94
108e166e 95GETTEXT_PACKAGE=lxappearance
0cd84ed6
HJYP
96AC_SUBST(GETTEXT_PACKAGE)
97AM_GLIB_GNU_GETTEXT
98AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
99
62d4031f
JL
100if test x"$enable_man" = x"yes"; then
101 AC_PATH_PROG([XSLTPROC], [xsltproc])
102 if test -z "$XSLTPROC"; then
103 enable_man=no
104 fi
105
106 dnl check for DocBook DTD and stylesheets in the local catalog.
107 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
108 [DocBook XML DTD V4.1.2], [], enable_man=no)
109 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
110 [DocBook XSL Stylesheets >= 1.70.1], [], enable_man=no)
111fi
112
113AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test "x$enable_man" != "xno")
114
0cd84ed6
HJYP
115AC_CONFIG_FILES([
116 Makefile
117 src/Makefile
118 data/Makefile
119 data/ui/Makefile
39bff85f 120 data/ui/about.ui
756f0a66 121 data/lxappearance.pc
62d4031f 122 man/Makefile
0cd84ed6
HJYP
123 po/Makefile.in
124])
125
126AC_OUTPUT
127
128if test x"$sysconfdir" != x'/etc'; then
129 echo
130 echo
131 echo 'Error: sysconfdir is not /etc.'
132 echo 'Please consider passing --sysconfdir=/etc to configure.';
133 echo 'Otherwise default config files will be installed to wrong place.'
134 echo
135 echo
136else
137 echo
3a7d812e 138 echo lxappearance....................... : Version $VERSION
0cd84ed6
HJYP
139 echo
140 echo Enable debug....................: "$enable_debug"
141 echo Prefix..........................: $prefix
142 echo
143 echo The binary will be installed in $prefix/bin
144 echo
145 echo http://lxde.org/
146 echo
3a7d812e 147 echo "Ready to make lxappearance. Type 'make' to continue."
0cd84ed6
HJYP
148 echo
149fi