-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
578 lines (492 loc) · 14.8 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
dnl -*- Mode: Autoconf; tab-width: 8; indent-tabs-mode: nil; -*-
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT(gimageview, 0.3.0)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/gimageview.c])
AM_INIT_AUTOMAKE(1.6)
AM_CONFIG_HEADER(config.h)
AM_SILENT_RULES([yes])
dnl ******************************
dnl Checks for programs.
dnl ******************************
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_YACC
AC_ISC_POSIX
AM_MAINTAINER_MODE
dnl ******************************
dnl libtool
dnl ******************************
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
dnl ******************************
dnl Checks for host
dnl ******************************
AC_CANONICAL_HOST
dnl Used for enabling the "-no-undefined" flag while generating DLLs
dnl Copied from the official gtk+-2 configure.in
AC_MSG_CHECKING([for some Win32 platform])
case "$host" in
*-*-mingw*|*-*-cygwin*)
platform_win32=yes
;;
*)
platform_win32=no
;;
esac
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
if test x"$platform_win32" = x"yes"; then
WINDRES=windres
AC_SUBST(WINDRES)
fi
AC_MSG_CHECKING([for native Win32])
case "$host" in
*-*-mingw*)
os_win32=yes
;;
*)
os_win32=no
;;
esac
AC_MSG_RESULT([$os_win32])
AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
dnl ******************************
dnl required library version
dnl ******************************
# Gtk+-2.0
GLIB2_REQUIRED=2.10.0
GMODULE2_REQUIRED=2.10.0
GDK_PIXBUF2_REQUIRED=2.10.0
GTK2_REQUIRED=2.10.0
AC_SUBST(GLIB2_REQUIRED)
AC_SUBST(GMODULE2_REQUIRED)
AC_SUBST(GTK2_REQUIRED)
AC_SUBST(GDK_PIXBUF2_REQUIRED)
# Backends
EXIF_REQUIRED=0.6.0
LIBRSVG_REQUIRED=1.0.0
LIBWMF_REQUIRED=0.2.8
XINE_REQUIRED=1.0.0
AC_SUBST(EXIF_REQUIRED)
AC_SUBST(LIBRSVG_REQUIRED)
AC_SUBST(LIBWMF_REQUIRED)
AC_SUBST(XINE_REQUIRED)
dnl ******************************
dnl Check for GTK
dnl ******************************
PKG_CHECK_MODULES(GTK,
[glib-2.0 >= $GLIB2_REQUIRED
gmodule-2.0 >= $GMODULE2_REQUIRED
gdk-pixbuf-2.0 >= $GDK_PIXBUF2_REQUIRED
gtk+-2.0 >= $GTK2_REQUIRED], ,
[ AC_MSG_ERROR(Test for GTK+-2.0 failed. See the file 'INSTALL' for help) ])
dnl ********************
dnl Test for GZIP
dnl ********************
ZLIB_CFLAGS=""
ZLIB_LIBS="-lz"
AC_SUBST(ZLIB_CFLAGS)
AC_SUBST(ZLIB_LIBS)
dnl ********************
dnl Test for bzlib
dnl ********************
BZLIB_CFLAGS=""
BZLIB_LIBS=""
AC_CHECK_HEADER(bzlib.h, [
AC_CHECK_LIB(bz2, BZ2_bzlibVersion, [
available_bzlib=yes;
BZLIB_LIBS="-lbz2";
AC_DEFINE(BZAPI_NEEDS_PREFIX, 1, [Define if your bzlib needs BZ2_ prefix.])
], [
AC_CHECK_LIB(bz2, bzlibVersion, [
available_bzlib=yes; BZLIB_LIBS="-lbz2";
])
])
])
if test x"$available_bzlib" = xyes; then
AC_DEFINE(HAVE_BZLIB, 1, [Define if you have bzlib.])
fi
AM_CONDITIONAL(HAVE_BZLIB, test x"$available_bzlib" = x"yes")
AC_SUBST(BZLIB_CFLAGS)
AC_SUBST(BZLIB_LIBS)
dnl ********************
dnl Test for libpng
dnl ********************
PKG_CHECK_MODULES(PNG,
[libpng], ,
[AC_MSG_ERROR(*** (PNG library is not found) ***)])
dnl ********************
dnl Test for libjpeg
dnl ********************
JPEG_CFLAGS=""
JPEG_LIBS=""
available_jpeg=no
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
available_jpeg=yes,
available_jpeg=no)
if test x"$available_jpeg" = xyes; then
AC_MSG_CHECKING([for jpeglib.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#undef HAVE_STDLIB_H
#include <jpeglib.h>],
available_jpeg=yes,
available_jpeg=no)
AC_MSG_RESULT($available_jpeg)
if test x"$available_jpeg" = xyes; then
JPEG_LIBS='-ljpeg'
AC_CHECK_LIB(jpeg, jpeg_simple_progression,
AC_DEFINE(HAVE_PROGRESSIVE_JPEG, 1,
[Define if your JPEG library supports progressive saving.]),
AC_MSG_WARN([JPEG library does not support progressive saving.]))
fi
fi
if test x"$available_jpeg" = xyes; then
AC_DEFINE(ENABLE_JPEG, 1,
[Define if you want to compile JPEG plugin.])
else
AC_MSG_WARN([*** JPEG loader will not be built ***])
fi
AM_CONDITIONAL(ENABLE_JPEG, test x"$available_jpeg" = x"yes")
AC_SUBST(JPEG_CFLAGS)
AC_SUBST(JPEG_LIBS)
enable_jpeg=$available_jpeg
dnl ********************
dnl Test for libexif
dnl ********************
AC_ARG_WITH(libexif,
[ --with-libexif Use libexif for showing EXIF data [default=yes]],
enable_exif="${withval}",
enable_exif=yes)
if test x"$enable_exif" = xyes; then
PKG_CHECK_MODULES(EXIF, libexif >= $EXIF_REQUIRED, , [
enable_exif=no;
AC_MSG_WARN(Did not find libexif installed)
])
fi
AM_CONDITIONAL(ENABLE_EXIF, test x"$enable_exif" = xyes)
if test x"$enable_exif" = xyes; then
AC_DEFINE(ENABLE_EXIF, 1, [Define if you want to compile EXIF features.])
fi
dnl ********************
dnl Test for libmng
dnl ********************
AC_ARG_WITH(libmng,
[ --with-libmng Use libmng for MNG image [default=yes]],
[enable_mng="${withval}"], [enable_mng=yes])
MNG_CFLAGS=""
MNG_LIBS=""
if test x"$enable_mng" = x"yes"; then
if test x"$available_jpeg" = x"yes"; then
AC_CHECK_HEADER(libmng.h, [
AC_CHECK_LIB(mng, mng_initialize, [
AC_MSG_CHECKING([for libmng functions])
AC_TRY_COMPILE([ #include <stdio.h>
#include <libmng.h> ],
[ mng_handle handle;
mng_version_text();
handle = mng_initialize(NULL, NULL, NULL, MNG_NULL);
mng_setcb_errorproc(handle, NULL);
mng_setcb_openstream(handle, NULL);
mng_setcb_closestream(handle, NULL);
mng_setcb_readdata(handle, NULL);
mng_setcb_gettickcount(handle, NULL);
mng_setcb_settimer(handle, NULL);
mng_setcb_processheader(handle, NULL);
mng_setcb_getcanvasline(handle, NULL);
mng_setcb_refresh(handle, NULL);
mng_get_userdata(handle);
mng_set_canvasstyle(handle, MNG_CANVAS_RGB8);
mng_set_bgcolor(handle, 0, 0, 0);
mng_readdisplay(handle);
mng_readdisplay_resume(handle); ],
[ MNG_LIBS="$JPEG_LIBS -lz -lmng";
AC_DEFINE(ENABLE_MNG, 1, [Define if you want to compile mng plugin.])],
[ enable_mng=no;
AC_MSG_WARN(*** MNG library (libmng) is found but it is too old ***) ])
AC_MSG_RESULT($enable_mng)
], [
enable_mng=no
], $MNG_LIBS )
], [
enable_mng=no:
])
else
AC_MSG_WARN([*** libmng requires libjpeg. MNG plugin will not be compiled.])
enable_mng=no
fi
fi
AM_CONDITIONAL(ENABLE_MNG, test x"$enable_mng" = xyes)
AC_SUBST(MNG_CFLAGS)
AC_SUBST(MNG_LIBS)
dnl ********************
dnl Test for librsvg
dnl ********************
AC_ARG_WITH(librsvg,
[ --with-librsvg Use librsvg for SVG image [default=yes]],
enable_librsvg="${withval}",
enable_librsvg=yes)
if test x"$enable_librsvg" = xyes; then
PKG_CHECK_MODULES(LIBRSVG, librsvg-2.0, , [
enable_librsvg=no;
AC_MSG_WARN(Did not find librsvg-2.0 installed)
])
fi
AM_CONDITIONAL(ENABLE_LIBRSVG, test x"$enable_librsvg" = xyes)
dnl ****************************
dnl Check for libwmf
dnl ****************************
AC_ARG_WITH(libwmf,
[ --with-libwmf Use libwmf library for Windows Meta File [default=yes]],
[enable_libwmf="${withval}"],
[enable_libwmf=yes])
if test "x$enable_libwmf" = xyes; then
have_libwmf=no
AM_PATH_LIBWMF($LIBWMF_REQUIRED,
[have_libwmf=yes], [have_libwmf=no])
if test "x$have_libwmf" = xyes; then
AC_DEFINE(ENABLE_WMF, 1, [Define if you want to compile wmf plugin.])
else
AC_MSG_WARN(Did not find libwmf installed)
enable_libwmf=no;
fi
fi
AM_CONDITIONAL(ENABLE_WMF, test x"$enable_libwmf" = xyes)
dnl ****************************
dnl check for Xinerama
dnl ****************************
AC_PATH_XTRA
XINERAMA_LIBS=""
AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
[XINERAMA_LIBS="-lXinerama"
AC_CHECK_HEADERS(X11/extensions/Xinerama.h)],
[],[$X_LIBS -lX11 -lXext])
AC_SUBST(XINERAMA_LIBS)
AC_SUBST(X_LIBS)
movie_support=""
dnl ****************************
dnl Check for Xine library
dnl ****************************
AC_ARG_WITH(xine,
[ --with-xine Use Xine library for movie (experimental) [default=no]],
[enable_xine="${withval}"],
[enable_xine=no])
if test x"$enable_xine" = xyes; then
have_xine=no
AM_PATH_XINE($XINE_REQUIRED,
[have_xine=yes], [have_xine=no])
if test x"$have_xine" = xyes; then
AC_DEFINE(ENABLE_XINE, 1, [Define if you want to compile xine plugin.])
movie_support="Xine ${movie_support}"
else
AC_MSG_WARN(Did not find xine-lib installed)
enable_xine=no;
fi
fi
AM_CONDITIONAL(ENABLE_XINE, test x"$enable_xine" = xyes)
dnl ******************************
dnl for gettext
dnl ******************************
GETTEXT_PACKAGE=gimv
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Gettext package])
ALL_LINGUAS="fr ja"
AM_GLIB_GNU_GETTEXT
AM_GLIB_DEFINE_LOCALEDIR(GIMV_LOCALEDIR)
dnl ***************************************************************************
dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
dnl ***************************************************************************
gimv_save_LIBS=$LIBS
LIBS="$LIBS $GTK_LIBS"
AC_CHECK_FUNCS(bind_textdomain_codeset)
LIBS=$gimv_save_LIBS
dnl *******************
dnl for intltool
dnl *******************
AC_PROG_INTLTOOL
dnl **************************************
dnl enable/disable susie plugin support
dnl **************************************
AC_ARG_ENABLE(spi,
[ --enable-spi susie plugin support (broken) [default=no]],
[enable_spi="${enableval}"], [enable_spi=no])
AM_CONDITIONAL(ENABLE_SPI, test x"$enable_spi" = xyes)
if test x"$enable_spi" = xyes; then
AC_DEFINE(ENABLE_SPI, 1, [Define if you want to enable Susie plugin support feature.])
if test x"$platform_win32" = xno; then
DLLLOADER_CFLAGS="-I\$(top_srcdir)/lib -I\$(top_srcdir)/lib/dllloader"
DLLLOADER_LIBS="\$(top_builddir)/lib/dllloader/libdllloader.la"
AC_SUBST(DLLLOADER_CFLAGS)
AC_SUBST(DLLLOADER_LIBS)
fi
fi
dnl ******************************
dnl disable/enable splash logo
dnl ******************************
AC_ARG_ENABLE(splash,
[ --enable-splash enable splash logo],
[enable_splash="${enableval}"], [enable_splash=yes])
if test x"$enable_splash" = xyes; then
AC_DEFINE(ENABLE_SPLASH, 1, [Define if you want to enable splash feature.])
fi
dnl *********************************
dnl disable/enable MPlayer Support
dnl *********************************
AC_ARG_ENABLE(mplayer,
[ --enable-mplayer enable MPlyer support (experimental) [default=no]],
[enable_mplayer="${enableval}"], [enable_mplayer=no])
if test x"$enable_mplayer" = xyes; then
AC_DEFINE(ENABLE_MPLAYER, 1, [Define if you want to compile MPlayer plugin.])
movie_support="MPlayer ${movie_support}"
fi
AM_CONDITIONAL(ENABLE_MPLAYER, test x"$enable_mplayer" = x"yes")
dnl *********************************
dnl Check Movie Support
dnl *********************************
if test x"$movie_support" = x; then
movie_support=no
else
AC_DEFINE(ENABLE_MOVIE, 1, [Define if you use movie support])
fi
dnl ******************************
dnl Checks for header files.
dnl ******************************
AC_PATH_X
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([ \
alloca.h argz.h \
errno.h \
fcntl.h \
langinfo.h libintl.h limits.h locale.h \
malloc.h memory.h \
netinet/in.h nl_types.h \
stddef.h stdlib.h string.h strings.h sys/param.h sys/time.h \
unistd.h utime.h \
])
dnl **************************************************************
dnl Checks for typedefs, structures, and compiler characteristics.
dnl **************************************************************
AC_C_CONST
AC_TYPE_UID_T
AC_C_INLINE
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
if test x$CC = xgcc; then
CFLAGS="$CFLAGS -Wall"
fi
if test x"$platform_win32" = xyes; then
LDFLAGS="$LDFLAGS -mwindows"
fi
dnl **********************************
dnl Checks for library functions.
dnl **********************************
AC_FUNC_ALLOCA
dnl AC_FUNC_CHOWN
dnl AC_FUNC_FORK
dnl AC_FUNC_LSTAT
dnl AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MMAP
dnl AC_FUNC_MKTIME
dnl AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([ \
__argz_count __argz_next __argz_stringify \
dcgettext dup2 \
endgrent endpwent \
floor \
getcwd getpagesize getwd \
memmove mempcpy memset mkdir munmap \
nl_langinfo \
pow putenv setenv \
setlocale sqrt stpcpy strcasecmp strchr strcspn \
strdup strrchr strstr strtoul \
uname utime \
])
dnl ******************************
dnl set data dir definition
dnl ******************************
gimv_datadir="\${datadir}/\${PACKAGE}"
docdir="\${datadir}/doc"
gimv_docdir="\${docdir}/\${PACKAGE}"
gimv_icondir="\${datadir}/\${PACKAGE}/pixmaps"
AC_SUBST(docdir)
AC_SUBST(gimv_datadir)
AC_SUBST(gimv_docdir)
AC_SUBST(gimv_icondir)
dnl Plugin directory
plugindir="\${libdir}/\${PACKAGE}"
ARCHIVER_PLUGIN_DIR="archiver"
IMAGE_LOADER_PLUGIN_DIR="image_loader"
IMAGE_SAVER_PLUGIN_DIR="image_saver"
IO_STREAM_PLUGIN_DIR="io_stream"
IMAGE_VIEW_PLUGIN_DIR="image_view"
THUMBNAIL_VIEW_PLUGIN_DIR="thumbnail_view"
THUMBNAIL_PLUGIN_DIR="thumbnail"
AC_SUBST(plugindir)
AC_SUBST(ARCHIVER_PLUGIN_DIR)
AC_SUBST(IMAGE_LOADER_PLUGIN_DIR)
AC_SUBST(IMAGE_SAVER_PLUGIN_DIR)
AC_SUBST(IO_STREAM_PLUGIN_DIR)
AC_SUBST(IMAGE_VIEW_PLUGIN_DIR)
AC_SUBST(THUMBNAIL_VIEW_PLUGIN_DIR)
AC_SUBST(THUMBNAIL_PLUGIN_DIR)
AC_CONFIG_FILES([
Makefile
doc/Makefile
doc/ja/Makefile
etc/Makefile
m4/Makefile
po/Makefile.in
lib/Makefile
lib/dllloader/Makefile
plugins/Makefile
plugins/archiver/Makefile
plugins/image_loader/Makefile
plugins/image_saver/Makefile
plugins/image_view/Makefile
plugins/io_stream/Makefile
plugins/thumbnail/Makefile
plugins/thumbnail_view/Makefile
src/Makefile
src/pixmaps/Makefile
src/prefs_ui/Makefile
gimageview.spec
])
AC_OUTPUT
dnl
dnl Show some info:
dnl
AC_MSG_RESULT([
Configure Result :
C Compiler : ${CC}
CFLAGS : ${CFLAGS}
Install path : ${prefix}
JPEG (libjpg) : ${enable_jpeg}
MNG (libmng) : ${enable_mng}
SVG (librsvg): ${enable_librsvg}
WMF (libwmf) : ${enable_libwmf}
Movie Support : ${movie_support}
EXIF : ${enable_exif}
Susie plugin : ${enable_spi}
Show splash : ${enable_splash}
])