]> www.fi.muni.cz Git - evince.git/blob - configure.ac
Add a nautilus thumbnailer. Based on patch by Fernando Herrera
[evince.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_PREREQ(2.59)
4 AC_INIT(evince, 0.1.6)
5 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
6
7 dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
8 AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS")
9
10 AM_CONFIG_HEADER(config.h)
11
12 AM_MAINTAINER_MODE
13
14 AM_PROG_LIBTOOL
15
16 AC_ISC_POSIX
17 AC_PROG_CC
18 AM_PROG_CC_STDC
19 AC_PROG_CXX
20 AC_STDC_HEADERS
21 AC_PROG_RANLIB
22 AC_PROG_INTLTOOL
23
24 GNOME_DEBUG_CHECK
25
26 ALL_LINGUAS="bg ca cs da de el en_CA en_GB fi fr ja no nb nl pt_BR sv zh_CN zh_TW"
27
28 AM_GLIB_GNU_GETTEXT
29
30 GETTEXT_PACKAGE=AC_PACKAGE_NAME
31 AC_SUBST(GETTEXT_PACKAGE)
32 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
33
34 PKG_CHECK_MODULES(LIBEVPRIVATE, gtk+-2.0 >= 2.4.0)
35 PKG_CHECK_MODULES(RECENT_FILES, gtk+-2.0 >= 2.4.0 libgnomeui-2.0 >= 2.4.0)
36 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 poppler >= 0.1.1)
37 PKG_CHECK_MODULES(THUMBNAILER, gtk+-2.0 >= 2.6.0 gnome-vfs-2.0 poppler >= 0.1.1)
38 PKG_CHECK_MODULES(DVI, gtk+-2.0 >= 2.6.0)
39 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6.0)
40 PKG_CHECK_MODULES(PS, gtk+-2.0 >= 2.6.0 gnome-vfs-2.0 libgnomeui-2.0)
41 PKG_CHECK_MODULES(POPPLER, poppler >= 0.1.1)
42
43 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`  
44 AC_SUBST(GLIB_GENMARSHAL)
45
46 dnl Compile with disable-deprecated switches
47
48 AC_ARG_ENABLE(deprecated,
49 AC_HELP_STRING([--disable-deprecated],
50                [Don't allow any deprecated GTK+/etc. features.]),
51 set_enable_deprecated="$enableval",[
52 if test -f $srcdir/autogen.sh; then
53         is_cvs_version=true
54         set_enable_deprecated=no
55 else
56         set_enable_deprecated=yes
57         fi
58 ])
59 AC_MSG_CHECKING([whether to disable deprecated glib/gtk+/etc. features])
60 if test "$set_enable_deprecated" != "yes"; then
61         AC_MSG_RESULT(yes)
62         EVINCE_DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED"
63 else
64         AC_MSG_RESULT(no)
65         EVINCE_DISABLE_DEPRECATED=""
66 fi
67 AC_SUBST(EVINCE_DISABLE_DEPRECATED)
68
69 AM_GCONF_SOURCE_2
70
71 AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
72 if test "x$GCONFTOOL" = "xno"; then
73         AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
74 fi
75
76 dnl ================== ggv checks ===================================================
77 AC_ARG_WITH(gs-pkg,
78             [  --with-gs=dir       Directory Where GhostScript package is installed.])
79
80 if test "x$with_gs" = "x"; then
81         AC_PATH_PROG(GS_PROG, gs)
82         if test -z "$GS_PROG"; then
83                 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 evince)
84         fi
85 else
86         GS_PROG=$with_gs
87 fi
88
89 AC_DEFINE_UNQUOTED(GS_PATH, "$GS_PROG", [Path to the 'gs' executable.])
90
91
92 dnl check for GS version
93 AC_MSG_CHECKING(for Ghostscript version...)
94 GS_VERSION=`gs --version | head -n 1 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
95 AC_MSG_RESULT(found $GS_VERSION)
96 if test "$GS_VERSION" -lt "7"; then
97         AC_MSG_ERROR([You need Ghostscript version >= 7 in order to run evince])
98 fi
99 AA_PARMS="-sDEVICE=x11alpha -dNOPLATFONTS"
100 AC_DEFINE_UNQUOTED(ALPHA_PARAMS, "$AA_PARMS", [Anti-aliasing parameters for Ghostscript.])
101 AC_MSG_RESULT(Antialiasing parameters for Ghostscript: $AA_PARMS)
102
103
104 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
105 dnl stolen from nautilus and gnome-common
106
107 AC_ARG_ENABLE(more-warnings,
108 [  --enable-more-warnings  Maximum compiler warnings],
109 set_more_warnings="$enableval",[
110 if test -f $srcdir/autogen.sh; then
111         is_cvs_version=true
112         set_more_warnings=yes
113 else
114         set_more_warnings=no
115 fi
116 ])
117 AC_MSG_CHECKING(for more warnings, including -Werror)
118 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
119         AC_MSG_RESULT([yes, using gcc])
120         CFLAGS="\
121         -Wall \
122         -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
123         -Wnested-externs -Wpointer-arith \
124         -Wcast-align -Wsign-compare \
125         -Werror \
126         $CFLAGS"
127
128 dnl     case " $CFLAGS " in
129 dnl         *[\ \       ]-ansi[\ \      ]*) ;;
130 dnl         *) CFLAGS="$CFLAGS -ansi" ;;
131 dnl     esac
132 dnl     case " $CFLAGS " in
133 dnl         *[\ \       ]-pedantic[\ \  ]*) ;;
134 dnl         *) CFLAGS="$CFLAGS -pedantic" ;;
135 dnl     esac
136
137         for option in -Wno-strict-aliasing -Wno-sign-compare; do
138                 SAVE_CFLAGS="$CFLAGS"
139                 CFLAGS="$CFLAGS $option"
140                 AC_MSG_CHECKING([whether gcc understands $option])
141                 AC_TRY_COMPILE([], [],
142                         has_option=yes,
143                         has_option=no,)
144                 if test $has_option = no; then
145                         CFLAGS="$SAVE_CFLAGS"
146                 fi
147                 AC_MSG_RESULT($has_option)
148                 unset has_option
149                 unset SAVE_CFLAGS
150         done
151         unset option
152 else
153         AC_MSG_RESULT(no)
154 fi
155
156 dnl ======================== End of ggv checks =================================
157
158 AC_OUTPUT([
159 Makefile
160 cut-n-paste/Makefile
161 cut-n-paste/recent-files/Makefile
162 data/Makefile
163 lib/Makefile
164 pdf/Makefile
165 pixbuf/Makefile
166 ps/Makefile
167 po/Makefile.in
168 backend/Makefile
169 shell/Makefile
170 thumbnailer/Makefile
171 ])