Release 0.2.5.
[lxde/gpicview.git] / configure.ac
CommitLineData
1d48a247
HJYP
1dnl Process this file with autoconf to produce a configure script.
2
ef972954 3AC_INIT([gpicview],[0.2.5],[],[gpicview])
5e5b7aec 4# Autotols programs
d46b957d 5AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign no-dist-gzip dist-xz])
1d48a247
HJYP
6AM_MAINTAINER_MODE
7
5e5b7aec
JL
8AC_LANG([C])
9LT_INIT
1d48a247 10
5e5b7aec 11AC_SEARCH_LIBS([strerror],[cposix])
1d48a247
HJYP
12AC_PROG_CC
13AM_PROG_CC_STDC
7e1dcec1 14AM_PROG_CC_C_O
1d48a247
HJYP
15AC_HEADER_STDC
16
f453c5fd
JL
17# Support silent build rules. Disable by either passing --disable-silent-rules
18# to configure or passing V=1 to make
19AM_SILENT_RULES([yes])
20
5e5b7aec
JL
21AC_CONFIG_HEADERS([config.h])
22AC_CONFIG_MACRO_DIR([m4])
23
58045517 24AC_ARG_ENABLE(more_warnings,
5e5b7aec 25 [AS_HELP_STRING([--enable-more-warnings],[Add more warnings @<:@default=no@:>@])],
58045517
JL
26 [enable_more_warnings="${enableval}"],
27 [enable_more_warnings=no]
28)
29
30if test x"$enable_more_warnings" = x"yes"; then
adf169fa
JL
31 ADDITIONAL_FLAGS="-Wall -Werror=all -Werror=format -Werror=implicit-function-declaration -Werror=implicit-int -Werror=missing-braces -Werror=parentheses -Werror=return-type -Werror=strict-aliasing -Werror=switch -Wuninitialized -Werror=unused-label -Werror=unused-value -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Werror=missing-declarations -Wredundant-decls -Wmissing-noreturn -Wpointer-arith -Wcast-align -Wwrite-strings -Werror=inline -Werror=format-nonliteral -Wformat-nonliteral -Werror=format-security -Wformat-security -Winit-self -Werror=missing-include-dirs -Werror=undef -Werror=aggregate-return -Wmissing-format-attribute -Werror=nested-externs -fno-strict-aliasing -fmessage-length=0 -Wp,-D_FORTIFY_SOURCE=2 -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES"
32fi
33AC_SUBST(ADDITIONAL_FLAGS)
34
35
f54c74cf
HJYP
36AM_GLIB_GNU_GETTEXT
37IT_PROG_INTLTOOL([0.40.0])
38
58045517 39AC_ARG_ENABLE(gtk3,
5e5b7aec 40AS_HELP_STRING([--enable-gtk3],[enable to use gtk-3.0 instead of gtk-2.0]),
58045517
JL
41[case "${enableval}" in
42 yes) enable_gtk3=yes ;;
43 no) enable_gtk3=no ;;
44 *) AC_MSG_ERROR([bad value "${enableval}" for --enable-gtk3, use "yes" (default) or "no".]) ;;
45esac],[])
46
47if test "x$enable_gtk3" = "xyes" ; then
48 CFLAGS="$CFLAGS -DENABLE_GTK3"
49 gtk_modules="gtk+-3.0 >= 3.0.0"
50else
51 gtk_modules="gtk+-2.0 >= 2.12.0"
52fi
53PKG_CHECK_MODULES(GTK, [$gtk_modules])
54AC_SUBST(GTK_CFLAGS)
55AC_SUBST(GTK_LIBS)
56
57pkg_modules="x11"
1d48a247 58
05d97d07 59PKG_CHECK_MODULES(X11, [$pkg_modules])
7c3b160c
HJYP
60AC_CHECK_LIB(jpeg, jpeg_start_decompress, [],
61 [AC_MSG_ERROR([libjpeg not found])], -lm)
62AC_CHECK_HEADER(jpeglib.h, , [AC_MSG_ERROR([libjpeg not found])])
63LIBJPEG='-ljpeg'
64
54ac7ec7
AF
65AC_SUBST(X11_CFLAGS)
66AC_SUBST(X11_LIBS)
1d48a247 67
1377aaf4
AG
68# Generate po/LINGUAS on the fly rather than relying on translators
69# to maintain it manually. This also overcome the problem that Transifex
70# cannot add a language to po/LINGUAS if a new po file is submitted.
71rm -f $srcdir/po/LINGUAS
72for po_file in `ls $srcdir/po/*.po | sort`;
73do
74 lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
75 echo $lang >> $srcdir/po/LINGUAS
76done
77
1d48a247
HJYP
78GETTEXT_PACKAGE=gpicview
79AC_SUBST(GETTEXT_PACKAGE)
80AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
81
5e5b7aec 82AC_CONFIG_FILES([
1d48a247
HJYP
83Makefile
84src/Makefile
85data/Makefile
86po/Makefile.in
1d48a247 87])
5e5b7aec 88AC_OUTPUT
1d48a247
HJYP
89
90echo
91echo GPicView....................... : Version $VERSION
92echo
93echo Prefix..........................: $prefix
94echo
95echo The binary will be installed in $prefix/bin
96echo
c9c60499 97echo http://lxde.org/
1d48a247 98echo