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