Merging upstream version 0.99.1 (Closes: #777637).
[debian/lxde-common.git] / configure.ac
1 AC_PREREQ([2.57])
2 AC_INIT(lxde-common,[0.99.1], [http://lxde.org])
3 AM_INIT_AUTOMAKE([-Wall -Werror foreign no-dist-gzip dist-xz])
4 dnl AC_PROG_INTLTOOL(, [no-xml])
5 dnl AM_MAINTAINER_MODE
6
7 # Checks for programs.
8 AC_PROG_INSTALL
9 AC_PROG_LN_S
10
11 AC_ARG_ENABLE(man,
12        [AC_HELP_STRING([--enable-man],
13                [regenerate roff man pages from Docbook @<:@default=no@:>@])],
14        [enable_man="${enableval}"],
15        [enable_man=no]
16 )
17 # xsessions data of path for GDM
18 AC_ARG_WITH([xsession-path],
19     AS_HELP_STRING(
20         [--with-xsession-path=PATH],
21         [set the install path of xsession data [[DATAROOTDIR/xsessions]]]),
22         [test x$withval != x && xsesspath="$withval"],
23         [xsesspath="\${datarootdir}/xsessions"])
24 AC_SUBST(xsesspath)
25
26
27 if test x"$enable_man" = x"yes"; then
28         AC_PATH_PROG([XSLTPROC], [xsltproc])
29         if test -z "$XSLTPROC"; then
30                 enable_man=no
31         fi
32
33         dnl check for DocBook DTD and stylesheets in the local catalog.
34         JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
35                 [DocBook XML DTD V4.1.2], [], enable_man=no)
36         JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
37                 [DocBook XSL Stylesheets >= 1.70.1], [], enable_man=no)
38 fi
39
40 AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test "x$enable_man" != "xno")
41
42 dnl Fix invalid sysconfdir when --prefix=/usr
43 if test `eval "echo $sysconfdir"` = /usr/etc
44 then
45     sysconfdir=/etc
46 fi
47
48 GETTEXT_PACKAGE=lxde-common
49 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of default gettext domain])
50 AC_SUBST(GETTEXT_PACKAGE)
51
52 # Generate po/LINGUAS on the fly rather than relying on translators
53 # to maintain it manually. This also overcome the problem that Transifex
54 # cannot add a language to po/LINGUAS if a new po file is submitted.
55 rm -f $srcdir/po/LINGUAS
56 for po_file in `ls $srcdir/po/*.po | sort`;
57 do
58     lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
59     echo $lang >> $srcdir/po/LINGUAS
60 done
61
62 AM_GLIB_GNU_GETTEXT
63
64 IT_PROG_INTLTOOL([0.40.0])
65
66 dnl dirty hack used to prevent the installation of useless mo files.
67 USE_NLS=no
68 AC_SUBST(USE_NLS)
69
70 AC_OUTPUT([
71   Makefile
72   startlxde
73   lxde-logout
74   LXDE.desktop.in
75   lxpanel/panel
76   openbox/rc.xml
77   openbox-lxde
78   pcmanfm/pcmanfm.conf
79   man/Makefile
80   po/Makefile.in
81 ])
82
83 if test x"$sysconfdir" != x'/etc'; then
84     echo
85     echo
86     echo 'Error: sysconfdir is not /etc.'
87     echo 'Please consider passing --sysconfdir=/etc to configure.';
88     echo 'Otherwise default config files will be installed to wrong place.'
89     echo
90     echo
91 fi