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