Move lxtask.desktop.in into data/ subdirectory.
[lxde/lxtask.git] / configure.ac
1 AC_PREREQ([2.57])
2 AC_INIT(lxtask,[0.1.4], [],lxtask)
3 AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz])
4 AC_PROG_INTLTOOL(, [no-xml])
5 AM_MAINTAINER_MODE
6
7 AM_CONFIG_HEADER(config.h)
8
9 AC_PROG_CC
10 AC_PROG_INSTALL
11 AM_PROG_CC_C_O
12
13 dnl Check for UNIX variants
14 AC_AIX()
15 AC_ISC_POSIX()
16 #AC_MINIX()
17
18 AC_HEADER_STDC()
19 AC_CHECK_HEADERS([dirent.h pwd.h sys/types.h sys/stat.h sys/param.h \
20                   stdio.h stdlib.h string.h unistd.h stdlib.h signal.h])
21
22 AC_ARG_ENABLE(gtk3,
23 [  --enable-gtk3        enable to use gtk-3.0 instead of gtk-2.0 ],
24 [case "${enableval}" in
25   yes)  enable_gtk3=yes ;;
26   *)   enable_gtk3=no ;;
27 esac],[])
28
29 echo "x$enable_gtk3"
30 if test "x$enable_gtk3" = "xyes" ; then
31   pkg_modules="gtk+-3.0 >= 3.0.0"
32 else
33   pkg_modules="gtk+-2.0 >= 2.6.0"
34 fi
35
36 PKG_CHECK_MODULES(GTK, [$pkg_modules])
37 AC_SUBST(GTK_CFLAGS)
38 AC_SUBST(GTK_LIBS)
39
40 GETTEXT_PACKAGE=lxtask
41 #AM_GNU_GETTEXT([external])
42 AM_GNU_GETTEXT_VERSION(0.14.1)
43 AC_SUBST(GETTEXT_PACKAGE)
44 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
45
46 # Generate po/LINGUAS on the fly rather than relying on translators
47 # to maintain it manually. This also overcome the problem that Transifex
48 # cannot add a language to po/LINGUAS if a new po file is submitted.
49 rm -f $srcdir/po/LINGUAS
50 for po_file in `ls $srcdir/po/*.po | sort`;
51 do
52     lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
53     echo $lang >> $srcdir/po/LINGUAS
54 done
55
56 AM_GLIB_GNU_GETTEXT
57
58 AC_ARG_ENABLE(debug,
59     [AC_HELP_STRING([--enable-debug],
60         [build lxtask with debug support @<:@default=no@:>@])],
61     [enable_debug="${enableval}"],
62     [enable_debug=no]
63 )
64
65 if test "$enable_debug" = "yes"; then
66     # turn on debug and disable optimization
67     CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
68     case "$CC" in
69     gcc*)
70         CPPFLAGS="$CPPFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers"
71         ;;
72     *)
73         ;;
74     esac
75     dnl Be more strict on portability
76     CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=700"
77 else
78     # turn off glib debug checks
79     CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
80 fi
81
82 AC_OUTPUT([
83   Makefile
84   src/Makefile
85   po/Makefile.in
86 ])
87
88 echo
89 echo LXTask....................................... : Version $VERSION
90 echo
91 echo Prefix....................................... : $prefix
92 echo
93 echo The binary will be installed in $prefix/bin
94 echo
95 echo http://lxde.org/
96 echo
97 echo Have fun!
98 echo