]> www.fi.muni.cz Git - evince.git/blob - configure.ac
Release 0.1.6
[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(DVI, gtk+-2.0 >= 2.6.0)
38 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6.0)
39 PKG_CHECK_MODULES(PS, gtk+-2.0 >= 2.6.0 gnome-vfs-2.0 libgnomeui-2.0)
40 PKG_CHECK_MODULES(POPPLER, poppler >= 0.1.1)
41
42 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`  
43 AC_SUBST(GLIB_GENMARSHAL)
44
45 dnl Compile with disable-deprecated switches
46
47 AC_ARG_ENABLE(deprecated,
48 AC_HELP_STRING([--disable-deprecated],
49                [Don't allow any deprecated GTK+/etc. features.]),
50 set_enable_deprecated="$enableval",[
51 if test -f $srcdir/autogen.sh; then
52         is_cvs_version=true
53         set_enable_deprecated=no
54 else
55         set_enable_deprecated=yes
56         fi
57 ])
58 AC_MSG_CHECKING([whether to disable deprecated glib/gtk+/etc. features])
59 if test "$set_enable_deprecated" != "yes"; then
60         AC_MSG_RESULT(yes)
61         EVINCE_DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED"
62 else
63         AC_MSG_RESULT(no)
64         EVINCE_DISABLE_DEPRECATED=""
65 fi
66 AC_SUBST(EVINCE_DISABLE_DEPRECATED)
67
68 AM_GCONF_SOURCE_2
69
70 AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
71 if test "x$GCONFTOOL" = "xno"; then
72         AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
73 fi
74
75 dnl ================== ggv checks ===================================================
76 AC_ARG_WITH(gs-pkg,
77             [  --with-gs=dir       Directory Where GhostScript package is installed.])
78
79 if test "x$with_gs" = "x"; then
80         AC_PATH_PROG(GS_PROG, gs)
81         if test -z "$GS_PROG"; then
82                 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)
83         fi
84 else
85         GS_PROG=$with_gs
86 fi
87
88 AC_DEFINE_UNQUOTED(GS_PATH, "$GS_PROG", [Path to the 'gs' executable.])
89
90
91 dnl check for GS version
92 AC_MSG_CHECKING(for Ghostscript version...)
93 GS_VERSION=`gs --version | head -n 1 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
94 AC_MSG_RESULT(found $GS_VERSION)
95 if test "$GS_VERSION" -lt "7"; then
96         AC_MSG_ERROR([You need Ghostscript version >= 7 in order to run evince])
97 fi
98 AA_PARMS="-sDEVICE=x11alpha -dNOPLATFONTS"
99 AC_DEFINE_UNQUOTED(ALPHA_PARAMS, "$AA_PARMS", [Anti-aliasing parameters for Ghostscript.])
100 AC_MSG_RESULT(Antialiasing parameters for Ghostscript: $AA_PARMS)
101
102
103 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
104 dnl stolen from nautilus and gnome-common
105
106 AC_ARG_ENABLE(more-warnings,
107 [  --enable-more-warnings  Maximum compiler warnings],
108 set_more_warnings="$enableval",[
109 if test -f $srcdir/autogen.sh; then
110         is_cvs_version=true
111         set_more_warnings=yes
112 else
113         set_more_warnings=no
114 fi
115 ])
116 AC_MSG_CHECKING(for more warnings, including -Werror)
117 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
118         AC_MSG_RESULT([yes, using gcc])
119         CFLAGS="\
120         -Wall \
121         -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
122         -Wnested-externs -Wpointer-arith \
123         -Wcast-align -Wsign-compare \
124         -Werror \
125         $CFLAGS"
126
127 dnl     case " $CFLAGS " in
128 dnl         *[\ \       ]-ansi[\ \      ]*) ;;
129 dnl         *) CFLAGS="$CFLAGS -ansi" ;;
130 dnl     esac
131 dnl     case " $CFLAGS " in
132 dnl         *[\ \       ]-pedantic[\ \  ]*) ;;
133 dnl         *) CFLAGS="$CFLAGS -pedantic" ;;
134 dnl     esac
135
136         for option in -Wno-strict-aliasing -Wno-sign-compare; do
137                 SAVE_CFLAGS="$CFLAGS"
138                 CFLAGS="$CFLAGS $option"
139                 AC_MSG_CHECKING([whether gcc understands $option])
140                 AC_TRY_COMPILE([], [],
141                         has_option=yes,
142                         has_option=no,)
143                 if test $has_option = no; then
144                         CFLAGS="$SAVE_CFLAGS"
145                 fi
146                 AC_MSG_RESULT($has_option)
147                 unset has_option
148                 unset SAVE_CFLAGS
149         done
150         unset option
151 else
152         AC_MSG_RESULT(no)
153 fi
154
155 dnl ======================== End of ggv checks =================================
156
157 AC_OUTPUT([
158 Makefile
159 cut-n-paste/Makefile
160 cut-n-paste/recent-files/Makefile
161 data/Makefile
162 lib/Makefile
163 pdf/Makefile
164 pixbuf/Makefile
165 ps/Makefile
166 po/Makefile.in
167 backend/Makefile
168 shell/Makefile
169 ])