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