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)
24 ALL_LINGUAS="ca cs da de en_CA ja no nb nl pt_BR sv zh_CN"
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)
34 PKG_CHECK_MODULES(SHELL, gtk+-2.0 >= 2.6.0 libgnomeui-2.0 gnome-vfs-2.0 libgnomeprint-2.2 libgnomeprintui-2.2 libglade-2.0 gconf-2.0)
35 PKG_CHECK_MODULES(DVI, gtk+-2.0 >= 2.6.0)
36 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6.0)
37 PKG_CHECK_MODULES(PS, gtk+-2.0 >= 2.6.0 gnome-vfs-2.0 libgnomeui-2.0)
39 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
40 AC_SUBST(GLIB_GENMARSHAL)
42 dnl Compile with disable-deprecated switches
44 AC_ARG_ENABLE(deprecated,
45 AC_HELP_STRING([--disable-deprecated],
46 [Don't allow any deprecated GTK+/etc. features.]),
47 set_enable_deprecated="$enableval",[
48 if test -f $srcdir/autogen.sh; then
50 set_enable_deprecated=no
52 set_enable_deprecated=yes
55 AC_MSG_CHECKING([whether to disable deprecated glib/gtk+/etc. features])
56 if test "$set_enable_deprecated" != "yes"; then
58 EVINCE_DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED"
61 EVINCE_DISABLE_DEPRECATED=""
63 AC_SUBST(EVINCE_DISABLE_DEPRECATED)
67 AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
68 if test "x$GCONFTOOL" = "xno"; then
69 AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
72 dnl ================== Xpdf aconf.h.in checks ==================================
74 AH_TEMPLATE([HAVE_LIBSM], [Define to 1 if you have session management.])
75 AH_TEMPLATE([ENABLE_NLS], [Use Native Language Support.])
76 AH_TEMPLATE([HAVE_CATGETS], [Use catgets functions.])
77 AH_TEMPLATE([HAVE_GETTEXT], [Use gettext functions.])
79 dnl Optional features.
80 AH_TEMPLATE([A4_PAPER],
81 [Use A4 paper size instead of Letter for PostScript output.])
82 AC_ARG_ENABLE(a4-paper,
83 AC_HELP_STRING([--enable-a4-paper],
84 [use A4 paper size instead of Letter for
88 dnl never define NO_TEXT_SELECT, just remember this Xpdf setting.
89 AH_TEMPLATE([NO_TEXT_SELECT], [Do not allow text selection.])
91 AH_TEMPLATE([OPI_SUPPORT],
92 [Include support for OPI comments.])
94 AC_HELP_STRING([--enable-opi],
95 [include support for OPI comments]),
96 AC_DEFINE(OPI_SUPPORT))
98 dnl enable these unconditionally.
99 AC_DEFINE([MULTITHREADED], [1], [Enable multithreading support.])
100 AC_DEFINE([TEXTOUT_WORD_LIST], [1], [Enable word list support.])
102 AH_TEMPLATE([APPDEFDIR],
103 [Directory with the Xpdf app-defaults file.])
104 AC_ARG_WITH(appdef-dir,
105 AC_HELP_STRING([--with-appdef-dir],
106 [set app-defaults directory]),
107 AC_DEFINE_UNQUOTED(APPDEFDIR, "$with_appdef_dir"))
110 dnl This ugly kludge to get the sysconfdir path is needed because
111 dnl autoconf doesn't actually set the prefix variable until later.
112 if test "$sysconfdir" = '${prefix}/etc'; then
113 if test "x$prefix" = xNONE; then
114 system_xpdfrc="$ac_default_prefix/etc/xpdfrc"
116 system_xpdfrc="$prefix/etc/xpdfrc"
119 system_xpdfrc="$sysconfdir/xpdfrc"
121 AC_DEFINE_UNQUOTED(SYSTEM_XPDFRC, "$system_xpdfrc",
122 [Full path for the system-wide xpdfrc file.])
124 dnl Checks for header files.
127 dnl Switch over to C++. This will make the checks below a little
128 dnl bit stricter (requiring function prototypes in include files).
129 dnl (99% of xpdf is written in C++.)
132 dnl Look for header that defines select() and fd_set.
133 AC_MSG_CHECKING([select() and fd_set in sys/select.h and sys/bsdtypes.h])
134 AC_TRY_COMPILE([#include <stdlib.h>
137 #include <sys/types.h>],
139 select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no)
140 if test $xpdf_ok = yes; then
141 AC_MSG_RESULT([not needed])
143 AC_TRY_COMPILE([#include <stdlib.h>
146 #include <sys/types.h>
147 #include <sys/select.h>],
149 select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no)
150 if test $xpdf_ok = yes; then
151 AC_DEFINE(HAVE_SYS_SELECT_H, 1, [Have sys/select.h.])
152 AC_MSG_RESULT([need sys/select.h])
154 AC_TRY_COMPILE([#include <stdlib.h>
157 #include <sys/types.h>
158 #include <sys/bsdtypes.h>],
160 select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no)
161 if test $xpdf_ok = yes; then
162 AC_DEFINE(HAVE_SYS_BSDTYPES_H, 1, [Have sys/bsdtypes.h.])
163 AC_MSG_RESULT([need sys/bsdtypes.h])
165 AC_MSG_RESULT([problem])
170 dnl Look for header that defines FD_ZERO.
171 AC_MSG_CHECKING([FD_ZERO and strings.h or bstring.h])
172 AC_TRY_COMPILE([#include <stdlib.h>
173 #include <sys/types.h>
174 #ifdef HAVE_SYS_SELECT_H
175 #include <sys/select.h>
177 [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
178 if test $xpdf_ok = yes; then
179 AC_MSG_RESULT([not needed])
181 AC_TRY_COMPILE([#include <stdlib.h>
182 #include <sys/types.h>
184 #ifdef HAVE_SYS_SELECT_H
185 #include <sys/select.h>
187 [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
188 if test $xpdf_ok = yes; then
189 AC_DEFINE(HAVE_STRINGS_H, 1, [Have strings.h.])
190 AC_MSG_RESULT([need strings.h])
192 AC_TRY_COMPILE([#include <stdlib.h>
193 #include <sys/types.h>
195 #ifdef HAVE_SYS_SELECT_H
196 #include <sys/select.h>
198 [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
199 if test $xpdf_ok = yes; then
200 AC_DEFINE(HAVE_BSTRING_H, 1, [Have bstring.h.])
201 AC_MSG_RESULT([need bstring.h])
203 AC_MSG_RESULT([problem])
208 dnl Look for rewinddir.
209 AC_CHECK_FUNCS(rewinddir)
210 if test $ac_cv_func_rewinddir = no; then
211 AC_CHECK_LIB(cposix, rewinddir)
214 dnl Checks for library functions.
215 AC_CHECK_FUNCS(popen)
216 dnl # This should use 'AC_CHECK_FUNCS(mkstemp)' but that fails if
217 dnl # the mkstemp exists in the library but isn't declared in the
218 dnl # include file (e.g., in cygwin 1.1.2).
219 AC_CACHE_CHECK([for mkstemp],
220 xpdf_cv_func_mkstemp,
221 [AC_TRY_LINK([#include <stdlib.h>
222 #include <unistd.h>],
224 xpdf_cv_func_mkstemp=yes, xpdf_cv_func_mkstemp=no)])
225 if test "$xpdf_cv_func_mkstemp" = yes; then
226 AC_DEFINE(HAVE_MKSTEMP, 1, [Have mkstemp().])
228 dnl Check for mkstemps, just like mkstemp.
229 AC_CACHE_CHECK([for mkstemps],
230 xpdf_cv_func_mkstemps,
231 [AC_TRY_LINK([#include <stdlib.h>
232 #include <unistd.h>],
233 [mkstemps("foo", 0);],
234 xpdf_cv_func_mkstemps=yes, xpdf_cv_func_mkstemps=no)])
235 if test "$xpdf_cv_func_mkstemps" = yes; then
236 AC_DEFINE(HAVE_MKSTEMPS, 1, [Have mkstemps().])
239 dnl Check select argument type: on HP-UX before version 10, select
240 dnl takes (int *) instead of (fd_set *).
241 AC_CACHE_CHECK([whether select takes fd_set arguments],
242 xpdf_cv_func_select_arg,
243 [AC_TRY_COMPILE([#include <sys/types.h>
244 #include <sys/time.h>
246 #ifdef HAVE_SYS_SELECT_H
247 #include <sys/select.h>
250 select(1, &fds, &fds, &fds, 0);],
251 xpdf_cv_func_select_arg=yes, xpdf_cv_func_select_arg=no)])
252 if test "$xpdf_cv_func_select_arg" != yes; then
253 AC_DEFINE(SELECT_TAKES_INT, 1, [select() takes int, not fd_set arguments.])
256 dnl Back to C for the library tests.
259 dnl Check for fseeko/ftello or fseek64/ftell64
260 dnl The LARGEFILE and FSEEKO macros have to be called in C, not C++, mode.
263 AC_CHECK_FUNCS(fseek64, xpdf_cv_func_fseek64=yes, xpdf_cv_func_fseek64=no)
264 AC_CHECK_FUNCS(ftell64, xpdf_cv_func_ftell64=yes, xpdf_cv_func_ftell64=no)
265 if test "$xpdf_cv_func_fseek64" = yes -a "$xpdf_cv_func_ftell64" = yes; then
266 AC_DEFINE(HAVE_FSEEK64, 1, [Have fseek64().])
269 dnl Check for freetype headers
272 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
273 if test "x$FREETYPE_CONFIG" != "xno" ; then
274 FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
275 FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
276 AC_DEFINE(HAVE_FREETYPE_H, 1, [Have FreeType2 include files])
278 vers=`$FREETYPE_CONFIG --version 2>/dev/null | sed -e 's/libfreetype //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
279 if test -n "$vers" && test "$vers" -le 9005003; then
280 AC_DEFINE_UNQUOTED(HAVE_FREETYPE_217_OR_OLDER, 1, [Defines if your system has the freetype library 2.1.7 or older])
282 AC_DEFINE_UNQUOTED(HAVE_FREETYPE_217_OR_OLDER, 0, [Defines if your system has the freetype library 2.1.7 or older])
287 AC_SUBST(FREETYPE_CFLAGS)
288 AC_SUBST(FREETYPE_LIBS)
290 dnl ================== End of xpdf checks ===========================================
292 dnl ================== ggv checks ===================================================
294 [ --with-gs=dir Directory Where GhostScript package is installed.])
296 if test "x$with_gs" = "x"; then
297 AC_PATH_PROG(GS_PROG, gs)
298 if test -z "$GS_PROG"; then
299 AC_MSG_ERROR(Unable to find GhostScript in the PATH. Provide the full path for GhostScript(--with-gs=PATH). You need to have Ghostscript installed in order to run GGV)
305 AC_DEFINE_UNQUOTED(GS_PATH, "$GS_PROG", [Path to the 'gs' executable.])
308 dnl check for GS version and define appropriate alpha parameters
309 AC_MSG_CHECKING(for Ghostscript version...)
310 GS_VERSION=`$GS_PROG --version | head -n 1`
311 AC_MSG_RESULT(found $GS_VERSION)
312 dnl GS tends to get a lot of BadMatch errors with the *AlphaBits parameters
313 dnl so I've commented their use out
314 dnl if test "$GS_VERSION" -gt "5"; then
315 dnl AA_PARMS="-sDEVICE=x11 -dTextAlphaBits=4 -dGraphicsAlphaBits=4"
317 dnl AA_PARMS="-sDEVICE=x11alpha"
319 AA_PARMS="-sDEVICE=x11alpha -dNOPLATFONTS"
320 AC_DEFINE_UNQUOTED(ALPHA_PARAMS, "$AA_PARMS", [Anti-aliasing parameters for Ghostscript.])
321 AC_MSG_RESULT(Antialiasing parameters for Ghostscript: $AA_PARMS)
324 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
325 dnl stolen from nautilus and gnome-common
327 AC_ARG_ENABLE(more-warnings,
328 [ --enable-more-warnings Maximum compiler warnings],
329 set_more_warnings="$enableval",[
330 if test -f $srcdir/autogen.sh; then
332 set_more_warnings=yes
337 AC_MSG_CHECKING(for more warnings, including -Werror)
338 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
339 AC_MSG_RESULT([yes, using gcc])
342 -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
343 -Wnested-externs -Wpointer-arith \
344 -Wcast-align -Wsign-compare \
348 dnl case " $CFLAGS " in
349 dnl *[\ \ ]-ansi[\ \ ]*) ;;
350 dnl *) CFLAGS="$CFLAGS -ansi" ;;
352 dnl case " $CFLAGS " in
353 dnl *[\ \ ]-pedantic[\ \ ]*) ;;
354 dnl *) CFLAGS="$CFLAGS -pedantic" ;;
357 for option in -Wno-strict-aliasing -Wno-sign-compare; do
358 SAVE_CFLAGS="$CFLAGS"
359 CFLAGS="$CFLAGS $option"
360 AC_MSG_CHECKING([whether gcc understands $option])
361 AC_TRY_COMPILE([], [],
364 if test $has_option = no; then
365 CFLAGS="$SAVE_CFLAGS"
367 AC_MSG_RESULT($has_option)
376 dnl ======================== End of ggv checks =================================
381 cut-n-paste/recent-files/Makefile