~ubuntu-branches/ubuntu/utopic/inkscape/utopic-proposed

1.1.1 by Guido Guenther
Import upstream version 0.43
1
dnl Process this file with autoconf to produce a configure script.
2
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
3
AC_PREREQ(2.53)
4
5
# Always use 0.xx+devel instead of 0.xxdevel for the version, e.g. 0.46+devel.
6
# Rationale: (i) placate simple version comparison software such as
7
# `dpkg --compare-versions'.  (ii) We don't always know what the next
8
# version is going to be called until about the time we release it
9
# (whereas we always know what the previous version was called).
1.6.4 by Alexander Valavanis
Import upstream version 0.48.4
10
AC_INIT(inkscape, 0.48.4)
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
11
1.1.1 by Guido Guenther
Import upstream version 0.43
12
AC_CANONICAL_HOST
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
13
AC_CONFIG_SRCDIR([src/main.cpp])
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
14
AM_INIT_AUTOMAKE([dist-zip dist-bzip2 tar-pax])
1.1.1 by Guido Guenther
Import upstream version 0.43
15
1.1.4 by Sebastien Bacher
Import upstream version 0.45
16
AC_ARG_ENABLE([lsb], AS_HELP_STRING([--enable-lsb], [LSB-compatible build configuration]), [
17
  prefix=/opt/inkscape
18
  PATH="/opt/lsb/bin:$PATH"
19
  CC=lsbcc
20
  CXX=lsbc++
21
  export CC CXX
22
])
23
1.1.1 by Guido Guenther
Import upstream version 0.43
24
AM_CONFIG_HEADER(config.h)
25
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
26
AC_LANG(C++)
27
AC_ISC_POSIX
28
AC_PROG_CXX
29
AM_PROG_CC_STDC
30
AM_PROG_AS
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
31
AC_PROG_RANLIB
32
AC_PROG_INTLTOOL(0.22)
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
33
AC_HEADER_STDC
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
34
INK_BZR_SNAPSHOT_BUILD
35
36
dnl If automake 1.11 shave the output to look nice
37
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
38
1.1.1 by Guido Guenther
Import upstream version 0.43
39
dnl These next few lines are needed only while libcroco is in our source tree.
40
AC_PROG_CC
41
AM_PROG_CC_C_O
42
if test "$GCC" = "yes"; then
43
  # Enable some warnings from gcc.
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
44
  AC_LANG_PUSH(C)
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
45
46
  ####
47
  # Generic cpp flags...
48
49
  # What is just plain "-W" ?
50
  # Fortify source requires -O2 or higher, which is handled with newer autoconf
51
  CPPFLAGS="-W -D_FORTIFY_SOURCE=2 $CPPFLAGS"
52
  # Enable format and format security warnings
53
  CPPFLAGS="-Wformat -Wformat-security $CPPFLAGS"
54
  # Enable all default warnings
55
  CPPFLAGS="-Wall $CPPFLAGS"
1.6.2 by Alex Valavanis
Import upstream version 0.48.3
56
  # Enforce including only <glib.h> (required since 2.31)
1.6.3 by Alex Valavanis
Import upstream version 0.48.3.1
57
  PKG_CHECK_MODULES(NEW_GLIBMM, glibmm-2.4 >= 2.28, new_glibmm=yes,
58
new_glibmm=no)
59
  if test "x$new_glibmm" = "xyes"; then
60
    CPPFLAGS="-DG_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
61
  fi
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
62
63
  # Test for -Werror=... (introduced some time post-4.0)
64
  # If we hit a format error -- it should be fatal.
65
  AC_MSG_CHECKING([compiler support for -Werror=format-security])
66
  ink_svd_CPPFLAGS="$CPPFLAGS"
67
  CPPFLAGS="-Werror=format-security $CPPFLAGS"
68
  AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), [ink_opt_ok=yes], [ink_opt_ok=no])
69
  AC_MSG_RESULT([$ink_opt_ok])
70
  if test "x$ink_opt_ok" != "xyes"; then
71
    CPPFLAGS="$ink_svd_CPPFLAGS"
72
  fi
73
74
  ####
75
  # C-specific flags...
76
1.1.1 by Guido Guenther
Import upstream version 0.43
77
  # -Wno-pointer-sign is probably new in gcc 4.0; certainly it isn't accepted
78
  # by gcc 2.95.
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
79
  AC_MSG_CHECKING([compiler support for -Wno-pointer-sign])
1.1.1 by Guido Guenther
Import upstream version 0.43
80
  ink_svd_CFLAGS="$CFLAGS"
81
  CFLAGS="-Wno-pointer-sign $CFLAGS"
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
82
  AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), [ink_opt_ok=yes], [ink_opt_ok=no])
83
  AC_MSG_RESULT([$ink_opt_ok])
84
  if test "x$ink_opt_ok" != "xyes"; then
85
    CFLAGS="$ink_svd_CFLAGS"
86
  fi
87
88
  ####
89
  # Linker flags...
90
91
  # Have linker produce read-only relocations, if it knows how
92
  AC_MSG_CHECKING([linker tolerates -z relro])
93
  ink_svd_LDFLAGS="$LDFLAGS"
94
  LDFLAGS="-Wl,-z,relro $LDFLAGS"
95
  AC_LINK_IFELSE(AC_LANG_PROGRAM([]), [ink_opt_ok=yes], [ink_opt_ok=no])
96
  AC_MSG_RESULT([$ink_opt_ok])
97
  if test "x$ink_opt_ok" != "xyes"; then
98
    LDFLAGS="$ink_svd_LDFLAGS"
99
  fi
100
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
101
  AC_LANG_POP
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
102
103
  # C++-specific flags are defined further below.  Look for CXXFLAGS...
1.1.1 by Guido Guenther
Import upstream version 0.43
104
fi
105
106
dnl Honor aclocal flags
107
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
108
109
dnl Verify our GCC version
110
if test "x$GXX" = "xyes"; then
111
	AC_MSG_CHECKING([GNU compiler version])
112
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
113
	# Don't pass CXXFLAGS to the following CXX command as some 
114
	# of them can't be specified along with '-v'.
