-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
2028 lines (1760 loc) · 69.3 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
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl Process this file with autoconf to produce a configure script.
dnl $LastChangedDate: 2017-10-10 23:42:24 +0200 (Tue, 10 Oct 2017) $
AC_PREREQ([2.54])
# we'll move forward, one day or another
#AC_PREREQ([2.61])
# for future use, too
#AC_PROG_CC(cc gcc)
#AC_PROG_CXX(CC g++ gcc c++ cxx)
define([svnversion],esyscmd([sh -c "svnversion | tr -c '[0-9]' ' ' | sed 's/ *//g;s/^$/-1/g' "]))dnl
# WARNING : here 0.0 denotes the package version, which will be corrected some lines after this.
AC_INIT([fim],[0.6-trunk],[dezperado_FOobAr_autistici_Baz_org, by replacing _FOobAr_ with a @ and _Baz_ with a .])
AC_CONFIG_SRCDIR([src/fim.cpp])
if test x"svnversion" != x ; then
# The above test gets evaluated when creating the configure script.
AC_DEFINE(SVN_REVISION,"svnversion",[SVN REVISION])
AC_SUBST(SVN_REVISION,"svnversion")
AC_DEFINE(SVN_REVISION_NUMBER,svnversion,[SVN REVISION NUMBER])
AC_SUBST(SVN_REVISION_NUMBER,svnversion)
fi
AH_TEMPLATE([FIM_CONFIGURATION])
FIM_CONFIGURATION="$0 $@"
AC_SUBST(FIM_CONFIGURATION)
AC_DEFINE_UNQUOTED([FIM_CONFIGURATION],"$FIM_CONFIGURATION")
AC_MSG_NOTICE([
Welcome to the Fim (revision $SVN_REVISION) configure script!
This script will create the right Makefile for building Fim on your system.
But first, it will check if your system has the right configuration for Fim to build.
There are options to this script, please run :
./configure --help=short
for a complete list of these options.
Please read BUGS and README and report any bug found to the Fim maintainer!
])
#AM_CONFIG_HEADER([config.h])
#AC_CONFIG_SRCDIR(pinentry/pinentry.h)
#
#AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION)
AC_GNU_SOURCE
#AC_MANTAINER_MODE
#AC_CANONICAL_HOST
#missing_dir=`cd $ac_aux_dir && pwd`
#AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
#AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
#AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
#AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
#AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_PROG_CC
AC_PROG_CPP
AC_PROG_YACC
AC_PROG_LEX
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_REVISION([$Revision$])
AC_PROG_CXX
#AC_PROG_CXXCPP
AC_CHECK_TOOL(AR, ar, ar)
fim_cv_version=`cat $srcdir/VERSION`
AC_LANG([C++])
#AC_LANG_PUSH([C++])
AM_INIT_AUTOMAKE
#AM_INIT_AUTOMAKE(fim, $fim_cv_version)
#AM_INIT_AUTOMAKE(fim, 1.0)
AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/VERSION'])
CPPFLAGS=''
AC_SUBST(FIM_LIBS)
AC_SUBST(FIM_LIB_OBJECTS)
AC_SUBST(VERSION)
dnl AC_SUBST(HTMLDOCS)
#AC_LANG_POP([C++])
fim="fim"
AC_MSG_CHECKING([for prefix])
if test x$prefix = xNONE; then
fim_cv_prefix=$ac_default_prefix
else
fim_cv_prefix=$prefix
fi
AC_MSG_RESULT($fim_cv_prefix)
AC_ISC_POSIX
#AM_C_PROTOTYPES
if test "x$U" != "x"; then
AC_MSG_ERROR(Compiler not ANSI compliant)
fi
#AC_PROG_CPP
AC_PROG_MAKE_SET
AC_C_INLINE
AC_C_CONST
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
AC_CHECK_SIZEOF(off_t)
AM_MAINTAINER_MODE
AH_TEMPLATE([HAVE_GETENV])
AC_CHECK_FUNC([getenv], AC_DEFINE([HAVE_GETENV], [1], [If present, the getenv function allows fim to read environment variables.]))
AC_CHECK_FUNC([getline], AC_DEFINE([HAVE_GETLINE], [1], [If present, will be used for stdin reading. (on GNU)]))
AC_CHECK_FUNC([getdelim], AC_DEFINE([HAVE_GETDELIM], [1], [If present, will be used for stdin reading. (on GNU)]))
AC_CHECK_FUNC([fgetln], AC_DEFINE([HAVE_FGETLN], [1], [If present, fgetln() will be used as a replacement for getline(). (on BSD)]))
AC_CHECK_FUNC([get_current_dir_name], AC_DEFINE([HAVE_GET_CURRENT_DIR_NAME], [1], [Should live when _GNU_SOURCE, but it could be not the case.]))
AC_CHECK_FUNC([rsb_lib_init])
AC_CHECK_LIB([m],[pow])
AC_CHECK_LIB([fl],[yylex])
AC_ARG_ENABLE(graphicsmagick, AC_HELP_STRING([--enable-graphicsmagick], [Enable GraphicsMagick library support (EXPERIMENTAL).]), [ if test x$enableval != xno ; then fim_handle_graphicsmagick=yes ; fi ] )
AC_CHECK_LIB([GraphicsMagick],[GetMagickVersion],
[
if test x"$fim_handle_graphicsmagick" = x"yes" ; then
FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffMagick.o";
LIBS="$LIBS `GraphicsMagick-config --cppflags --ldflags --libs|tr '\n' ' '` ";
CXXFLAGS="$CXXFLAGS `GraphicsMagick-config --cppflags |tr '\n' ' '` ";
AC_DEFINE([HAVE_LIBGRAPHICSMAGICK],[1],[We have libGraphicsMagick])
fi
], [])
AC_ARG_ENABLE(imlib2, AC_HELP_STRING([--enable-imlib2], [Enable Imlib2 library support (EXPERIMENTAL,INCOMPLETE).]), [ if test x$enableval != xno ; then fim_handle_imlib2=yes ; fi ] )
AC_CHECK_LIB([Imlib2],[imlib_create_image],
[
if test x"$fim_handle_imlib2" = x"yes" ; then
FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS Imlib2Device.o";
LIBS="$LIBS `imlib2-config --libs|tr '\n' ' '` ";
CXXFLAGS="$CXXFLAGS `imlib2-config --cflags |tr '\n' ' '` ";
AC_DEFINE([FIM_WITH_LIBIMLIB2],[1],[We have libImlib])
fi
], [])
AC_CHECK_PROG([HAVE_FLEX],[flex],[yes],[no])
AC_CHECK_PROG([HAVE_BISON],[bison],[yes],[no])
if test x$HAVE_FLEX != x"yes" ; then
AC_MSG_ERROR([No flex (lexical analyser generator) executable detected!]) ;
fi
if test x$HAVE_BISON != x"yes" ; then
AC_MSG_ERROR([No bison (parser generator) executable detected!]) ;
fi
AC_CHECK_PROG([HAVE_ECHO],[echo],[yes],[no])
AC_CHECK_PROG([HAVE_RM],[rm],[yes],[no])
AC_CHECK_PROG([HAVE_SED],[sed],[yes],[no])
AC_CHECK_PROG([HAVE_GREP],[grep],[yes],[no])
AC_CHECK_PROG([HAVE_SORT],[sort],[yes],[no])
AC_CHECK_PROG([HAVE_CPP],[cpp],[yes],[no])
AC_CHECK_PROG([HAVE_AWK],[awk],[yes],[no])
AC_CHECK_PROG([HAVE_CAT],[cat],[yes],[no])
AC_CHECK_PROG([HAVE_MAN],[man],[yes],[no])
#AC_CHECK_PROG([HAVE_WHICH],[which],[yes],[no])
#AC_CHECK_PROG([HAVE_GPG],[gpg],[yes],[no])
#AC_CHECK_PROG([HAVE_LS],[ls],[yes],[no])
#AC_CHECK_PROG([HAVE_CD],[cd],[yes],[no])
#AC_CHECK_PROG([HAVE_CC],[cc],[yes],[no])
dnl
AC_ARG_VAR([LIBTIFF],[libtiff library (contributes to LIBS)])
AC_ARG_VAR([LIBGIF],[libgif library (contributes to LIBS)])
AC_ARG_VAR([LIBJPEG],[libjpeg library (contributes to LIBS)])
AC_ARG_VAR([LIBPS],[libspectre library (contributes to LIBS)])
AC_ARG_VAR([LIBDJVU],[libdjvu libdjvulibre (contributes to LIBS)])
AC_ARG_VAR([LIBPOPPLER],[poppler libdjvulibre (contributes to LIBS)])
dnl
AC_PATH_PROG([RM],[rm],[no])
AC_PATH_PROG([SED],[sed],[no])
AC_PATH_PROG([GREP],[grep],[no])
AC_PATH_PROG([ECHO],[echo],[no])
AC_PATH_PROG([SORT],[sort],[no])
AC_PATH_PROG([CPP],[cpp],[no])
AC_PATH_PROG([AWK],[awk],[no])
AC_PATH_PROG([CAT],[cat],[no])
AC_PATH_PROG([MAN],[man],[no])
#AC_PATH_PROG([CC],[cc],[no])
#AC_PATH_PROG([WHICH],[which],[no])
#AC_PATH_PROG([GPG],[gpg],[no])
#AC_PATH_PROG([LS],[ls],[no])
#AC_PATH_PROG([CD],[cd],[no])
# FIXME: what if we have no grep and/or no sed ?
# (echo is often a shell builtin)
have_default_bindings=yes
have_default_mapping=yes
have_default_config=yes
AC_ARG_ENABLE(default_bindings, AC_HELP_STRING([--disable-default-bindings], [Builtin default minimal key binding]),
[ if test x$enableval = xyes; then
have_default_bindings=yes
else
have_default_bindings=no
fi
])
AC_ARG_ENABLE(default_mapping, AC_HELP_STRING([--disable-default-mapping], [Builtin default minimal key mapping]),
[ if test x$enableval = xyes; then
have_default_mapping=yes
else
have_default_mapping=no
fi
])
AC_ARG_ENABLE(default_config, AC_HELP_STRING([--disable-default-config], [Builtin default minimal configuration]),
[ if test x$enableval = xyes; then
have_default_config=yes
else
have_default_config=no
fi
])
AH_TEMPLATE([FIM_DEFAULT_CONFIG])
if test x$have_default_bindings != xno; then
FIM_DEFS="$FIM_DEFS -D FIM_DEFAULT_CONFIG"
AC_DEFINE([FIM_DEFAULT_CONFIG])
fi
AH_TEMPLATE([FIM_DEFAULT_KEY_CONFIG])
if test x$have_default_mapping != xno; then
FIM_DEFS="$FIM_DEFS -D FIM_DEFAULT_KEY_CONFIG"
AC_DEFINE([FIM_DEFAULT_KEY_CONFIG])
fi
AH_TEMPLATE([FIM_DEFAULT_CONFIGURATION])
if test x$have_default_config != xno; then
FIM_DEFS="$FIM_DEFS -D FIM_DEFAULT_CONFIGURATION"
AC_DEFINE([FIM_DEFAULT_CONFIGURATION])
fi
#CPPFLAGS=$DEPS
#AC_SUBST(LIBSDL_CXXFLAGS)
#AC_SUBST(LIBPNG_CXXFLAGS)
#AC_SUBST(LIBSDL_CXXFLAGS)
#AC_SUBST(LIBPNG_CXXFLAGS)
#AC_SUBST(LIBPNG_LIBS)
AC_ARG_ENABLE(system, AC_HELP_STRING([--disable-system], [Disable system() and pipe() calls.]),
[ if test x$enableval = xno ; then
fim_system_calls=no
fi
])
dnl new:
AC_ARG_ENABLE(framebuffer, AC_HELP_STRING([--disable-framebuffer], [Disable the framebuffer device driver.]),
[ if test x$enableval = xno ; then
fim_handle_framebuffer=no
fi
])
AC_MSG_NOTICE([Checking for headers required by the Linux framebuffer device.])
AC_CHECK_HEADERS([linux/fb.h], [break], AC_MSG_WARN([[Cannot find linux/fb.h. Fim Linux framebuffer driver requires it!.]]))
AC_CHECK_HEADERS([linux/vt.h], [break], AC_MSG_WARN([[Cannot find linux/vt.h. Fim Linux framebuffer driver requires it!.]]))
AC_CHECK_HEADERS([linux/kd.h], [break], AC_MSG_WARN([[Cannot find linux/kd.h. Fim Linux framebuffer driver requires it!.]]))
if test x$ac_cv_header_linux_fb_h != xyes -o \
x$ac_cv_header_linux_vt_h != xyes -o \
x$ac_cv_header_linux_kd_h != xyes ; then
AC_MSG_WARN([Turning off Linux framebuffer support due to missing headers])
fim_handle_framebuffer=no
fi
if test x$fim_handle_framebuffer = xno ; then
AC_DEFINE(FIM_WITH_NO_FRAMEBUFFER, 1, [Defined when framebuffer device support is turned off.])
fi
AC_HEADER_STDC
AC_FUNC_MMAP
AC_CHECK_FUNCS([bzero memset memcmp strncmp strcpy])
AC_CHECK_FUNCS([bcopy bcmp])
AC_CHECK_FUNCS([drand48 random rand])
AC_CHECK_FUNCS([fileno])
AC_CHECK_FUNCS([fmemopen])
AC_CHECK_HEADERS([wordexp.h glob.h fnmatch.h])
dnl AC_FUNC_REALLOC() dnl triggers error in automake 1.10.1
#AC_CHECK_HEADERS([stddef.h])
#AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([string.h strings.h], [AC_CHECK_FUNCS(strerror)])
AC_CHECK_HEADERS([stdint.h])
AC_CHECK_HEADERS([wchar.h])
AC_CHECK_HEADERS([fontconfig/fontconfig.h])
AC_CHECK_HEADERS([fontconfig/fcfreetype.h])
AC_HEADER_DIRENT()
AC_CHECK_HEADERS([stdarg.h sys/ioctl.h ioctl.h sysexits.h])
AC_CHECK_HEADERS([sys/time.h sys/resource.h])
AC_CHECK_HEADERS([time.h])
AC_CHECK_HEADERS([unix.h])
AC_CHECK_HEADERS([libgen.h])
AC_CHECK_HEADERS([sys/user.h])
AC_CHECK_HEADERS([sys/mman.h])
AC_CHECK_HEADERS([cstdio stdio.h], [break],AC_MSG_ERROR([[Cannot find cstdio or stdio.h. Fim requires at least one or the other.]]))
AC_CHECK_HEADERS([climits limits.h], [break], AC_MSG_ERROR([[Cannot find limits.h nor climits. Fim requires it!.]]))
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([int *])
AC_CHECK_SIZEOF([size_t])
AC_C_BIGENDIAN([fim_big_endian=yes],[fim_big_endian=no],[fim_big_endian=hmmm])
if test "x$fim_big_endian" = "xyes" ; then
AH_TEMPLATE([FIM_BIG_ENDIAN])
AC_DEFINE([FIM_BIG_ENDIAN])
fi
dnl ============= begin misc external programs detection
dnl ============= end misc external programs detection
dnl if test "X$ac_cv_header_cstdio" != "Xyes" && test "X$ac_cv_header_stdio_h" != "Xyes"; then
dnl AC_MSG_ERROR([[Cannot find cstdio or stdio.h. Fim requires at least one or the other.]])
dnl fi
dnl if test "X$ac_cv_header_linux_fb_h" != "Xyes" ; then
dnl AC_MSG_ERROR([[Cannot find linux/fb.h. Fim requires it!.]])
dnl fi
dnl AC_CHECK_FUNCS(setrlimit getsid)
AC_TYPE_SIGNAL
dnl ==================
AH_TEMPLATE([FIM_WANT_STATIC_BINARY])
AC_ARG_ENABLE(static, AC_HELP_STRING([--enable-static], [Want a static binary. (disabled by default)]), [ if test x$enableval = xyes; then fim_cv_want_static=1 ; else fim_cv_want_static=0 ; fi ],[ fim_cv_want_static=0 ])
if test x$fim_cv_want_static == x1 ; then
LIBS="$LIBS --static"
LIBDJVU_STATIC_EXTRA="-lpthread"
# too many dependencies for the following!
LIBPOPPLER_STATIC_EXTRA=""
LIBSPECTRE_STATIC_EXTRA=""
#LIBPOPPLER_STATIC_EXTRA="-lfreetype -llcms"
#LIBSPECTRE_STATIC_EXTRA="-Wl,--start-group -lgs -lfontconfig -ldl -ljbig2dec -ljasper -lpthread -lpng -lppd -lpaper -lavahi-common -lavahi-client -lexpat -lfreetype -lgnutls -ldbus-1 -ltasn1 -lcupsimage -lcups -lgcrypt -Wl,--end-group "
LIBTIFF_STATIC_EXTRA="-ljpeg -lz"
AC_DEFINE_UNQUOTED([FIM_WANT_STATIC_BINARY], $fim_cv_want_static [Want a static binary. (disabled by default)])
fi
dnl ==================
AC_ARG_WITH(regex, AC_HELP_STRING([--with-regex], [Use the GNU regex library instead of the POSIX one]),
[fim_cv_regex=yes],
[AC_CHECK_FUNCS(regcomp, fim_cv_regex=no, fim_cv_regex=yes)])
if test X$fim_cv_regex = Xno ; then
AC_CACHE_CHECK([whether your system regexp library is completely broken],
[fim_cv_regex_broken],
AC_TRY_RUN([
#include <unistd.h>
#include <regex.h>
int main() { regex_t blah ; regmatch_t p; p.rm_eo = p.rm_eo; return regcomp(&blah, "foo.*bar", REG_NOSUB) || regexec (&blah, "foobar", 0, NULL, 0); }],
fim_cv_regex_broken=no, fim_cv_regex_broken=yes, fim_cv_regex_broken=yes))
if test X$fim_cv_regex_broken = Xyes ; then
echo "Using the included GNU regex instead." >&AC_FD_MSG
fim_cv_regex=yes
fi
fi
if test X$fim_cv_regex = Xyes; then
AC_DEFINE(USE_GNU_REGEX,1,[ Define if you want to use the included (GNU) regex.c. ])
AC_LIBOBJ(regex)
fi
AC_MSG_CHECKING(where to put the documentation...)
dnl AC_ARG_WITH(docdir, AC_HELP_STRING([--with-docdir=PATH], [Specify where to put the documentation]),
dnl [fim_cv_docdir=$withval],
dnl [fim_cv_docdir='${prefix}/doc/fim-${fim_cv_version}'])
# FIXME : the above line seems troublesome, BUT IT IS NOT (see the muttrc for this trick).
AC_MSG_RESULT($fim_cv_docdir)
dnl docdir=$fim_cv_docdir
dnl AC_SUBST(docdir)
AC_SUBST(fim_cv_version)
dnl ============= gif file handling
AC_ARG_ENABLE(gif, AC_HELP_STRING([--disable-gif], [Disable gif support.]),
[ if test x$enableval = xno ; then
fim_handle_gif=no
fi
])
if test x$fim_handle_gif != xno ; then
fim_handle_gif=yes
have_gif=yes
if test x$with_libgif != xno && test -z "$LIBGIF"; then
AC_CHECK_LIB(gif,DGifOpenFileHandle ,
have_gif=yes,
have_gif=no
AC_MSG_WARN([*** GIF loader will not be built (GIF library not found) ***]))
if test x"$have_gif" = xyes; then
AC_MSG_CHECKING([for gif.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#undef HAVE_STDLIB_H
#include <gif_lib.h>],
have_gif=yes,
have_gif=no)
AC_MSG_RESULT($have_gif)
if test x"$have_gif" = xyes; then
LIBGIF='-lgif'
else
AC_MSG_WARN([*** GIF loader will not be built (GIF header file not found) ***])
fi
fi
fi
# if test x$with_libgif != xno ; then
# the following needs thorough testing
if test x"$have_gif" == xyes ; then
FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffGif.o"
LIBS="$LIBS $LIBGIF"
AC_DEFINE([FIM_HANDLE_GIF])
else
fim_handle_gif=no
fi
# if test x$with_libgif != xno && test -z "$LIBGIF"; then
#
# fi
else
fim_handle_gif=no
fi
AC_SUBST(LIBGIF)
AM_CONDITIONAL(ENABLE_GIF, test x$have_gif = xyes)
dnl ============= tiff file handling
AC_ARG_ENABLE(tiff, AC_HELP_STRING([--disable-tiff], [Disable tiff support.]),
[ if test x$enableval = xno ; then
fim_handle_tiff=no
fi
])
if test x$fim_handle_tiff != xno ; then
fim_handle_tiff=yes
have_tiff=yes
if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
AC_CHECK_LIB(tiff,TIFFOpen ,
have_tiff=yes,
have_tiff=no
AC_MSG_WARN([*** TIFF loader will not be built (TIFF library not found) ***]) , [$LIBTIFF_STATIC_EXTRA])
if test x"$have_tiff" = xyes; then
AC_MSG_CHECKING([for tiff.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#undef HAVE_STDLIB_H
#include <tiff.h>],
have_tiff=yes,
have_tiff=no)
AC_MSG_RESULT($have_tiff)
if test x"$have_tiff" = xyes; then
LIBTIFF="-ltiff $LIBTIFF_STATIC_EXTRA"
else
AC_MSG_WARN([*** TIFF loader will not be built (TIFF header file not found) ***])
fi
fi
fi
# if test x$with_libtiff != xno ; then
# the following needs thorough testing
if test x"$have_tiff" == xyes ; then
FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffTiff.o"
LIBS="$LIBS $LIBTIFF"
AC_DEFINE([FIM_HANDLE_TIFF])
else
fim_handle_tiff=no
fi
# if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
#
# fi
else
fim_handle_tiff=no
fi
AC_SUBST(LIBTIFF)
AM_CONDITIONAL(ENABLE_TIFF, test x$have_tiff = xyes)
dnl ============= curses: optional
AC_CHECK_LIB([curses],[noecho])
dnl ============= ncurses: optional
AC_CHECK_LIB([ncurses],[noecho])
dnl ============= cacalib : optional
AC_CHECK_LIB(caca, caca_create_canvas,have_cacalib=yes,have_cacalib=no)
dnl ============= GNU gpm, unofficial yet
# AC_CHECK_LIB(gpm,Gpm_Open,
# ,true,
# AC_MSG_ERROR(*** gpm lib not found ... no problem ... ***))
#LIBS="$LIBS -lgpm"
dnl ============= C++ version handling
fim_cxx_standard=98
AC_ARG_ENABLE(c++11, AC_HELP_STRING([--enable-c++11], [Enable C++11 standard constructs (requires appropriate CXXFLAGS, e.g. -std=c++11).]), [ if test x$enableval = xno ; then true; else fim_cxx_standard=11; fi ])
AC_ARG_ENABLE(c++14, AC_HELP_STRING([--enable-c++14], [Enable C++14 standard constructs (requires appropriate CXXFLAGS, e.g. -std=c++14) (EXPERIMENTAL).]), [ if test x$enableval = xno ; then true; else fim_cxx_standard=14; fi ])
AC_ARG_ENABLE(c++17, AC_HELP_STRING([--enable-c++17], [Enable C++17 standard constructs (requires appropriate CXXFLAGS, e.g. -std=c++17) (EXPERIMENTAL).]), [ if test x$enableval = xno ; then true; else fim_cxx_standard=17; fi ])
dnl ============= no readline case handling
fim_want_readline=yes
AC_ARG_ENABLE(readline, AC_HELP_STRING([--disable-readline], [Disable readline support (EXPERIMENTAL).]),
[ if test x$enableval = xno ; then
fim_want_readline=no
else
fim_want_readline=yes
fi
])
dnl ============= GNU readline : essential
dnl Please note that when the readline library is compiled with the curses library, this check will fail, because
dnl we cannot know in advance if it is so.
AH_TEMPLATE([FIM_USE_READLINE])
AH_TEMPLATE([FIM_HANDLE_GIF])
AH_TEMPLATE([FIM_HANDLE_TIFF])
have_readline=no
# Sometimes the readline library is linked to the curses library, and we here try to detect this case..
if test x$have_readline = xno; then
if test x$fim_want_readline = xyes ; then
AC_CHECK_LIB(readline, rl_replace_line,
have_readline=yes
LIBS="$LIBS -lreadline"
AC_DEFINE([FIM_USE_READLINE])
,have_readline=no
AC_MSG_ERROR(*** GNU readline (or curses library ?) not found (used LIBS=${LIBS}) ! please install them or specify them in e.g. LIBS=... or run ./configure --disable-readline ***)
,[]
)
else
have_readline=no
AC_MSG_NOTICE(*** Fim will be built withoud GNU readline library headers ! Are you sure ? ***)
fi
fi
dnl FIXME : we try to detecht curses, although we do not know if the preceding did use it
if test x$have_readline = xyes; then
if test x$fim_want_readline = xyes ; then
AC_CHECK_LIB(curses, tputs,
have_curses=yes
LIBS="$LIBS"
,have_curses=no
)
fi
fi
dnl ============= jpeg file handling
#AC_ARG_WITH(jpeg, [ --disable-jpeg ], [ disable jpeg file support])
AC_ARG_ENABLE(jpeg, AC_HELP_STRING([--disable-jpeg], [Disable jpeg support.]),
[ if test x$enableval = xno ; then
fim_handle_jpeg=no
fi
])
if test x$fim_handle_jpeg != xno ; then
fim_handle_jpeg=yes
have_jpeg=yes
if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
have_jpeg=yes,
have_jpeg=no
AC_MSG_WARN([*** JPEG loader will not be built (JPEG library not found) ***]))
if test x"$have_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>],
have_jpeg=yes,
have_jpeg=no)
AC_MSG_RESULT($have_jpeg)
if test x"$have_jpeg" = xyes; then
LIBJPEG='-ljpeg'
else
AC_MSG_WARN([*** JPEG loader will not be built (JPEG header file not found) ***])
fi
fi
fi
# if test x$with_libjpeg != xno ; then
# the following needs thorough testing
if test x"$have_jpeg" == xyes ; then
FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffJpeg.o"
LIBS="$LIBS $LIBJPEG"
AC_DEFINE([HAVE_LIBJPEG],[1],[We have libjpeg])
else
fim_handle_jpeg=no
fi
# if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
# AC_MSG_ERROR([
# Checks for JPEG loader failed. You can build without it by passing
# --disable-jpeg to ./configure. ])
# fi
else
fim_handle_jpeg=no
fi
AC_SUBST(LIBJPEG)
AM_CONDITIONAL(ENABLE_JPEG, test x$have_jpeg = xyes)
dnl ============= dvi file handling (via TeX-Guy)
dnl
dnl AC_ARG_ENABLE(dvi, AC_HELP_STRING([--disable-dvi], [Disable dvi support.]),
dnl [ if test x$enableval = xno ; then
dnl fim_handle_dvi=no
dnl fi
dnl ])
dnl if test x$fim_handle_dvi != xno ; then
dnl fim_handle_dvi=yes
dnl have_dvi=yes
dnl if test x$with_libdvi != xno && test -z "$LIBDVI"; then
dnl AC_CHECK_LIB(dvilib2, DVI_init,
dnl have_dvi=yes,
dnl have_dvi=no
dnl AC_MSG_WARN([*** DVI loader will not be built (libdvi29 library not found) ***]))
dnl if test x"$have_dvi" = xyes; then
dnl AC_MSG_CHECKING([for libdvi29.h])
dnl AC_TRY_CPP(
dnl [#include <stdio.h>
dnl #undef PACKAGE
dnl #undef VERSION
dnl #undef HAVE_STDLIB_H
dnl #include <libdvi29.h>],
dnl have_dvi=yes,
dnl have_dvi=no)
dnl AC_MSG_RESULT($have_dvi)
dnl if test x"$have_dvi" = xyes; then
dnl LIBDVI='-ldvilib2'
dnl else
dnl AC_MSG_WARN([*** DVI loader will not be built (libdvi29.h header file not found) ***])
dnl fi
dnl fi
dnl fi
dnl
dnl # the following needs thorough testing
dnl if test x"$have_dvi" == xyes ; then
dnl FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffDvi.o"
dnl LIBS="$LIBS $LIBDVI"
dnl AC_DEFINE([HAVE_LIBSPECTRE],[1],[We have libdvilib2])
dnl else
dnl fim_handle_dvi=no
dnl fi
dnl
dnl # if test x$with_libdvi != xno && test -z "$LIBDVI"; then
dnl # AC_MSG_ERROR([
dnl # Checks for DVI loader failed. You can build without it by passing
dnl # --disable-dvi to ./configure. ])
dnl # fi
dnl else
dnl fim_handle_dvi=no
dnl fi
dnl AC_SUBST(LIBDVI)
dnl AM_CONDITIONAL(ENABLE_DVI, test x$have_dvi = xyes)
dnl ============= ps file handling
AC_ARG_ENABLE(ps, AC_HELP_STRING([--disable-ps], [Disable ps support.]),
[ if test x$enableval = xno ; then
fim_handle_ps=no
fi
])
if test x$fim_handle_ps != xno ; then
fim_handle_ps=yes
have_ps=yes
if test x$with_libps != xno && test -z "$LIBPS"; then
AC_CHECK_LIB(spectre, spectre_page_render,
have_ps=yes,
have_ps=no
AC_MSG_WARN([*** PS loader will not be built (spectre library not found) ***]) , [$LIBSPECTRE_STATIC_EXTRA])
if test x"$have_ps" = xyes; then
AC_MSG_CHECKING([for libspectre/spectre.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#undef HAVE_STDLIB_H
#include <libspectre/spectre.h>],
have_ps=yes,
have_ps=no)
AC_MSG_RESULT($have_ps)
if test x"$have_ps" = xyes; then
LIBPS="-lspectre $LIBSPECTRE_STATIC_EXTRA"
else
AC_MSG_WARN([*** PS loader will not be built (PS header file not found) ***])
fi
fi
fi
# the following needs thorough testing
if test x"$have_ps" == xyes ; then
FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffPs.o"
LIBS="$LIBS $LIBPS"
AC_DEFINE([HAVE_LIBSPECTRE],[1],[We have libspectre])
else
fim_handle_ps=no
fi
# if test x$with_libps != xno && test -z "$LIBPS"; then
# AC_MSG_ERROR([
# Checks for PS loader failed. You can build without it by passing
# --disable-ps to ./configure. ])
# fi
else
fim_handle_ps=no
fi
AC_SUBST(LIBPS)
AM_CONDITIONAL(ENABLE_PS, test x$have_ps = xyes)
dnl ============= djvu file handling
AC_ARG_ENABLE(djvu, AC_HELP_STRING([--disable-djvu], [Disable djvu support.]),
[ if test x$enableval = xno ; then
fim_handle_djvu=no
fi
])
if test x$fim_handle_djvu != xno ; then
fim_handle_djvu=yes
have_djvu=yes
if test x$with_libdjvu != xno && test -z "$LIBDJVU"; then
AC_CHECK_LIB(djvulibre, ddjvu_page_create_by_pageno,
have_djvu=yes,
have_djvu=no
AC_MSG_WARN([*** DJVU loader will not be built (DJVU library not found) ***]), [$LIBDJVU_STATIC_EXTRA])
if test x"$have_djvu" = xyes; then
AC_MSG_CHECKING([for libdjvu/ddjvuapi.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#undef HAVE_STDLIB_H
#include <libdjvu/ddjvuapi.h>],
have_djvu=yes,
have_djvu=no)
AC_MSG_RESULT($have_djvu)
if test x"$have_djvu" = xyes; then
LIBDJVU="-ldjvulibre $LIBDJVU_STATIC_EXTRA"
else
AC_MSG_WARN([*** DJVU loader will not be built (DJVU header file not found) ***])
fi
fi
fi
# the following needs thorough testing
if test x"$have_djvu" == xyes ; then
FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffDjvu.o"
LIBS="$LIBS $LIBDJVU"
AC_DEFINE([HAVE_LIBDJVU],[1],[We have libdjvulibre])
else
fim_handle_djvu=no
fi
# if test x$with_libdjvu != xno && test -z "$LIBDJVU"; then
# AC_MSG_ERROR([
# Checks for DJVU loader failed. You can build without it by passing
# --disable-djvu to ./configure. ])
# fi
else
fim_handle_djvu=no
fi
AC_SUBST(LIBDJVU)
AM_CONDITIONAL(ENABLE_DJVU, test x$have_djvu = xyes)
dnl ============= pdf file handling with libpoppler
dnl
dnl By default, we disable poppler : its API is still immature.
dnl
fim_handle_pdf=no
AC_ARG_ENABLE(poppler, AC_HELP_STRING([--enable-poppler], [Enable poppler (PDF rendering) support. This will add LIBPOPPLER_CXXFLAGS="-I/usr/include/poppler/" to the compilation flags. You can override this by passing configure a suitable LIBPOPPLER_CXXFLAGS variable.]),
[ if test x$enableval = xyes ; then
fim_handle_pdf=yes
fi
], [$LIBPOPPLER_STATIC_EXTRA])
dnl FIXME : checking only for libpoppler-glib, should also check for libpoppler !
if test x$fim_handle_pdf != xno ; then
fim_handle_pdf=yes
have_poppler=yes
if test x$with_libpoppler != xno && test -z "$LIBPOPPLER"; then
dnl FIXME : the following is a dirty hack
AC_CHECK_LIB(poppler, gfree,
have_poppler=yes,
have_poppler=no
AC_MSG_WARN([*** POPPLER loader will not be built (POPPLER library not found) ***]) )
if test x"$have_poppler" = xyes; then
AC_MSG_CHECKING([for poppler/poppler-config.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#undef HAVE_STDLIB_H
/* fim uses these headers. let us hope poppler will stabilize soon!*/
#include <poppler/poppler-config.h>
#include <poppler/PDFDoc.h>
#include <poppler/OutputDev.h>
#include <poppler/SplashOutputDev.h>
#include <poppler/splash/SplashBitmap.h>
#include <poppler/splash/SplashTypes.h>
#include <poppler/Page.h>
#include <poppler/GlobalParams.h> /* globalParams lives here */
],
have_poppler=yes,
have_poppler=no)
have_poppler=yes
AC_MSG_RESULT($have_poppler)
if test x"$have_poppler" = xyes; then
LIBPOPPLER="-lpoppler $LIBPOPPLER_STATIC_EXTRA"
# FIXME: the following is a dirty hack!
if test x"$LIBPOPPLER_CXXFLAGS" = x ; then
LIBPOPPLER_CXXFLAGS="-I/usr/include/poppler/"
fi
CXXFLAGS="$CXXFLAGS $LIBPOPPLER_CXXFLAGS -DFIM_LIBPOPPLER_VERSION_MAYBE=$have_poppler_maybe_version"
dnl are we sure poppler does not have something like the following ?
dnl LIBPOPPLER_LIBS=`$LIBPOPPLER_CONFIG --libs`
else
AC_MSG_WARN([*** POPPLER/PDF loader will not be built (POPPLER header file not found) ***])
fi
fi
fi
# the following needs thorough testing
if test x"$have_poppler" == xyes ; then
FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffPdf.o"
LIBS="$LIBS $LIBPOPPLER"
AC_DEFINE([HAVE_LIBPOPPLER],[1],[We have libpoppler (Warning: the API could still break! (as of v.0.8.7--0.24.1))])
else
fim_handle_pdf=no
fi
# if test x$with_libpoppler != xno && test -z "$LIBPOPPLER"; then
# AC_MSG_ERROR([
# Checks for POPPLER loader failed. You can build without it by passing
# --disable-poppler to ./configure. ])
# fi
else
fim_handle_pdf=no
fi
AC_SUBST(LIBPOPPLER)
AM_CONDITIONAL(ENABLE_POPPLER, test x$have_poppler = xyes)
dnl FIXME : we have two libpoppler checks ... :
dnl ================== pdf checks ===================================================
AC_ARG_ENABLE(pdf,
[AC_HELP_STRING([--enable-pdf], [Compile with pdf support])],enable_pdf="$enableval",enable_pdf=yes)
if test "x$enable_pdf" = "xyes"; then
POPPLER_REQUIRED=0.8.7
# dear fim hackers, you should install pkg-config to get this macro expanded
PKG_CHECK_MODULES(POPPLER, poppler >= $POPPLER_REQUIRED,enable_pdf=yes,enable_pdf=no)
if test "x$enable_pdf" = "xyes"; then
AC_DEFINE([ENABLE_PDF], [1], [Enable pdf support.])
SHELL_LIBS="$SHELL_LIBS $POPPLER_LIBS"
SHELL_CXXFLAGS="$SHELL_CXXFLAGS $POPPLER_CXXFLAGS"
fim_save_LIBS=$LIBS
LIBS="$LIBS $POPPLER_LIBS"
LIBS=$fim_save_LIBS
else
AC_MSG_WARN(["PDF support is disabled since poppler library version $POPPLER_REQUIRED or newer not found"])
fi
fi
AM_CONDITIONAL(ENABLE_PDF, test x$enable_pdf = xyes)
dnl ================== end of pdf checks ============================================
dnl ================================================================================
fim_handle_bmp=yes
AC_ARG_ENABLE(bmp, AC_HELP_STRING([--disable-bmp], [Disable BMP file support (enabled by default).]),
[ if test x$enableval = xno ; then
fim_handle_bmp=no
fi
])
if test x$fim_handle_bmp = xyes; then
AC_MSG_NOTICE([Enabling BMP file format support.])
AC_DEFINE(FIM_WITH_BMP, 1, [BMP file support.])
FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffBmp.o"
else
AC_MSG_NOTICE([Disabling BMP file format support.])
AC_DEFINE(FIM_WITH_BMP, 0, [BMP file support.])
fi
dnl ================================================================================
fim_handle_pcx=yes
AC_ARG_ENABLE(pcx, AC_HELP_STRING([--disable-pcx], [Disable PCX file support (enabled by default).]),
[ if test x$enableval = xno ; then
fim_handle_pcx=no
fi
])
if test x$fim_handle_pcx = xyes; then
AC_MSG_NOTICE([Enabling PCX file format support.])
AC_DEFINE(FIM_WITH_PCX, 1, [PCX file support.])
FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffPcx.o"
else
AC_MSG_NOTICE([Disabling PCX file format support.])
AC_DEFINE(FIM_WITH_PCX, 0, [PCX file support.])
fi
dnl ================================================================================
## png file handling
AC_ARG_WITH(png-prefix, AC_HELP_STRING([--with-png-prefix=PFX], [prefix where libpng is installed (optional)]),
libpng_config_prefix="$withval", libpng_config_prefix="")
fim_handle_png=yes
AC_ARG_ENABLE(png, AC_HELP_STRING([--disable-png], [Disable png support.]),
[ if test x$enableval = xno ; then
fim_handle_png=no
fi
])
if test x$fim_handle_png = xyes; then
# support for custom library configurator path
if test x$libpng_config_prefix != x; then
LIBPNG_CONFIG="$libpng_config_prefix/bin/libpng-config"
else
# default path configurator
AC_PATH_PROG(LIBPNG_CONFIG, libpng-config, no)
fi
if test "x$LIBPNG_CONFIG" = "xno"; then
AC_MSG_WARN([*** PNG loader will not be built (PNG library not found) ***])
fim_handle_png=no
else
CXXFLAGS="$CXXFLAGS `$LIBPNG_CONFIG --cflags`"
if test x$fim_cv_want_static == x1 ; then
LIBS="$LIBS `$LIBPNG_CONFIG --static --libs`"
else
LIBS="$LIBS `$LIBPNG_CONFIG --libs`"
fi
# finish this !
FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffPng.o"
AC_DEFINE(FIM_WITH_LIBPNG, 1, [Defined, if libpng support is enabled])
fi
fi
#AM_CONDITIONAL(BUILD_PNG, test x$fim_handle_png = xyes)
dnl ================================================================================
fim_handle_xyz=no
AC_ARG_ENABLE(xyz, AC_HELP_STRING([--enable-xyz], [Enable the sample bogus 'xyz' file loading support. This makes only sense in order to learn how to include a new file format and wish to play with src/FbiStuffXyz.cpp in the while.]),
[ if test x$enableval = xyes ; then
fim_handle_xyz=yes
fi
])
if test x$fim_handle_xyz = xyes; then
LIBXYZ="" # one would set an actual value here
LIBS="$LIBS $LIBXYZ"
FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffXyz.o"
AC_DEFINE(FIM_WITH_LIBXYZ, 1, [Defined if sample bogus 'xyz' loader support is enabled.])
fi
dnl ================================================================================
## raw/nef file handling via UFRaw
fim_handle_ufraw=no
AC_ARG_ENABLE(ufraw, AC_HELP_STRING([--enable-ufraw], [Enable UFRaw support (EXPERIMENTAL).]),
[ if test x$enableval = xno ; then
fim_handle_ufraw=no
else
fim_handle_ufraw=yes
fi
])
if test x$fim_handle_ufraw = xyes; then
# support for custom library configurator path
CXXFLAGS="$CXXFLAGS $UFRAW_CXXFLAGS"
LIBS="$LIBS $UFRAW_LIBS"
FIM_LIB_OBJECTS="$FIM_LIB_OBJECTS FbiStuffUFRaw.o" # FIXME
AC_DEFINE(FIM_WITH_UFRAW, 1, [Defined, if UFRaw support is enabled])
AC_MSG_NOTICE([Enabling UFRaw / libufraw.])
fi