1 dnl Process this file with autoconf to produce a configure script.
5 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
7 dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
8 AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS")
10 AM_CONFIG_HEADER(config.h)
28 GETTEXT_PACKAGE=AC_PACKAGE_NAME
29 AC_SUBST(GETTEXT_PACKAGE)
30 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
32 PKG_CHECK_MODULES(LIBEVPRIVATE, gtk+-2.0 >= 2.4.0)
33 PKG_CHECK_MODULES(RECENT_FILES, gtk+-2.0 >= 2.4.0 libgnomeui-2.0 >= 2.4.0 libbonobo-2.0)
34 PKG_CHECK_MODULES(SHELL, gtk+-2.0 >= 2.5.0 libgnomeui-2.0 gnome-vfs-2.0 libbonoboui-2.0 libgnomeprint-2.2 libgnomeprintui-2.2 libglade-2.0)
35 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6.0)
37 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
38 AC_SUBST(GLIB_GENMARSHAL)
40 dnl Compile with disable-deprecated switches
42 AC_ARG_ENABLE(deprecated,
43 AC_HELP_STRING([--disable-deprecated],
44 [Don't allow any deprecated GTK+/etc. features.]),
45 set_enable_deprecated="$enableval",[
46 if test -f $srcdir/autogen.sh; then
48 set_enable_deprecated=no
50 set_enable_deprecated=yes
53 AC_MSG_CHECKING([whether to disable deprecated glib/gtk+/etc. features])
54 if test "$set_enable_deprecated" != "yes"; then
56 EVINCE_DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED"
59 EVINCE_DISABLE_DEPRECATED=""
61 AC_SUBST(EVINCE_DISABLE_DEPRECATED)
63 dnl ================== Xpdf aconf.h.in checks ==================================
65 AH_TEMPLATE([HAVE_LIBSM], [Define to 1 if you have session management.])
66 AH_TEMPLATE([ENABLE_NLS], [Use Native Language Support.])
67 AH_TEMPLATE([HAVE_CATGETS], [Use catgets functions.])
68 AH_TEMPLATE([HAVE_GETTEXT], [Use gettext functions.])
70 dnl Optional features.
71 AH_TEMPLATE([A4_PAPER],
72 [Use A4 paper size instead of Letter for PostScript output.])
73 AC_ARG_ENABLE(a4-paper,
74 AC_HELP_STRING([--enable-a4-paper],
75 [use A4 paper size instead of Letter for
79 dnl never define NO_TEXT_SELECT, just remember this Xpdf setting.
80 AH_TEMPLATE([NO_TEXT_SELECT], [Do not allow text selection.])
82 AH_TEMPLATE([OPI_SUPPORT],
83 [Include support for OPI comments.])
85 AC_HELP_STRING([--enable-opi],
86 [include support for OPI comments]),
87 AC_DEFINE(OPI_SUPPORT))
89 dnl enable these unconditionally.
90 AC_DEFINE([MULTITHREADED], [1], [Enable multithreading support.])
91 AC_DEFINE([TEXTOUT_WORD_LIST], [1], [Enable word list support.])
93 AH_TEMPLATE([APPDEFDIR],
94 [Directory with the Xpdf app-defaults file.])
95 AC_ARG_WITH(appdef-dir,
96 AC_HELP_STRING([--with-appdef-dir],
97 [set app-defaults directory]),
98 AC_DEFINE_UNQUOTED(APPDEFDIR, "$with_appdef_dir"))
101 dnl This ugly kludge to get the sysconfdir path is needed because
102 dnl autoconf doesn't actually set the prefix variable until later.
103 if test "$sysconfdir" = '${prefix}/etc'; then
104 if test "x$prefix" = xNONE; then
105 system_xpdfrc="$ac_default_prefix/etc/xpdfrc"
107 system_xpdfrc="$prefix/etc/xpdfrc"
110 system_xpdfrc="$sysconfdir/xpdfrc"
112 AC_DEFINE_UNQUOTED(SYSTEM_XPDFRC, "$system_xpdfrc",
113 [Full path for the system-wide xpdfrc file.])
115 dnl Checks for header files.
118 dnl Switch over to C++. This will make the checks below a little
119 dnl bit stricter (requiring function prototypes in include files).
120 dnl (99% of xpdf is written in C++.)
123 dnl Look for header that defines select() and fd_set.
124 AC_MSG_CHECKING([select() and fd_set in sys/select.h and sys/bsdtypes.h])
125 AC_TRY_COMPILE([#include <stdlib.h>
128 #include <sys/types.h>],
130 select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no)
131 if test $xpdf_ok = yes; then
132 AC_MSG_RESULT([not needed])
134 AC_TRY_COMPILE([#include <stdlib.h>
137 #include <sys/types.h>
138 #include <sys/select.h>],
140 select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no)
141 if test $xpdf_ok = yes; then
142 AC_DEFINE(HAVE_SYS_SELECT_H, 1, [Have sys/select.h.])
143 AC_MSG_RESULT([need sys/select.h])
145 AC_TRY_COMPILE([#include <stdlib.h>
148 #include <sys/types.h>
149 #include <sys/bsdtypes.h>],
151 select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no)
152 if test $xpdf_ok = yes; then
153 AC_DEFINE(HAVE_SYS_BSDTYPES_H, 1, [Have sys/bsdtypes.h.])
154 AC_MSG_RESULT([need sys/bsdtypes.h])
156 AC_MSG_RESULT([problem])
161 dnl Look for header that defines FD_ZERO.
162 AC_MSG_CHECKING([FD_ZERO and strings.h or bstring.h])
163 AC_TRY_COMPILE([#include <stdlib.h>
164 #include <sys/types.h>
165 #ifdef HAVE_SYS_SELECT_H
166 #include <sys/select.h>
168 [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
169 if test $xpdf_ok = yes; then
170 AC_MSG_RESULT([not needed])
172 AC_TRY_COMPILE([#include <stdlib.h>
173 #include <sys/types.h>
175 #ifdef HAVE_SYS_SELECT_H
176 #include <sys/select.h>
178 [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
179 if test $xpdf_ok = yes; then
180 AC_DEFINE(HAVE_STRINGS_H, 1, [Have strings.h.])
181 AC_MSG_RESULT([need strings.h])
183 AC_TRY_COMPILE([#include <stdlib.h>
184 #include <sys/types.h>
186 #ifdef HAVE_SYS_SELECT_H
187 #include <sys/select.h>
189 [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
190 if test $xpdf_ok = yes; then
191 AC_DEFINE(HAVE_BSTRING_H, 1, [Have bstring.h.])
192 AC_MSG_RESULT([need bstring.h])
194 AC_MSG_RESULT([problem])
199 dnl Look for rewinddir.
200 AC_CHECK_FUNCS(rewinddir)
201 if test $ac_cv_func_rewinddir = no; then
202 AC_CHECK_LIB(cposix, rewinddir)
205 dnl Checks for library functions.
206 AC_CHECK_FUNCS(popen)
207 dnl # This should use 'AC_CHECK_FUNCS(mkstemp)' but that fails if
208 dnl # the mkstemp exists in the library but isn't declared in the
209 dnl # include file (e.g., in cygwin 1.1.2).
210 AC_CACHE_CHECK([for mkstemp],
211 xpdf_cv_func_mkstemp,
212 [AC_TRY_LINK([#include <stdlib.h>
213 #include <unistd.h>],
215 xpdf_cv_func_mkstemp=yes, xpdf_cv_func_mkstemp=no)])
216 if test "$xpdf_cv_func_mkstemp" = yes; then
217 AC_DEFINE(HAVE_MKSTEMP, 1, [Have mkstemp().])
219 dnl Check for mkstemps, just like mkstemp.
220 AC_CACHE_CHECK([for mkstemps],
221 xpdf_cv_func_mkstemps,
222 [AC_TRY_LINK([#include <stdlib.h>
223 #include <unistd.h>],
224 [mkstemps("foo", 0);],
225 xpdf_cv_func_mkstemps=yes, xpdf_cv_func_mkstemps=no)])
226 if test "$xpdf_cv_func_mkstemps" = yes; then
227 AC_DEFINE(HAVE_MKSTEMPS, 1, [Have mkstemps().])
230 dnl Check select argument type: on HP-UX before version 10, select
231 dnl takes (int *) instead of (fd_set *).
232 AC_CACHE_CHECK([whether select takes fd_set arguments],
233 xpdf_cv_func_select_arg,
234 [AC_TRY_COMPILE([#include <sys/types.h>
235 #include <sys/time.h>
237 #ifdef HAVE_SYS_SELECT_H
238 #include <sys/select.h>
241 select(1, &fds, &fds, &fds, 0);],
242 xpdf_cv_func_select_arg=yes, xpdf_cv_func_select_arg=no)])
243 if test "$xpdf_cv_func_select_arg" != yes; then
244 AC_DEFINE(SELECT_TAKES_INT, 1, [select() takes int, not fd_set arguments.])
247 dnl Back to C for the library tests.
250 dnl Check for fseeko/ftello or fseek64/ftell64
251 dnl The LARGEFILE and FSEEKO macros have to be called in C, not C++, mode.
254 AC_CHECK_FUNCS(fseek64, xpdf_cv_func_fseek64=yes, xpdf_cv_func_fseek64=no)
255 AC_CHECK_FUNCS(ftell64, xpdf_cv_func_ftell64=yes, xpdf_cv_func_ftell64=no)
256 if test "$xpdf_cv_func_fseek64" = yes -a "$xpdf_cv_func_ftell64" = yes; then
257 AC_DEFINE(HAVE_FSEEK64, 1, [Have fseek64().])
260 dnl Check for freetype headers
263 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
264 if test "x$FREETYPE_CONFIG" != "xno" ; then
265 FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
266 FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
267 AC_DEFINE(HAVE_FREETYPE_H, 1, [Have FreeType2 include files])
270 AC_SUBST(FREETYPE_CFLAGS)
271 AC_SUBST(FREETYPE_LIBS)
273 dnl ================== End of xpdf checks ===========================================
275 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
276 dnl stolen from nautilus and gnome-common
278 AC_ARG_ENABLE(more-warnings,
279 [ --enable-more-warnings Maximum compiler warnings],
280 set_more_warnings="$enableval",[
281 if test -f $srcdir/autogen.sh; then
283 set_more_warnings=yes
288 AC_MSG_CHECKING(for more warnings, including -Werror)
289 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
290 AC_MSG_RESULT([yes, using gcc])
293 -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
294 -Wnested-externs -Wpointer-arith \
295 -Wcast-align -Wsign-compare \
299 dnl case " $CFLAGS " in
300 dnl *[\ \ ]-ansi[\ \ ]*) ;;
301 dnl *) CFLAGS="$CFLAGS -ansi" ;;
303 dnl case " $CFLAGS " in
304 dnl *[\ \ ]-pedantic[\ \ ]*) ;;
305 dnl *) CFLAGS="$CFLAGS -pedantic" ;;
308 for option in -Wno-strict-aliasing -Wno-sign-compare; do
309 SAVE_CFLAGS="$CFLAGS"
310 CFLAGS="$CFLAGS $option"
311 AC_MSG_CHECKING([whether gcc understands $option])
312 AC_TRY_COMPILE([], [],
315 if test $has_option = no; then
316 CFLAGS="$SAVE_CFLAGS"
318 AC_MSG_RESULT($has_option)
327 dnl ==========================================================================
332 cut-n-paste/recent-files/Makefile