115
	cc_version=["`$CXX -v 2>&1 </dev/null |grep 'gcc version' |\
1.1.1 by Guido Guenther
Import upstream version 0.43
116
		sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`"]
117
118
	AC_MSG_RESULT([$cc_version])
119
120
	# Some version numbers
121
	cc_vers_major=`echo $cc_version | cut -f1 -d.`
122
	cc_vers_minor=`echo $cc_version | cut -f2 -d.`
123
	cc_vers_patch=`echo $cc_version | cut -f3 -d.`
124
	test -n "$cc_vers_major" || cc_vers_major=0
125
	test -n "$cc_vers_minor" || cc_vers_minor=0
126
	test -n "$cc_vers_patch" || cc_vers_patch=0
127
	cc_vers_all=`expr $cc_vers_major '*' 1000000 + $cc_vers_minor '*' 1000 + $cc_vers_patch`
128
129
	if test $cc_vers_major -lt 3; then
130
		AC_MSG_ERROR([gcc >= 3.0 is needed to compile inkscape])
131
	fi
132
fi
133
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
134
# Detect a working version of unordered containers.
135
AC_MSG_CHECKING([TR1 unordered_set usability])
136
AC_COMPILE_IFELSE([
137
#include <tr1/unordered_set>
138
int main() {
139
  std::tr1::unordered_set<int> i, j;
140
  i = j;
141
  return 0;
142
}
143
], [unordered_set_works=yes], [unordered_set_works=no])
144
if test "x$unordered_set_works" = "xyes"; then
145
	AC_MSG_RESULT([ok])
146
	AC_DEFINE(HAVE_TR1_UNORDERED_SET, 1, [Has working standard TR1 unordered_set])
147
else
148
	AC_MSG_RESULT([not working])
149
fi
150
AC_CHECK_HEADER([boost/unordered_set.hpp], [AC_DEFINE(HAVE_BOOST_UNORDERED_SET, 1, [Boost unordered_set (Boost >= 1.36)])], [])
151
AC_CHECK_HEADER([ext/hash_set], [AC_DEFINE(HAVE_EXT_HASH_SET, 1, [Legacy GNU ext/hash_set])], [])
152
153
# Test whether GCC emits a spurious warning when using boost::optional
154
# If yes, turn off strict aliasing warnings to reduce noise
155
# and allow the legitimate warnings to stand out
156
AC_MSG_CHECKING([for overzealous strict aliasing warnings])
157
ignore_strict_aliasing=no
158
CXXFLAGS_SAVE=$CXXFLAGS
159
CXXFLAGS="$CXXFLAGS -Werror=strict-aliasing"
160
AC_COMPILE_IFELSE([
161
#include <boost/optional.hpp>
162
boost::optional<int> x;
163
int func() {
164
  return *x;
165
}
166
], [ignore_strict_aliasing=no], [ignore_strict_aliasing=yes])
167
AC_MSG_RESULT($ignore_strict_aliasing)
168
CXXFLAGS=$CXXFLAGS_SAVE
169
if test "x$ignore_strict_aliasing" = "xyes"; then
170
  CXXFLAGS="$CXXFLAGS -Wno-strict-aliasing"
171
fi
172
1.1.1 by Guido Guenther
Import upstream version 0.43
173
dnl ******************************
174
dnl Gettext stuff
175
dnl ******************************
176
GETTEXT_PACKAGE="AC_PACKAGE_NAME"
177
AC_SUBST(GETTEXT_PACKAGE)
178
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Translation domain used])
179
dnl Add the languages which your application supports here.
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
180
ALL_LINGUAS="am ar az be bg bn br ca ca@valencia cs da de dz el en_AU en_CA en_GB en_US@piglatin eo es_MX es et eu fa fi fr ga gl he hr hu hy id it ja km ko lt mk mn nb ne nl nn pa pl pt_BR pt ro ru rw sk sl sq sr@latin sr sv te_IN th tr uk vi zh_CN zh_TW"
1.1.1 by Guido Guenther
Import upstream version 0.43
181
AM_GLIB_GNU_GETTEXT
182
183
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
184
if test "x$PKG_CONFIG" = "xno"; then
185
	AC_MSG_ERROR(You have to install pkg-config to compile inkscape.)
186
fi
187
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
188
dnl Find msgfmt.  Without this, po/Makefile fails to set MSGFMT on some platforms.
189
AC_PATH_PROG(MSGFMT, msgfmt, msgfmt)
190
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
191
1.2.1 by Wolfram Quester
Import upstream version 0.44.1
192
dnl ******************************
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
193
dnl Check for OpenMP 
194
dnl Replace this with AC_OPENMP once Autoconf 2.62 is widespread
195
dnl ******************************
196
AX_OPENMP([openmp_ok=yes],[openmp_ok=no])
197
if test "x$openmp_ok" = "xyes"; then
198
	dnl We have it, now set up the flags
199
	CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS"
200
	AC_CHECK_HEADER(omp.h)
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
201
	AC_DEFINE(HAVE_OPENMP, 1, [Use OpenMP])
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
202
fi
203
204
dnl ******************************
1.2.1 by Wolfram Quester
Import upstream version 0.44.1
205
dnl Check for libpng 
206
dnl ******************************
1.1.10 by Kees Cook
Import upstream version 0.47~pre4
207
AC_CHECK_LIB(png, png_read_info, [AC_CHECK_HEADER(png.h, png_ok=yes, png_ok=yes)], png_ok=no, -lz -lm)
1.1.1 by Guido Guenther
Import upstream version 0.43
208
if test "x$png_ok" != "xyes"; then
209
	AC_MSG_ERROR([libpng >= 1.2 is needed to compile inkscape])
210
fi
211
212
dnl Handle possible dlopen requirement for libgc
213
dnl Isn't this internal to something in autoconf?  Couldn't find it...
214
AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen],
215
          [lt_cv_dlopen="dlopen"],
216
      [AC_CHECK_LIB([dl], [dlopen],
217
            [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
218
        [AC_CHECK_LIB([svld], [dlopen],
219
              [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
220
          [AC_CHECK_LIB([dld], [dld_link],
221
                [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
222
          ])
223
        ])
224
      ])
225
    ])
226
227
AC_CHECK_HEADERS([gc.h gc/gc.h],
228
                 [
229
		    # To test for the different required libs, I have to
230
		    # overcome autoconf's caching system, so I change the
231
		    # desired function name.  They're all in libgc.
232
		    # The "break" will exit from the top level
233
                    # AC_CHECK_HEADERS.
234
		    gc_libs=""
235
		    AC_CHECK_LIB(gc, GC_init,
236
                                 [gc_ok=yes;
237
				  LIBS="-lgc $gc_libs $LIBS";
238
				  break], [gc_ok=no], [$gc_libs])
239
		    gc_libs="-lpthread"
240
		    AC_CHECK_LIB(gc, GC_malloc,
241
                                 [gc_ok=yes;
242
				  LIBS="-lgc $gc_libs $LIBS";
243
                                  break], [gc_ok=no], [$gc_libs])
244
		    gc_libs="$lt_cv_dlopen_libs"
245
		    AC_CHECK_LIB(gc, GC_realloc,
246
                                 [gc_ok=yes;
247
				  LIBS="-lgc $gc_libs $LIBS";
248
                                  break], [gc_ok=no], [$gc_libs])
249
		    gc_libs="-lpthread $lt_cv_dlopen_libs"
250
		    AC_CHECK_LIB(gc, GC_free,
251
                                 [gc_ok=yes;
252
				  LIBS="-lgc $gc_libs $LIBS";
253
				  break], [gc_ok=no], [$gc_libs])
254
		    break],
255
                 [gc_ok=no])
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
256
if test "x$gc_ok" = "xyes" && test "x$cross_compiling" = "xno" ; then 
1.1.1 by Guido Guenther
Import upstream version 0.43
257
	AC_MSG_CHECKING([libgc version 6.4+])
258
	AC_RUN_IFELSE(
259
		[AC_LANG_SOURCE([[
260
			#ifdef HAVE_GC_GC_H
261
			# include <gc/gc.h>
262
			#else
263
			# include <gc.h>
264
			#endif
265
			#include <stdio.h>
266
			extern unsigned GC_version;
267
			int main(void){
268
				unsigned min = ((6 << 16) | (4 << 8) | 0);
269
				printf("%d.%d.%d ",GC_version >> 16, (GC_version >> 8) & 0xFF, GC_version & 0xFF);
270
				if (GC_version>=min) return 0;
271
				return 1;
272
			}]])],
273
		[gc_ok=yes],
274
		[gc_ok=no]
275
	)
276
	AC_MSG_RESULT([$gc_ok])
277
fi
278
if test "x$gc_ok" != "xyes"; then
279
	AC_MSG_ERROR([libgc (the Boehm Conservative Collector) 6.4+, is needed to compile inkscape -- http://www.hpl.hp.com/personal/Hans_Boehm/gc])
280
fi
281
1.2.1 by Wolfram Quester
Import upstream version 0.44.1
282
dnl This check is to get a FIONREAD definition on Solaris 8
283
AC_CHECK_HEADERS([sys/filio.h])
284
285
1.1.1 by Guido Guenther
Import upstream version 0.43
286
AC_CHECK_HEADERS([malloc.h])
287
AC_CHECK_FUNCS([mallinfo], [
288
	AC_CHECK_MEMBERS([struct mallinfo.usmblks,
289
			  struct mallinfo.fsmblks,
290
			  struct mallinfo.uordblks,
291
			  struct mallinfo.fordblks,
292
			  struct mallinfo.hblkhd],,,
293
			 [#include <malloc.h>])
294
])
295
296
AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
297
if test "x$FREETYPE_CONFIG" = "xno"; then
298
	AC_MSG_ERROR([Cannot find freetype-config])
299
fi
300
FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
301
FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
302
AC_SUBST(FREETYPE_CFLAGS)
303
AC_SUBST(FREETYPE_LIBS)
304
305
dnl ******************************
306
dnl Win32
307
dnl ******************************
308
AC_MSG_CHECKING([for Win32 platform])
309
case "$host" in
310
  *-*-mingw*)
311
    platform_win32=yes
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
312
    WIN32_CFLAGS="-mms-bitfields -DLIBXML_STATIC"
1.1.1 by Guido Guenther
Import upstream version 0.43
313
    ;;
314
  *)
315
    platform_win32=no
316
    ;;
317
esac
318
AC_MSG_RESULT([$platform_win32])
319
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
320
AC_SUBST(WIN32_CFLAGS)
1.1.1 by Guido Guenther
Import upstream version 0.43
321
1.6.1 by Alex Valavanis
Import upstream version 0.48.2
322
dnl ******************************
323
dnl MacOS X
324
dnl ******************************
325
AC_MSG_CHECKING([for OSX platform])
326
if test "x$build_vendor" = "xapple" ; then
327
  platform_osx=yes
328
else
329
  platform_osx=no
330
fi
331
AC_MSG_RESULT([$platform_osx])
332
AM_CONDITIONAL(PLATFORM_OSX, test "$platform_osx" = "yes")
333
	
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
334
AC_MSG_CHECKING([for Solaris platform])
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
335
case "$host" in
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
336
  *-solaris2.*)
337
    platform_solaris=yes
338
    solaris_version=`echo $host|sed -e 's/^.*-solaris2\.//' -e s'/\..*$//'`
339
    CFLAGS="$CFLAGS -DSOLARIS=$solaris_version"
340
    CXXFLAGS="$CXXFLAGS -DSOLARIS=$solaris_version"
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
341
    ;;
342
  *)
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
343
    platform_solaris=no
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
344
    ;;
345
esac
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
346
AC_MSG_RESULT([$platform_solaris])
347
AM_CONDITIONAL(PLATFORM_SOLARIS, test "$platform_solaris" = "yes")
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
348
1.1.1 by Guido Guenther
Import upstream version 0.43
349
dnl ******************************
350
dnl gnome vfs checking
351
dnl ******************************
352
353
AC_ARG_WITH(gnome-vfs,
354
	AC_HELP_STRING([--with-gnome-vfs], [use gnome vfs for loading files]),
355
	[with_gnome_vfs=$withval], [with_gnome_vfs=auto])
356
357
if test "x$with_gnome_vfs" = "xno"; then
358
	dnl Asked to ignore gnome-vfs
359
	gnome_vfs=no
360
else
361
        dnl Have to test gnome-vfs presence
362
	PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= 2.0, gnome_vfs=yes, gnome_vfs=no)
363
	if test "x$gnome_vfs" != "xyes"; then
364
	        dnl No gnome-vfs found
365
		if test "x$with_gnome_vfs" = "xyes"; then
366
		        dnl Gnome-VFS was explicitly asked for, so stop
367
			AC_MSG_ERROR([--with-gnome-vfs was specified, but appropriate libgnomevfs development packages could not be found])
368
		else
369
			# gnome-vfs is no, tell us for the log file
370
			AC_MSG_RESULT($gnome_vfs)
371
		fi
372
	fi
373
fi
374
375
AM_CONDITIONAL(USE_GNOME_VFS, test "x$gnome_vfs" = "xyes")
376
if test "x$gnome_vfs" = "xyes"; then
377
	AC_DEFINE(WITH_GNOME_VFS, 1, [Use gnome vfs file load functionality])
378
fi
379
380
AC_SUBST(GNOME_VFS_CFLAGS)
381
AC_SUBST(GNOME_VFS_LIBS)
382
383
dnl ******************************
384
dnl libinkjar checking
385
dnl ******************************
386
387
AC_ARG_WITH(inkjar,
388
	AC_HELP_STRING([--without-inkjar], [disable openoffice files (SVG jars)]),[with_ij=$withval], [with_ij=yes])
389
390
if test "x$with_ij" = "xyes"; then
391
	AC_DEFINE(WITH_INKJAR, 1, [enable openoffice files (SVG jars)])
392
	AC_C_BIGENDIAN
393
	AC_CHECK_HEADERS(zlib.h)
394
	ij=yes
395
else
396
	ij=no
397
fi
398
AM_CONDITIONAL(INKJAR, test "$with_ij" = "yes")
399
400
ink_spell_pkg=
401
if pkg-config --exists gtkspell-2.0; then
402
	ink_spell_pkg=gtkspell-2.0
403
	AC_DEFINE(WITH_GTKSPELL, 1, [enable gtk spelling widget])
404
fi
405
406
dnl ******************************
407
dnl PERL checking
408
dnl ******************************
409
410
AC_MSG_CHECKING(for Perl development environment)
411
AC_ARG_WITH(perl,
1.1.2 by Martin Pitt
Import upstream version 0.44
412
            AC_HELP_STRING([--with-perl], [use Perl for embedded scripting (EXPERIMENTAL)]),
1.1.1 by Guido Guenther
Import upstream version 0.43
413
            [with_perl=$withval], [with_perl=skipped])
414
415
if test "x$with_perl" = "xyes"; then
416
    checkPERL_CFLAGS=`perl -MExtUtils::Embed -e perl_inc 2>/dev/null`
417
    if test "$?" -gt "0"; then
418
        with_perl="no"
419
    else
1.1.4 by Sebastien Bacher
Import upstream version 0.45
420
        checkPERL_LIBS=`perl -MExtUtils::Embed -e ldopts 2>/dev/null`
1.1.1 by Guido Guenther
Import upstream version 0.43
421
        if test "$?" -gt "0"; then
422
            with_perl="no"
423
        else
424
            with_perl="yes"
425
        fi
426
    fi
427
fi
428
AC_MSG_RESULT([$with_perl])
429
if test "x$with_perl" = "xyes"; then
430
    # Test that we actually have the perl libraries installed
431
    oldCFLAGS="$CFLAGS"
1.1.4 by Sebastien Bacher
Import upstream version 0.45
432
    oldLIBS="$LIBS"
1.1.1 by Guido Guenther
Import upstream version 0.43
433
    CFLAGS="$CFLAGS $checkPERL_CFLAGS"
1.1.4 by Sebastien Bacher
Import upstream version 0.45
434
    LIBS="$LIBS $checkPERL_LIBS"
1.1.1 by Guido Guenther
Import upstream version 0.43
435
    AC_CHECK_FUNC([perl_parse],[
436
	PERL_CFLAGS="$checkPERL_CFLAGS"
1.1.4 by Sebastien Bacher
Import upstream version 0.45
437
	PERL_LIBS="$checkPERL_LIBS"
1.1.1 by Guido Guenther
Import upstream version 0.43
438
        AC_DEFINE(WITH_PERL, 1, [use Perl for embedded scripting])
439
        ],[
440
	with_perl="no"
441
	])
442
    CFLAGS="$oldCFLAGS"
1.1.4 by Sebastien Bacher
Import upstream version 0.45
443
    LIBS="$oldLIBS"
1.1.1 by Guido Guenther
Import upstream version 0.43
444
fi
445
AM_CONDITIONAL(WITH_PERL, test "x$with_perl" = "xyes")
446
AC_SUBST(PERL_CFLAGS)
1.1.4 by Sebastien Bacher
Import upstream version 0.45
447
AC_SUBST(PERL_LIBS)
1.1.1 by Guido Guenther
Import upstream version 0.43
448
449
dnl ******************************
450
dnl Python checking
451
dnl ******************************
452
453
AC_MSG_CHECKING(for Python development environment)
454
AC_ARG_WITH(python,
1.1.2 by Martin Pitt
Import upstream version 0.44
455
            AC_HELP_STRING([--with-python], [use Python for embedded scripting (EXPERIMENTAL)]),
1.1.1 by Guido Guenther
Import upstream version 0.43
456
            [with_python=$withval], [with_python=skipped])
457
458
if test "x$with_python" = "xyes"; then
459
    checkPYTHON_CFLAGS=`python -c "import distutils.sysconfig ; print '-I%s' % distutils.sysconfig.get_config_var('INCLUDEPY')" 2>/dev/null`
460
    if test "$?" -gt "0"; then
461
        with_python="no"
462
    else
1.1.4 by Sebastien Bacher
Import upstream version 0.45
463
        checkPYTHON_LIBS=`python -c "import distutils.sysconfig ; print '%s/%s %s' % (distutils.sysconfig.get_config_var('LIBPL'),distutils.sysconfig.get_config_var('LDLIBRARY'),distutils.sysconfig.get_config_var('LIBS'))" 2>/dev/null`
1.1.1 by Guido Guenther
Import upstream version 0.43
464
        if test "$?" -gt "0"; then
465
            with_python="no"
466
        else
467
            with_python="yes"
468
        fi
469
    fi
470
fi
471
AC_MSG_RESULT([$with_python])
472
if test "x$with_python" = "xyes"; then
473
    # Test that we actually have the python libraries installed
474
    oldCFLAGS="$CFLAGS"
475
    oldLIBS="$LIBS"
476
    CFLAGS="$CFLAGS $checkPYTHON_CFLAGS"
477
    LIBS="$LIBS $checkPYTHON_LIBS"
478
    AC_CHECK_FUNC([Py_Initialize],[
479
	PYTHON_CFLAGS="$checkPYTHON_CFLAGS"
480
	PYTHON_LIBS="$checkPYTHON_LIBS"
481
        AC_DEFINE(WITH_PYTHON, 1, [use Python for embedded scripting])
482
        ],[
483
	with_python="no"
484
	])
485
    CFLAGS="$oldCFLAGS"
486
    LIBS="$oldLIBS"
487
fi
488
AM_CONDITIONAL(WITH_PYTHON, test "x$with_python" = "xyes")
489
AC_SUBST(PYTHON_CFLAGS)
490
AC_SUBST(PYTHON_LIBS)
491
492
dnl ******************************
1.1.2 by Martin Pitt
Import upstream version 0.44
493
dnl LittleCms checking
494
dnl ******************************
495
496
AC_ARG_ENABLE(lcms,
497
	AC_HELP_STRING([--enable-lcms], [enable LittleCms for color management]),
498
	[enable_lcms=$enableval], [enable_lcms=yes])
499
500
if test "x$enable_lcms" = "xno"; then
1.6.2 by Alex Valavanis
Import upstream version 0.48.3
501
    # Asked to ignore LittleCms
502
    lcms=no
503
    have_lcms2=no
1.1.2 by Martin Pitt
Import upstream version 0.44
504
else
1.6.2 by Alex Valavanis
Import upstream version 0.48.3
505
    # Have to test LittleCms presence
506
    if test "x${platform_osx}" != "xyes"; then
507
       # lcms 2.2 & 2.3 have problems on OSX
508
	PKG_CHECK_MODULES(LCMS2, lcms2, have_lcms2="yes", have_lcms2="no")
509
    fi
510
511
    if test "x${have_lcms2}" = "xyes"; then
512
        LIBS="$LIBS $LCMS2_LIBS"
513
        AC_DEFINE(HAVE_LIBLCMS2, 1, [define to 1 if you have lcms version 2.x])
514
	AC_SUBST(LCMS2_CFLAGS)
515
	AC_SUBST(LCMS2_LIBS)
516
    else
517
        PKG_CHECK_MODULES(LCMS, lcms >= 1.13, lcms=yes, lcms=no)
518
        if test "x$lcms" = "xyes"; then
519
            LIBS="$LIBS $LCMS_LIBS"
520
            AC_DEFINE(HAVE_LIBLCMS1, 1, [define to 1 if you have lcms version 1.x])
521
	    AC_SUBST(LCMS_CFLAGS)
522
	    AC_SUBST(LCMS_LIBS)
523
        else
524
            # No lcms found. LittleCms was explicitly asked for, so stop
525
            AC_MSG_ERROR([--enable-lcms was specified, but appropriate LittleCms development packages could not be found])
526
        fi
527
    fi
1.1.2 by Martin Pitt
Import upstream version 0.44
528
fi
529
530
dnl ******************************
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
531
dnl Libpoppler checking
532
dnl ******************************
533
534
AC_ARG_ENABLE(poppler-cairo,
535
	AC_HELP_STRING([--enable-poppler-cairo], [Enable libpoppler-cairo for rendering PDF preview]),
536
	[enable_poppler_cairo=$enableval], [enable_poppler_cairo=yes])
537
538
POPPLER_CFLAGS=""
539
PKG_CHECK_MODULES(POPPLER, poppler >= 0.5.9, poppler=yes, poppler=no)
540
541
if test "x$poppler" = "xyes"; then
542
	dnl Working libpoppler
543
	dnl Have to test libpoppler-glib presence
544
	PKG_CHECK_MODULES(POPPLER_GLIB, poppler-glib >= 0.5.9, poppler_glib=yes, poppler_glib=no)
545
	if test "x$poppler_glib" = "xyes"; then
546
		dnl Working libpoppler-glib found
547
		dnl Check whether the Cairo SVG backend is available
548
		PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, cairo_svg=yes, cairo_svg=no)
549
		if test "x$cairo_svg" = "xyes"; then
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
550
			POPPLER_LIBS="$POPPLER_LIBS $POPPLER_GLIB_LIBS "
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
551
		fi
552
	fi
553
	if test "x$enable_poppler_cairo" = "xyes"; then
554
		dnl Have to test libpoppler-cairo presence for PDF preview
555
		dnl AC_CHECK_HEADER(Magick++.h, magick_ok=yes, magick_ok=no)
556
		PKG_CHECK_MODULES(POPPLER_CAIRO, poppler-cairo >= 0.5.9, poppler_cairo=yes, poppler_cairo=no)
557
		if test "x$poppler_glib" = "xyes" -a "x$poppler_cairo" = "xyes" -a \
558
			"x$cairo_svg" = "xno"
559
		then
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
560
			POPPLER_LIBS="$POPPLER_LIBS $POPPLER_CAIRO_LIBS "
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
561
		fi
562
	fi
563
fi
564
565
if test "x$poppler" = "xyes"; then
566
	LIBS="$LIBS $POPPLER_LIBS"
567
	AC_DEFINE(HAVE_POPPLER, 1, [Use libpoppler for direct PDF import])
568
fi
569
if test "x$poppler_cairo" = "xyes" -a "x$poppler_glib" = "xyes"; then
570
	AC_DEFINE(HAVE_POPPLER_CAIRO, 1, [Use libpoppler-cairo for rendering PDF preview])
571
fi
572
if test "x$poppler_glib" = "xyes" -a "x$cairo_svg" = "xyes"; then
573
	AC_DEFINE(HAVE_POPPLER_GLIB, 1, [Use libpoppler-glib and Cairo-SVG for PDF import])
574
fi
575
AC_SUBST(POPPLER_CFLAGS)
576
AC_SUBST(POPPLER_LIBS)
577
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
578
PKG_CHECK_MODULES(POPPLER_GFXFONT, poppler >= 0.8.3, popplernew=yes, popplernew=no)
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
579
if test "x$popplernew" = "xyes"; then
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
580
	AC_DEFINE(POPPLER_NEW_GFXFONT, 1, [Use GfxFont from Poppler >= 0.8.3])
581
fi
582
1.6.4 by Alexander Valavanis
Import upstream version 0.48.4
583
PKG_CHECK_MODULES(POPPLER_NEWERRORAPI, poppler >= 0.20.0, popplernewerror=yes, popplernewerror=no)
584
if test "x$popplernewerror" = "xyes"; then
585
	AC_DEFINE(POPPLER_NEW_ERRORAPI, 1, [Use new error API from Poppler >= 0.20.0])
586
fi
587
588
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
589
ink_svd_CPPFLAGS=$CPPFLAGS
590
ink_svd_LIBS=$LIBS
591
CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
592
LIBS="$LIBS $POPPLER_LIBS"
49 by Alexander Valavanis
* New upstream version (LP: #710619). Fixes several Ubuntu bugs:
593
594
AC_MSG_CHECKING(for new color space API in Poppler)
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
595
popplercolor="no"
596
AC_COMPILE_IFELSE([
597
#include <GfxState.h>
598
599
int main() {
600
  typedef GfxColorSpace *(*parse_p)(Object *, Gfx *);
601
  parse_p p;
602
  p = &GfxColorSpace::parse;
603
  return 0;
604
}
605
], [popplercolor=yes])
49 by Alexander Valavanis
* New upstream version (LP: #710619). Fixes several Ubuntu bugs:
606
if test "x$popplercolor" = "xyes"; then
607
	AC_DEFINE(POPPLER_NEW_COLOR_SPACE_API, 1, [Use color space API from Poppler >= 0.12.2])
608
	AC_MSG_RESULT(yes)
609
else
610
	AC_MSG_RESULT(no)
611
fi
612
613
# Poppler's b604a008 commit changes this
614
AC_MSG_CHECKING([whether Poppler's GfxPatch no longer uses GfxColor])
615
popplergfxcolor="no"
616
AC_COMPILE_IFELSE([
617
#include <GfxState.h>
618
619
int main() {
620
  GfxPatch::ColorValue color = {c: {0}};
621
  GfxPatch patch;
622
  patch.color[[0]][[0]] = color;
623
  return 0;
624
}
625
], [popplergfxcolor=yes])
626
if test "x$popplergfxcolor" = "xyes"; then
627
	AC_DEFINE(POPPLER_NEW_GFXPATCH, 1, [GfxPatch no longer uses GfxColor in >= 0.15.1])
628
	AC_MSG_RESULT(yes)
629
else
630
	AC_MSG_RESULT(no)
631
fi
632
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
633
CPPFLAGS=$ink_svd_CPPFLAGS
634
LIBS=$ink_svd_LIBS
635
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
636
dnl ******************************
1.1.1 by Guido Guenther
Import upstream version 0.43
637
dnl Inkboard dependency checking
638
dnl ******************************
639
1.1.10 by Kees Cook
Import upstream version 0.47~pre4
640
dnl with_inkboard="no"
641
dnl with_inkboard_ssl="no"
642
643
dnl INKBOARD_CFLAGS=""
644
645
dnl AC_ARG_ENABLE(inkboard,
646
dnl 		AS_HELP_STRING([--enable-inkboard], [enable Inkboard online whiteboard facility (disabled by default)]),
647
dnl        with_inkboard=$enableval,with_inkboard=no)
648
649
dnl if test "x$with_inkboard" = "xyes"; then
650
dnl 		with_inkboard="yes"
651
dnl 		AC_DEFINE(WITH_INKBOARD,1,[Build in Inkboard support])
1.1.4 by Sebastien Bacher
Import upstream version 0.45
652
		
653
		dnl Test for OpenSSL
1.1.10 by Kees Cook
Import upstream version 0.47~pre4
654
dnl 		PKG_CHECK_MODULES(INKBOARD, openssl, with_inkboard_ssl=yes, with_inkboard_ssl=no)
655
dnl 		if test "x$with_inkboard_ssl" = "xyes"; then
1.1.4 by Sebastien Bacher
Import upstream version 0.45
656
			dnl OpenSSL found; enable SSL support in Pedro
1.1.10 by Kees Cook
Import upstream version 0.47~pre4
657
dnl 			INKBOARD_CFLAGS="$INKBOARD_CFLAGS -DHAVE_SSL"
658
dnl 			RELAYTOOL([ssl], INKBOARD_LIBS, INKBOARD_CFLAGS, [inkboard_weak=yes])
659
dnl 			RELAYTOOL([crypto], INKBOARD_LIBS, INKBOARD_CFLAGS, [inkboard_weak=yes])
660
dnl 			AC_DEFINE(WITH_INKBOARD_SSL,1,[Build in SSL support for Inkboard])
661
dnl 		fi
662
dnl else
663
dnl 	with_inkboard="no"
664
dnl fi
1.1.1 by Guido Guenther
Import upstream version 0.43
665
1.1.10 by Kees Cook
Import upstream version 0.47~pre4
666
dnl AM_CONDITIONAL(WITH_INKBOARD, test "x$with_inkboard" = "xyes")
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
667
668
INKBOARD_CFLAGS=""
669
INKBOARD_LIBS=""
670
AC_SUBST(INKBOARD_LIBS)
671
AC_SUBST(INKBOARD_CFLAGS)
1.1.1 by Guido Guenther
Import upstream version 0.43
672
673
dnl ******************************
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
674
dnl Check for libwpg for extension
675
dnl ******************************
676
1.6.1 by Alex Valavanis
Import upstream version 0.48.2
677
with_libwpg=no
678
679
PKG_CHECK_MODULES(LIBWPG01, libwpg-0.1 libwpg-stream-0.1, with_libwpg01=yes, with_libwpg01=no)
680
if test "x$with_libwpg01" = "xyes"; then
681
	AC_DEFINE(WITH_LIBWPG01,1,[Build in libwpg 0.1.x])
682
	with_libwpg=yes
683
	AC_SUBST(LIBWPG_LIBS, $LIBWPG01_LIBS)
684
	AC_SUBST(LIBWPG_CFLAGS, $LIBWPG01_CFLAGS)
685
fi
686
AM_CONDITIONAL(WITH_LIBWPG01, test "x$with_libwpg01" = "xyes")
687
688
PKG_CHECK_MODULES(LIBWPG02, libwpg-0.2 libwpd-0.9 libwpd-stream-0.9, with_libwpg02=yes, with_libwpg02=no)
689
if test "x$with_libwpg02" = "xyes"; then
690
	AC_DEFINE(WITH_LIBWPG02,1,[Build in libwpg 0.2.x])
691
	with_libwpg=yes
692
	AC_SUBST(LIBWPG_LIBS, $LIBWPG02_LIBS)
693
	AC_SUBST(LIBWPG_CFLAGS, $LIBWPG02_CFLAGS)
694
fi
695
AM_CONDITIONAL(WITH_LIBWPG02, test "x$with_libwpg02" = "xyes")
696
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
697
if test "x$with_libwpg" = "xyes"; then
698
	AC_DEFINE(WITH_LIBWPG,1,[Build in libwpg])
699
fi
700
AM_CONDITIONAL(WITH_LIBWPG, test "x$with_libwpg" = "xyes")
701
702
dnl ******************************
703
dnl Check for ImageMagick Magick++ 
704
dnl ******************************
705
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
706
PKG_CHECK_MODULES(IMAGEMAGICK, ImageMagick++, magick_ok=yes, magick_ok=no)
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
707
if test "x$magick_ok" = "xyes"; then
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
708
      AC_DEFINE(WITH_IMAGE_MAGICK,1,[Image Magick++ support for bitmap effects])
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
709
fi
710
AM_CONDITIONAL(USE_IMAGE_MAGICK, test "x$magick_ok" = "xyes")
711
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
712
AC_SUBST(IMAGEMAGICK_LIBS)
713
AC_SUBST(IMAGEMAGICK_CFLAGS)
714
715
dnl ***********************************************************************************************************
716
dnl Check for a Cairo version that implements user-fonts feature (with a stable API, that is cairo > 1.7.6),
717
dnl so that we conditionally add SVGFonts support
718
dnl ***********************************************************************************************************
719
720
PKG_CHECK_MODULES(CAIRO_USER_FONTS, cairo > 1.7.6, cairouserfonts=yes, cairouserfonts=no)
721
if test "x$cairouserfonts" = "xyes"; then
722
       AC_DEFINE(ENABLE_SVG_FONTS, 1, [SVG Fonts should be used])
723
fi
724
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
725
dnl ******************************
1.1.1 by Guido Guenther
Import upstream version 0.43
726
dnl   Unconditional dependencies
727
dnl ******************************
728
1.1.2 by Martin Pitt
Import upstream version 0.44
729
dnl sigc++-2.0 >= 2.0.12: using "visit_each" not available in 2.0.10
730
if test $cc_vers_major -gt 3; then
1.1.4 by Sebastien Bacher
Import upstream version 0.45
731
  min_sigc_version=2.0.12
1.1.2 by Martin Pitt
Import upstream version 0.44
732
else
1.1.4 by Sebastien Bacher
Import upstream version 0.45
733
  min_sigc_version=2.0.11
734
fi
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
735
PKG_CHECK_MODULES(INKSCAPE, gdkmm-2.4  glibmm-2.4 giomm-2.4 gtkmm-2.4 >= 2.10.0  gtk+-2.0  libxml-2.0 >= 2.6.11  libxslt >= 1.0.15  cairo  sigc++-2.0 >= $min_sigc_version  $ink_spell_pkg  gthread-2.0 >= 2.0 libpng >= 1.2 gsl)
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
736
1.6.2 by Alex Valavanis
Import upstream version 0.48.3
737
dnl gtkmm provides no preprocessor macros for easily checking versions.  This check is used
738
dnl to figure out if we are working with the newer 2.24 series or not.
739
PKG_CHECK_MODULES(GTKMM_2_24, gtkmm-2.4 >= 2.24, with_gtkmm_2_24=yes, with_gtkmm_2_24=no)
740
if test "x$with_gtkmm_2_24" = "xyes"; then
741
	AC_DEFINE(WITH_GTKMM_2_24,1,[Build with Gtkmm 2.24.x])
742
fi
743
744
PKG_CHECK_MODULES(GTKMM_2_22, gtkmm-2.4 >= 2.22, with_gtkmm_2_22=yes, with_gtkmm_2_22=no)
745
if test "x$with_gtkmm_2_22" = "xyes"; then
746
	AC_DEFINE(WITH_GTKMM_2_22,1,[Build with Gtkmm 2.22.x])
747
fi
748
749
# Check for GTK+ backend target
750
AC_MSG_CHECKING([for GTK+ backend target])
751
gtk_backend_target=`pkg-config --variable=target gtk+-2.0`
752
AC_MSG_RESULT($gtk_backend_target)
753
754
# Add X11 library if needed
755
if test "x$gtk_backend_target" = "xx11"; then
756
  INKSCAPE_LIBS="$INKSCAPE_LIBS -lX11"
757
fi
758
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
759
# Check for Apple Mac OS X Carbon framework
760
carbon_ok=no
761
AC_MSG_CHECKING([for Mac OS X Carbon support])
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
762
AC_COMPILE_IFELSE([
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
763
#include <Carbon/Carbon.h>
764
#include <CoreServices/CoreServices.h>
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
765
], [carbon_ok=yes])
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
766
AC_MSG_RESULT($carbon_ok)
767
if test "x$carbon_ok" = "xyes"; then
768
  AC_DEFINE(HAVE_CARBON, 1, [define to 1 if Carbon is available])
769
  CARBON_LDFLAGS="-framework Carbon"
770
  AC_SUBST(CARBON_LDFLAGS)
771
fi
772
AM_CONDITIONAL(HAVE_CARBON, test "x$carbon_ok" = "xyes")
773
774
# Check for some boost header files
775
AC_CHECK_HEADERS([boost/concept_check.hpp], [], AC_MSG_ERROR([You need the boost package (e.g. libboost-dev)]))
1.1.4 by Sebastien Bacher
Import upstream version 0.45
776
777
PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, cairo_pdf=yes, cairo_pdf=no)
778
if test "x$cairo_pdf" = "xyes"; then
779
  AC_DEFINE(HAVE_CAIRO_PDF, 1, [Whether the Cairo PDF backend is available])
1.1.2 by Martin Pitt
Import upstream version 0.44
780
fi
1.1.1 by Guido Guenther
Import upstream version 0.43
781
782
dnl Shouldn't we test for libpng and libz?
1.6.2 by Alex Valavanis
Import upstream version 0.48.3
783
INKSCAPE_LIBS="$INKSCAPE_LIBS -lpng -lz -lxml2 -ldl"
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
784
if test "x$openmp_ok" = "xyes"; then
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
785
	INKSCAPE_LIBS="$INKSCAPE_LIBS -lgomp"
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
786
fi
1.1.1 by Guido Guenther
Import upstream version 0.43
787
788
AC_CHECK_HEADER(popt.h,
789
		[INKSCAPE_LIBS="$INKSCAPE_LIBS -lpopt"],
790
		AC_MSG_ERROR([libpopt is required]))
791
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
792
dnl **************************
793
dnl Check for aspell 
794
dnl ******************************
795
AC_CHECK_LIB(aspell, new_aspell_config, [AC_CHECK_HEADER(aspell.h, aspell_ok=yes, aspell_ok=no)], aspell_ok=no, -lz -lm)
796
if test "x$aspell_ok" = "xyes"; then
797
	AC_DEFINE(HAVE_ASPELL, 1, [Use aspell for built-in spellchecker])
798
  INKSCAPE_LIBS="$INKSCAPE_LIBS -laspell"
799
else
800
	AC_MSG_CHECKING([Aspell not found, spell checker will be disabled])
801
fi
802
1.1.1 by Guido Guenther
Import upstream version 0.43
803
dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
804
sp_save_LIBS=$LIBS
805
LIBS="$LIBS $INKSCAPE_LIBS"
806
AC_CHECK_FUNCS(bind_textdomain_codeset)
807
dnl Check for gtk_window_fullscreen in gtk (>= 2.2)
808
AC_CHECK_FUNCS(gtk_window_set_default_icon_from_file)
809
AC_CHECK_FUNCS(gtk_window_fullscreen)
810
LIBS=$sp_save_LIBS
811
812
813
dnl Check for binary relocation support
814
dnl Hongli Lai <h.lai@chello.nl>
815
816
AC_ARG_ENABLE(binreloc,
817
       [  --enable-binreloc       compile with binary relocation support],
818
       enable_binreloc=$enableval,enable_binreloc=no)
819
820
AC_MSG_CHECKING(whether binary relocation support should be enabled)
821
if test "$enable_binreloc" = "yes"; then
822
       AC_MSG_RESULT(yes)
823
       AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
824
       if test -e /proc/self/maps; then
825
               AC_MSG_RESULT(yes)
826
       else
827
               AC_MSG_RESULT(no)
828
               AC_MSG_ERROR(/proc/self/maps is not available. Binary relocation cannot be enabled.)
829
               enable_binreloc="no"
830
       fi
831
832
elif test "$enable_binreloc" = "auto"; then
833
       AC_MSG_RESULT(yes when available)
834
       AC_MSG_CHECKING(for linker mappings at /proc/self/maps)
835
       if test -e /proc/self/maps; then
836
               AC_MSG_RESULT(yes)
837
               enable_binreloc=yes
838
839
               AC_MSG_CHECKING(whether everything is installed to the same prefix)
840
               if test "$bindir" = '${exec_prefix}/bin' -a "$sbindir" = '${exec_prefix}/sbin' -a \
841
                       "$datadir" = '${prefix}/share' -a "$libdir" = '${exec_prefix}/lib' -a \
842
                       "$libexecdir" = '${exec_prefix}/libexec' -a "$sysconfdir" = '${prefix}/etc'
843
               then
844
                       AC_MSG_RESULT(yes)
845
               else
846
                       AC_MSG_RESULT(no)
847
                       AC_MSG_NOTICE(Binary relocation support will be disabled.)
848
                       enable_binreloc=no
849
               fi
850
851
       else
852
               AC_MSG_RESULT(no)
853
               enable_binreloc=no
854
       fi
855
856
elif test "$enable_binreloc" = "no"; then
857
       AC_MSG_RESULT(no)
858
else
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
859
       AC_MSG_RESULT([no (unknown value "$enable_binreloc")])
1.1.1 by Guido Guenther
Import upstream version 0.43
860
       enable_binreloc=no
861
fi
862
AC_DEFINE(BR_PTHREADS,[0],[Use binreloc thread support?])
863
if test "$enable_binreloc" = "yes"; then
864
   AC_DEFINE(ENABLE_BINRELOC,,[Use AutoPackage?])
865
fi
866
867
AC_ARG_ENABLE(osxapp,
868
       [  --enable-osxapp         compile with OSX .app data dir paths],
869
       enable_osxapp=$enableval,enable_osxapp=no)
870
if test "$enable_osxapp" = "yes"; then
871
   AC_DEFINE(ENABLE_OSX_APP_LOCATIONS,,[Build with OSX .app data dir paths?])
872
fi
873
1.1.2 by Martin Pitt
Import upstream version 0.44
874
dnl ******************************
1.1.1 by Guido Guenther
Import upstream version 0.43
875
dnl   Reported by autoscan
876
dnl ******************************
877
AC_CHECK_FUNCS(pow)
878
# if we did not find pow(), see if it's in libm.
879
if test x"$ac_cv_func_pow" = x"no" ; then
880
	AC_CHECK_LIB(m,pow)
881
fi
882
AC_CHECK_FUNCS(sqrt)
883
AC_CHECK_FUNCS(floor)
884
AC_CHECK_FUNCS(gettimeofday)
885
AC_CHECK_FUNCS(memmove)
886
AC_CHECK_FUNCS(memset)
887
AC_CHECK_FUNCS(mkdir)
888
AC_CHECK_FUNCS(strncasecmp)
889
AC_CHECK_FUNCS(strpbrk)
890
AC_CHECK_FUNCS(strrchr)
891
AC_CHECK_FUNCS(strspn)
892
AC_CHECK_FUNCS(strstr)
893
AC_CHECK_FUNCS(strtoul)
894
AC_CHECK_FUNCS(fpsetmask)
895
AC_CHECK_FUNCS(ecvt)
896
AC_CHECK_HEADERS(ieeefp.h)
897
AC_CHECK_HEADERS(fcntl.h)
898
AC_CHECK_HEADERS(libintl.h)
899
AC_CHECK_HEADERS(stddef.h)
900
AC_CHECK_HEADERS(sys/time.h)
901
AC_FUNC_STAT
902
AC_FUNC_STRFTIME
903
AC_FUNC_STRTOD
904
AC_HEADER_STAT
905
AC_HEADER_TIME
906
AC_STRUCT_TM
907
AC_TYPE_MODE_T
908
AC_TYPE_SIGNAL
909
910
dnl Work around broken gcc 3.3 (seen on OSX) where "ENABLE_NLS" isn't
911
dnl set correctly because the gettext function isn't noticed.
912
if test "$ac_cv_header_libintl_h" = "yes" &&
913
   test "$ac_cv_func_bind_textdomain_codeset" = "yes"  &&
914
   test "$gt_cv_func_have_gettext" != "yes"; then
915
    AC_DEFINE(ENABLE_NLS)
916
fi
917
918
dnl ******************************
919
dnl   Compilation warnings
920
dnl ******************************
921
if test "$GXX" = "yes"; then
922
  # Enable some warnings from g++.
923
924
  # Rationale: a number of bugs in inkscape have been fixed by enabling g++
925
  # warnings and addressing the produced warnings.  Usually the committing
926
  # developer is the best person to address the warnings.
927
928
  ink_svd_CXXFLAGS="$CXXFLAGS"
929
  CXXFLAGS="-Wno-unused-parameter $CXXFLAGS"
930
  # -Wno-unused-parameter isn't accepted by gcc 2.95.
931
  AC_COMPILE_IFELSE([int dummy;
932
], , CXXFLAGS="-Wno-unused $ink_svd_CXXFLAGS",)
933
  # Note: At least one bug has been caught from unused parameter warnings,
934
  # so it might be worth trying not to disable it.
935
  # One way of selectively disabling the warnings (i.e. only where the
936
  # programmer deliberately isn't using the parameter, e.g. for a callback)
937
  # is to remove the parameter name (leaving just its type), as is done
938
  # in src/seltrans.cpp:sp_seltrans_handle_event; this indicates that the
939
  # programmer deliberately has an unused parameter (e.g. because it's used
940
  # as a callback or similar function pointer use).
941
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
942
  # Add even more stuff
943
  CXXFLAGS="-Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch $CXXFLAGS"
1.1.1 by Guido Guenther
Import upstream version 0.43
944
945
fi
946
947
dnl ******************************
948
dnl   libinkscape
949
dnl ******************************
950
dnl
951
dnl AC_ARG_ENABLE(libinkscape, AC_HELP_STRING([--enable-libinkscape], [Compile dynamic library (experimental)]), [splib=$enableval], [splib=no])
952
dnl
953
dnl AM_CONDITIONAL(ENABLE_LIBINKSCAPE, test "x$splib" != "xno")
954
dnl
955
956
AC_SUBST(INKSCAPE_CFLAGS)
957
AC_SUBST(INKSCAPE_LIBS)
958
959
dnl Define our data paths for config.h
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
960
AC_DEFINE_DIR([INKSCAPE_DATADIR], [datadir], [Base data directory])
961
AC_DEFINE_DIR([PACKAGE_LOCALE_DIR], [localedir], [Locatization directory])
1.1.1 by Guido Guenther
Import upstream version 0.43
962
963
AC_CONFIG_FILES([
964
Makefile
965
src/Makefile
966
src/check-header-compile
967
src/application/makefile
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
968
src/bind/makefile
1.1.1 by Guido Guenther
Import upstream version 0.43
969
src/debug/makefile
970
src/dialogs/makefile
971
src/display/makefile
972
src/dom/makefile
973
src/extension/implementation/makefile
974
src/extension/internal/makefile
975
src/extension/makefile
976
src/extension/script/makefile
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
977
src/filters/makefile
1.1.1 by Guido Guenther
Import upstream version 0.43
978
src/helper/makefile
979
src/io/makefile
980
src/libcroco/makefile
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
981
src/libgdl/makefile
1.1.1 by Guido Guenther
Import upstream version 0.43
982
src/libnr/makefile
983
src/libnrtype/makefile
984
src/libavoid/makefile
985
src/livarot/makefile
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
986
src/live_effects/makefile
987
src/live_effects/parameter/makefile
1.1.4 by Sebastien Bacher
Import upstream version 0.45
988
src/pedro/makefile
1.1.1 by Guido Guenther
Import upstream version 0.43
989
src/jabber_whiteboard/makefile
990
src/svg/makefile
991
src/trace/makefile
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
992
src/ui/cache/makefile
1.1.1 by Guido Guenther
Import upstream version 0.43
993
src/ui/dialog/makefile
994
src/ui/makefile
995
src/ui/view/makefile
996
src/ui/widget/makefile
997
src/util/makefile
998
src/widgets/makefile
999
src/xml/makefile
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
1000
src/2geom/makefile
1.1.1 by Guido Guenther
Import upstream version 0.43
1001
doc/Makefile
1002
po/Makefile.in
1003
share/Makefile
1004
share/clipart/Makefile
1005
share/examples/Makefile
1006
share/extensions/Makefile
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
1007
share/extensions/alphabet_soup/Makefile
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
1008
share/extensions/Barcode/Makefile
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
1009
share/extensions/Poly3DObjects/Makefile
1010
share/extensions/test/Makefile
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
1011
share/extensions/xaml2svg/Makefile
1.1.8 by Kees Cook
Import upstream version 0.47~pre0
1012
share/filters/Makefile
1.1.1 by Guido Guenther
Import upstream version 0.43
1013
share/fonts/Makefile
1014
share/gradients/Makefile
1015
share/icons/Makefile
1.4.3 by Wolfram Quester
Import upstream version 0.48.0
1016
share/icons/application/Makefile
1017
share/icons/application/16x16/Makefile
1018
share/icons/application/22x22/Makefile
1019
share/icons/application/24x24/Makefile
1020
share/icons/application/32x32/Makefile
1021
share/icons/application/48x48/Makefile
1022
share/icons/application/256x256/Makefile
1.1.2 by Martin Pitt
Import upstream version 0.44
1023
share/keys/Makefile
1.1.1 by Guido Guenther
Import upstream version 0.43
1024
share/markers/Makefile
1025
share/palettes/Makefile
1026
share/patterns/Makefile
1027
share/screens/Makefile
1028
share/templates/Makefile
1029
share/tutorials/Makefile
1030
share/ui/Makefile
1031
packaging/autopackage/default.apspec
1032
inkscape.spec
1033
Info.plist
1034
inkview.1
1035
])
1036
1037
AH_BOTTOM([
1038
1039
1040
])
1041
1042
AC_OUTPUT
1043
1044
echo "
1045
Configuration:
1046
1047
        Source code location:     ${srcdir}
1048
        Destination path prefix:  ${prefix}
1049
        Compiler:                 ${CXX}
1050
        CPPFLAGS:                 ${CPPFLAGS}
1051
        CXXFLAGS:                 ${CXXFLAGS}
1052
        CFLAGS:                   ${CFLAGS}
1053
        LDFLAGS:                  ${LDFLAGS}
1054
1.1.4 by Sebastien Bacher
Import upstream version 0.45
1055
        Use gnome-vfs:            ${gnome_vfs}
1.1.1 by Guido Guenther
Import upstream version 0.43
1056
        Use openoffice files:     ${ij}
1057
        Use relocation support:   ${enable_binreloc}
1.1.4 by Sebastien Bacher
Import upstream version 0.45
1058
        Internal Python:          ${with_python}
1059
        Internal Perl:            ${with_perl}
1060
        Enable LittleCms:         ${enable_lcms}
1.1.6 by Kees Cook
Import upstream version 0.46~pre1
1061
        Enable Poppler-Cairo:     ${enable_poppler_cairo}
1062
        ImageMagick Magick++:     ${magick_ok}
1063
        Libwpg:                   ${with_libwpg}
1.6.2 by Alex Valavanis
Import upstream version 0.48.3
1064
        GTK+ backend target:      ${gtk_backend_target}
1.1.1 by Guido Guenther
Import upstream version 0.43
1065
"