-
-
Notifications
You must be signed in to change notification settings - Fork 78
/
configure.ac
1514 lines (1348 loc) · 43.9 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
AC_PREREQ(2.60)
dnl should be "yes" only within the released distribution
ISRELEASED="no"
if test $ISRELEASED = "no"; then
RELDATELONG=""
RELDATESHORT=""
RELDATENUM=""
fi
# Silence warning: ar: 'u' modifier ignored since 'D' is the default
AC_SUBST(AR_FLAGS, [cr])
AC_CONFIG_AUX_DIR(etc)
AC_CONFIG_LIBOBJ_DIR(libs)
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_SILENT_RULES([yes])
AM_CONFIG_HEADER(config.h)
VERSIONINFO=m4_esyscmd([./utils/fvwm-version-str.sh])
dnl date of the released version (please zero pad the day in the last 2 dates)
dnl for example: "4 February 2003", "04 Feb 2003", "2003-02-04"
dnl date format strings: "%e %B %Y", "%d-%b-%Y", "%Y-%m-%d"
RELDATELONG="30 March 24"
RELDATESHORT="30-Mar-24"
RELDATENUM="24-03-30"
# constant variable settings
FVWMNAMELONG="F? Virtual Window Manager"
FVWMHOMEPAGE="http://fvwm.org/"
FVWMLIST="[email protected]"
FVWMWORKERSLIST="[email protected]"
FVWMWORKERSLISTLONG="fvwm workers list <[email protected]>"
MANPAGE_PREAMBLE='.\" WARNING: This file was automatically generated. Edit the .in file instead.'
AC_SUBST(ISRELEASED)
AH_TEMPLATE([VERSIONINFO],[Additional version information, like date])
AC_DEFINE_UNQUOTED(VERSIONINFO, "$VERSIONINFO")
AC_SUBST(VERSIONINFO)
AC_SUBST(RELDATELONG)
AC_SUBST(RELDATESHORT)
AC_SUBST(RELDATENUM)
AC_SUBST(FVWMNAMELONG)
AC_SUBST(FVWMHOMEPAGE)
AC_SUBST(FVWMLIST)
AC_SUBST(FVWMWORKERSLIST)
AC_SUBST(FVWMWORKERSLISTLONG)
AC_SUBST(MANPAGE_PREAMBLE)
# check for programs needed to build html docs
AC_CHECK_PROG(SED, sed, sed, "")
AC_SUBST(SED)
# optional python:
PYTHON=
REQUIRED_PYTHON_VERSION=3.0
AC_SUBST(REQUIRED_PYTHON_VERSION)
AC_PATH_PROG([PYTHON],[python3],[:])
AS_IF([test "$PYTHON" != ":"],
[AM_PYTHON_CHECK_VERSION([$PYTHON],[$REQUIRED_PYTHON_VERSION],[:],
[PYTHON=":"])])
# Golang
problem_golang=""
AC_ARG_ENABLE(golang,
AS_HELP_STRING([--enable-golang],[enable compilation of modules written in Go]),
[ if test x"$enableval" = xyes; then
with_golang="yes, check"
else
with_golang="no"
problem_golang=": Explicitly disabled"
fi ],
[ with_golang="no" ]
)
if test ! x"$with_golang" = xno; then
AC_CHECK_PROGS(GO, go)
if test -n "$GO"; then
GOVERSIONOPTION=version
go_version=$($GO $GOVERSIONOPTION | sed -e 's/go version go//' | sed -e 's/ .*$//')
AX_COMPARE_VERSION([$go_version], [ge], ["1.14.0"],
[with_golang="yes";
problem_golang=" ($go_version)";
GO=],
[with_golang="no";
AC_MSG_ERROR([Go version ($go_version) is lower than the minimum required version ($REQUIRED_GO_VERSION)])])
fi
fi
AM_CONDITIONAL([FVWM_BUILD_GOLANG], [test x"$with_golang" = xyes])
AC_SUBST(GO)
#!!!
PERL=""
REQUIRED_PERL_VERSION=5.004
AC_SUBST(REQUIRED_PERL_VERSION)
if test x"$PERL" = x; then
AC_PATH_PROG(PERL, perl)
fi
if test ! x"$PERL" = x; then
AC_MSG_CHECKING([for perl $REQUIRED_PERL_VERSION or better])
if ("$PERL" -e "require $REQUIRED_PERL_VERSION;") 2>/dev/null; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_WARN([$PERL not found or too old])
fi
else
AC_MSG_WARN([perl is not found, it is required for some scripts and modules])
AC_MSG_WARN([It is recommended to install perl $REQUIRED_PERL_VERSION or better later])
PERL=/usr/bin/perl
fi
AC_MSG_RESULT([assuming $PERL as perl location])
AC_SUBST(PERL)
# installation paths
transform=`echo "${program_transform_name}" | "$SED" -e 's/\\$\\$/\\$/'`
PPACKAGE=`echo "${PACKAGE}" | "$SED" -e "${transform}"`
FVWM_MODULESUBDIR=/${PPACKAGE}/${VERSION}
FVWM_DATASUBDIR=/${PPACKAGE}
AC_ARG_ENABLE(package-subdirs,
AS_HELP_STRING([--disable-package-subdirs],
[do not create subdirs for modules and data]),
[if test x"$enableval" = xno; then FVWM_MODULESUBDIR=""; FVWM_DATASUBDIR="";
fi], [])
FVWM_MODULEDIR='${libexecdir}'"$FVWM_MODULESUBDIR"
FVWM_DATADIR='${datadir}'"$FVWM_DATASUBDIR"
FVWM_DOCDIR='${datadir}'"$FVWM_DATASUBDIR/htmldoc"
FVWM_PERLLIBDIR='${datadir}'"$FVWM_DATASUBDIR/perllib"
FVWM_CONFDIR='${sysconfdir}'dnl used _only_ to search for system.fvwm2rc
AC_SUBST(FVWM_MODULEDIR)
AC_SUBST(FVWM_DATADIR)
AC_SUBST(FVWM_PERLLIBDIR)
AC_SUBST(FVWM_CONFDIR)
AC_SUBST(FVWM_DOCDIR)
# Check for compatibility for missing implementations.
AC_REPLACE_FUNCS([ \
asprintf \
])
AH_TEMPLATE([FVWM_CONFIG],
[Name of config filenames in FVWM_USERDIR and FVWM_DATADIR])
AC_DEFINE(FVWM_CONFIG, "config")
AH_TEMPLATE([FVWM2RC],[Suffix for old (to be deprecated) config filenames])
AC_DEFINE(FVWM2RC, ".fvwm2rc")
# Various configure-time options
dnl dummy: smr_SWITCH(sm, dummy for test script, on, SESSION)
# Need to know where X is, for finding some libraries (e.g. xpm)
no_x=""
AC_PATH_XTRA
if test x"$no_x" = x"yes"; then
echo
echo "X11 libraries or header files could not be found. Please make"
echo "sure the X11 development package is installed on your system."
echo "If it is definitely installed, try setting the include and library"
echo "paths with the --x-include and --x-libraries options of configure."
echo "Fvwm can not be compiled without the X11 development environment."
echo
echo "Aborting."
echo
exit 1
fi
# FIXME: default value should be derived from computed path to X
# includes. Actually, this should probably not appear in configure
# at all: it is settable at runtime, and only confuses the issue to
# have it settable here too.
#
AC_MSG_CHECKING(imagepath)
val="/usr/include/X11/bitmaps:/usr/include/X11/pixmaps"
AC_ARG_WITH(imagepath,
AS_HELP_STRING([--with-imagepath=PATH],
[colon-delimited search path for images]),
[ case "$withval" in
no)
AC_MSG_ERROR([Can not disable image path.])
;;
yes)
;;
*)
val="$withval"
;;
esac ])
AH_TEMPLATE([FVWM_IMAGEPATH],[Where to search for images.])
AC_DEFINE_UNQUOTED(FVWM_IMAGEPATH, "$val")
FVWM_IMAGEPATH="$val"
AC_SUBST(FVWM_IMAGEPATH)
AC_MSG_RESULT($val)
# Minimal checks for programs: enough to enable checking for
# optional libraries.
AC_PROG_CC
AC_PROG_CPP
# added -Wall for gcc, what about for others?
if test "x$GCC" = "xyes"; then
CFLAGS="-Wall -Wno-implicit-int -fno-common -Wno-error=format-security $CFLAGS"
fi
# Help finding POSIX functions on some systems
AC_ISC_POSIX
AC_MINIX
# check size of some types
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $X_CFLAGS"
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(Window, , [#include <stdio.h>
#include <X11/X.h>])
AC_CHECK_SIZEOF(Pixel, , [#include <stdio.h>
#include <X11/Intrinsic.h>])
AC_CHECK_SIZEOF(void *)
CFLAGS="$ac_save_CFLAGS"
size_check_failed=""
if test "$ac_cv_sizeof_void_p" -gt "$ac_cv_sizeof_long"; then
echo "The type void * is bigger than long."
size_check_failed=1
fi
if test "$ac_cv_sizeof_Window" -gt "$ac_cv_sizeof_long"; then
echo "The type Window is bigger than long."
size_check_failed=1
fi
if test "$ac_cv_sizeof_Pixel" -gt "$ac_cv_sizeof_long"; then
echo "The type Pixel is bigger than long."
size_check_failed=1
fi
if test x"$size_check_failed" = x1; then
echo "This is not supported by the module interface yet (make_new_vpacket)."
echo "Detected type sizes are: int($ac_cv_sizeof_int), long($ac_cv_sizeof_long), void*($ac_cv_sizeof_void_p), Window($ac_cv_sizeof_Window), Pixel($ac_cv_sizeof_Pixel)"
echo "Please report details of your system and this message to ${FVWMWORKERSLIST}."
echo
exit 1
fi
# 'unset' is not portable, but setting to null is not enough to avoid using
# the cached value! For ancient shells "rm config.cache" is a solution.
UNSET=true
if unset UNSET 2>/dev/null; then UNSET=unset; fi
# ********* multibyte
# FreeBSD has libxpg4, check this and use if found.
AC_CANONICAL_HOST
AC_MSG_CHECKING(platform)
case "$host_os" in
freebsd*)
PLATFORM=freebsd
AC_MSG_RESULT(FreeBSD)
AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])
;;
*openbsd*)
PLATFORM=openbsd
AC_MSG_RESULT(OpenBSD)
CFLAGS="$CFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
;;
*darwin*)
PLATFORM=macos
AC_MSG_RESULT(MacOS)
;;
*)
PLATFORM=unknown
AC_MSG_RESULT(unknown)
;;
esac
AC_SUBST(PLATFORM)
AM_CONDITIONAL([HOST_MACOS], [test "$PLATFORM" = "macos"])
if test "x$PLATFORM" = "xmacos"; then
AC_DEFINE([HOST_MACOS], [macos], [Host is MacOS])
fi
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([xt],[xt],
[],
[
AC_MSG_ERROR([*** libxt not found. ***])
])
problem_mandoc=""
AC_CHECK_PROG(ASCIIDOC, asciidoctor, asciidoctor, "")
AC_SUBST(ASCIIDOC)
AC_ARG_ENABLE(mandoc,
AS_HELP_STRING([--enable-mandoc],
[enable generation of man pages]),
[ if test x"$enableval" = xyes; then
with_mandoc="yes, check"
else
with_mandoc="no"
problem_mandoc=": Explicitly disabled"
fi ],
[ with_mandoc="no" ]
)
if test ! x"$with_mandoc" = xno; then
if test x"$ASCIIDOC" = x ; then
with_mandoc="no"
problem_mandoc=": No asciidoctor found in PATH"
else
with_mandoc="yes"
fi
fi
AM_CONDITIONAL([FVWM_BUILD_MANDOC], [test x"$with_mandoc" = xyes])
AC_ARG_ENABLE(htmldoc,
AS_HELP_STRING([--enable-htmldoc],
[enable generation of html man pages]),
[ if test x"$enableval" = xyes; then
with_htmldoc="yes, check"
else
with_htmldoc="no"
problem_htmldoc=": Explicitly disabled"
fi ],
[ with_htmldoc="no" ]
)
if test ! x"$with_htmldoc" = xno; then
if test x"$ASCIIDOC" = x ; then
with_htmldoc="no"
problem_htmldoc=": No asciidoctor found in PATH"
else
with_htmldoc="yes"
fi
fi
AM_CONDITIONAL([FVWM_BUILD_HTMLDOC], [test x"$with_htmldoc" = xyes])
AM_CONDITIONAL([FVWM_BUILD_DOC], [test x"$with_mandoc" = xyes || test x"$with_htmldoc" = xyes])
# ********* session management
# Check the availability of SM; we don't have to add any extra libraries,
# since -lSM -lICE are in X_PRE_LIBS when they exist.
dnl [old check] AC_CHECK_LIB(SM, SmcOpenConnection, AC_DEFINE(SESSION), ,
dnl [old check] [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
problem_sm=""
AC_ARG_ENABLE(sm,
AS_HELP_STRING([--disable-sm],[disable session management support]),
[ if test x"$enableval" = xyes; then
with_sm="yes, check"
else
with_sm="no"
problem_sm=": Explicitly disabled"
fi ],
[ with_sm="not specified, check" ]
)
if test ! x"$with_sm" = xno; then
dnl Uncomment the following and comment out AC_CHECK_LIB to get --with-sm-*
dnl $UNSET ac_cv_lib_SM_SmcOpenConnection
dnl $UNSET ac_cv_header_X11_SM_SMlib_h
dnl smr_CHECK_LIB(sm, SM, adds session management support, SmcOpenConnection,
dnl X11/SM/SMlib.h,
dnl [$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS], $X_CFLAGS)
dnl test "$sm_LIBS" && AC_DEFINE(SESSION)
$UNSET ac_cv_lib_SM_SmcOpenConnection
AH_TEMPLATE([SESSION],[Enables session management functionality.])
AC_CHECK_LIB(SM, SmcOpenConnection, with_sm=yes; AC_DEFINE(SESSION),
with_sm=no; problem_sm=": Failed to detect libSM",
[$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
ac_LIBS="$LIBS"
LIBS="$LIBS -lICE"
AC_CHECK_FUNCS([_IceTransNoListen],
[AC_CHECK_HEADERS([X11/Xtrans/Xtrans.h],
[AC_DEFINE(ICE_t, 1, [Xtrans transport type])
dnl AC_DEFINE(TRANS_CLIENT, 1, [Xtrans transport client code])
AC_DEFINE(TRANS_SERVER, 1, [Xtrans transport server code])])])
LIBS="$ac_LIBS"
fi
dnl AC_SUBST(sm_LIBS)
dnl AC_SUBST(sm_CFLAGS)
# Checking for optional libraries
# Default is to use them if found; can be disable using --without
# These are put up front so that if they are requested, but
# configure fails to find them, we fail early.
# ********* shape extension
dnl smr_SWITCH(shape, shape extensions, on, SHAPE)
AC_ARG_ENABLE(shape,
AS_HELP_STRING([--disable-shape],[disable shaped window support]),
[ if test x"$enableval" = xyes; then
with_shape="yes, check"
else
with_shape="no"
problem_shape=": Explicitly disabled"
fi ],
[ with_shape="not specified, check" ]
)
AH_TEMPLATE(SHAPE,
[ Define if you want the Shaped window extensions.
Shaped window extensions seem to increase the window managers RSS
by about 60 Kbytes. They provide for leaving a title-bar on the window
without a border.
If you don't use shaped window extension, you can either make your
shaped windows undecorated, or live with a border and backdrop around
all your shaped windows (oclock, xeyes)
If you normally use a shaped window (xeyes or oclock), you might as
well compile this extension in, since the memory cost is minimal in
this case (The shaped window shared libs will be loaded anyway). If you
don't normally use a shaped window, you have to decide for yourself.
Note: if it is compiled in, run time detection is used to make sure that
the currently running X server supports it.])
if test ! x"$with_shape" = xno; then
$UNSET ac_cv_lib_Xext_XShapeQueryExtension
AC_CHECK_LIB(Xext, XShapeQueryExtension,
with_shape=yes; AC_DEFINE(SHAPE),
with_shape=no;
problem_shape=": Failed to detect Shape extension",
[$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
fi
# ********* MIT Shared Memory Extension
AC_ARG_ENABLE(shm,
AS_HELP_STRING([--disable-shm],[disable MIT Shared Memory Extension]),
[ if test x"$enableval" = xyes; then
with_shm="yes, check"
else
with_shm="no"
problem_shm=": Explicitly disabled"
fi ],
[ with_shm="not specified, check" ]
)
AH_TEMPLATE([HAVE_XSHM],[Define if MIT Shared Memory extension is used.])
if test ! x"$with_shm" = xno; then
$UNSET ac_cv_lib_Xext_XShmQueryExtension
AC_CHECK_LIB(Xext, XShmQueryExtension,
with_shm=yes; AC_DEFINE(HAVE_XSHM),
with_shm=no;
problem_shm=": Can't detect MIT Shared Memory ext.",
[$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
fi
# Silently look for X11/XKBlib.h
AH_TEMPLATE([HAVE_X11_XKBLIB_H],[Define if Xkb extension is used.])
AC_CHECK_HEADER(X11/XKBlib.h, AC_DEFINE(HAVE_X11_XKBLIB_H))
# libevent
AH_TEMPLATE([HAVE_LIBEVENT],[Define if libevent is used.])
PKG_CHECK_MODULES([libevent], [libevent >= 2.0],
[
AC_DEFINE(HAVE_LIBEVENT)
libevent_LIBS=`pkg-config --libs libevent`
],
[
AC_MSG_ERROR([*** libevent >=2 not found. Install its header files. ***])
])
AC_SUBST(libevent_LIBS)
AC_SUBST(libevent_CFLAGS)
# ********* XRandR
AH_TEMPLATE([HAVE_XRANDR],[Define if XRandR library is used.])
PKG_CHECK_MODULES([xrandr], [xrandr >= 1.5],
[
AC_DEFINE(HAVE_XRANDR)
XRandR_LIBS=-lXrandr
],
[
AC_MSG_ERROR([*** XRandR not found. Install its header files. ***])
])
AC_SUBST(XRandR_LIBS)
AC_SUBST(XRandR_CFLAGS)
# ********* xrender
problem_xrender=""
AC_ARG_ENABLE(xrender,
AS_HELP_STRING([--disable-xrender],[disable Xrender alpha-blend rendering]),
[ if test x"$enableval" = xyes; then
with_xrender="yes, check"
else
with_xrender="no"
problem_xrender=": Explicitly disabled"
fi ],
[ with_xrender="not specified, check" ]
)
AH_TEMPLATE([HAVE_XRENDER],[Define if Xrender library is used.])
if test ! x"$with_xrender" = xno; then
$UNSET ac_cv_lib_Xrender_XRenderComposite
AC_CHECK_LIB(Xrender, XRenderComposite,
with_xrender=yes; Xrender_LIBS=-lXrender;
AC_DEFINE(HAVE_XRENDER),
with_xrender=no; Xrender_LIBS=
problem_xrender=": Failed to detect libXrender",
[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
fi
AC_SUBST(Xrender_LIBS)
AC_SUBST(Xrender_CFLAGS)
# ********* xcursor
AH_TEMPLATE([HAVE_XCURSOR],[Define if Xcursor library is used.])
xcursor_CFLAGS=""
xcursor_LIBS=""
AC_ARG_ENABLE(xcursor,
AS_HELP_STRING([--disable-xcursor],
[disable Xcursor ARGB/animated cursor loading]),
[ if test x"$enableval" = xno; then
with_xcursor=no
problem_xcursor=": Explicitly disabled"
fi ],
)
if test ! x"$with_xcursor" = xno; then
with_xcursor=no
if test ! x"$with_xrender" = xno; then
$UNSET ac_cv_lib_Xrender_XRenderCreateCursor
AC_CHECK_LIB(Xrender, XRenderCreateCursor, [
with_xcursor=yes
],[
problem_xcursor=": Your libXrender version is too old"
],
[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
else
problem_xcursor=": Need Xrender support"
fi
fi
if test x"$with_xcursor" = xyes ; then
$UNSET ac_cv_lib_Xcursor_XcursorImageLoadCursor
AC_CHECK_LIB(Xcursor, XcursorImageLoadCursor, [
AC_DEFINE(HAVE_XCURSOR)
Xcursor_LIBS=-lXcursor
problem_xcursor=""
],[
with_xcursor=no
problem_xcursor=": Failed to detect libXcursor"
],[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
fi
AC_SUBST(Xcursor_CFLAGS)
AC_SUBST(Xcursor_LIBS)
freetype_CFLAGS=""
freetype_LIBS=""
AH_TEMPLATE([HAVE_XFT],[Define if Xft library is used.])
AH_TEMPLATE([HAVE_XFT2],[Define if Xft 2 library is used.])
AH_TEMPLATE([HAVE_XFT_UTF8],[Define if Xft library can handle utf8 encoding])
AC_MSG_CHECKING([whether pkg-config could find freetype2])
if "${PKG_CONFIG}" --exists freetype2; then
AC_MSG_RESULT([yes])
CFLAGS_FREETYPE=`"${PKG_CONFIG}" --cflags freetype2`
FREETYPE_LIBS=`"${PKG_CONFIG}" --libs freetype2`
freetype_CFLAGS="$CFLAGS_FREETYPE"
freetype_LIBS="$FREETYPE_LIBS"
have_freetype=yes
else
AC_MSG_RESULT([no])
have_freetype=no
fi
AC_SUBST(freetype_CFLAGS)
AC_SUBST(freetype_LIBS)
# check for fontconfig for Xft 2
have_fontconfig=no
if test ! x"$have_freetype" = xno ; then
AM_CHECK_FC(1.0.1)
if test x"$no_fc" = x ; then
have_fontconfig=yes
fontconfig_CFLAGS=`$PKG_CONFIG --cflags fontconfig`
fontconfig_LIBS=`$PKG_CONFIG --libs fontconfig`
CFLAGS="$CFLAGS $fontconfig_CFLAGS"
LIBS="$LIBS $fontconfig_LIBS"
else
have_fontconfig=no
problem_xft=": Can't detect fontconfig >= 1.0.1"
fi
fi
# now check for Xft 2
with_xft=no
if test ! x"$have_fontconfig" = xno ; then
# Xft 2
AM_CHECK_XFT(2.0.0)
if test x"$no_xft" = x; then
with_xft=yes
problem_xft=" (version 2)"
AC_DEFINE(HAVE_XFT2)
AC_DEFINE(HAVE_XFT)
AC_DEFINE(HAVE_XFT_UTF8)
Xft_LIBS=$XFT_LIBS
Xft_CFLAGS=$XFT_CFLAGS
else
problem_xft=": Can't detect Xft2, detected fontconfig"
fi
fi
# if Xft2 not detected check for Xft1
if test ! x"$have_freetype" = xno && test ! x"$with_xft" = xyes; then
#Xft 1
$UNSET ac_cv_lib_XftConfigSubstitute
$UNSET ac_cv_lib_Xft_XftFontOpen
$UNSET ac_cv_lib_Xft_XftDrawStringUtf8
AC_CHECK_LIB(Xft, XftFontOpen,
with_xft=yes, with_xft=no,
[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $FT2_LIBS $Xrender_LIBS])
if test x"$with_xft" = xyes ; then
AC_CHECK_LIB(Xft, XftConfigSubstitute, is_xft1=yes, is_xft1=no,
[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $FT2_LIBS $Xrender_LIBS])
if test x"$is_xft1" = xyes; then
Xft_LIBS="-lXft $FT2_LIBS"
Xft_CFLAGS="$Xft_CFLAGS $FT2_CFLAGS"
problem_xft=" (version 1)"
AC_DEFINE(HAVE_XFT)
else
with_xft=no
problem_xft=": Can't detect Xft 1 or fontconfig"
fi
else
problem_xft=": Can't detect Xft 1 or 2 and fontconfig"
fi
if test x"$with_xft" = xyes; then
AC_CHECK_LIB(Xft, XftDrawStringUtf8,
AC_DEFINE(HAVE_XFT_UTF8),,
[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $FT2_LIBS $Xrender_LIBS])
fi
fi
AC_SUBST(Xft_LIBS)
AC_SUBST(Xft_CFLAGS)
if test x"$with_xft" = "no" || test x"$with_fontconfig" = "xno" || \
test x"$have_freetype" = "xno"; then
AC_MSG_ERROR(["*** XFT/Fontconfig/Freetype not found. ***])
fi
# ********* xpm
problem_xpm=": Xpm library or header not found"
$UNSET ac_cv_header_X11_xpm_h
$UNSET ac_cv_lib_Xpm_XpmReadFileToXpmImage
smr_CHECK_LIB(xpm, Xpm, for coloured or shaped icons,
XpmReadFileToXpmImage, X11/xpm.h,
[$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS], $X_CFLAGS)
if test ! x"$xpm_LIBS" = x; then
# Check for proper version of Xpm -- from XEmacs 21.x configure.in
AC_MSG_CHECKING([for Xpm 3.4g or better])
my_CPPFLAGS="$CPPFLAGS"
my_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $xpm_CFLAGS $X_CFLAGS"
LIBS="$LIBS $xpm_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
AC_TRY_RUN([#include <X11/xpm.h>
int main(int c, char **v) {
return c == 1 ? 0 :
XpmIncludeVersion != XpmLibraryVersion() ? 1 :
XpmIncludeVersion < 30407 ? 2 : 0 ;}],
[./conftest dummy_arg; xpm_status=$?;
if test x"$xpm_status" = x0; then
with_xpm=yes
problem_xpm=""
else
with_xpm=no;
if test x"$xpm_status" = x1; then
problem_xpm=": Xpm library and header versions don't match"
elif test x"$xpm_status" = x2x; then
problem_xpm=": Xpm library version is too old"
else
problem_xpm=": Internal xpm detection logic error"
fi
fi],
[with_xpm=no; problem_xpm=": Xpm test error, see config.log"],
[echo $ac_n "cross compiling; assumed OK... $ac_c"])
AC_MSG_RESULT($with_xpm)
CPPFLAGS="$my_CPPFLAGS"
LIBS="$my_LIBS"
AH_TEMPLATE([XPM],[Define if Xpm library is used.])
if test x"$with_xpm" = xyes; then
AC_DEFINE(XPM)
# FVWMBANNER=FvwmBanner AC_SUBST(FVWMBANNER)
# FVWMSCRIPT=FvwmScript AC_SUBST(FVWMSCRIPT)
else
xpm_LIBS=
xpm_CFLAGS=
fi
fi
AC_SUBST(xpm_LIBS)
AC_SUBST(xpm_CFLAGS)
# ********* png
png_LIBS=""
png_CFLAGS=""
AH_TEMPLATE([HAVE_PNG], [Define PNG])
AC_ARG_ENABLE(png,
AS_HELP_STRING([--disable-png],
[Disables libpng support.]),
[with_png="$enableval"],
[with_png="yes"])
if test "$with_png" = no; then
AC_MSG_WARN([***
disabling PNG support will mean the default
configuration shipped with FVWM will be without icon
support. Be sure this is what you mean to do.
***])
else
AC_MSG_CHECKING([for libpng...])
PKG_CHECK_MODULES([png], [libpng >= 1.2],
[
AC_DEFINE(HAVE_PNG)
],
[
AC_MSG_ERROR([***
libpng not found, and --disable-png not given.
It is recommended to use libpng so that PNG icons can
be rendered by FVWM, which the default configuration
file needs, as well as other third-party programs
which generate menus, for example.
If it is critical that FVWM does not link against
libpng (perhaps due to size limitations of the
binary), then use --disable-png
***])
])
# ** needed by the png support
AC_C_BIGENDIAN
fi
AC_SUBST(png_LIBS)
AC_SUBST(png_CFLAGS)
# ********* rsvg
rsvg_min_version=2.13.92
AH_TEMPLATE([HAVE_RSVG], [Define if librsvg library is used.])
AC_ARG_ENABLE(rsvg,
AS_HELP_STRING([--disable-rsvg],
[disable scalable vector graphics (SVG images)]),
[ if test x"$enableval" = xno; then
with_rsvg=no
problem_rsvg=": Explicitly disabled"
fi ],
)
if test ! x"$with_rsvg" = xno; then
with_rsvg=no
if test ! x"$PKG_CONFIG" = x ; then
AC_MSG_CHECKING(for librsvg - version >= $rsvg_min_version)
if $PKG_CONFIG --exists librsvg-2.0 ; then
if $PKG_CONFIG --exists "librsvg-2.0 >= $rsvg_min_version" ; then
AC_MSG_RESULT(yes)
AC_MSG_CHECKING(for cairo svg backend)
if $PKG_CONFIG --exists cairo-svg ; then
svg_packages="librsvg-2.0 cairo-svg"
elif $PKG_CONFIG --exists libsvg-cairo ; then
svg_packages="librsvg-2.0 libsvg-cairo"
elif $PKG_CONFIG --exists cairo ; then
svg_packages="librsvg-2.0 cairo"
else
svg_packages=""
fi
if test ! x"$svg_packages" = x ; then
AC_MSG_RESULT(yes)
rsvg_CFLAGS=`$PKG_CONFIG --cflags $svg_packages`
rsvg_LIBS=`$PKG_CONFIG --libs $svg_packages`
with_rsvg=yes
else
AC_MSG_RESULT(no)
AC_MSG_WARN([*** cairo was not found in the pkg-config search])
AC_MSG_WARN([*** path. Add the directory containing cairo.pc])
AC_MSG_WARN([*** to the PKG_CONFIG_PATH environment variable.])
problem_rsvg=": Cannot detect cairo backend"
fi
else
AC_MSG_RESULT(no)
AC_MSG_WARN([*** Your librsvg version is < $rsvg_min_version])
problem_rsvg=": Your librsvg version is too old"
fi
else
AC_MSG_RESULT(no)
AC_MSG_WARN([*** librsvg-2.0 was not found in the pkg-config search])
AC_MSG_WARN([*** path. Either librsvg is not installed or you need])
AC_MSG_WARN([*** to add the directory containing librsvg-2.0.pc to])
AC_MSG_WARN([*** the PKG_CONFIG_PATH environment variable.])
problem_rsvg=": librsvg library or header not found"
fi
else
problem_rsvg=": pkg-config not found"
fi
fi
if test x"$with_rsvg" = xyes ; then
AC_MSG_CHECKING(whether a librsvg program compiles and runs)
original_CFLAGS="$CFLAGS"
original_LIBS="$LIBS"
CFLAGS="$CFLAGS $rsvg_CFLAGS"
LIBS="$LIBS $rsvg_LIBS"
AC_TRY_RUN([
#include <librsvg/rsvg.h>
#include <librsvg/rsvg-cairo.h>
int main() {
RsvgHandle *rsvg;
g_type_init();
if(!(rsvg = rsvg_handle_new())) return 1;
g_object_unref(G_OBJECT(rsvg));
return 0;
}
], [
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
AC_MSG_WARN([*** The librsvg test program failed to run. If your system])
AC_MSG_WARN([*** has shared libraries outside the normal system library])
AC_MSG_WARN([*** path, you need to make sure that the LD_LIBRARY_PATH])
AC_MSG_WARN([*** (or the like) environment variable is correctly set.])
with_rsvg=no
problem_rsvg=": Failed to run test program"
], [echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$original_CFLAGS"
LIBS="$original_LIBS"
fi
if test x"$with_rsvg" = xyes ; then
AC_DEFINE(HAVE_RSVG)
problem_rsvg=""
else
rsvg_CFLAGS=""
rsvg_LIBS=""
fi
AC_SUBST(rsvg_CFLAGS)
AC_SUBST(rsvg_LIBS)
# ********* readline
with_readline=no
problem_readline=": Both termcap and ncurses disabled"
smr_ARG_WITHLIB(termcap, , to accomplish readline)
AH_TEMPLATE([HAVE_READLINE],[Define if readline is available.])
if test ! x"$with_termcap" = xno; then
# Forget cached values, so user can re-run configure
$UNSET ac_cv_header_readline_history_h
$UNSET ac_cv_lib_readline_readline
AC_MSG_CHECKING([with termcap])
smr_CHECK_LIB(readline, , line editing/history, readline, readline/history.h,
$termcap_LIBS)
if test ! x"$readline_LIBS" = x; then
with_readline=yes
readline_LIBS="$readline_LIBS $termcap_LIBS"
AC_DEFINE(HAVE_READLINE)
fi
fi
smr_ARG_WITHLIB(ncurses, , to accomplish readline)
if test ! x"$with_ncurses" = xno && test x"$readline_LIBS" = x; then
# We couldn't use readline with termcap; try with ncurses?
# Doesn't this seem a hacky way to do this??
# unset cached values from last check...
$UNSET ac_cv_header_readline_history_h
$UNSET ac_cv_lib_readline_readline
AC_MSG_CHECKING([with ncurses])
dnl We can not call smr_CHECK_LIB twice here without having the usage twice.
dnl old_LIBS=$LIBS
dnl AC_CHECK_LIB(readline, readline, , , $ncurses_LIBS)
dnl LIBS=$old_LIBS
dnl if test x"$ac_cv_lib_readline_readline" = xyes; then
dnl AC_CHECK_HEADERS(readline/history.h)
dnl if test x"$ac_cv_header_readline_history_h" = xyes; then
dnl with_readline=yes
dnl readline_LIBS="$readline_LIBS $ncurses_LIBS"
dnl AC_DEFINE(HAVE_READLINE)
dnl fi
dnl fi
smr_CHECK_LIB(readline, , line editing/history, readline, readline/history.h,
$ncurses_LIBS)
if test ! x"$readline_LIBS" = x; then
with_readline=yes
readline_LIBS="$readline_LIBS $ncurses_LIBS"
AC_DEFINE(HAVE_READLINE)
fi
fi
dnl We need to check if we have GNU readline or BSD editline
AH_TEMPLATE([HAVE_GNU_READLINE],[Define if readline has full GNU interface])
if test x"$with_readline" = xyes; then
AC_CHECK_LIB(readline, append_history, AC_DEFINE(HAVE_GNU_READLINE), [], $readline_LIBS)
fi
AC_SUBST(readline_LIBS)
AC_SUBST(readline_CFLAGS)
# Check if Xsetlocale() is available or not.
AH_TEMPLATE([X_LOCALE],[Enables to use setlocale() provided by X])
AC_CHECK_LIB(X11, _Xsetlocale, AC_DEFINE(X_LOCALE),, $X_LIBS -lX11)
# Check if Xsetlocale() is available or not.
AH_TEMPLATE([HAVE_XOUTPUT_METHOD],[Enable X output method])
AC_CHECK_LIB(X11, XOpenOM, AC_DEFINE(HAVE_XOUTPUT_METHOD),, $X_LIBS -lX11)
# ******** iconv
with_iconv=no
with_iconv_type=no
with_lib_iconv=no
with_sys_iconv=no
problem_iconv=": Explicitly disabled"
AC_ARG_ENABLE(iconv,
AS_HELP_STRING([--disable-iconv],
[disable support for iconv character conversion]),
[ac_cv_iconv="$enableval"],
[ac_cv_iconv="yes"])
AH_TEMPLATE([USE_LIBICONV],
[define if we use libiconv (not needed in general: for example iconv is
native with recent glibc)])
AH_TEMPLATE([HAVE_ICONV],
[Define if iconv (in the libc) or libiconv is available])
if test ! x"$ac_cv_iconv" = xno; then
# * first check for gnu libiconv
$UNSET ac_cv_header_libiconv_h
$UNSET ac_cv_lib_libiconv_libiconv_open
smr_CHECK_LIB(
iconv, , if not found sys iconv is used, libiconv_open, iconv.h)
if test ! x"$iconv_LIBS" = x; then
AC_DEFINE(USE_LIBICONV)
with_lib_iconv=yes
fi
AC_SUBST(iconv_LIBS)
AC_SUBST(iconv_CFLAGS)
# * check for system iconv
AC_CHECK_FUNC(iconv_open, with_sys_iconv=yes)
if test x"$with_lib_iconv" = xyes && test x"$with_sys_iconv" = xyes; then
AC_MSG_WARN([*** Both system iconv and libiconv found: use libiconv])
AC_MSG_WARN([*** Use --with-iconv-library=no to use the system iconv])
fi
# * libiconv found check for libcharset to get the good iconv charset
if test x"$with_lib_iconv" = xyes; then
CHECK_LIBCHARSET
fi
test x"$with_lib_iconv" = xyes -o x"$with_sys_iconv" = xyes &&
with_iconv=yes && problem_iconv=""
test x"$with_lib_iconv" = xyes && with_iconv_type="yes (libiconv)"
test x"$with_sys_iconv" = xyes && with_iconv_type="yes (from C library)"
if test x"$with_iconv" = xno; then
AC_MSG_WARN([*** ])
AC_MSG_WARN([*** No iconv() implementation found in C library or libiconv])
AC_MSG_WARN([*** Please install libiconv ftp://ftp.gnu.org/pub/gnu/libiconv/])
AC_MSG_WARN([*** ])
fi
if test x"$with_iconv" = xyes; then
AC_DEFINE(HAVE_ICONV)
ICONV_SECOND_ARG
fi
fi
AH_VERBATIM([_HAVE_LIBCHARSET],
[#ifdef USE_LIBICONV
/* define to use locale_charset in the place of nl_langinfog if libiconv
* is used */
#undef HAVE_LIBCHARSET
#endif])
# ******** nl_langinfo and CODESET
AH_TEMPLATE([HAVE_CODESET],[Have nl_langinfo (CODESET)])
AC_MSG_CHECKING([for nl_langinfo (CODESET)])
AC_TRY_COMPILE([#include <langinfo.h>
#include <locale.h>],
[char *codeset = nl_langinfo(CODESET); setlocale(LC_CTYPE, "");],
AC_DEFINE(HAVE_CODESET)
have_codeset=yes,
have_codeset=no)
AC_MSG_RESULT($have_codeset)
# ********* fribidi
AC_ARG_ENABLE(bidi,
AS_HELP_STRING([--disable-bidi],[disable bi-directional text support]),
[ if test x"$enableval" = xyes; then
with_bidi="yes, check"
else
with_bidi="no"
problem_bidi=": Explicitly disabled"