Add some m4 macros
[lxde/lxadmin.git] / configure.ac
CommitLineData
570d597a
JL
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4prog_name = lxadmin
5
6AC_PREREQ([2.63])
7AC_INIT([lxadmin], [0.1.0], [http://lxde.org/])
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
f64a3d56
JL
28# Python support
29AM_PATH_PYTHON([2.4])
30
570d597a
JL
31# PKG_CHECK_MODULES(XLIB, "x11")
32# AC_SUBST(XLIB_CFLAGS)
33# AC_SUBST(XLIB_LIBS)
34
46cfee9c
JL
35#Support for xml-purge.c
36pkg_modules="gtk+-2.0 >= 2.12.0"
37PKG_CHECK_MODULES(GTK, [$pkg_modules])
38AC_SUBST(GTK_CFLAGS)
39AC_SUBST(GTK_LIBS)
570d597a
JL
40
41# gio_modules="gthread-2.0 gio-unix-2.0 glib-2.0 >= 2.18.0"
42# PKG_CHECK_MODULES(GIO, [$gio_modules])
43# AC_SUBST(GIO_CFLAGS)
44# AC_SUBST(GIO_LIBS)
45
46# menu_modules="libmenu-cache >= 0.3.2"
47# PKG_CHECK_MODULES(MENU_CACHE, [$menu_modules])
48# AC_SUBST(MENU_CACHE_CFLAGS)
49# AC_SUBST(MENU_CACHE_LIBS)
50
51AC_ARG_ENABLE(debug,
52 [AC_HELP_STRING([--enable-debug],
53 [build libfm with debug support @<:@default=no@:>@])],
54 [enable_debug="${enableval}"],
55 [enable_debug=no]
56)
57if test "$enable_debug" = "yes"; then
58 # turn on debug and disable optimization
59 CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
60else
61 # turn off glib debug checks
62 CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
63fi
64
65# Generate po/LINGUAS on the fly rather than relying on translators
66# to maintain it manually. This also overcome the problem that Transifex
67# cannot add a language to po/LINGUAS if a new po file is submitted.
68rm -f $srcdir/po/LINGUAS
69for po_file in `ls $srcdir/po/*.po | sort`;
70do
71 lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
72 echo $lang >> $srcdir/po/LINGUAS
73done
74
75GETTEXT_PACKAGE=lxadmin
76AC_SUBST(GETTEXT_PACKAGE)
77AM_GLIB_GNU_GETTEXT
78AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
79
a082e85a
JL
80# Add system directory for defs.in
81
82AC_SUBST(VERSION)
83AC_SUBST(PACKAGE)
84
85AS_AC_EXPAND(PYTHONDIR, $pythondir)
86AS_AC_EXPAND(BINDIR, $bindir)
87AS_AC_EXPAND(LOCALEDIR, $datarootdir/locale)
88AS_AC_EXPAND(PKGDATADIR, $datarootdir/$PACKAGE)
89AS_AC_EXPAND(DATADIR, $datarootdir/$PACKAGE)
90AS_AC_EXPAND(DESKTOPFILEDIR, $datarootdir/applications)
91
570d597a
JL
92AC_CONFIG_FILES([
93 Makefile
570d597a
JL
94 data/Makefile
95 data/ui/Makefile
a0327145 96 data/media/Makefile
f64a3d56 97 data/ui/lxproxy/Makefile
570d597a 98 po/Makefile.in
f64a3d56 99 src/Makefile
a082e85a 100 src/common/defs.py
f64a3d56
JL
101 src/lxcc/Makefile
102 src/lxdmconf/Makefile
a48ca210
JL
103 src/lxfontconfig/Makefile
104 src/lxkeyboardconf/Makefile
f64a3d56 105 src/lxproxy/Makefile
a48ca210
JL
106 src/lxscreenshot/Makefile
107 src/lxservices/Makefile
f64a3d56 108 src/openbox-keyconf/Makefile
570d597a
JL
109])
110
111AC_OUTPUT
112
113if test x"$sysconfdir" != x'/etc'; then
114 echo
115 echo
116 echo 'Error: sysconfdir is not /etc.'
117 echo 'Please consider passing --sysconfdir=/etc to configure.';
118 echo 'Otherwise default config files will be installed to wrong place.'
119 echo
120 echo
121else
122 echo
123 echo lxadmin....................... : Version $VERSION
124 echo
125 echo Enable debug....................: "$enable_debug"
126 echo Prefix..........................: $prefix
127 echo
128 echo The binary will be installed in $prefix/bin
129 echo
130 echo http://lxde.org/
131 echo
132 echo "Ready to make lxadmin. Type 'make' to continue."
133 echo
134fi