1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | dnl Copyright 1998-2004 Glyph & Cog, LLC |
---|
3 | dnl Copyright 1999-2000 Ximian, Inc. |
---|
4 | dnl Copyright 2002-2004 Martin Kretzschmar |
---|
5 | |
---|
6 | AC_PREREQ(2.52) |
---|
7 | AC_INIT(gpdf, 2.8.3, |
---|
8 | [http://bugzilla.gnome.org/enter_bug.cgi?product=gpdf]) |
---|
9 | STABLE_RELEASE=true |
---|
10 | |
---|
11 | AM_MAINTAINER_MODE |
---|
12 | |
---|
13 | AC_CONFIG_SRCDIR(xpdf/gpdf-control.cc) |
---|
14 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) |
---|
15 | AM_CONFIG_HEADER(aconf.h) |
---|
16 | |
---|
17 | dnl Required libraries |
---|
18 | |
---|
19 | GTK_REQUIRED=2.3.0 |
---|
20 | LIBBONOBO_REQUIRED=2.2.1 |
---|
21 | LIBGNOMEPRINT_REQUIRED=2.5.1 |
---|
22 | GCONF_REQUIRED=2.0.0 |
---|
23 | |
---|
24 | AC_SUBST(GTK_REQUIRED) |
---|
25 | AC_SUBST(LIBBONOBO_REQUIRED) |
---|
26 | AC_SUBST(LIBGNOMEPRINT_REQUIRED) |
---|
27 | AC_SUBST(GCONF_REQUIRED) |
---|
28 | |
---|
29 | dnl Checks for programs. |
---|
30 | |
---|
31 | AC_ISC_POSIX |
---|
32 | AC_PROG_CC |
---|
33 | AM_PROG_CC_STDC |
---|
34 | AC_PROG_CXX |
---|
35 | AC_STDC_HEADERS |
---|
36 | AC_PROG_RANLIB |
---|
37 | |
---|
38 | AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) |
---|
39 | |
---|
40 | AC_PATH_PROG(PDFTEX, pdftex, no) |
---|
41 | AM_CONDITIONAL(HAVE_PDFTEX, test "x$PDFTEX" != "xno") |
---|
42 | |
---|
43 | dnl Compiler strictness, deprecated function handling |
---|
44 | |
---|
45 | GNOME_COMPILE_WARNINGS("maximum") |
---|
46 | CFLAGS="$CFLAGS $WARN_CFLAGS" |
---|
47 | GNOME_CXX_WARNINGS("yes") |
---|
48 | CXXFLAGS="$CXXFLAGS $WARN_CXXFLAGS" |
---|
49 | |
---|
50 | AC_MSG_CHECKING([whether to disable deprecated glib/gtk+/etc. features]) |
---|
51 | AC_ARG_ENABLE([deprecation-errors], |
---|
52 | AC_HELP_STRING([--enable-deprecation-errors], |
---|
53 | [don't allow use of deprecated GTK+/etc. features]), |
---|
54 | if test "$enable_deprecation_errors" = "yes"; then |
---|
55 | AC_MSG_RESULT(yes) |
---|
56 | GPDF_DEPRECATED_CFLAGS="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED" |
---|
57 | else |
---|
58 | AC_MSG_RESULT(no) |
---|
59 | GPDF_DEPRECATED_CFLAGS="" |
---|
60 | fi, |
---|
61 | AC_MSG_RESULT(no) |
---|
62 | GPDF_DEPRECATED_CFLAGS="") |
---|
63 | AC_SUBST(GPDF_DEPRECATED_CFLAGS) |
---|
64 | |
---|
65 | dnl i18n |
---|
66 | |
---|
67 | ALL_LINGUAS="af am ar az be bn bs ca cs cy da de el en_CA en_GB eo es eu fa fi fr ga gl gu he hi hr hu id is it ja kn ko lt lv mk ml mn ms nb nl nn no or pa pl pt pt_BR ro ru sk sl sq sr sr@Latn sv ta th tr uk vi wa zh_CN zh_TW" |
---|
68 | |
---|
69 | GETTEXT_PACKAGE=AC_PACKAGE_NAME |
---|
70 | AC_SUBST(GETTEXT_PACKAGE) |
---|
71 | AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [foo]) |
---|
72 | |
---|
73 | AM_GLIB_GNU_GETTEXT |
---|
74 | AC_PROG_INTLTOOL |
---|
75 | |
---|
76 | dnl Xpdf aconf.h.in compatibility |
---|
77 | |
---|
78 | AH_TOP([#include <aconf2.h>]) |
---|
79 | AH_TEMPLATE([HAVE_LIBSM], [Define to 1 if you have session management.]) |
---|
80 | AH_TEMPLATE([ENABLE_NLS], [Use Native Language Support.]) |
---|
81 | AH_TEMPLATE([HAVE_CATGETS], [Use catgets functions.]) |
---|
82 | AH_TEMPLATE([HAVE_GETTEXT], [Use gettext functions.]) |
---|
83 | |
---|
84 | dnl Optional features. |
---|
85 | AH_TEMPLATE([A4_PAPER], |
---|
86 | [Use A4 paper size instead of Letter for PostScript output.]) |
---|
87 | AC_ARG_ENABLE(a4-paper, |
---|
88 | AC_HELP_STRING([--enable-a4-paper], |
---|
89 | [use A4 paper size instead of Letter for |
---|
90 | PostScript output]), |
---|
91 | AC_DEFINE(A4_PAPER)) |
---|
92 | |
---|
93 | dnl never define NO_TEXT_SELECT, just remember this Xpdf setting. |
---|
94 | AH_TEMPLATE([NO_TEXT_SELECT], [Do not allow text selection.]) |
---|
95 | |
---|
96 | AH_TEMPLATE([OPI_SUPPORT], |
---|
97 | [Include support for OPI comments.]) |
---|
98 | AC_ARG_ENABLE(opi, |
---|
99 | AC_HELP_STRING([--enable-opi], |
---|
100 | [include support for OPI comments]), |
---|
101 | AC_DEFINE(OPI_SUPPORT)) |
---|
102 | |
---|
103 | dnl enable these unconditionally. |
---|
104 | AC_DEFINE([MULTITHREADED], [1], [Enable multithreading support.]) |
---|
105 | AC_DEFINE([TEXTOUT_WORD_LIST], [1], [Enable word list support.]) |
---|
106 | |
---|
107 | AH_TEMPLATE([APPDEFDIR], |
---|
108 | [Directory with the Xpdf app-defaults file.]) |
---|
109 | AC_ARG_WITH(appdef-dir, |
---|
110 | AC_HELP_STRING([--with-appdef-dir], |
---|
111 | [set app-defaults directory]), |
---|
112 | AC_DEFINE_UNQUOTED(APPDEFDIR, "$with_appdef_dir")) |
---|
113 | |
---|
114 | dnl Path to xpdfrc. |
---|
115 | dnl This ugly kludge to get the sysconfdir path is needed because |
---|
116 | dnl autoconf doesn't actually set the prefix variable until later. |
---|
117 | if test "$sysconfdir" = '${prefix}/etc'; then |
---|
118 | if test "x$prefix" = xNONE; then |
---|
119 | system_xpdfrc="$ac_default_prefix/etc/xpdfrc" |
---|
120 | else |
---|
121 | system_xpdfrc="$prefix/etc/xpdfrc" |
---|
122 | fi |
---|
123 | else |
---|
124 | system_xpdfrc="$sysconfdir/xpdfrc" |
---|
125 | fi |
---|
126 | AC_DEFINE_UNQUOTED(SYSTEM_XPDFRC, "$system_xpdfrc", |
---|
127 | [Full path for the system-wide xpdfrc file.]) |
---|
128 | |
---|
129 | dnl Checks for header files. |
---|
130 | AC_HEADER_DIRENT |
---|
131 | |
---|
132 | dnl Switch over to C++. This will make the checks below a little |
---|
133 | dnl bit stricter (requiring function prototypes in include files). |
---|
134 | dnl (99% of xpdf is written in C++.) |
---|
135 | AC_LANG_CPLUSPLUS |
---|
136 | |
---|
137 | dnl Look for header that defines select() and fd_set. |
---|
138 | AC_MSG_CHECKING([select() and fd_set in sys/select.h and sys/bsdtypes.h]) |
---|
139 | AC_TRY_COMPILE([#include <stdlib.h> |
---|
140 | #include <stddef.h> |
---|
141 | #include <unistd.h> |
---|
142 | #include <sys/types.h>], |
---|
143 | [fd_set fds; |
---|
144 | select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no) |
---|
145 | if test $xpdf_ok = yes; then |
---|
146 | AC_MSG_RESULT([not needed]) |
---|
147 | else |
---|
148 | AC_TRY_COMPILE([#include <stdlib.h> |
---|
149 | #include <stddef.h> |
---|
150 | #include <unistd.h> |
---|
151 | #include <sys/types.h> |
---|
152 | #include <sys/select.h>], |
---|
153 | [fd_set fds; |
---|
154 | select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no) |
---|
155 | if test $xpdf_ok = yes; then |
---|
156 | AC_DEFINE(HAVE_SYS_SELECT_H, 1, [Have sys/select.h.]) |
---|
157 | AC_MSG_RESULT([need sys/select.h]) |
---|
158 | else |
---|
159 | AC_TRY_COMPILE([#include <stdlib.h> |
---|
160 | #include <stddef.h> |
---|
161 | #include <unistd.h> |
---|
162 | #include <sys/types.h> |
---|
163 | #include <sys/bsdtypes.h>], |
---|
164 | [fd_set fds; |
---|
165 | select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no) |
---|
166 | if test $xpdf_ok = yes; then |
---|
167 | AC_DEFINE(HAVE_SYS_BSDTYPES_H, 1, [Have sys/bsdtypes.h.]) |
---|
168 | AC_MSG_RESULT([need sys/bsdtypes.h]) |
---|
169 | else |
---|
170 | AC_MSG_RESULT([problem]) |
---|
171 | fi |
---|
172 | fi |
---|
173 | fi |
---|
174 | |
---|
175 | dnl Look for header that defines FD_ZERO. |
---|
176 | AC_MSG_CHECKING([FD_ZERO and strings.h or bstring.h]) |
---|
177 | AC_TRY_COMPILE([#include <stdlib.h> |
---|
178 | #include <sys/types.h> |
---|
179 | #ifdef HAVE_SYS_SELECT_H |
---|
180 | #include <sys/select.h> |
---|
181 | #endif], |
---|
182 | [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no) |
---|
183 | if test $xpdf_ok = yes; then |
---|
184 | AC_MSG_RESULT([not needed]) |
---|
185 | else |
---|
186 | AC_TRY_COMPILE([#include <stdlib.h> |
---|
187 | #include <sys/types.h> |
---|
188 | #include <strings.h> |
---|
189 | #ifdef HAVE_SYS_SELECT_H |
---|
190 | #include <sys/select.h> |
---|
191 | #endif], |
---|
192 | [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no) |
---|
193 | if test $xpdf_ok = yes; then |
---|
194 | AC_DEFINE(HAVE_STRINGS_H, 1, [Have strings.h.]) |
---|
195 | AC_MSG_RESULT([need strings.h]) |
---|
196 | else |
---|
197 | AC_TRY_COMPILE([#include <stdlib.h> |
---|
198 | #include <sys/types.h> |
---|
199 | #include <bstring.h> |
---|
200 | #ifdef HAVE_SYS_SELECT_H |
---|
201 | #include <sys/select.h> |
---|
202 | #endif], |
---|
203 | [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no) |
---|
204 | if test $xpdf_ok = yes; then |
---|
205 | AC_DEFINE(HAVE_BSTRING_H, 1, [Have bstring.h.]) |
---|
206 | AC_MSG_RESULT([need bstring.h]) |
---|
207 | else |
---|
208 | AC_MSG_RESULT([problem]) |
---|
209 | fi |
---|
210 | fi |
---|
211 | fi |
---|
212 | |
---|
213 | dnl Look for rewinddir. |
---|
214 | AC_CHECK_FUNCS(rewinddir) |
---|
215 | if test $ac_cv_func_rewinddir = no; then |
---|
216 | AC_CHECK_LIB(cposix, rewinddir) |
---|
217 | fi |
---|
218 | |
---|
219 | dnl Checks for library functions. |
---|
220 | AC_CHECK_FUNCS(popen) |
---|
221 | dnl # This should use 'AC_CHECK_FUNCS(mkstemp)' but that fails if |
---|
222 | dnl # the mkstemp exists in the library but isn't declared in the |
---|
223 | dnl # include file (e.g., in cygwin 1.1.2). |
---|
224 | AC_CACHE_CHECK([for mkstemp], |
---|
225 | xpdf_cv_func_mkstemp, |
---|
226 | [AC_TRY_LINK([#include <stdlib.h> |
---|
227 | #include <unistd.h>], |
---|
228 | [mkstemp("foo");], |
---|
229 | xpdf_cv_func_mkstemp=yes, xpdf_cv_func_mkstemp=no)]) |
---|
230 | if test "$xpdf_cv_func_mkstemp" = yes; then |
---|
231 | AC_DEFINE(HAVE_MKSTEMP, 1, [Have mkstemp().]) |
---|
232 | fi |
---|
233 | dnl Check for mkstemps, just like mkstemp. |
---|
234 | AC_CACHE_CHECK([for mkstemps], |
---|
235 | xpdf_cv_func_mkstemps, |
---|
236 | [AC_TRY_LINK([#include <stdlib.h> |
---|
237 | #include <unistd.h>], |
---|
238 | [mkstemps("foo", 0);], |
---|
239 | xpdf_cv_func_mkstemps=yes, xpdf_cv_func_mkstemps=no)]) |
---|
240 | if test "$xpdf_cv_func_mkstemps" = yes; then |
---|
241 | AC_DEFINE(HAVE_MKSTEMPS, 1, [Have mkstemps().]) |
---|
242 | fi |
---|
243 | |
---|
244 | dnl Check select argument type: on HP-UX before version 10, select |
---|
245 | dnl takes (int *) instead of (fd_set *). |
---|
246 | AC_CACHE_CHECK([whether select takes fd_set arguments], |
---|
247 | xpdf_cv_func_select_arg, |
---|
248 | [AC_TRY_COMPILE([#include <sys/types.h> |
---|
249 | #include <sys/time.h> |
---|
250 | #include <unistd.h> |
---|
251 | #ifdef HAVE_SYS_SELECT_H |
---|
252 | #include <sys/select.h> |
---|
253 | #endif], |
---|
254 | [fd_set fds; |
---|
255 | select(1, &fds, &fds, &fds, 0);], |
---|
256 | xpdf_cv_func_select_arg=yes, xpdf_cv_func_select_arg=no)]) |
---|
257 | if test "$xpdf_cv_func_select_arg" != yes; then |
---|
258 | AC_DEFINE(SELECT_TAKES_INT, 1, [select() takes int, not fd_set arguments.]) |
---|
259 | fi |
---|
260 | |
---|
261 | dnl Back to C for the library tests. |
---|
262 | AC_LANG_C |
---|
263 | |
---|
264 | dnl Check for fseeko/ftello or fseek64/ftell64 |
---|
265 | dnl The LARGEFILE and FSEEKO macros have to be called in C, not C++, mode. |
---|
266 | AC_SYS_LARGEFILE |
---|
267 | AC_FUNC_FSEEKO |
---|
268 | AC_CHECK_FUNCS(fseek64, xpdf_cv_func_fseek64=yes, xpdf_cv_func_fseek64=no) |
---|
269 | AC_CHECK_FUNCS(ftell64, xpdf_cv_func_ftell64=yes, xpdf_cv_func_ftell64=no) |
---|
270 | if test "$xpdf_cv_func_fseek64" = yes -a "$xpdf_cv_func_ftell64" = yes; then |
---|
271 | AC_DEFINE(HAVE_FSEEK64, 1, [Have fseek64().]) |
---|
272 | fi |
---|
273 | |
---|
274 | dnl Check for libpaper (Debian). |
---|
275 | smr_CHECK_LIB(libpaper, paper, [Debian libpaper], paperinit, paper.h) |
---|
276 | AC_SUBST(libpaper_LIBS) |
---|
277 | AC_SUBST(libpaper_CFLAGS) |
---|
278 | |
---|
279 | dnl Check for GNOME libraries |
---|
280 | |
---|
281 | PKG_CHECK_MODULES(EXTRA_GNOME, gtk+-2.0 >= $GTK_REQUIRED \ |
---|
282 | libgnomeui-2.0 \ |
---|
283 | libbonoboui-2.0 \ |
---|
284 | libbonobo-2.0 >= $LIBBONOBO_REQUIRED \ |
---|
285 | gnome-vfs-2.0 \ |
---|
286 | gnome-vfs-module-2.0 \ |
---|
287 | libgnomeprint-2.2 >= $LIBGNOMEPRINT_REQUIRED \ |
---|
288 | libgnomeprintui-2.2 \ |
---|
289 | libglade-2.0 \ |
---|
290 | gconf-2.0 >= $GCONF_REQUIRED) |
---|
291 | |
---|
292 | AC_SUBST(EXTRA_GNOME_LIBS) |
---|
293 | AC_SUBST(EXTRA_GNOME_CFLAGS) |
---|
294 | |
---|
295 | dnl gnome-print private headers |
---|
296 | |
---|
297 | GNOME_PRINT_PRIVATE_CFLAGS="-I`$PKG_CONFIG libgnomeprint-2.2 --variable privateincludedir`" |
---|
298 | |
---|
299 | save_CFLAGS="$CFLAGS" |
---|
300 | save_LIBS="$LIBS" |
---|
301 | CFLAGS="$CFLAGS $EXTRA_GNOME_CFLAGS $GNOME_PRINT_PRIVATE_CFLAGS" |
---|
302 | LIBS="$LIBS $EXTRA_GNOME_LIBS" |
---|
303 | AC_CACHE_CHECK([whether gnome-print has sane private headers], |
---|
304 | gpdf_cv_gnome_font_private, |
---|
305 | [AC_TRY_LINK([#include <libgnomeprint/private/gnome-font-private.h>], |
---|
306 | [gp_fontmap_get ();], |
---|
307 | gpdf_cv_gnome_font_private=yes, gpdf_cv_gnome_font_private=no)]) |
---|
308 | CFLAGS="$save_CFLAGS" |
---|
309 | LIBS="$save_LIBS" |
---|
310 | if test "$gpdf_cv_gnome_font_private" = yes; then |
---|
311 | AC_DEFINE(HAVE_FONT_EMBEDDING, 1, |
---|
312 | [Define to 1 if `gnome-font-private.h' is usable.]) |
---|
313 | else |
---|
314 | AC_MSG_WARN([Cannot use internal gnome-print headers. gpdf's font support won't be as good as possible.]) |
---|
315 | fi |
---|
316 | |
---|
317 | AC_SUBST(GNOME_PRINT_PRIVATE_CFLAGS) |
---|
318 | |
---|
319 | dnl gconf configuration source, |
---|
320 | dnl default to xml::$(sysconfdir)/gconf/gconf.xml.defaults |
---|
321 | |
---|
322 | AC_PATH_PROG(GCONFTOOL, gconftool-2, no) |
---|
323 | |
---|
324 | if test x"$GCONFTOOL" = xno; then |
---|
325 | AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf]) |
---|
326 | fi |
---|
327 | |
---|
328 | AM_GCONF_SOURCE_2 |
---|
329 | |
---|
330 | dnl Check the freetype version |
---|
331 | AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) |
---|
332 | if test "x$FREETYPE_CONFIG" != "xno" ; then |
---|
333 | vers=`$FREETYPE_CONFIG --version 2>/dev/null | sed -e 's/libfreetype //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` |
---|
334 | if test -n "$vers" && test "$vers" -le 9005003; then |
---|
335 | AC_DEFINE_UNQUOTED(HAVE_FREETYPE_217_OR_OLDER, 1, [Define to 1 if your system has the freetype library 2.1.7 or older]) |
---|
336 | else |
---|
337 | AC_DEFINE_UNQUOTED(HAVE_FREETYPE_217_OR_OLDER, 0, [Define to 1 if your system has the freetype library 2.1.7 or older]) |
---|
338 | fi |
---|
339 | fi |
---|
340 | |
---|
341 | dnl Fix for bug #121730 |
---|
342 | |
---|
343 | AC_CANONICAL_HOST |
---|
344 | |
---|
345 | case $host_os in |
---|
346 | hpux*) |
---|
347 | AC_MSG_CHECKING([for broken g++ 3.3 on HP-UX]) |
---|
348 | if test "$GCC" = "yes" && $CXX -dumpversion | grep ^3.3 > /dev/null; then |
---|
349 | AC_MSG_RESULT([yes, defining __STDC_EXT__ ]) |
---|
350 | AC_DEFINE(__STDC_EXT__, 1, [Define to 1 on HP-UX with gcc 3.3]) |
---|
351 | else |
---|
352 | AC_MSG_RESULT([no]) |
---|
353 | fi |
---|
354 | esac |
---|
355 | |
---|
356 | dnl Enable/Disable annotation sidebar |
---|
357 | |
---|
358 | AC_MSG_CHECKING([whether annotations view should be compiled]) |
---|
359 | AC_ARG_ENABLE(annotations-view, |
---|
360 | AC_HELP_STRING([--enable-annotations-view], |
---|
361 | [enable the Annotations view in the sidebar (very experimental)]), |
---|
362 | if test "$enable_annotations_view" = "yes"; then |
---|
363 | AC_MSG_RESULT([yes]) |
---|
364 | AC_DEFINE(USE_ANNOTS_VIEW, 1, [Enable/Disable Annotations view in GPdf sidebar]) |
---|
365 | else |
---|
366 | AC_MSG_RESULT([no]) |
---|
367 | fi, |
---|
368 | AC_MSG_RESULT([no])) |
---|
369 | |
---|
370 | AM_CONDITIONAL(USE_ANNOTS_VIEW, test "x$enable_annotations_view" = "xyes") |
---|
371 | |
---|
372 | dnl Write the makefiles. |
---|
373 | |
---|
374 | AC_OUTPUT([ |
---|
375 | Makefile |
---|
376 | gpdf.schemas |
---|
377 | gpdf.spec |
---|
378 | goo/Makefile |
---|
379 | lib/Makefile |
---|
380 | lib/ggv-sidebar/Makefile |
---|
381 | lib/recent-files/Makefile |
---|
382 | po/Makefile.in |
---|
383 | shell/Makefile |
---|
384 | shell/tests/Makefile |
---|
385 | test-files/Makefile |
---|
386 | fofi/Makefile |
---|
387 | splash/Makefile |
---|
388 | xpdf/Makefile |
---|
389 | xpdf/tests/Makefile |
---|
390 | help/Makefile |
---|
391 | help/C/Makefile |
---|
392 | help/de/Makefile |
---|
393 | help/es/Makefile |
---|
394 | ]) |
---|
395 | |
---|
396 | dnl Message of Doom |
---|
397 | |
---|
398 | $STABLE_RELEASE || echo " |
---|
399 | This is a development version of GPdf. |
---|
400 | Use GPdf 2.8.x if you want something more stable." |
---|