Fix #2979578 unable to open second pcmanfm instance in specific case.
[lxde/pcmanfm.git] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ([2.63])
5 AC_INIT([pcmanfm], [0.9.3], [http://pcmanfm.sf.net/])
6 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
7
8 AC_CONFIG_HEADERS([config.h])
9
10 # Checks for programs.
11 AC_ISC_POSIX
12 AC_PROG_CC
13 AM_PROG_LIBTOOL
14 AM_PROG_CC_STDC
15 AC_HEADER_STDC
16
17 # Checks for header files.
18 AC_HEADER_STDC
19
20 # Checks for typedefs, structures, and compiler characteristics.
21
22 # Checks for library functions.
23
24 # Large file support
25 AC_ARG_ENABLE([largefile],
26     AS_HELP_STRING([--enable-largefile],
27         [enable Large file support (default: yes)]),
28     largefile=$enableval, largefile="yes")
29
30 if 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])
34 fi
35
36 AC_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")
41 G_CAST_CHECKS=""
42 if test x"$cast_checks" = "xno"; then
43     G_CAST_CHECKS="-DG_DISABLE_CAST_CHECKS"
44 fi
45 AC_SUBST(G_CAST_CHECKS)
46
47 AC_ARG_ENABLE(debug,
48         [AC_HELP_STRING([--enable-debug],
49                 [build pcmanfm with debug support @<:@default=no@:>@])],
50         [enable_debug="${enableval}"],
51         [enable_debug=no]
52 )
53 if test "$enable_debug" = "yes"; then
54     # turn on debug and disable optimization
55     CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
56 else
57     # turn off glib debug checks
58     # G_DISABLE_CAST_CHECKS is already handled by $(G_CAST_CHECKS)
59     CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
60 fi
61
62 # intltool
63 IT_PROG_INTLTOOL([0.40.0])
64
65 # Checks for libraries.
66
67 PKG_CHECK_MODULES(XLIB, "x11")
68 AC_SUBST(XLIB_CFLAGS)
69 AC_SUBST(XLIB_LIBS)
70
71 gtk_modules="gtk+-2.0 >= 2.16.0"
72 PKG_CHECK_MODULES(GTK, [$gtk_modules])
73 AC_SUBST(GTK_CFLAGS)
74 AC_SUBST(GTK_LIBS)
75
76 gio_modules="gthread-2.0 gio-unix-2.0"
77 PKG_CHECK_MODULES(GIO, [$gio_modules])
78 AC_SUBST(GIO_CFLAGS)
79 AC_SUBST(GIO_LIBS)
80
81 gmodule_modules="gmodule-2.0"
82 PKG_CHECK_MODULES(GMODULE, [$gmodule_modules])
83 AC_SUBST(GMODULE_CFLAGS)
84 AC_SUBST(GMODULE_LIBS)
85
86 fm_modules="libfm-gtk"
87 PKG_CHECK_MODULES(FM, [$fm_modules])
88 AC_SUBST(FM_CFLAGS)
89 AC_SUBST(FM_LIBS)
90
91 menu_modules="libmenu-cache >= 0.3.2"
92 PKG_CHECK_MODULES(MENU_CACHE, [$menu_modules])
93 AC_SUBST(MENU_CACHE_CFLAGS)
94 AC_SUBST(MENU_CACHE_LIBS)
95
96 GETTEXT_PACKAGE=pcmanfm2
97 AC_SUBST(GETTEXT_PACKAGE)
98
99 # Generate po/LINGUAS on the fly rather than relying on translators
100 # to maintain it manually. This also overcome the problem that Transifex
101 # cannot add a language to po/LINGUAS if a new po file is submitted.
102 rm -f $srcdir/po/LINGUAS
103 for po_file in `ls $srcdir/po/*.po | sort`;
104 do
105     lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
106     echo $lang >> $srcdir/po/LINGUAS
107 done
108
109 AM_GLIB_GNU_GETTEXT
110 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
111
112 AC_CONFIG_FILES([
113     Makefile
114     src/Makefile
115     po/Makefile.in
116     data/Makefile
117     data/ui/Makefile
118     data/ui/about.glade
119     data/pcmanfm2.desktop
120 ])
121
122 AC_OUTPUT
123
124 echo Ready to make pcmanfm