1 | -*- mode: m4 -*- |
---|
2 | AC_PREREQ(2.52) |
---|
3 | AC_INIT(libgnomeprint, 2.2.1.1, |
---|
4 | http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-print) |
---|
5 | |
---|
6 | AM_CONFIG_HEADER(config.h) |
---|
7 | AM_INIT_AUTOMAKE(libgnomeprint, 2.2.1.1) |
---|
8 | |
---|
9 | AM_MAINTAINER_MODE |
---|
10 | |
---|
11 | AC_PROG_INTLTOOL |
---|
12 | |
---|
13 | AC_ISC_POSIX |
---|
14 | AC_PROG_CC |
---|
15 | AC_PROG_CPP |
---|
16 | AC_PROG_CXX |
---|
17 | AC_STDC_HEADERS |
---|
18 | AM_PROG_LIBTOOL |
---|
19 | |
---|
20 | AC_DEFINE(WE_ARE_LIBGNOMEPRINT_INTERNALS, 1, [Defined so that we can read our private headers]) |
---|
21 | |
---|
22 | |
---|
23 | dnl ==================================================== |
---|
24 | dnl FIXME: Does this really belong here?. See bug #80577 |
---|
25 | dnl ==================================================== |
---|
26 | AC_CHECK_FUNC(bind_textdomain_codeset,,[AC_CHECK_LIB(intl,bind_textdomain_codeset)]) |
---|
27 | |
---|
28 | dnl ============= |
---|
29 | dnl Warning flags |
---|
30 | dnl ============= |
---|
31 | GNOME_COMPILE_WARNINGS(maximum) |
---|
32 | CFLAGS="$CFLAGS $warning_flags" |
---|
33 | |
---|
34 | dnl ======= |
---|
35 | dnl gettext |
---|
36 | dnl ======= |
---|
37 | GETTEXT_PACKAGE=libgnomeprint-2.2 |
---|
38 | AC_SUBST(GETTEXT_PACKAGE) |
---|
39 | AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package]) |
---|
40 | |
---|
41 | ALL_LINGUAS="am ar az be bg ca cs da de el es et fi fr he hi hu it ja ko lv mn ms nl nn no pl pt pt_BR ro ru sk sl sv ta tr uk vi wa zh_TW zh_CN" |
---|
42 | AM_GLIB_GNU_GETTEXT |
---|
43 | |
---|
44 | dnl ========================================== |
---|
45 | dnl Checks for gtk-doc and docbook-tools |
---|
46 | dnl ========================================== |
---|
47 | AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs]) |
---|
48 | if test "x$with_html_dir" = "x" ; then |
---|
49 | HTML_DIR='${datadir}/gtk-doc/html' |
---|
50 | else |
---|
51 | HTML_DIR=$with_html_dir |
---|
52 | fi |
---|
53 | AC_SUBST(HTML_DIR) |
---|
54 | |
---|
55 | AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false) |
---|
56 | gtk_doc_min_version=0.9 |
---|
57 | if $GTKDOC ; then |
---|
58 | gtk_doc_version=`gtkdoc-mkdb --version` |
---|
59 | AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version]) |
---|
60 | |
---|
61 | IFS="${IFS= }"; gtk_save_IFS="$IFS"; IFS="." |
---|
62 | set $gtk_doc_version |
---|
63 | for min in $gtk_doc_min_version ; do |
---|
64 | cur=$1; shift |
---|
65 | if test -z $min ; then break; fi |
---|
66 | if test -z $cur ; then GTKDOC=false; break; fi |
---|
67 | if test $cur -gt $min ; then break ; fi |
---|
68 | if test $cur -lt $min ; then GTKDOC=false; break ; fi |
---|
69 | done |
---|
70 | IFS="$gtk_save_IFS" |
---|
71 | |
---|
72 | if $GTKDOC ; then |
---|
73 | AC_MSG_RESULT(yes) |
---|
74 | else |
---|
75 | AC_MSG_RESULT(no) |
---|
76 | fi |
---|
77 | fi |
---|
78 | |
---|
79 | AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC) |
---|
80 | AC_SUBST(HAVE_GTK_DOC) |
---|
81 | |
---|
82 | AC_CHECK_PROG(DB2HTML, db2html, true, false) |
---|
83 | AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML) |
---|
84 | |
---|
85 | dnl Let people disable the gtk-doc stuff. |
---|
86 | AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=no) |
---|
87 | |
---|
88 | if test x$enable_gtk_doc = xyes ; then |
---|
89 | if test x$GTKDOC = xtrue ; then |
---|
90 | enable_gtk_doc=yes |
---|
91 | else |
---|
92 | enable_gtk_doc=no |
---|
93 | fi |
---|
94 | fi |
---|
95 | |
---|
96 | dnl NOTE: We need to use a separate automake conditional for this |
---|
97 | dnl to make this work with the tarballs. |
---|
98 | AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes) |
---|
99 | dnl ========================================== |
---|
100 | dnl END: Checks for gtk-doc and docbook-tools |
---|
101 | dnl ========================================== |
---|
102 | dnl ================= |
---|
103 | dnl pkg-config checks |
---|
104 | dnl ================= |
---|
105 | glib_modules="glib-2.0 >= 1.3.10 gobject-2.0 >= 1.3.10 gmodule-2.0 >= 1.3.10" |
---|
106 | libart_modules="libart-2.0 >= 2.3.7" |
---|
107 | pango_modules="pango >= 0.21" |
---|
108 | libxml2_modules="libxml-2.0 >= 2.4.23" |
---|
109 | fontconfig_modules="fontconfig >= 1.0" |
---|
110 | PKG_CHECK_MODULES(GP, [ $glib_modules $libart_modules $pango_modules $libxml2_modules $libbonobo_modules $fontconfig_modules ]) |
---|
111 | |
---|
112 | AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) |
---|
113 | |
---|
114 | dnl ================================= |
---|
115 | dnl Checking for freetype2 |
---|
116 | dnl ================================= |
---|
117 | FREETYPE_LIBS= |
---|
118 | FREETYPE_CFLAGS= |
---|
119 | AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) |
---|
120 | if test "x$FREETYPE_CONFIG" = "xno" ; then |
---|
121 | AC_MSG_ERROR(You need FreeType2 (freetype-devel v 2.x package) for this version of libgnomeprint) |
---|
122 | else |
---|
123 | FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags` |
---|
124 | FREETYPE_LIBS=`$FREETYPE_CONFIG --libs` |
---|
125 | fi |
---|
126 | |
---|
127 | libgnomeprint_save_ldflags=$LDFLAGS |
---|
128 | LDFLAGS="$LDFLAGS $FREETYPE_LIBS" |
---|
129 | |
---|
130 | freetype_version=false |
---|
131 | AC_MSG_CHECKING([For sufficiently new FreeType (at least 2.0.5)]) |
---|
132 | AC_CHECK_LIB(freetype, FT_Get_Postscript_Name, freetype_version=true, :) |
---|
133 | if $freetype_version ; then |
---|
134 | AC_MSG_RESULT(yes) |
---|
135 | else |
---|
136 | AC_MSG_ERROR(You need FreeType2 (freetype-devel 2.0.5 or greater package) for this version of libgnomeprint) |
---|
137 | fi |
---|
138 | |
---|
139 | LDFLAGS=$libgnomeprint_save_ldflags |
---|
140 | |
---|
141 | dnl ================================= |
---|
142 | dnl END: Checking for freetype2 |
---|
143 | dnl ================================= |
---|
144 | |
---|
145 | dnl ========================================== |
---|
146 | dnl Checking for CUPS libraries |
---|
147 | dnl ========================================== |
---|
148 | try_cups=yes |
---|
149 | cups_msg=yes |
---|
150 | AC_ARG_WITH(cups, |
---|
151 | [ --{with,without}-cups Build the cups module], |
---|
152 | if test "x$withval" = "xno"; then |
---|
153 | try_cups=false |
---|
154 | cups_msg="Disabled by request" |
---|
155 | fi |
---|
156 | ) |
---|
157 | if test "x$try_cups" = "xyes"; then |
---|
158 | AC_MSG_CHECKING(for CUPS libraries version >= 1.1.0) |
---|
159 | if cups-config --version --libs > /dev/null 2>&1; then |
---|
160 | verstxt=`cups-config --version` |
---|
161 | vers=`echo "$verstxt" | \ |
---|
162 | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` |
---|
163 | if test "$vers" -lt 1001000; then |
---|
164 | AC_MSG_RESULT(Cups found but the version found is less than 1.1.0) |
---|
165 | cups_msg="Version requirement not satisfied" |
---|
166 | else |
---|
167 | CUPS_LIBS=`cups-config --libs` |
---|
168 | CUPS_CFLAGS=`cups-config --cflags` |
---|
169 | AC_MSG_RESULT(Found version $verstxt) |
---|
170 | fi |
---|
171 | else |
---|
172 | AC_MSG_RESULT("cups not found, make sure cups-config is in the path") |
---|
173 | cups_msg="cups-devel not installed (cups-config not found in the PATH)" |
---|
174 | fi |
---|
175 | fi |
---|
176 | AC_SUBST(CUPS_LIBS) |
---|
177 | AC_SUBST(CUPS_CFLAGS) |
---|
178 | AM_CONDITIONAL(HAVE_CUPS, test x"$cups_msg" = "xyes") |
---|
179 | dnl ========================================== |
---|
180 | dnl END: Checking for CUPS libraries |
---|
181 | dnl ========================================== |
---|
182 | |
---|
183 | dnl ========================================================================= |
---|
184 | dnl SET THE DIRECTORY PATHS, first: GNOME_PRINT_MODULES_DIR & GPA_MODULES_DIR |
---|
185 | dnl ========================================================================= |
---|
186 | if test "x${prefix}" = "xNONE"; then |
---|
187 | GNOME_PRINT_MODULES_DIR='${ac_default_prefix}/lib/libgnomeprint/${VERSION}/modules' |
---|
188 | else |
---|
189 | GNOME_PRINT_MODULES_DIR='${libdir}/libgnomeprint/${VERSION}/modules' |
---|
190 | fi |
---|
191 | AC_SUBST(GNOME_PRINT_MODULES_DIR, $GNOME_PRINT_MODULES_DIR) |
---|
192 | |
---|
193 | dnl ========================= |
---|
194 | dnl Now, GNOME_PRINT_DATA_DIR |
---|
195 | dnl ========================= |
---|
196 | if test "x${prefix}" = "xNONE"; then |
---|
197 | GNOME_PRINT_DATA_DIR='${ac_default_prefix}/${DATADIRNAME}/libgnomeprint/${VERSION}' |
---|
198 | else |
---|
199 | GNOME_PRINT_DATA_DIR='${prefix}/${DATADIRNAME}/libgnomeprint/${VERSION}' |
---|
200 | fi |
---|
201 | AC_SUBST(GNOME_PRINT_DATA_DIR, $GNOME_PRINT_DATA_DIR) |
---|
202 | dnl ============================ |
---|
203 | dnl END: SET THE DIRECTORY PATHS |
---|
204 | dnl ============================ |
---|
205 | |
---|
206 | dnl =============================== |
---|
207 | dnl LIBGNOMEPRINT_LIBS & CFLAGS |
---|
208 | dnl =============================== |
---|
209 | LIBGNOMEPRINT_CFLAGS="$GP_CFLAGS $FREETYPE_CFLAGS" |
---|
210 | LIBGNOMEPRINT_LIBS="$GP_LIBS $FREETYPE_LIBS" |
---|
211 | AC_SUBST(LIBGNOMEPRINT_CFLAGS) |
---|
212 | AC_SUBST(LIBGNOMEPRINT_LIBS) |
---|
213 | |
---|
214 | dnl ================================================= |
---|
215 | dnl Get the loadable module extension for this system |
---|
216 | dnl ================================================= |
---|
217 | AC_LTDL_SHLIBEXT |
---|
218 | LTDL_SHLIBEXT=$libltdl_cv_shlibext |
---|
219 | AC_SUBST(LTDL_SHLIBEXT) |
---|
220 | |
---|
221 | dnl ============================= |
---|
222 | dnl Used for tests/ & tests/tools |
---|
223 | dnl ============================= |
---|
224 | PKG_CHECK_MODULES(TOOLS, "glib-2.0 gobject-2.0 libxml-2.0") |
---|
225 | TOOLS_LIBS="$TOOLS_LIBS -lpopt" |
---|
226 | AC_SUBST(TOOLS_CFLAGS) |
---|
227 | AC_SUBST(TOOLS_LIBS) |
---|
228 | |
---|
229 | AC_OUTPUT([ |
---|
230 | Makefile |
---|
231 | po/Makefile.in |
---|
232 | libgnomeprint/Makefile |
---|
233 | libgnomeprint/gpa/Makefile |
---|
234 | libgnomeprint/transports/Makefile |
---|
235 | libgnomeprint/libgnomeprint-2.2.pc |
---|
236 | libgnomeprint/modules/Makefile |
---|
237 | libgnomeprint/modules/cups/Makefile |
---|
238 | data/Makefile |
---|
239 | data/models/Makefile |
---|
240 | data/printers/Makefile |
---|
241 | tests/Makefile |
---|
242 | tests/files/Makefile |
---|
243 | tests/output/Makefile |
---|
244 | tests/tools/Makefile |
---|
245 | doc/Makefile |
---|
246 | doc/reference/Makefile |
---|
247 | ]) |
---|
248 | |
---|
249 | echo " |
---|
250 | Compiler: ${CC} |
---|
251 | Compiler flags: ${CFLAGS}" |
---|
252 | if test "x$cups_msg" = "xyes"; then |
---|
253 | echo " Cups module: $cups_msg [LIBS: $CUPS_LIBS]" |
---|
254 | else |
---|
255 | echo " Cups module: $cups_msg" |
---|
256 | fi |
---|
257 | echo " Data dir: `eval echo $GNOME_PRINT_DATA_DIR`" |
---|
258 | if test x$enable_gtk_doc = xyes ; then |
---|
259 | echo " Enable gtk-doc: Yes" |
---|
260 | else |
---|
261 | echo " Enable gtk-doc: No" |
---|
262 | fi |
---|
263 | echo |
---|