Made it buildable with Gtk+-3.0.
[lxde/pcmanfm.git] / configure.ac
CommitLineData
b6e3c554
HJYP
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ([2.63])
a9dc034b 5AC_INIT([pcmanfm], [1.0.1], [http://pcmanfm.sf.net/])
b6e3c554
HJYP
6AM_INIT_AUTOMAKE([-Wall -Werror foreign])
7
8AC_CONFIG_HEADERS([config.h])
9
10# Checks for programs.
11AC_ISC_POSIX
12AC_PROG_CC
b6e3c554 13AM_PROG_CC_STDC
8893ba14 14AM_PROG_CC_C_O
b6e3c554
HJYP
15
16# Checks for header files.
17AC_HEADER_STDC
18
19# Checks for typedefs, structures, and compiler characteristics.
20
21# Checks for library functions.
6aec080a 22AC_SEARCH_LIBS([floor], [m])
b6e3c554
HJYP
23
24# Large file support
25AC_ARG_ENABLE([largefile],
26 AS_HELP_STRING([--enable-largefile],
27 [enable Large file support (default: yes)]),
28 largefile=$enableval, largefile="yes")
29
30if test x"$largefile" = x"yes"; then
31 CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64"
32 AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
33 AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
34fi
35
36AC_ARG_ENABLE(
37 [cast-checks],
38 AS_HELP_STRING([--enable-cast-checks],
39 [enable Glib casting checks (default: disable)]),
40 cast_checks=$enableval, cast_checks="no")
41G_CAST_CHECKS=""
42if test x"$cast_checks" = "xno"; then
43 G_CAST_CHECKS="-DG_DISABLE_CAST_CHECKS"
44fi
45AC_SUBST(G_CAST_CHECKS)
46
05ece184 47AC_ARG_ENABLE(debug,
fc789786
HJYP
48 [AC_HELP_STRING([--enable-debug],
49 [build pcmanfm with debug support @<:@default=no@:>@])],
50 [enable_debug="${enableval}"],
51 [enable_debug=no]
05ece184
HJYP
52)
53if test "$enable_debug" = "yes"; then
54 # turn on debug and disable optimization
55 CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
fbb7b12d
AG
56 case "$CC" in
57 gcc*)
5a89e062 58 CPPFLAGS="$CPPFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers"
fbb7b12d
AG
59 ;;
60 *)
61 ;;
62 esac
05ece184
HJYP
63else
64 # turn off glib debug checks
65 # G_DISABLE_CAST_CHECKS is already handled by $(G_CAST_CHECKS)
66 CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
67fi
68
b6e3c554
HJYP
69# intltool
70IT_PROG_INTLTOOL([0.40.0])
71
72# Checks for libraries.
6b110820 73
74PKG_CHECK_MODULES(XLIB, "x11")
75AC_SUBST(XLIB_CFLAGS)
76AC_SUBST(XLIB_LIBS)
77
549b9985
AG
78dnl gtk_modules="gtk+-2.0 >= 2.16.0"
79dnl PKG_CHECK_MODULES(GTK, [$gtk_modules])
80dnl AC_SUBST(GTK_CFLAGS)
81dnl AC_SUBST(GTK_LIBS)
b6e3c554 82
549b9985
AG
83dnl pango_modules="pango >= 1.20.0"
84dnl PKG_CHECK_MODULES(PANGO, [$pango_modules])
85dnl AC_SUBST(PANGO_CFLAGS)
86dnl AC_SUBST(PANGO_LIBS)
25a6a7b1 87
549b9985
AG
88dnl glib_modules="glib-2.0 >= 2.16.0"
89dnl PKG_CHECK_MODULES(GLIB, [$glib_modules])
90dnl AC_SUBST(GLIB_CFLAGS)
91dnl AC_SUBST(GLIB_LIBS)
25a6a7b1
HJYP
92
93gio_modules="gthread-2.0 gio-unix-2.0 >= 2.18.0"
b6e3c554
HJYP
94PKG_CHECK_MODULES(GIO, [$gio_modules])
95AC_SUBST(GIO_CFLAGS)
96AC_SUBST(GIO_LIBS)
97
549b9985
AG
98dnl gmodule_modules="gmodule-2.0"
99dnl PKG_CHECK_MODULES(GMODULE, [$gmodule_modules])
100dnl AC_SUBST(GMODULE_CFLAGS)
101dnl AC_SUBST(GMODULE_LIBS)
b6e3c554 102
549b9985 103fm_modules="glib-2.0 gtk+-2.0 gio-unix-2.0 pango >= 1.20.0 libfm >= 1.0 libfm-gtk >= 1.0"
b6e3c554
HJYP
104PKG_CHECK_MODULES(FM, [$fm_modules])
105AC_SUBST(FM_CFLAGS)
106AC_SUBST(FM_LIBS)
107
6f316e39
AG
108dnl This is temp. workaround until 1.0.2 where libfm 1.0.1 will be required
109AC_MSG_CHECKING([for fm_default_dnd_dest_targets])
110save_CPPFLAGS="$CPPFLAGS"
111CPPFLAGS="$CPPFLAGS $FM_CFLAGS"
112AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
113#include <libfm/fm-gtk.h>
114void* x = fm_default_dnd_dest_targets;
115 ])], [AC_DEFINE(HAVE_LIBFM_DEFAULT_DND_DEST_TARGETS, 1,
116 [Define if Libfm have fm_default_dnd_dest_targets in headers])
117 AC_MSG_RESULT(yes)],
118 [AC_MSG_RESULT(no)])
119CPPFLAGS="$save_CPPFLAGS"
120
9b7ac5a0 121menu_modules="libmenu-cache >= 0.3.2"
b6e3c554
HJYP
122PKG_CHECK_MODULES(MENU_CACHE, [$menu_modules])
123AC_SUBST(MENU_CACHE_CFLAGS)
124AC_SUBST(MENU_CACHE_LIBS)
125
ab86a7a2 126GETTEXT_PACKAGE=pcmanfm
b6e3c554 127AC_SUBST(GETTEXT_PACKAGE)
121e58ff
HJYP
128
129# Generate po/LINGUAS on the fly rather than relying on translators
130# to maintain it manually. This also overcome the problem that Transifex
131# cannot add a language to po/LINGUAS if a new po file is submitted.
132rm -f $srcdir/po/LINGUAS
133for po_file in `ls $srcdir/po/*.po | sort`;
134do
135 lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
136 echo $lang >> $srcdir/po/LINGUAS
137done
138
08e70fea 139AM_GLIB_GNU_GETTEXT
b6e3c554
HJYP
140AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
141
6a9e415d
AG
142dnl Fix invalid sysconfdir when --prefix=/usr
143if test `eval "echo $sysconfdir"` = /usr/etc
144then
145 sysconfdir=/etc
146fi
147
b6e3c554
HJYP
148AC_CONFIG_FILES([
149 Makefile
150 src/Makefile
151 po/Makefile.in
f2a36fcd 152 data/Makefile
77cb39fa 153 data/pcmanfm.1
f2a36fcd
HJYP
154 data/ui/Makefile
155 data/ui/about.glade
b6e3c554
HJYP
156])
157
158AC_OUTPUT
159
160echo Ready to make pcmanfm