source: trunk/third/gpdf/configure.in @ 21437

Revision 21437, 12.2 KB checked in by ghudson, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21436, which included commits to RCS files with non-trunk default branches.
Line 
1dnl Process this file with autoconf to produce a configure script.
2dnl Copyright 1998-2004 Glyph & Cog, LLC
3dnl Copyright 1999-2000 Ximian, Inc.
4dnl Copyright 2002-2004 Martin Kretzschmar
5
6AC_PREREQ(2.52)
7AC_INIT(gpdf, 2.8.3,
8        [http://bugzilla.gnome.org/enter_bug.cgi?product=gpdf])
9STABLE_RELEASE=true
10
11AM_MAINTAINER_MODE
12
13AC_CONFIG_SRCDIR(xpdf/gpdf-control.cc)
14AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
15AM_CONFIG_HEADER(aconf.h)
16
17dnl Required libraries
18
19GTK_REQUIRED=2.3.0
20LIBBONOBO_REQUIRED=2.2.1
21LIBGNOMEPRINT_REQUIRED=2.5.1
22GCONF_REQUIRED=2.0.0
23
24AC_SUBST(GTK_REQUIRED)
25AC_SUBST(LIBBONOBO_REQUIRED)
26AC_SUBST(LIBGNOMEPRINT_REQUIRED)
27AC_SUBST(GCONF_REQUIRED)
28
29dnl Checks for programs.
30
31AC_ISC_POSIX
32AC_PROG_CC
33AM_PROG_CC_STDC
34AC_PROG_CXX
35AC_STDC_HEADERS
36AC_PROG_RANLIB
37
38AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
39
40AC_PATH_PROG(PDFTEX, pdftex, no)
41AM_CONDITIONAL(HAVE_PDFTEX, test "x$PDFTEX" != "xno")
42
43dnl Compiler strictness, deprecated function handling
44
45GNOME_COMPILE_WARNINGS("maximum")
46CFLAGS="$CFLAGS $WARN_CFLAGS"
47GNOME_CXX_WARNINGS("yes")
48CXXFLAGS="$CXXFLAGS $WARN_CXXFLAGS"
49
50AC_MSG_CHECKING([whether to disable deprecated glib/gtk+/etc. features])
51AC_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="")
63AC_SUBST(GPDF_DEPRECATED_CFLAGS)
64
65dnl i18n
66
67ALL_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
69GETTEXT_PACKAGE=AC_PACKAGE_NAME
70AC_SUBST(GETTEXT_PACKAGE)
71AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [foo])
72
73AM_GLIB_GNU_GETTEXT
74AC_PROG_INTLTOOL
75
76dnl Xpdf aconf.h.in compatibility
77
78AH_TOP([#include <aconf2.h>])
79AH_TEMPLATE([HAVE_LIBSM], [Define to 1 if you have session management.])
80AH_TEMPLATE([ENABLE_NLS], [Use Native Language Support.])
81AH_TEMPLATE([HAVE_CATGETS], [Use catgets functions.])
82AH_TEMPLATE([HAVE_GETTEXT], [Use gettext functions.])
83
84dnl Optional features.
85AH_TEMPLATE([A4_PAPER],
86            [Use A4 paper size instead of Letter for PostScript output.])
87AC_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
93dnl never define NO_TEXT_SELECT, just remember this Xpdf setting.
94AH_TEMPLATE([NO_TEXT_SELECT], [Do not allow text selection.])
95
96AH_TEMPLATE([OPI_SUPPORT],
97            [Include support for OPI comments.])
98AC_ARG_ENABLE(opi,
99              AC_HELP_STRING([--enable-opi],
100                             [include support for OPI comments]),
101              AC_DEFINE(OPI_SUPPORT))
102
103dnl enable these unconditionally.
104AC_DEFINE([MULTITHREADED], [1], [Enable multithreading support.])
105AC_DEFINE([TEXTOUT_WORD_LIST], [1], [Enable word list support.])
106             
107AH_TEMPLATE([APPDEFDIR],
108            [Directory with the Xpdf app-defaults file.])
109AC_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
114dnl Path to xpdfrc.
115dnl This ugly kludge to get the sysconfdir path is needed because
116dnl autoconf doesn't actually set the prefix variable until later.
117if 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
123else
124  system_xpdfrc="$sysconfdir/xpdfrc"
125fi
126AC_DEFINE_UNQUOTED(SYSTEM_XPDFRC, "$system_xpdfrc",
127                   [Full path for the system-wide xpdfrc file.])
128
129dnl Checks for header files.
130AC_HEADER_DIRENT
131
132dnl Switch over to C++.  This will make the checks below a little
133dnl bit stricter (requiring function prototypes in include files).
134dnl (99% of xpdf is written in C++.)
135AC_LANG_CPLUSPLUS
136
137dnl Look for header that defines select() and fd_set.
138AC_MSG_CHECKING([select() and fd_set in sys/select.h and sys/bsdtypes.h])
139AC_TRY_COMPILE([#include <stdlib.h>
140#include <stddef.h>
141#include <unistd.h>
142#include <sys/types.h>],
143  [fd_set fds;
144select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no)
145if test $xpdf_ok = yes; then
146  AC_MSG_RESULT([not needed])
147else
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;
154select(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;
165select(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
173fi
174
175dnl Look for header that defines FD_ZERO.
176AC_MSG_CHECKING([FD_ZERO and strings.h or bstring.h])
177AC_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)
183if test $xpdf_ok = yes; then
184  AC_MSG_RESULT([not needed])
185else
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
211fi
212
213dnl Look for rewinddir.
214AC_CHECK_FUNCS(rewinddir)
215if test $ac_cv_func_rewinddir = no; then
216  AC_CHECK_LIB(cposix, rewinddir)
217fi
218
219dnl Checks for library functions.
220AC_CHECK_FUNCS(popen)
221dnl # This should use 'AC_CHECK_FUNCS(mkstemp)' but that fails if
222dnl # the mkstemp exists in the library but isn't declared in the
223dnl # include file (e.g., in cygwin 1.1.2).
224AC_CACHE_CHECK([for mkstemp],
225xpdf_cv_func_mkstemp,
226[AC_TRY_LINK([#include <stdlib.h>
227#include <unistd.h>],
228[mkstemp("foo");],
229xpdf_cv_func_mkstemp=yes, xpdf_cv_func_mkstemp=no)])
230if test "$xpdf_cv_func_mkstemp" = yes; then
231  AC_DEFINE(HAVE_MKSTEMP, 1, [Have mkstemp().])
232fi
233dnl Check for mkstemps, just like mkstemp.
234AC_CACHE_CHECK([for mkstemps],
235xpdf_cv_func_mkstemps,
236[AC_TRY_LINK([#include <stdlib.h>
237#include <unistd.h>],
238[mkstemps("foo", 0);],
239xpdf_cv_func_mkstemps=yes, xpdf_cv_func_mkstemps=no)])
240if test "$xpdf_cv_func_mkstemps" = yes; then
241  AC_DEFINE(HAVE_MKSTEMPS, 1, [Have mkstemps().])
242fi
243
244dnl Check select argument type: on HP-UX before version 10, select
245dnl takes (int *) instead of (fd_set *).
246AC_CACHE_CHECK([whether select takes fd_set arguments],
247xpdf_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;
255select(1, &fds, &fds, &fds, 0);],
256xpdf_cv_func_select_arg=yes, xpdf_cv_func_select_arg=no)])
257if test "$xpdf_cv_func_select_arg" != yes; then
258  AC_DEFINE(SELECT_TAKES_INT, 1, [select() takes int, not fd_set arguments.])
259fi
260
261dnl Back to C for the library tests.
262AC_LANG_C
263
264dnl Check for fseeko/ftello or fseek64/ftell64
265dnl The LARGEFILE and FSEEKO macros have to be called in C, not C++, mode.
266AC_SYS_LARGEFILE
267AC_FUNC_FSEEKO
268AC_CHECK_FUNCS(fseek64, xpdf_cv_func_fseek64=yes, xpdf_cv_func_fseek64=no)
269AC_CHECK_FUNCS(ftell64, xpdf_cv_func_ftell64=yes, xpdf_cv_func_ftell64=no)
270if test "$xpdf_cv_func_fseek64" = yes -a "$xpdf_cv_func_ftell64" = yes; then
271  AC_DEFINE(HAVE_FSEEK64, 1, [Have fseek64().])
272fi
273
274dnl Check for libpaper (Debian).
275smr_CHECK_LIB(libpaper, paper, [Debian libpaper], paperinit, paper.h)
276AC_SUBST(libpaper_LIBS)
277AC_SUBST(libpaper_CFLAGS)
278
279dnl Check for GNOME libraries
280
281PKG_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
292AC_SUBST(EXTRA_GNOME_LIBS)
293AC_SUBST(EXTRA_GNOME_CFLAGS)
294
295dnl gnome-print private headers
296
297GNOME_PRINT_PRIVATE_CFLAGS="-I`$PKG_CONFIG libgnomeprint-2.2 --variable privateincludedir`"
298
299save_CFLAGS="$CFLAGS"
300save_LIBS="$LIBS"
301CFLAGS="$CFLAGS $EXTRA_GNOME_CFLAGS $GNOME_PRINT_PRIVATE_CFLAGS"
302LIBS="$LIBS $EXTRA_GNOME_LIBS"
303AC_CACHE_CHECK([whether gnome-print has sane private headers],
304gpdf_cv_gnome_font_private,
305[AC_TRY_LINK([#include <libgnomeprint/private/gnome-font-private.h>],
306[gp_fontmap_get ();],
307gpdf_cv_gnome_font_private=yes, gpdf_cv_gnome_font_private=no)])
308CFLAGS="$save_CFLAGS"
309LIBS="$save_LIBS"
310if 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.])
313else
314  AC_MSG_WARN([Cannot use internal gnome-print headers. gpdf's font support won't be as good as possible.])
315fi
316
317AC_SUBST(GNOME_PRINT_PRIVATE_CFLAGS)
318
319dnl gconf configuration source,
320dnl default to xml::$(sysconfdir)/gconf/gconf.xml.defaults
321
322AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
323
324if test x"$GCONFTOOL" = xno; then
325  AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
326fi
327
328AM_GCONF_SOURCE_2
329
330dnl Check the freetype version
331AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
332if 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
339fi
340
341dnl Fix for bug #121730
342
343AC_CANONICAL_HOST
344
345case $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
354esac   
355
356dnl Enable/Disable annotation sidebar
357
358AC_MSG_CHECKING([whether annotations view should be compiled])
359AC_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
370AM_CONDITIONAL(USE_ANNOTS_VIEW, test "x$enable_annotations_view" = "xyes")
371
372dnl Write the makefiles.
373
374AC_OUTPUT([
375Makefile
376gpdf.schemas
377gpdf.spec
378goo/Makefile
379lib/Makefile
380lib/ggv-sidebar/Makefile
381lib/recent-files/Makefile
382po/Makefile.in
383shell/Makefile
384shell/tests/Makefile
385test-files/Makefile
386fofi/Makefile
387splash/Makefile
388xpdf/Makefile
389xpdf/tests/Makefile
390help/Makefile
391help/C/Makefile
392help/de/Makefile
393help/es/Makefile
394])
395
396dnl Message of Doom
397
398$STABLE_RELEASE || echo "
399This is a development version of GPdf.
400Use GPdf 2.8.x if you want something more stable."
Note: See TracBrowser for help on using the repository browser.