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 dnl Compile with disable-deprecated switches
39 AC_ARG_ENABLE(deprecated,
40 AC_HELP_STRING([--disable-deprecated],
41 [Don't allow any deprecated GTK+/etc. features.]),
42 set_enable_deprecated="$enableval",[
43 if test -f $srcdir/autogen.sh; then
45 set_enable_deprecated=no
47 set_enable_deprecated=yes
50 AC_MSG_CHECKING([whether to disable deprecated glib/gtk+/etc. features])
51 if test "$set_enable_deprecated" != "yes"; then
53 EVINCE_DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED"
56 EVINCE_DISABLE_DEPRECATED=""
58 AC_SUBST(EVINCE_DISABLE_DEPRECATED)
60 dnl ================== Xpdf aconf.h.in checks ==================================
62 AH_TEMPLATE([HAVE_LIBSM], [Define to 1 if you have session management.])
63 AH_TEMPLATE([ENABLE_NLS], [Use Native Language Support.])
64 AH_TEMPLATE([HAVE_CATGETS], [Use catgets functions.])
65 AH_TEMPLATE([HAVE_GETTEXT], [Use gettext functions.])
67 dnl Optional features.
68 AH_TEMPLATE([A4_PAPER],
69 [Use A4 paper size instead of Letter for PostScript output.])
70 AC_ARG_ENABLE(a4-paper,
71 AC_HELP_STRING([--enable-a4-paper],
72 [use A4 paper size instead of Letter for
76 dnl never define NO_TEXT_SELECT, just remember this Xpdf setting.
77 AH_TEMPLATE([NO_TEXT_SELECT], [Do not allow text selection.])
79 AH_TEMPLATE([OPI_SUPPORT],
80 [Include support for OPI comments.])
82 AC_HELP_STRING([--enable-opi],
83 [include support for OPI comments]),
84 AC_DEFINE(OPI_SUPPORT))
86 dnl enable these unconditionally.
87 AC_DEFINE([MULTITHREADED], [1], [Enable multithreading support.])
88 AC_DEFINE([TEXTOUT_WORD_LIST], [1], [Enable word list support.])
90 AH_TEMPLATE([APPDEFDIR],
91 [Directory with the Xpdf app-defaults file.])
92 AC_ARG_WITH(appdef-dir,
93 AC_HELP_STRING([--with-appdef-dir],
94 [set app-defaults directory]),
95 AC_DEFINE_UNQUOTED(APPDEFDIR, "$with_appdef_dir"))
98 dnl This ugly kludge to get the sysconfdir path is needed because
99 dnl autoconf doesn't actually set the prefix variable until later.
100 if test "$sysconfdir" = '${prefix}/etc'; then
101 if test "x$prefix" = xNONE; then
102 system_xpdfrc="$ac_default_prefix/etc/xpdfrc"
104 system_xpdfrc="$prefix/etc/xpdfrc"
107 system_xpdfrc="$sysconfdir/xpdfrc"
109 AC_DEFINE_UNQUOTED(SYSTEM_XPDFRC, "$system_xpdfrc",
110 [Full path for the system-wide xpdfrc file.])
112 dnl Checks for header files.
115 dnl Switch over to C++. This will make the checks below a little
116 dnl bit stricter (requiring function prototypes in include files).
117 dnl (99% of xpdf is written in C++.)
120 dnl Look for header that defines select() and fd_set.
121 AC_MSG_CHECKING([select() and fd_set in sys/select.h and sys/bsdtypes.h])
122 AC_TRY_COMPILE([#include <stdlib.h>
125 #include <sys/types.h>],
127 select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no)
128 if test $xpdf_ok = yes; then
129 AC_MSG_RESULT([not needed])
131 AC_TRY_COMPILE([#include <stdlib.h>
134 #include <sys/types.h>
135 #include <sys/select.h>],
137 select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no)
138 if test $xpdf_ok = yes; then
139 AC_DEFINE(HAVE_SYS_SELECT_H, 1, [Have sys/select.h.])
140 AC_MSG_RESULT([need sys/select.h])
142 AC_TRY_COMPILE([#include <stdlib.h>
145 #include <sys/types.h>
146 #include <sys/bsdtypes.h>],
148 select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no)
149 if test $xpdf_ok = yes; then
150 AC_DEFINE(HAVE_SYS_BSDTYPES_H, 1, [Have sys/bsdtypes.h.])
151 AC_MSG_RESULT([need sys/bsdtypes.h])
153 AC_MSG_RESULT([problem])
158 dnl Look for header that defines FD_ZERO.
159 AC_MSG_CHECKING([FD_ZERO and strings.h or bstring.h])
160 AC_TRY_COMPILE([#include <stdlib.h>
161 #include <sys/types.h>
162 #ifdef HAVE_SYS_SELECT_H
163 #include <sys/select.h>
165 [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
166 if test $xpdf_ok = yes; then
167 AC_MSG_RESULT([not needed])
169 AC_TRY_COMPILE([#include <stdlib.h>
170 #include <sys/types.h>
172 #ifdef HAVE_SYS_SELECT_H
173 #include <sys/select.h>
175 [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
176 if test $xpdf_ok = yes; then
177 AC_DEFINE(HAVE_STRINGS_H, 1, [Have strings.h.])
178 AC_MSG_RESULT([need strings.h])
180 AC_TRY_COMPILE([#include <stdlib.h>
181 #include <sys/types.h>
183 #ifdef HAVE_SYS_SELECT_H
184 #include <sys/select.h>
186 [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
187 if test $xpdf_ok = yes; then
188 AC_DEFINE(HAVE_BSTRING_H, 1, [Have bstring.h.])
189 AC_MSG_RESULT([need bstring.h])
191 AC_MSG_RESULT([problem])
196 dnl Look for rewinddir.
197 AC_CHECK_FUNCS(rewinddir)
198 if test $ac_cv_func_rewinddir = no; then
199 AC_CHECK_LIB(cposix, rewinddir)
202 dnl Checks for library functions.
203 AC_CHECK_FUNCS(popen)
204 dnl # This should use 'AC_CHECK_FUNCS(mkstemp)' but that fails if
205 dnl # the mkstemp exists in the library but isn't declared in the
206 dnl # include file (e.g., in cygwin 1.1.2).
207 AC_CACHE_CHECK([for mkstemp],
208 xpdf_cv_func_mkstemp,
209 [AC_TRY_LINK([#include <stdlib.h>
210 #include <unistd.h>],
212 xpdf_cv_func_mkstemp=yes, xpdf_cv_func_mkstemp=no)])
213 if test "$xpdf_cv_func_mkstemp" = yes; then
214 AC_DEFINE(HAVE_MKSTEMP, 1, [Have mkstemp().])
216 dnl Check for mkstemps, just like mkstemp.
217 AC_CACHE_CHECK([for mkstemps],
218 xpdf_cv_func_mkstemps,
219 [AC_TRY_LINK([#include <stdlib.h>
220 #include <unistd.h>],
221 [mkstemps("foo", 0);],
222 xpdf_cv_func_mkstemps=yes, xpdf_cv_func_mkstemps=no)])
223 if test "$xpdf_cv_func_mkstemps" = yes; then
224 AC_DEFINE(HAVE_MKSTEMPS, 1, [Have mkstemps().])
227 dnl Check select argument type: on HP-UX before version 10, select
228 dnl takes (int *) instead of (fd_set *).
229 AC_CACHE_CHECK([whether select takes fd_set arguments],
230 xpdf_cv_func_select_arg,
231 [AC_TRY_COMPILE([#include <sys/types.h>
232 #include <sys/time.h>
234 #ifdef HAVE_SYS_SELECT_H
235 #include <sys/select.h>
238 select(1, &fds, &fds, &fds, 0);],
239 xpdf_cv_func_select_arg=yes, xpdf_cv_func_select_arg=no)])
240 if test "$xpdf_cv_func_select_arg" != yes; then
241 AC_DEFINE(SELECT_TAKES_INT, 1, [select() takes int, not fd_set arguments.])
244 dnl Back to C for the library tests.
247 dnl Check for fseeko/ftello or fseek64/ftell64
248 dnl The LARGEFILE and FSEEKO macros have to be called in C, not C++, mode.
251 AC_CHECK_FUNCS(fseek64, xpdf_cv_func_fseek64=yes, xpdf_cv_func_fseek64=no)
252 AC_CHECK_FUNCS(ftell64, xpdf_cv_func_ftell64=yes, xpdf_cv_func_ftell64=no)
253 if test "$xpdf_cv_func_fseek64" = yes -a "$xpdf_cv_func_ftell64" = yes; then
254 AC_DEFINE(HAVE_FSEEK64, 1, [Have fseek64().])
257 dnl Check for freetype headers
260 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
261 if test "x$FREETYPE_CONFIG" != "xno" ; then
262 FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
263 FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
264 AC_DEFINE(HAVE_FREETYPE_H, 1, [Have FreeType2 include files])
267 AC_SUBST(FREETYPE_CFLAGS)
268 AC_SUBST(FREETYPE_LIBS)
270 dnl ================== End of xpdf checks ===========================================
272 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
273 dnl stolen from nautilus and gnome-common
275 AC_ARG_ENABLE(more-warnings,
276 [ --enable-more-warnings Maximum compiler warnings],
277 set_more_warnings="$enableval",[
278 if test -f $srcdir/autogen.sh; then
280 set_more_warnings=yes
285 AC_MSG_CHECKING(for more warnings, including -Werror)
286 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
287 AC_MSG_RESULT([yes, using gcc])
290 -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
291 -Wnested-externs -Wpointer-arith \
292 -Wcast-align -Wsign-compare \
296 dnl case " $CFLAGS " in
297 dnl *[\ \ ]-ansi[\ \ ]*) ;;
298 dnl *) CFLAGS="$CFLAGS -ansi" ;;
300 dnl case " $CFLAGS " in
301 dnl *[\ \ ]-pedantic[\ \ ]*) ;;
302 dnl *) CFLAGS="$CFLAGS -pedantic" ;;
305 for option in -Wno-strict-aliasing -Wno-sign-compare; do
306 SAVE_CFLAGS="$CFLAGS"
307 CFLAGS="$CFLAGS $option"
308 AC_MSG_CHECKING([whether gcc understands $option])
309 AC_TRY_COMPILE([], [],
312 if test $has_option = no; then
313 CFLAGS="$SAVE_CFLAGS"
315 AC_MSG_RESULT($has_option)
324 dnl ==========================================================================
329 cut-n-paste/recent-files/Makefile