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

« back to all changes in this revision

Viewing changes to .pc/0006-Update_to_new_libwpg.patch/configure.ac

  • Committer: Package Import Robot
  • Author(s): Alex Valavanis
  • Date: 2014-08-19 19:10:32 UTC
  • mfrom: (1.6.5) (2.5.14 sid)
  • Revision ID: package-import@ubuntu.com-20140819191032-2eca1qihaszjk9i6
Tags: 0.48.5-2ubuntu1
* Merge with Debian Unstable (LP: #1358863). Fixes several Ubuntu bugs:
  - Illustrator CS SVG won't load: namespace URIs in entities (LP: #166371)
  - inkscape crashed with SIGSEGV in
    sp_dtw_color_profile_event() (LP: #966441)
  - inkscape crashed with SIGSEGV (LP: #1051017)
  - inkscape crashed with SIGSEGV in Inkscape::Preferences::_getNode()
    (LP: #1163241)
  - save a copy reverts to save as (LP: #529843)
  - Extension to braille not working on Xubuntu 12.10 (LP: #1090865)
* Remaining changes:
  - debian/control:
    + Set Ubuntu Developer as maintainer,
    + build-depend on dh-translation to handle Ubuntu translation,
    + demote pstoedit from Recommends to Suggests (because it's in universe),
  - debian/patches/0006_add_unity_quicklist_support.patch: add.
  - debian/patches/series: update.
  - debian/rules:
    + add dh_translation to handle Ubuntu translation
* Drop debian/patches/librevenge.patch (superseded by
    debian/patches/0006-Update_to_new_libwpg.patch)

Show diffs side-by-side

added added

removed removed

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