Debian Codegraph @

configure.ac

raw
1 dnl Copyright (C) 2001-2004 Roger Leigh
2 dnl
3 dnl This program is free software; you can redistribute it and/or modify
4 dnl it under the terms of the GNU General Public License as published by
5 dnl the Free Software Foundation; either version 2, or (at your option)
6 dnl any later version.
7 dnl
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 dnl GNU General Public License for more details.
12 dnl
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program. If not, see <https://www.gnu.org/licenses/>.
15
16 dnl Process this file with autoconf to produce a configure script.
17
18 dnl MAKING RELEASES (a step-by-step guide!)
19 dnl ===============
20 dnl
21 dnl Since the last release:
22 dnl 1. if only source code (not the interface) has changed, set
23 dnl GUTENPRINT_MICRO_VERSION += 1;
24 dnl 2. if any interfaces have been added or changed *compatibly*
25 dnl GUTENPRINT_CURRENT_INTERFACE (GCI) += 1;
26 dnl GUTENPRINT_BINARY_AGE (GBA) += 1;
27 dnl 3. if interfaces have been deleted or changed *incompatibly*, set
28 dnl GCI = GBA + 1;
29 dnl GBA = 0;
30 dnl
31 dnl (Note that "added", "changed", and "deleted" refer to *external*
32 dnl interfaces, that is, interfaces that start with stp_ and are in any
33 dnl of the header files in include/gutenprint. Internal interfaces
34 dnl that are prefixed with stpi_ and are only listed in internal headers
35 dnl in src/main do not need to be considered, since no external program
36 dnl should rely on them. "Change" refers to more than just function
37 dnl signature; things like changes to enumerated types or changes in
38 dnl behavior with the same function arguments are also considered changes)
39 dnl
40 dnl The .soname version is (GCI - GBA).GBA
41 dnl Example: if GCI is 3 and GBA is 1, the version is 2.1. To get 2.2,
42 dnl GCI would be incremented to 4 and GBA to 2.
43 dnl
44 dnl *NOTE*: due to an error preparing 5.2.8, we must skip over major version of
45 dnl 3 (that is, GCI - GBA) and go directly from 2 to 4.
46 dnl
47 dnl For example:
48 dnl GCI=3, GBA=1 => .soname = libgutenprint.so.2.1
49 dnl GCI=4, GBA=2 => .soname = libgutenprint.so.2.2 (5.2.9)
50 dnl GCI=5, GBA=3 => .soname = libgutenprint.so.2.3 (5.2.10)
51 dnl (and so on for 5.2 releases, which must remain compatible)
52 dnl GCI=4, GBA=0 => .soname = libgutenprint.so.4.0
53 dnl GCI=5, GBA=1 => .soname = libgutenprint.so.4.1
54 dnl GCI=6, GBA=2 => .soname = libgutenprint.so.4.2
55 dnl (for Gutenprint 5.3 or 5.4 or 6.0 or whatever)
56 dnl GCI=5, GBA=0 => .soname = libgutenprint.so.5.0
57 dnl GCI=6, GBA=1 => .soname = libgutenprint.so.5.1
58 dnl GCI=7, GBA=2 => .soname = libgutenprint.so.5.2
59 dnl (for the next major/minor release beyond that)
60 dnl
61 dnl Typically, programs will require a certain major number to be matched
62 dnl and a minimum minor number. Causing the major number to be incremented
63 dnl will result in programs linked against libgutenprint.so.2 to be treated
64 dnl as incompatible with libgutenprint.so.3.
65 dnl
66 dnl .soname versions can have a third component, which is set from
67 dnl GUTENPRINT_INTERFACE_AGE. This resulted in problems on OS X and
68 dnl we have elected to use only two components in the .soname.
69 dnl
70 dnl Similar principles apply to libgutenprintui2, but that interface is
71 dnl still at 1.0.
72 dnl
73 dnl For more detailed information, see the libtool info documentation.
74 dnl
75 pushdef([GUTENPRINT_NAME], [gutenprint])
76 pushdef([GUTENPRINT_MAJOR_VERSION], [5])
77 pushdef([GUTENPRINT_MINOR_VERSION], [3])
78 pushdef([GUTENPRINT_MICRO_VERSION], [6])
79 dnl Append snapshot ID if STP_BUILD_SNAPSHOT is set
80 pushdef([GUTENPRINT_EXTRA_VERSION], [[]m4_esyscmd_s(scripts/snapstamp)])
81 pushdef([GUTENPRINT_CURRENT_INTERFACE], [15])
82 pushdef([GUTENPRINT_BINARY_AGE], [6])
83 pushdef([GUTENPRINTUI2_CURRENT_INTERFACE], [8])
84 pushdef([GUTENPRINTUI2_BINARY_AGE], [6])
85 pushdef([GUTENPRINT_VERSION], GUTENPRINT_MAJOR_VERSION.GUTENPRINT_MINOR_VERSION.GUTENPRINT_MICRO_VERSION[]GUTENPRINT_EXTRA_VERSION)
86
87 AC_INIT([GUTENPRINT_NAME],
88 [GUTENPRINT_VERSION],
89 [[email protected]],
90 [GUTENPRINT_NAME],
91 [https://gimp-print.sourceforge.net])
92 AC_PREREQ([2.69])
93 AC_REVISION($Revision$)
94 AC_CONFIG_SRCDIR(src/main/print-vars.c)
95 AC_CONFIG_MACRO_DIR([m4])
96 AC_CONFIG_AUX_DIR(scripts)
97 STP_INIT
98 AC_COPYRIGHT(
99 [
100 Parts of this configure script come from the 'configure.ac' file, and
101 are not based on freely-redistributable m4 macros; you can redistribute
102 them and/or modify them under the terms of the GNU General Public
103 as published by the Free Software Foundation; either version 2, or (at
104 your option) any later version.
105
106 This program is distributed in the hope that it will be useful,
107 but WITHOUT ANY WARRANTY; without even the implied warranty of
108 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
109 GNU General Public License for more details.
110
111 You should have received a copy of the GNU General Public License
112 along with this program. If not, see <https://www.gnu.org/licenses/>.
113 ])
114
115 [GUTENPRINT_MAJOR_VERSION]=GUTENPRINT_MAJOR_VERSION
116 [GUTENPRINT_MINOR_VERSION]=GUTENPRINT_MINOR_VERSION
117 [GUTENPRINT_MICRO_VERSION]=GUTENPRINT_MICRO_VERSION
118 [GUTENPRINT_EXTRA_VERSION]=GUTENPRINT_EXTRA_VERSION
119 [GUTENPRINT_CURRENT_INTERFACE]=GUTENPRINT_CURRENT_INTERFACE
120 [GUTENPRINT_INTERFACE_AGE]=0
121 [GUTENPRINT_BINARY_AGE]=GUTENPRINT_BINARY_AGE
122 [GUTENPRINT_VERSION]=GUTENPRINT_VERSION
123 [GUTENPRINTUI2_CURRENT_INTERFACE]=GUTENPRINTUI2_CURRENT_INTERFACE
124 [GUTENPRINTUI2_INTERFACE_AGE]=0
125 [GUTENPRINTUI2_BINARY_AGE]=GUTENPRINTUI2_BINARY_AGE
126 popdef([GUTENPRINT_MAJOR_VERSION])
127 popdef([GUTENPRINT_MINOR_VERSION])
128 popdef([GUTENPRINT_MICRO_VERSION])
129 popdef([GUTENPRINT_EXTRA_VERSION])
130 popdef([GUTENPRINT_CURRENT_INTERFACE])
131 popdef([GUTENPRINT_BINARY_AGE])
132 popdef([GUTENPRINTUI2_CURRENT_INTERFACE])
133 popdef([GUTENPRINTUI2_BINARY_AGE])
134
135 configure_args=
136
137 for arg in "$@" ; do
138 if test -n "$configure_args" ; then
139 configure_args="$configure_args "
140 fi
141 if echo "$arg" | grep -q '[\s]' ; then
142 arg="'$arg'"
143 fi
144 configure_args="$configure_args$arg"
145 done
146
147 AC_SUBST([GUTENPRINT_MAJOR_VERSION])
148 AC_SUBST([GUTENPRINT_MINOR_VERSION])
149 AC_SUBST([GUTENPRINT_MICRO_VERSION])
150 AC_SUBST([GUTENPRINT_CURRENT_INTERFACE])
151 AC_SUBST([GUTENPRINT_INTERFACE_AGE])
152 AC_SUBST([GUTENPRINT_BINARY_AGE])
153 AC_SUBST([GUTENPRINT_VERSION])
154 AC_SUBST([GUTENPRINTUI2_CURRENT_INTERFACE])
155 AC_SUBST([GUTENPRINTUI2_INTERFACE_AGE])
156 AC_SUBST([GUTENPRINTUI2_BINARY_AGE])
157
158 dnl Make sure we inherit common compiler options from the environment...
159 CFLAGS="${CFLAGS:=}"
160 CPPFLAGS="${CPPFLAGS:=}"
161 CXXFLAGS="${CXXFLAGS:=}"
162 LDFLAGS="${LDFLAGS:=}"
163 LIBS="${LIBS:=}"
164
165 dnl Initialize automake stuff.
166 dnl We use our own NEWS file check, as explained in Makefile.am.
167 AM_INIT_AUTOMAKE(1.9 dist-xz dist-bzip2 no-dist-gzip tar-ustar gnu)
168 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
169 popdef([GUTENPRINT_NAME])
170 popdef([GUTENPRINT_VERSION])
171
172
173 dnl In the following script, there are a the following variants
174 dnl of cflags and variables
175 dnl
176 dnl *_CFLAGS: cflags for compiling libraries and example progs
177 dnl *_LIBS: libraries for linking programs. ONLY to be used
178 dnl to generate ${gutenprint_libs}
179 dnl *_LIBDEPS: libraries for linking libraries against
180 dnl *_libdeps: library dependencies for pkg-config
181 dnl *_cflags: cflags for pkg-config
182 dnl *_libs: libs for pkg-config
183
184 GUTENPRINT_LIBS="-lgutenprint"
185 GUTENPRINTUI2_LIBS="-lgutenprintui2"
186 gutenprint_version=${GUTENPRINT_VERSION}
187 gutenprintui2_version=${GUTENPRINT_VERSION}
188
189 GUTENPRINTUI2_LIBDEPS="${GUTENPRINTUI2_LIBDEPS} \$(GUTENPRINT_LIBS)"
190
191 dnl Specify a configuration file.
192 AM_CONFIG_HEADER([config.h])
193
194 dnl Available languages (translations)
195 ALL_LINGUAS="ca cs da de el en_GB es fi fr gl hr hu is it ja ka nb nl pl pt ro ru sk sl sv tr uk vi zh_CN zh_TW"
196 AC_SUBST(ALL_LINGUAS)
197
198 dnl Set up libtool scripts.
199 dnl Disable static library building to speed up the build
200 LT_INIT[(dlopen)]
201
202 # We need static libraries for CUPS genppd program for now, for bug 865265
203 # --rlk 20031223
204 AC_ENABLE_STATIC(yes)
205 #AC_DISABLE_SHARED
206 LT_INIT
207 AC_SUBST(LIBTOOL_DEPS)
208 dnl define HAVE_GNU_LD if GNU ld is present
209 if test "$ac_cv_prog_gnu_ld" = "yes" ; then
210 AC_DEFINE(HAVE_GNU_LD,, [Define if GNU ld is present.])
211 fi
212
213 dnl Set up maintainer mode
214 AM_MAINTAINER_MODE
215 if test x${USE_MAINTAINER_MODE} = xyes ; then
216 MAINTAINER_MODE="true"
217 BUILD_TEST="yes"
218 BUILD_DOC="yes"
219 AC_DEFINE(HAVE_MAINTAINER_MODE,, [Define if maintainer-mode is to be used.])
220 fi
221
222 dnl Check canonical system/host (a kludge: replace me with something better).
223 if test x${host_os} = xlinux-gnu ; then
224 OSTYPE="linux"
225 elif test "`echo ${host_os} | sed 's/^\(linux\).*$/\1/'`" = "linux" ; then
226 OSTYPE="linux"
227 elif test "`echo ${host_os} | sed 's/^\(irix\).*$/\1/'`" = "irix" ; then
228 OSTYPE="irix"
229 else
230 OSTYPE="${host_os}"
231 fi
232 AC_DEFINE_UNQUOTED(OSTYPE, ["${OSTYPE}"], [The operating system to build for])
233
234
235 dnl Command line options.
236 AC_ARG_WITH([cups-config],
237 [AS_HELP_STRING([--with-cups-config=path], [Specify path to cups-config executable.])],
238 [with_cups_config="$withval"],
239 [with_cups_config=system]
240 )
241 AS_IF([test "x$with_cups_config" != "xsystem"], [
242 CUPS_CONFIG=$with_cups_config
243 ], [
244 AC_PATH_TOOL(CUPS_CONFIG, [cups-config])
245 AS_IF([test -z "$CUPS_CONFIG"], [
246 FOUND_CUPS_CONFIG=no
247 ],
248 [
249 FOUND_CUPS_CONFIG=yes
250 ])
251 ])
252
253 missing_cups_error="
254
255 ******* ERROR ******
256 You do not have the necessary software installed to build the CUPS driver.
257 This is most likely not what you want, as the resulting installation will
258 not be usable as part of a normal printing system. If you are certain
259 that this is what you want, please run configure with --without-cups.
260 Otherwise, please read the README and install the necessary development
261 package, most likely named 'cups-devel', and re-run configure.
262
263 "
264
265 STP_ARG_WITH_DETAILED(
266 [cups],
267 [=PREFIX],
268 [whether to build CUPS driver],
269 [(default PREFIX=/usr)],
270 [BUILD_CUPS],
271 [(automatic)],
272 [
273 yes)
274 if test "$FOUND_CUPS_CONFIG" = "yes" ; then
275 [BUILD_CUPS]="yes"
276 AC_MSG_RESULT([yes])
277 cups_prefix="/usr"
278 else
279 AC_MSG_ERROR([$missing_cups_error])
280 fi
281 ;;
282 no) [BUILD_CUPS]="no" ; AC_MSG_RESULT([no]) ; cups_prefix="/usr" ;;
283 *) if test -d ${withval} ; then
284 [BUILD_CUPS]="yes"
285 AC_MSG_RESULT([yes (using specified prefix)])
286 cups_prefix="${withval}"
287 else
288 AC_MSG_RESULT([unknown])
289 AC_MSG_ERROR([${withval}: no such directory for --with-cups])
290 fi ;;
291 ],[
292 if test "$FOUND_CUPS_CONFIG" = "yes" ; then
293 cups_prefix="${prefix}"
294 [BUILD_CUPS]="yes"
295 else
296 AC_MSG_ERROR([$missing_cups_error])
297 fi
298 ])
299
300 dnl GNU gettext checks.
301 AM_GNU_GETTEXT_VERSION([0.16])
302 AM_GNU_GETTEXT([external])
303
304 AM_CONDITIONAL(USE_NLS, test x${USE_NLS} = xyes)
305
306 STP_ARG_ENABLE([nls-macosx],
307 [build CUPS PPD files],
308 [USE_NLS_OSX],
309 [(automatic)])
310
311 USE_LEVEL3_PS=no
312 BUILD_CUPS_PPDS="${BUILD_CUPS}"
313 BUILD_TRANSLATED_CUPS_PPDS=no
314 BUILD_CUPS_1_2="no"
315 if test -n "${CUPS_CONFIG}" -a "${BUILD_CUPS}" = "yes" ; then
316 cups_version=`${CUPS_CONFIG} --version | sed -e '1,$s/svn$/.0/'`
317 dnl Quote to protect sed regexes
318 dnl Some relases may be 1.xrc1 or 1.xsvn. Grab only what is needed.
319 [cups_major=`echo $cups_version | sed -e 's/\([0-9][0-9]*\).*/\1/'`]
320 [cups_minor=`echo $cups_version | sed -e 's/\([0-9][0-9]*\).\([0-9][0-9]*\).*/\2/'`]
321 [cups_point=`echo $cups_version | sed -e 's/\([0-9][0-9]*\).\([0-9][0-9]*\).\([0-9][0-9]*\).*/\3/'`]
322 dnl There was no CUPS 1.0.15 or the like
323 if test "$cups_major" -gt 1 -o "$cups_minor" -gt 1 -o "$cups_point" -gt 14 ; then
324 USE_LEVEL3_PS=yes
325 fi
326 if test "$cups_major" -gt 1 -o "$cups_minor" -gt 1 ; then
327 BUILD_CUPS_PPDS="no"
328 BUILD_CUPS_1_2="yes"
329 fi
330 fi
331
332 STP_ARG_ENABLE([cups-ppds],
333 [build CUPS PPD files],
334 [BUILD_CUPS_PPDS],
335 [(automatic)])
336
337 STP_ARG_ENABLE([cups-1_2-enhancements],
338 [build CUPS 1.2 enhancements],
339 [BUILD_CUPS_1_2],
340 [(automatic)])
341
342 if test "$USE_NLS" != no -a "$BUILD_CUPS_PPDS" = yes ; then
343 BUILD_TRANSLATED_CUPS_PPDS="yes"
344 fi
345
346 STP_ARG_ENABLE([translated-cups-ppds],
347 [build translated CUPS PPD files],
348 [BUILD_TRANSLATED_CUPS_PPDS],
349 [(automatic)])
350
351 if test "$BUILD_CUPS_1_2" = yes -a "$BUILD_TRANSLATED_CUPS_PPDS" = yes ; then
352 BUILD_GLOBALIZED_CUPS_PPDS=yes
353 else
354 BUILD_GLOBALIZED_CUPS_PPDS=no
355 fi
356
357 STP_ARG_ENABLE([globalized-cups-ppds],
358 [build globalized CUPS PPD files],
359 [BUILD_GLOBALIZED_CUPS_PPDS],
360 [(automatic)])
361
362 STP_ARG_ENABLE_DETAILED([simplified-cups-ppds],
363 [],
364 [build simplified CUPS PPD files],
365 [(options: yes, no, only)],
366 [BUILD_SIMPLIFIED_CUPS_PPDS],
367 [no],
368 [
369 yes) [WHICH_PPDS]="-a"; BUILD_SIMPLIFIED_CUPS_PPDS=yes; AC_MSG_RESULT([yes]) ;;
370 no) [WHICH_PPDS]=""; BUILD_SIMPLIFIED_CUPS_PPDS=no; AC_MSG_RESULT([no]) ;;
371 only) [WHICH_PPDS]="-s"; BUILD_SIMPLIFIED_CUPS_PPDS=only; AC_MSG_RESULT([only]) ;;
372 *) AC_MSG_ERROR([${enableval}: not a valid option ('yes', 'no', or 'only')]) ;;
373 ])
374
375 STP_ARG_ENABLE([cups-ppds-at-top-level],
376 [place CUPS PPD files at top level],
377 [CUPS_PPDS_AT_TOP_LEVEL],
378 [no])
379
380 STP_ARG_ENABLE([cups-level3-ppds],
381 [generate PostScript level 3 PPD files],
382 [USE_LEVEL3_PS],
383 [(automatic)])
384
385 STATIC_GENPPD="$enable_static"
386 STP_ARG_ENABLE([static-genppd],
387 [build a statically-linked cups-genppd and rastertogutenprint. WARNING: Please read the README and NEWS (release notes) CAREFULLY before using --disable-static-genppd!],
388 [STATIC_GENPPD],
389 [(automatic)])
390
391 ENABLE_STATIC="$enable_static"
392 AC_DEFINE_UNQUOTED(ENABLE_STATIC, "${ENABLE_STATIC}", [Static libraries are built.])
393 AC_SUBST(ENABLE_STATIC)
394
395 ENABLE_SHARED="$enable_shared"
396 AC_DEFINE_UNQUOTED(ENABLE_SHARED, "${ENABLE_SHARED}", [Shared libraries are built.])
397 AC_SUBST(ENABLE_SHARED)
398
399 STP_ARG_WITH_DETAILED([modules],
400 [],
401 [enable loadable modules],
402 [(options: ltdl, dlopen, static)],
403 [WITH_MODULES],
404 [(automatic)],[
405 yes) [WITH_MODULES]="yes"; AC_MSG_RESULT([yes]) ;;
406 no) [WITH_MODULES]="no"; AC_MSG_RESULT([no]) ;;
407 ltdl) [WITH_MODULES]="ltdl"; AC_MSG_RESULT([ltdl]) ;;
408 dlopen) [WITH_MODULES]="dlopen"; AC_MSG_RESULT([dlopen]) ;;
409 static) [WITH_MODULES]="static"; AC_MSG_RESULT([static]) ;;
410 *) AC_MSG_ERROR([${withval}: not a valid module loader]) ;;
411 ],[
412 # if static libraries are enabled, modules must be static
413 if test x$enable_static = xyes; then
414 [WITH_MODULES]="static"
415 else
416 [WITH_MODULES]="yes"]
417 fi)
418
419 # Abort if a broken configuration was required
420 if test x$enable_static = xyes; then
421 if test $WITH_MODULES = no; then
422 :
423 elif test $WITH_MODULES = static; then
424 :
425 else
426 AC_MSG_ERROR([--disable-static must be used with --with-modules])
427 fi
428 fi
429
430 STP_ARG_ENABLE([debug],
431 [turn on debugging in build],
432 [ENABLE_DEBUG],
433 [no])
434
435 STP_ARG_ENABLE([profile],
436 [turn on profiling in build],
437 [ENABLE_PROFILE],
438 [no])
439
440 STP_ARG_WITH_DETAILED([readline], ,
441 [use readline],
442 [(default tries -lncurses, -lcurses, -ltermcap)],
443 [USE_READLINE],
444 [yes],[
445 yes) [USE_READLINE]="yes" ; AC_MSG_RESULT([yes]) ;;
446 no) [USE_READLINE]="no" ; AC_MSG_RESULT([no]) ;;
447 only) [USE_READLINE]="yes"
448 [EXTRA_LIBREADLINE_DEPS]=" "
449 AC_MSG_RESULT([yes (using only readline)]) ;;
450 *) [USE_READLINE]="yes"
451 [EXTRA_LIBREADLINE_DEPS]="${withval}"
452 AC_MSG_RESULT([yes (using extra libraries ${withval})]) ;;
453 ])
454 dnl if test -z "${[EXTRA_LIBREADLINE_DEPS]}" ; then
455 dnl [EXTRA_LIBREADLINE_DEPS]=""
456 dnl fi
457
458 # libusb-1.0 (For CUPS backends, but only bother if CUPS is enabled)
459 AS_IF([test "x$BUILD_CUPS" = "xyes"], [
460 PKG_CHECK_MODULES([LIBUSB], [libusb-1.0],
461 [HAVE_LIBUSB=yes
462 BUILD_LIBUSB_BACKENDS=yes],
463 [HAVE_LIBUSB=no
464 BUILD_LIBUSB_BACKENDS=no])
465 ])
466
467 STP_ARG_ENABLE([user-install],
468 [install GIMP2 plugin in home directory],
469 [USER_INSTALL],
470 [no])
471 if test x$USER_INSTALL = xyes ; then
472 PLUG_IN_PATH="bin"
473 else
474 PLUG_IN_PATH="admin-bin"
475 fi
476
477 AC_PATH_TOOL([GIMPTOOL2_CHECK], [gimptool-2.0 gimptool])
478 if test -z "${GIMPTOOL2_CHECK}" ; then
479 BUILD_GIMP2="no"
480 else
481 # Check we have version 2.0
482 gimptool_check_version=`${GIMPTOOL2_CHECK} --version`
483 dnl Quote to protect sed regexes
484 [gimptool_check_major=`echo "$gimptool_check_version" | sed -e 's/\([0-9][0-9]*\).\([0-9][0-9]*\).\([0-9][0-9]*\).*/\1/'`]
485 [gimptool_check_minor=`echo "$gimptool_check_version" | sed -e 's/\([0-9][0-9]*\).\([0-9][0-9]*\).\([0-9][0-9]*\).*/\2/'`]
486 if test "$gimptool_check_major" -eq 2; then
487 BUILD_GIMP2="yes"
488 if test "$gimptool_check_minor" -ge 4 ; then
489 BUILD_GIMP2_AS_GUTENPRINT="yes"
490 else
491 BUILD_GIMP2_AS_GUTENPRINT="no"
492 fi
493 else
494 BUILD_GIMP2="no"
495 BUILD_GIMP2_AS_GUTENPRINT="no"
496 fi
497 if test x${BUILD_GIMP2} = xyes ; then
498 AC_MSG_CHECKING([for GIMP 2.0 plug-in directory])
499 GIMPTOOL2_OUTPUT=`$GIMPTOOL2_CHECK --dry-run --install-${PLUG_IN_PATH} print | tail -n 1`
500 GIMP2_PLUGIN_DIR=`echo "$GIMPTOOL2_OUTPUT" | cut -d ' ' -f 3 | tr -d "\'"`
501 AC_MSG_RESULT([$GIMP2_PLUGIN_DIR])
502 if test "x$NO_PKGCONFIG_PATHS" = x; then
503 gimp2_plug_indir="${GIMP2_PLUGIN_DIR}"
504 else
505 gimp2_plug_indir="${prefix}/lib/gimp/2.0/plug-ins"
506 fi
507
508 fi
509 fi
510
511 PKG_CHECK_MODULES([GTK2], [gtk+-2.0],
512 [HAVE_GTK2=yes
513 BUILD_LIBGUTENPRINTUI2=yes
514 GUTENPRINTUI2_LIBDEPS="${GUTENPRINTUI2_LIBDEPS} ${GTK2_LIBS}"],
515 [HAVE_GTK2=no
516 BUILD_LIBGUTENPRINTUI2=no])
517 # Require both gimptool and pkg-config to succeed
518 AS_IF([test "x$BUILD_GIMP2" = "xyes"], [
519 PKG_CHECK_MODULES([GIMP2], [gimpui-2.0], [BUILD_GIMP2=yes], [BUILD_GIMP2=no])
520 ])
521
522 STP_ARG_WITH([gimp2],
523 [build GIMP 2.x Print plugin],
524 [BUILD_GIMP2],
525 [(automatic)])
526
527 STP_ARG_WITH([gimp2-as-gutenprint],
528 [name GIMP 2.x Print plugin gutenprint (requires GIMP 2.2; normally used with GIMP 2.4 or above)],
529 [BUILD_GIMP2_AS_GUTENPRINT],
530 [(automatic)])
531
532 STP_ARG_ENABLE([libgutenprintui2],
533 [build Gutenprint GTK+-2.0 user interface library],
534 [BUILD_LIBGUTENPRINTUI2],
535 [(automatic)])
536
537 STP_ARG_ENABLE([samples],
538 [install sample images],
539 [INSTALL_SAMPLES],
540 [yes])
541
542 STP_ARG_ENABLE([escputil],
543 [build escputil],
544 [BUILD_ESCPUTIL],
545 [yes])
546
547 STP_ARG_ENABLE([test],
548 [build test programs],
549 [BUILD_TEST],
550 [yes])
551
552 STP_ARG_WITH([doc],
553 [build Gutenprint documentation],
554 [BUILD_DOC],
555 [yes])
556
557 if test "$BUILD_TEST" = "yes" ; then
558 BUILD_TESTPATTERN="yes"
559 else
560 BUILD_TESTPATTERN="no"
561 fi
562
563 STP_ARG_ENABLE([testpattern],
564 [build testpattern generator],
565 [BUILD_TESTPATTERN],
566 [(automatic)])
567
568 dnl aclocal flags.
569 dnl AM_ACLOCAL_INCLUDE(m4 m4local)
570
571 dnl Checks for programs used in the build process
572 AM_ICONV_LINK
573 AC_SEARCH_LIBS([strerror],[cposix])
574 AC_PROG_AWK
575 AC_PROG_CC
576 AM_PROG_CC_STDC
577 AM_PROG_CC_C_O
578 AC_PROG_INSTALL
579 AC_PROG_LN_S
580 AM_PROG_LEX
581 AC_PROG_YACC
582 AC_PROG_MKDIR_P
583 AC_PATH_PROG([TEST], [test])
584 AC_PATH_PROG([TRUE], [true])
585 AC_PATH_PROG([FIND], [find])
586 AC_PATH_PROG([PERL], [perl])
587 AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
588 AC_PATH_PROG([CONVERT], [convert])
589 AC_PATH_PROG([BASHREAL], [bash])
590 if test x${USE_MAINTAINER_MODE} = xyes ; then
591 if test x${CONVERT} = x ; then
592 AC_MSG_WARN([PostScript developer's guide cannot be regenerated!])
593 fi
594 fi
595 AC_PATH_PROG(TEXI2HTML, texi2html)
596 if test x${USE_MAINTAINER_MODE} = xyes ; then
597 if test x${TEXI2HTML} = x ; then
598 AC_MSG_WARN([HTML documentation cannot be regenerated!])
599 fi
600 fi
601 AC_PATH_PROG(DVIPS, dvips)
602 if test x${USE_MAINTAINER_MODE} = xyes ; then
603 if test x${DVIPS} = x ; then
604 AC_MSG_WARN([PostScript documentation cannot be regenerated!])
605 fi
606 fi
607 AC_PATH_PROG(DB2PDF, db2pdf)
608 if test x${USE_MAINTAINER_MODE} = xyes ; then
609 if test x${DB2PDF} = x ; then
610 AC_MSG_WARN([PDF developer's guide cannot be regenerated!])
611 fi
612 fi
613 AC_PATH_PROGS(DVIPDF, dvipdf dvipdfm)
614 if test x${USE_MAINTAINER_MODE} = xyes ; then
615 if test x${DVIPDF} = x ; then
616 AC_MSG_WARN([PDF documentation cannot be regenerated!])
617 fi
618 fi
619 AC_PATH_PROG(DB2PS, db2ps)
620 if test x${USE_MAINTAINER_MODE} = xyes ; then
621 if test x${DB2PS} = x ; then
622 AC_MSG_WARN([PostScript developer's guide cannot be regenerated!])
623 fi
624 fi
625 AC_PATH_PROG(DB2HTML, db2html)
626 if test x${USE_MAINTAINER_MODE} = xyes ; then
627 if test x${DB2HTML} = x ; then
628 AC_MSG_WARN([HTML developer's guide cannot be regenerated!])
629 fi
630 fi
631 AC_PATH_PROG(DOXYGEN, doxygen)
632 if test x${USE_MAINTAINER_MODE} = xyes ; then
633 if test x${DOXYGEN} = x ; then
634 AC_MSG_WARN([HTML developer's guide cannot be regenerated!])
635 fi
636 fi
637
638 AC_PATH_PROG([XZ], [xz])
639 AC_PATH_PROG([GZIP], [gzip])
640 AC_PATH_PROG([BZIP2], [bzip2])
641 AC_PATH_PROG([LRZIP], [lrzip])
642 AC_PATH_PROG([RZIP], [rzip])
643 AC_PATH_PROG([ZPAQ], [zpaq])
644 AC_PATH_PROG([BASH], [bash])
645 if test x${ZPAQ} != x ; then
646 COMPRESS='$(top_builddir)/scripts/wzpaq -z -q'
647 CSUF=.zpaq
648 elif test x${LRZIP} != x ; then
649 COMPRESS="${LRZIP} -z -q"
650 CSUF=.lrz
651 elif test x${XZ} != x ; then
652 COMPRESS="${XZ} -e -9"
653 CSUF=.xz
654 elif test x${RZIP} != x ; then
655 COMPRESS="${RZIP} -9"
656 CSUF=.rz
657 elif test x${BZIP2} != x ; then
658 COMPRESS="${BZIP2} -9"
659 CSUF=.bz2
660 else
661 COMPRESS="${GZIP} -9"
662 CSUF=.gz
663 fi
664 AC_SUBST(COMPRESS)
665 AC_SUBST(CSUF)
666
667 GUTENPRINT_RELEASE_VERSION=${GUTENPRINT_MAJOR_VERSION}.${GUTENPRINT_MINOR_VERSION}
668 AH_TEMPLATE(GUTENPRINT_RELEASE_VERSION,, [Gutenprint release version])
669 AC_DEFINE_UNQUOTED(GUTENPRINT_RELEASE_VERSION, "${GUTENPRINT_RELEASE_VERSION}")
670 GUTENPRINT_BASE_VERSION=${GUTENPRINT_MAJOR_VERSION}.${GUTENPRINT_MINOR_VERSION}.${GUTENPRINT_MICRO_VERSION}
671 AH_TEMPLATE(GUTENPRINT_BASE_VERSION,, [Gutenprint base version])
672 AC_DEFINE_UNQUOTED(GUTENPRINT_BASE_VERSION, "${GUTENPRINT_BASE_VERSION}")
673
674 PACKAGE_LOCALE_DIR='${prefix}/share/locale'
675
676 PACKAGE_DATA_DIR="${datadir}/${PACKAGE}"
677
678 PACKAGE_LIB_DIR="${libdir}/${PACKAGE}"
679
680 PACKAGE_BIN_DIR="${bindir}"
681
682 PKGXMLDATADIR="${PACKAGE_DATA_DIR}/${GUTENPRINT_RELEASE_VERSION}/xml"
683
684 PKGMODULEDIR="${PACKAGE_LIB_DIR}/${GUTENPRINT_RELEASE_VERSION}/modules"
685
686 dnl Compiler flags
687 if test x$ac_compiler_gnu = "xyes"; then
688 STP_ADD_COMPILER_ARGS([-Wall -Wextra -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Werror=format-security],, [GNUCFLAGS])
689 if test x${USE_MAINTAINER_MODE} = xyes ; then
690 STP_ADD_COMPILER_ARGS([ -Waggregate-return -Wcast-qual -Wshadow -Wredundant-decls -Wstrict-prototypes -Winline],, [GNUCFLAGS])
691 else
692 STP_ADD_COMPILER_ARGS([ -Wno-deprecated-declarations -Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter],, [GNUCFLAGS])
693 fi
694 if test x$ENABLE_DEBUG = xyes ; then
695 STP_ADD_COMPILER_ARG([-g])
696 STP_ADD_COMPILER_ARG([-Og])
697 else
698 STP_ADD_FIRST_COMPILER_ARG([-O3 -O2 -O1 -O])
699 fi
700 else
701 if test x$ENABLE_DEBUG = xyes ; then
702 STP_ADD_COMPILER_ARG([-g])
703 STP_ADD_COMPILER_ARG([-Og])
704 else
705 STP_ADD_FIRST_COMPILER_ARG([-O])
706 fi
707 fi
708 if test x$ENABLE_PROFILE = xyes ; then
709 STP_ADD_COMPILER_ARG([-pg])
710 fi
711
712 # C99 + POSIX extras
713 STP_ADD_COMPILER_ARGS([-D_POSIX_C_SOURCE=200809L -std=c99],, [GNUCFLAGS])
714
715 AC_SUBST(GNUCFLAGS)
716
717 AH_TEMPLATE([HAVE_GCC_ATTRIBUTES],
718 [Define to 1 if GCC special attributes are supported])
719 AC_MSG_CHECKING([if $CC supports __attribute__ syntax])
720 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([typedef struct __attribute__((__packed__)) {
721 unsigned char foo;
722 char bar;
723 long baz;
724 } test_struct_t;],
725 [test_struct_t mystruct;])],
726 [AC_MSG_RESULT([yes])]
727 AC_DEFINE([HAVE_GCC_ATTRIBUTES], 1),
728 [AC_MSG_RESULT([no])])
729
730 AH_VERBATIM([HAVE_GCC_ATTRIBUTES_BOILERPLATE],
731 [#if !defined(HAVE_GCC_ATTRIBUTES) && !defined(__attribute__)
732 /* This should really be a C99 anonymous variadic macro. */
733 #define __attribute__(attr)
734 #endif])
735
736 dnl Checks for libraries.
737 dnl When checking readline, check using extra libraries first.
738 dnl We want to protect against the link somehow succeeding, but only
739 dnl failing at runtime, as seems to happen on some BSD systems.
740 AH_TEMPLATE(HAVE_LIBREADLINE, [Is libreadline present?])
741 if test "$USE_READLINE" = yes ; then
742 if test "$EXTRA_LIBREADLINE_DEPS" = "" ; then
743 unset ac_cv_lib_readline_readline
744 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
745 HAVE_LIBREADLINE=false, -lncurses)
746 if test x${HAVE_LIBREADLINE} = xtrue ; then
747 echo " Using -lreadline -lncurses"
748 EXTRA_LIBREADLINE_DEPS=-lncurses
749 AC_DEFINE(HAVE_LIBREADLINE, [1])
750 else
751 unset ac_cv_lib_readline_readline
752 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
753 HAVE_LIBREADLINE=false, -lcurses)
754 if test x${HAVE_LIBREADLINE} = xtrue ; then
755 echo " Using -lreadline -lcurses"
756 EXTRA_LIBREADLINE_DEPS=-lcurses
757 AC_DEFINE(HAVE_LIBREADLINE, [1])
758 else
759 unset ac_cv_lib_readline_readline
760 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
761 HAVE_LIBREADLINE=false, -ltermcap)
762 if test x${HAVE_LIBREADLINE} = xtrue ; then
763 echo " Using -lreadline -ltermcap"
764 EXTRA_LIBREADLINE_DEPS=-ltermcap
765 AC_DEFINE(HAVE_LIBREADLINE, [1])
766 else
767 unset ac_cv_lib_readline_readline
768 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
769 HAVE_LIBREADLINE=false)
770 if test x${HAVE_LIBREADLINE} = xtrue ; then
771 AC_DEFINE(HAVE_LIBREADLINE, [1])
772 else
773 AC_DEFINE(HAVE_LIBREADLINE, [0])
774 fi
775 fi
776 fi
777 fi
778 else
779 unset ac_cv_lib_readline_readline
780 AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true,
781 HAVE_LIBREADLINE=false, ${EXTRA_LIBREADLINE_DEPS})
782 if test x${HAVE_LIBREADLINE} = xtrue ; then
783 echo " Using -lreadline ${EXTRA_LIBREADLINE_DEPS}"
784 AC_DEFINE(HAVE_LIBREADLINE, [1])
785 else
786 AC_DEFINE(HAVE_LIBREADLINE, [0])
787 fi
788 fi
789 else
790 HAVE_LIBREADLINE=false
791 AC_DEFINE(HAVE_LIBREADLINE, [0])
792 fi
793
794 dnl libltdl, used for dynamic module loading
795 AC_CHECK_LIB(ltdl, lt_dlopen, [LTDL_LIBS="-lltdl"])
796
797 AC_CHECK_LIB(dl, dlopen, [DLOPEN_LIBS="-ldl"])
798
799 AC_CHECK_LIB(m,pow,
800 GUTENPRINT_LIBDEPS="${GUTENPRINT_LIBDEPS} -lm"
801 gutenprint_libdeps="${gutenprint_libdeps} -lm"
802 GUTENPRINTUI2_LIBDEPS="${GUTENPRINTUI2_LIBDEPS} -lm"
803 gutenprintui2_libdeps="${gutenprintui2_libdeps} -lm"
804 LIBM=-lm
805 )
806
807 dnl CUPS stuff
808 STP_CUPS_PATH
809 STP_CUPS_LIBS
810
811 dnl Checks for header files.
812 AC_HEADER_STDC
813 AC_CHECK_HEADERS(getopt.h)
814 AC_CHECK_HEADER(readline/readline.h,
815 HAVE_READLINE_READLINE_H=true,
816 HAVE_READLINE_READLINE_H=false)
817 if test x${HAVE_READLINE_READLINE_H} = xtrue ; then
818 AC_DEFINE(HAVE_READLINE_READLINE_H,, [Define if libreadline header is present.])
819 if test x${HAVE_LIBREADLINE} = xtrue ; then
820 LIBREADLINE_DEPS="-lreadline $EXTRA_LIBREADLINE_DEPS"
821 fi
822 fi
823 AC_CHECK_HEADERS(dlfcn.h, [HAVE_DLFCN_H=true])
824 AC_CHECK_HEADERS(fcntl.h)
825 AC_CHECK_HEADERS(limits.h)
826 AC_CHECK_HEADERS(locale.h)
827 AC_CHECK_HEADERS(ltdl.h, [HAVE_LTDL_H=true])
828 AC_CHECK_HEADERS(stdarg.h stdlib.h string.h)
829 AC_CHECK_HEADERS(sys/time.h sys/types.h)
830 AC_CHECK_HEADERS(time.h)
831 AC_CHECK_HEADERS(unistd.h)
832
833 dnl Checks for typedefs, structures, and compiler characteristics.
834 AC_C_CONST
835 AC_C_INLINE
836 AC_TYPE_OFF_T
837 AC_TYPE_SIZE_T
838
839 dnl Checks for library functions.
840 AC_CHECK_FUNCS([nanosleep poll usleep])
841 AC_CHECK_FUNCS([getopt_long])
842 AC_CHECK_FUNCS([setenv getuid waitpid])
843
844 AC_CHECK_DECLS([strdup, strndup])
845
846 dnl finite() is non-standard, isfinite() is ISO-standard, figure out
847 dnl which to use...
848 AC_SEARCH_LIBS(finite, m, CFLAGS="-Disfinite=finite $CFLAGS")
849
850 dnl Define what has to be built
851 AM_CONDITIONAL(BUILD_CUPS, test x${BUILD_CUPS} = xyes)
852
853 AM_CONDITIONAL(BUILD_CUPS_1_2, test x${BUILD_CUPS_1_2} = xyes)
854
855 AM_CONDITIONAL(BUILD_CUPS_PPDS, test x${BUILD_CUPS_PPDS} = xyes)
856
857 AM_CONDITIONAL(CUPS_PPDS_AT_TOP_LEVEL, test x${CUPS_PPDS_AT_TOP_LEVEL} = xyes)
858
859 AM_CONDITIONAL(BUILD_TRANSLATED_CUPS_PPDS, test x${BUILD_TRANSLATED_CUPS_PPDS} = xyes )
860
861 AM_CONDITIONAL(BUILD_GLOBALIZED_CUPS_PPDS, test x${BUILD_GLOBALIZED_CUPS_PPDS} = xyes )
862
863 AM_CONDITIONAL(BUILD_SIMPLIFIED_CUPS_PPDS, test x${BUILD_SIMPLIFIED_CUPS_PPDS} = xyes)
864
865 if test x${USE_LEVEL3_PS} = xno ; then
866 CUPS_PPD_PS_LEVEL=2
867 else
868 CUPS_PPD_PS_LEVEL=3
869 fi
870
871 AM_CONDITIONAL(USE_LEVEL3_PS, test x${USE_LEVEL3_PS} = xyes)
872
873 AM_CONDITIONAL(BUILD_ESCPUTIL, test x${BUILD_ESCPUTIL} = xyes)
874
875 AM_CONDITIONAL(BUILD_TEST, test x${BUILD_TEST} = xyes)
876
877 AM_CONDITIONAL(BUILD_TESTPATTERN, test x${BUILD_TESTPATTERN} = xyes)
878
879 AM_CONDITIONAL(BUILD_LIBGUTENPRINTUI2, test x${BUILD_LIBGUTENPRINTUI2} = xyes)
880
881 AM_CONDITIONAL(BUILD_GIMP2, test x${BUILD_GIMP2} = xyes)
882
883 AM_CONDITIONAL(BUILD_DOC, test x${BUILD_DOC} = xyes)
884
885 AM_CONDITIONAL(BUILD_GIMP2_AS_GUTENPRINT, test x${BUILD_GIMP2_AS_GUTENPRINT} = xyes)
886
887 AM_CONDITIONAL(INSTALL_SAMPLES, test x${INSTALL_SAMPLES} = xyes)
888
889 AM_CONDITIONAL(INSTALL_USER_GUIDE, test x${INSTALL_USER_GUIDE} = xyes)
890
891 AM_CONDITIONAL(BUILD_LIBUSB_BACKENDS, test x${BUILD_LIBUSB_BACKENDS} = xyes)
892
893
894 # loadable modules
895 # portable sh has no AND test...
896 if test -n "$HAVE_LTDL_H"; then
897 if test -n "$LTDL_LIBS"; then
898 LTDL_POSSIBLE="true"
899 fi
900 fi
901 if test -n "$HAVE_DLFCN_H"; then
902 if test -n "$DLOPEN_LIBS"; then
903 DLOPEN_POSSIBLE="true"
904 fi
905 fi
906
907 # define what the user chose to build, if possible.
908 # Prefer dlopen over ltdl.
909 if test x$WITH_MODULES = xyes; then
910 if test x$DLOPEN_POSSIBLE = xtrue; then
911 USE_DLOPEN="true"
912 elif test x$LDTL_POSSIBLE = xtrue; then
913 USE_LTDL="true"
914 fi
915 elif test x$WITH_MODULES = xltdl; then
916 if test x$LTDL_POSSIBLE = xtrue; then
917 USE_LTDL="true"
918 fi
919 elif test x$WITH_MODULES = xdlopen; then
920 if test x$DLOPEN_POSSIBLE = xtrue; then
921 USE_DLOPEN="true"
922 fi
923 fi
924
925 # The current backends can use dlopen or libltdl
926 if test x$BUILD_LIBUSB_BACKENDS = xyes; then
927 if test x$DLOPEN_POSSIBLE = xtrue; then
928 USE_DLOPEN="true"
929 elif test x$LDTL_POSSIBLE = xtrue; then
930 USE_LTDL="true"
931 fi
932 fi
933
934 # define what module system is to be used
935 AC_MSG_CHECKING([which module system will be used])
936 if test x$USE_LTDL = xtrue; then
937 if test -z "$WITH_MODULES" -o x$WITH_MODULES = xno -o x$WITH_MODULES = xstatic ; then
938 MODULE="false"
939 else
940 MODULE="true"
941 AC_DEFINE(MODULE, "1", [Build a modular libgutenprint])
942 GUTENPRINT_LIBDEPS="${GUTENPRINT_LIBDEPS} ${LTDL_LIBS}"
943 gutenprint_libdeps="${gutenprint_libdeps} ${LTDL_LIBS}"
944 fi
945 LIBUSB_BACKEND_LIBDEPS="${LIBUSB_BACKEND_LIBDEPS} ${LTDL_LIBS}"
946 AC_DEFINE(USE_LTDL, "1", [Use GNU libltdl as module loader])
947 AC_MSG_RESULT([ltdl])
948 elif test x$USE_DLOPEN = xtrue; then
949 if test -z "$WITH_MODULES" -o x$WITH_MODULES = xno -o x$WITH_MODULES = xstatic ; then
950 MODULE="false"
951 else
952 MODULE="true"
953 AC_DEFINE(MODULE, "1", [Build a modular libgutenprint])
954 GUTENPRINT_LIBDEPS="${GUTENPRINT_LIBDEPS} ${DLOPEN_LIBS}"
955 gutenprint_libdeps="${gutenprint_libdeps} ${DLOPEN_LIBS}"
956 fi
957 LIBUSB_BACKEND_LIBDEPS="${LIBUSB_BACKEND_LIBDEPS} ${DLOPEN_LIBS}"
958 AC_DEFINE(USE_DLOPEN, "1", [Use libdl/dlopen as module loader])
959 AC_MSG_RESULT([dlopen])
960 else
961 MODULE="false"
962 AC_MSG_RESULT([static])
963 fi
964 AM_CONDITIONAL(BUILD_MODULES, test x$MODULE = xtrue)
965
966 AM_CONDITIONAL(BUILD_GENPPD_STATIC, test x"$STATIC_GENPPD" = xyes)
967
968 dnl Define LTLIBOBJS
969 AC_CONFIG_COMMANDS_PRE(
970 [LTLIBOBJS=`echo "$LIB@&t@OBJS" | sed 's/\.o/.lo/g'`
971 AC_SUBST(LTLIBOBJS)
972 LTALLOCA=`echo "$ALLOCA" | sed 's/\.o/.lo/g'`
973 AC_SUBST(LTALLOCA)])
974
975 dnl Definitions
976 AC_DEFINE_UNQUOTED(CUPS_DATADIR, "${cups_conf_datadir}", [CUPS data directory.])
977
978 AH_TEMPLATE(CUPS_MODELDIR,, [CUPS PPD file directory])
979 if test "${CUPS_PPDS_AT_TOP_LEVEL}" = yes ; then
980 AC_DEFINE_UNQUOTED(CUPS_MODELDIR, "${cups_conf_datadir}/model/")
981 else
982 AC_DEFINE_UNQUOTED(CUPS_MODELDIR, "${cups_conf_datadir}/model/${PACKAGE}/${GUTENPRINT_RELEASE_VERSION}/")
983 fi
984
985 AC_ARG_WITH(cups_nickname, [ --with-cups-nickname="nickname suffix"
986 Suffix to add to PPD NickName, default=" - CUPS+Gutenprint v"],
987 CUPS_PPD_NICKNAME_STRING="$withval",
988 CUPS_PPD_NICKNAME_STRING=" - CUPS+Gutenprint v")
989
990 AH_TEMPLATE(CUPS_PPD_NICKNAME_STRING,, [CUPS PPD Nickname string])
991 AC_DEFINE_UNQUOTED(CUPS_PPD_NICKNAME_STRING, "$CUPS_PPD_NICKNAME_STRING")
992
993
994 AC_DEFINE_UNQUOTED(CUPS_PPD_PS_LEVEL, ${CUPS_PPD_PS_LEVEL}, [CUPS PPD PostScript level])
995 STP_RELEASE_DATE
996
997 MINIMAL_PRINTERS_TO_TEST="escp2-r1800 escp2-3880 \
998 pcl-g_4 pcl-g_5c pcl-500 \
999 mitsubishi-p95d shinko-chcs2145 kodak-1400 canon-cp910 mitsubishi-9800d \
1000 bjc-s200 bjc-PIXMA-Pro9000mk2 \
1001 datamax_oneil_I4212e \
1002 lexmark-z43"
1003
1004 AC_DEFINE_UNQUOTED(MINIMAL_PRINTERS_TO_TEST, ${MINIMAL_PRINTERS_TO_TEST},
1005 [Printers to test in minimal run])
1006
1007 dnl Some versions of make get very grouchy about $(RM)
1008 RM='rm'
1009
1010 PKGROOT=`pwd`
1011
1012 dnl Substitutions
1013 AC_SUBST(PACKAGE_LOCALE_DIR)
1014 AC_SUBST(PACKAGE_DATA_DIR)
1015 AC_SUBST(PACKAGE_LIB_DIR)
1016 AC_SUBST(PACKAGE_BIN_DIR)
1017 AC_SUBST(PKGXMLDATADIR)
1018 AC_SUBST(PKGMODULEDIR)
1019 AC_SUBST(cups_prefix)
1020 AC_SUBST(cups_exec_prefix)
1021 AC_SUBST(cups_bindir)
1022 AC_SUBST(cups_sbindir)
1023 AC_SUBST(cups_conf_datadir)
1024 AC_SUBST(cups_conf_serverbin)
1025 AC_SUBST(cups_conf_serverroot)
1026 AC_SUBST(CUPS_CFLAGS)
1027 AC_SUBST(CUPS_LIBS)
1028 AC_SUBST(CUPS_PPD_PS_LEVEL)
1029 AC_SUBST(GENPPD_LIBS)
1030 AC_SUBST(RM)
1031 AC_SUBST(GIMP2_CFLAGS)
1032 AC_SUBST(GIMP2_LIBS)
1033 AC_SUBST(gimp2_plug_indir)
1034 AC_SUBST(GUTENPRINT_CFLAGS)
1035 AC_SUBST(GUTENPRINT_LIBS)
1036 AC_SUBST(GUTENPRINT_LIBDEPS)
1037 AC_SUBST(GUTENPRINT_VERSION)
1038 AC_SUBST(GUTENPRINTUI2_CFLAGS)
1039 AC_SUBST(GUTENPRINTUI2_LIBS)
1040 AC_SUBST(GUTENPRINTUI2_LIBDEPS)
1041 AC_SUBST(GUTENPRINTUI2_VERSION)
1042 AC_SUBST(gutenprint_cflags)
1043 gutenprint_libs="${GUTENPRINT_LIBS} ${gutenprint_libdeps}"
1044 AC_SUBST(gutenprint_libs)
1045 AC_SUBST(gutenprint_libdeps)
1046 AC_SUBST(gutenprintui2_cflags)
1047 gutenprintui2_libs="${GUTENPRINTUI2_LIBS} ${gutenprintui2_libdeps}"
1048 AC_SUBST(gutenprintui2_libs)
1049 AC_SUBST(gutenprintui2_libdeps)
1050 AC_SUBST(LIBM)
1051 AC_SUBST(LIBREADLINE_DEPS)
1052 AC_SUBST(MAINTAINER_CFLAGS)
1053 AC_SUBST(WHICH_PPDS)
1054 AC_SUBST(BUILD_CUPS_PPDS)
1055 AC_SUBST(GUTENPRINT_BASE_VERSION)
1056 AC_SUBST(GUTENPRINT_RELEASE_VERSION)
1057 AC_SUBST(LIBUSB_BACKEND_LIBDEPS)
1058 AC_SUBST(PKGROOT)
1059 AC_SUBST(MINIMAL_PRINTERS_TO_TEST)
1060
1061 dnl Optional architecture options to be applied after all autoconf tests
1062 dnl are done...
1063 AC_ARG_WITH(archflags, [ --with-archflags="..." additional options for CFLAGS and LDFLAGS],
1064 CFLAGS="$CFLAGS $withval"
1065 LDFLAGS="$LDFLAGS $withval")
1066
1067 dnl Output files
1068
1069 AC_CONFIG_FILES([Makefile])
1070 AC_CONFIG_FILES([doc/Makefile])
1071 AC_CONFIG_FILES([doc/gutenprint.dox])
1072 AC_CONFIG_FILES([doc/gutenprintui2.dox])
1073 AC_CONFIG_FILES([doc/developer/Makefile])
1074 AC_CONFIG_FILES([include/Makefile])
1075 AC_CONFIG_FILES([include/gutenprint/Makefile])
1076 AC_CONFIG_FILES([include/gutenprintui2/Makefile])
1077 AC_CONFIG_FILES([include/gutenprint/gutenprint-version.h])
1078 AC_CONFIG_FILES([man/Makefile])
1079 AC_CONFIG_FILES([man/cups-calibrate.8])
1080 AC_CONFIG_FILES([man/cups-genppd.8])
1081 AC_CONFIG_FILES([man/cups-genppdupdate.8])
1082 AC_CONFIG_FILES([man/escputil.1])
1083 AC_CONFIG_FILES([po/Makefile.in])
1084 AC_CONFIG_FILES([samples/Makefile])
1085 AC_CONFIG_FILES([src/Makefile])
1086 AC_CONFIG_FILES([src/cups/Makefile])
1087 AC_CONFIG_FILES([src/cups/Info.plist])
1088 CONFIG_FILE_EXEC([src/cups/cups-genppdupdate])
1089 CONFIG_FILE_EXEC([src/cups/test-ppds.test])
1090 CONFIG_FILE_EXEC([src/cups/min-pagesize])
1091 AC_CONFIG_FILES([src/escputil/Makefile])
1092 CONFIG_FILE_EXEC([src/testpattern/compare-image-files])
1093 CONFIG_FILE_EXEC([src/testpattern/run-testpattern])
1094 CONFIG_FILE_EXEC([src/testpattern/run-testpattern-1.test])
1095 CONFIG_FILE_EXEC([src/testpattern/run-testpattern-2])
1096 CONFIG_FILE_EXEC([src/testpattern/run-testpattern-2.test])
1097 CONFIG_FILE_EXEC([src/testpattern/compare-checksums])
1098 CONFIG_FILE_EXEC([src/testpattern/compress-checksums])
1099 CONFIG_FILE_EXEC([src/cups/test-rastertogutenprint])
1100 CONFIG_FILE_EXEC([src/cups/test-rastertogutenprint.test])
1101 AC_CONFIG_FILES([src/testpattern/Makefile])
1102 AC_CONFIG_FILES([src/gimp2/Makefile])
1103 AC_CONFIG_FILES([src/main/Makefile])
1104 AC_CONFIG_FILES([src/main/gutenprint.pc])
1105 AC_CONFIG_FILES([src/xml/Makefile])
1106 AC_CONFIG_FILES([src/xml/dither/Makefile])
1107 AC_CONFIG_FILES([src/xml/papers/Makefile])
1108 AC_CONFIG_FILES([src/xml/printers/Makefile])
1109 AC_CONFIG_FILES([src/xml/escp2/Makefile])
1110 AC_CONFIG_FILES([src/xml/escp2/media/Makefile])
1111 AC_CONFIG_FILES([src/xml/escp2/mediasizes/Makefile])
1112 AC_CONFIG_FILES([src/xml/escp2/model/Makefile])
1113 AC_CONFIG_FILES([src/xml/escp2/model/base/Makefile])
1114 AC_CONFIG_FILES([src/xml/escp2/inputslots/Makefile])
1115 AC_CONFIG_FILES([src/xml/escp2/inks/Makefile])
1116 AC_CONFIG_FILES([src/xml/escp2/weaves/Makefile])
1117 AC_CONFIG_FILES([src/xml/escp2/qualitypresets/Makefile])
1118 AC_CONFIG_FILES([src/xml/escp2/resolutions/Makefile])
1119 AC_CONFIG_FILES([src/gutenprintui2/Makefile])
1120 AC_CONFIG_FILES([src/gutenprintui2/gutenprintui2.pc])
1121 AC_CONFIG_FILES([test/Makefile])
1122 CONFIG_FILE_EXEC([test/compress-5level.sh])
1123 CONFIG_FILE_EXEC([test/compress-6level.sh])
1124 CONFIG_FILE_EXEC([test/uncompress-5level.sh])
1125 CONFIG_FILE_EXEC([test/uncompress-6level.sh])
1126 CONFIG_FILE_EXEC([test/parse-bjc])
1127 CONFIG_FILE_EXEC([test/parse-escp2])
1128 CONFIG_FILE_EXEC([test/run-testdither.test])
1129 CONFIG_FILE_EXEC([test/run-weavetest.test])
1130 CONFIG_FILE_EXEC([test/test-curve.test])
1131 AC_CONFIG_FILES([scripts/Makefile])
1132 CONFIG_FILE_EXEC([scripts/mkgitlog])
1133 CONFIG_FILE_EXEC([scripts/gversion])
1134 CONFIG_FILE_EXEC([scripts/test-gversion])
1135 CONFIG_FILE_EXEC([scripts/wzpaq])
1136 AC_CONFIG_COMMANDS([default], [
1137 echo
1138 ],
1139 [GUTENPRINT_RELEASE_VERSION=${GUTENPRINT_RELEASE_VERSION}]
1140 [GUTENPRINT_BASE_VERSION=${GUTENPRINT_BASE_VERSION}]
1141 )
1142
1143 AC_OUTPUT
1144
1145 warnings_emitted=0
1146 echo
1147 echo "Gutenprint Configuration Summary:" |tee config.summary
1148 echo "---------- ------------- --------" |tee -a config.summary
1149 echo |tee -a config.summary
1150 echo "If you have any problems, please report the information below to" |tee -a config.summary
1151 echo "$PACKAGE_BUGREPORT" |tee -a config.summary
1152 echo |tee -a config.summary
1153 echo "================================================================" |tee -a config.summary
1154 echo " Release: $PACKAGE_STRING generated on $RELEASE_DATE" |tee -a config.summary
1155 DATE_FMT="+%Y-%m-%dT%H:%M:%S+0000"
1156 SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}"
1157 BUILD_DATE=$(date -u -d "@$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u "$DATE_FMT")
1158 echo " Generated at $BUILD_DATE by $LOGNAME" |tee -a config.summary
1159 echo |tee -a config.summary
1160 echo " Features:" |tee -a config.summary
1161 if test "$BUILD_CUPS" != "no" ; then
1162 echo " Build CUPS driver: $BUILD_CUPS, installing in $cups_prefix" |tee -a config.summary
1163 echo " Build CUPS 1.2 enhancements: $BUILD_CUPS_1_2" |tee -a config.summary
1164 echo " Build CUPS PPD files: $BUILD_CUPS_PPDS" |tee -a config.summary
1165 if test "$BUILD_CUPS_PPDS" != "no" ; then
1166 echo " Build translated CUPS PPD files: $BUILD_TRANSLATED_CUPS_PPDS" |tee -a config.summary
1167 echo " Build global CUPS PPD files: $BUILD_GLOBALIZED_CUPS_PPDS" |tee -a config.summary
1168 echo " Build simplified CUPS PPD files: $BUILD_SIMPLIFIED_CUPS_PPDS" |tee -a config.summary
1169 echo " Install CUPS PPDs at top level: $CUPS_PPDS_AT_TOP_LEVEL" |tee -a config.summary
1170 fi
1171 if test "$BUILD_CUPS_PPDS" != "no" -o "$BUILD_CUPS_1_2" != "no" ; then
1172 echo " Generate PS level 3 CUPS PPD files: $USE_LEVEL3_PS" |tee -a config.summary
1173 fi
1174 echo " Build genppd statically: $STATIC_GENPPD" |tee -a config.summary
1175
1176 if test "$STATIC_GENPPD" = "no" ; then
1177 echo " ***WARNING: Use of --disable-static-genppd or --disable-static" |tee -a config.summary
1178 echo " when building CUPS is very dangerous. The build may" |tee -a config.summary
1179 echo " fail when building the PPD files, or may *SILENTLY*" |tee -a config.summary
1180 echo " build incorrect PPD files or cause other problems." |tee -a config.summary
1181 echo " Please review the README and release notes carefully!" |tee -a config.summary
1182 warnings_emitted=1
1183 fi
1184 echo " Build CUPS dyesub USB backend: $BUILD_LIBUSB_BACKENDS" |tee -a config.summary
1185 else
1186 echo " Build CUPS: $BUILD_CUPS" |tee -a config.summary
1187 fi
1188 echo " Build EPSON inkjet utility: $BUILD_ESCPUTIL" |tee -a config.summary
1189 if test "$BUILD_GIMP2" != "no" ; then
1190 echo " Build enhanced Print plugin for GIMP2: yes" |tee -a config.summary
1191 if test "$BUILD_GIMP2_AS_GUTENPRINT" != "no" ; then
1192 echo " GIMP2 plugin will be named: gutenprint" |tee -a config.summary
1193 else
1194 echo " GIMP2 plugin will be named: print" |tee -a config.summary
1195 fi
1196 echo " Install plugin(s) in home directory: $USER_INSTALL" |tee -a config.summary
1197 else
1198 echo " Build enhanced Print plugin for GIMP2: no" |tee -a config.summary
1199 fi
1200 echo " Build test programs: $BUILD_TEST" |tee -a config.summary
1201 echo " Build testpattern generator: $BUILD_TESTPATTERN" |tee -a config.summary
1202 echo |tee -a config.summary
1203 echo " Installation summary:" |tee -a config.summary
1204 echo " Installation prefix: $prefix" |tee -a config.summary
1205 # Configure intentionally does not expand exec_prefix to allow make
1206 # to do so.
1207 echo " Exec prefix: `eval eval echo $exec_prefix` ($exec_prefix)" |tee -a config.summary
1208 echo " Data directory: `eval eval echo $PACKAGE_DATA_DIR` ($PACKAGE_DATA_DIR)" |tee -a config.summary
1209 echo " Library directory: `eval eval echo $PACKAGE_LIB_DIR` ($PACKAGE_LIB_DIR)" |tee -a config.summary
1210 echo " Executable directory: `eval eval echo $PACKAGE_BIN_DIR` ($PACKAGE_BIN_DIR)" |tee -a config.summary
1211 echo " XML data directory: `eval eval echo $PKGXMLDATADIR` ($PKGXMLDATADIR)" |tee -a config.summary
1212 echo " Module directory: `eval eval echo $PKGMODULEDIR` ($PKGMODULEDIR)" |tee -a config.summary
1213 echo " Install sample images: $INSTALL_SAMPLES" |tee -a config.summary
1214 echo |tee -a config.summary
1215 echo " General configuration:" |tee -a config.summary
1216 echo " Configure arguments: $configure_args" |tee -a config.summary
1217 echo " Compiler: $CC" |tee -a config.summary
1218 echo " Compiler Version: `"$CC" -v 2>&1 |grep ' version '`" |tee -a config.summary
1219 if test x$ac_compiler_gnu = "xyes"; then
1220 echo " Compiler options: $CFLAGS $GNUCFLAGS" |tee -a config.summary
1221 else
1222 echo " Compiler options: $CFLAGS" |tee -a config.summary
1223 fi
1224 echo " Build static libraries: $enable_static" |tee -a config.summary
1225 echo " Build shared libraries: $enable_shared" |tee -a config.summary
1226 echo " Maintainer mode: $USE_MAINTAINER_MODE" |tee -a config.summary
1227 echo " Use i18n: $USE_NLS" |tee -a config.summary
1228 echo " Generate profiling information: $ENABLE_PROFILE" |tee -a config.summary
1229 echo " Generate debugging symbols: $ENABLE_DEBUG" |tee -a config.summary
1230 echo " Use modules: $WITH_MODULES" |tee -a config.summary
1231 if test -n "$EXTRA_LIBREADLINE_DEPS" ; then
1232 echo " Use readline libraries: $USE_READLINE, extra arguments: $EXTRA_LIBREADLINE_DEPS" |tee -a config.summary
1233 else
1234 echo " Use readline libraries: $USE_READLINE" |tee -a config.summary
1235 fi
1236 echo " uname -a output: `uname -a`" |tee -a config.summary
1237 echo "================================================================" |tee -a config.summary
1238 if test $warnings_emitted -ne 0 ; then
1239 echo
1240 echo '*** WARNING: Please review the warnings shown above carefully!'
1241 fi
1242 echo |tee -a config.summary
1243 if test "$BUILD_GIMP2" = "no" -o "$BUILD_CUPS" = "no" ; then
1244 echo "VERY IMPORTANT:" |tee -a config.summary
1245 echo "If you expect to build the CUPS driver or the enhanced Print plugin for" |tee -a config.summary
1246 echo "GIMP, but the output above indicates that that component will not be built," |tee -a config.summary
1247 echo "it almost certainly indicates that development packages required to build" |tee -a config.summary
1248 echo "that component are not installed on your system. Please read the README" |tee -a config.summary
1249 echo "file and install the necessary development packages before reporting any" |tee -a config.summary
1250 echo "error to the development team. Depending upon your operating system version," |tee -a config.summary
1251 echo "you may have to install packages from the installation medium or over" |tee -a config.summary
1252 echo "the network." |tee -a config.summary
1253 echo |tee -a config.summary
1254 fi
1255 echo "Finished configuring. Please review CAREFULLY the configuration summary above."
1256 echo "This summary is also stored in config.summary"
1257 echo "Type 'make clean' followed by 'make' to build the package"
1258 echo "then 'make install' to install it."