forked from ThomasAdam/fvwm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
1928 lines (1739 loc) · 56.1 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)
AC_INIT(fvwm/fvwm.c)
dnl should be "yes" only within the released distribution
ISRELEASED=no
version=2.6.6
VERSIONINFO=""
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="20 April 2012"
RELDATESHORT="02-Apr-2012"
RELDATENUM="2012-04-20"
# constant variable settings
FVWMNAMELONG="F? Virtual Window Manager"
FVWMHOMEPAGE="http://fvwm.org/"
FVWMFTP="ftp.fvwm.org"
FVWMFTPDIR="/pub/ftp"
FVWMALTFTP="metalab.unc.edu"
FVWMALTFTPDIR="/pub/Linux/X11/window-managers/"
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.'
if test ! x"$ISRELEASED" = xyes; then
VERSIONINFO=" (from cvs)"
RELDATELONG="(not released yet)"
RELDATESHORT="(not released yet)"
RELDATENUM="(not released yet)"
# # migo: unfortunately this nice idea can not work, it is not updated.
# # I will think more about this, maybe autoconf-2.50+ has a solution.
# if test -d CVS/ -a -f CVS/Entries && \
# date +%Y-%m-%d -d 'Wed Sep 4 12:36:50 2002' >/dev/null 2>&1
# then
# # this is not the exact date, but better than the current date
# for file in CVS/Entries */CVS/Entries; do
# changelog_date="`cat $file | grep /ChangeLog/ \
# | cut -d/ -f4`"
# test ! x"$changelog_date" = x && \
# date +%Y-%m-%d -d "$changelog_date" >>changelog_dates
# done
# changelog_date=`cat changelog_dates | sort -r -u | head -1`
# VERSIONINFO=" (from cvs $changelog_date)"
# rm -f changelog_dates
# fi
fi
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(FVWMFTP)
AC_SUBST(FVWMFTPDIR)
AC_SUBST(FVWMALTFTP)
AC_SUBST(FVWMALTFTPDIR)
AC_SUBST(FVWMLIST)
AC_SUBST(FVWMWORKERSLIST)
AC_SUBST(FVWMWORKERSLISTLONG)
AC_SUBST(MANPAGE_PREAMBLE)
AM_INIT_AUTOMAKE(fvwm, ${version})
AM_CONFIG_HEADER(config.h)
# check for programs needed to build html docs
AC_CHECK_PROG(SED, sed, sed, "")
AC_SUBST(SED)
# optional python:
AM_PATH_PYTHON([2.5],, [:])
#!!!
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])
HAVE_PERL_FOR_DOCS=1
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
HAVE_PERL_FOR_DOCS=0
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
FVWM_MODULESUBDIR=/${PACKAGE}/${VERSION}
FVWM_DATASUBDIR=/${PACKAGE}
FVWM_DOCSUBDIR=/doc/${PACKAGE}
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_DOCSUBDIR"
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)
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
AC_ARG_ENABLE(dmalloc,
AS_HELP_STRING([--enable-dmalloc],
[enable support for the dmalloc debugging library]),
[ac_cv_dmalloc="$enableval"],
[ac_cv_dmalloc="no"])
AC_ARG_ENABLE(efence,
AS_HELP_STRING([--enable-efence],
[enable support for the efence debugging library]),
[ac_cv_efence="$enableval"],
[ac_cv_efence="no"])
smr_SWITCH(command-log, command logging, off, FVWM_COMMAND_LOG,, [Produces a log of all executed commands and their times on stderr.])
AH_VERBATIM([_FVWM_COMMAND_LOG],
[#ifdef FVWM_COMMAND_LOG
# define FVWM_DEBUG_TIME 1
#endif])
smr_SWITCH(debug-msgs, debugging messages, off, FVWM_DEBUG_MSGS,, [if you would like to see lots of debug messages from fvwm, for debugging
purposes, uncomment the next line])
AH_VERBATIM([_FVWM_DEBUG_MSGS],
[#ifdef FVWM_DEBUG_MSGS
# define DBUG(x,y) fvwm_msg(DBG,x,y)
#else
# define DBUG(x,y) /* no messages */
#endif])
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 $CFLAGS"
fi
# Help finding POSIX functions on some systems
AC_ISC_POSIX
AC_MINIX
# catch -Werror and similar options when running configure
AC_TRY_COMPILE([#include <stdio.h>],
[int i; static j; int *p; char *c;
switch (*p = p = *c) { case 0: printf("%Q", c, p); }
*c = &i; c = p;
while (1 || (unsigned int)3 >= 0 || ((int)-1) == ((unsigned int)1));
return;], , AC_MSG_ERROR("
configure is not able to compile programs with warnings. Please
remove all offending options like -Werror from the CFLAGS and
CPPFLAGS variables and run configure again."))
# 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
case $host_os in
freebsd*)
AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);;
*)
;;
esac
# *** pkg-config
# unfortunately, we need pkg-config for the detection of certain libs:
# - version of fontconfig without fontconfig-config
# - version of fribidi without fribidi-config
AM_CHECK_PKG_CONFIG
# Building man pages & HTML documentation (from XML source).
# extract command names
if test ! x"$SED" = x; then
DOC_COMMANDS=`
sed -n '
:findhead
/#.*define.*CMD_ENT/bfindcmd
n
bfindhead
:findcmd
n
/CMD_ENT/bfound
bfindcmd
:found
/"#"/bfindcmd
/"propertychange"/bfindcmd
/"readwritecolors"/bfindcmd
/"send_.*"/bfindcmd
/"set_.*"/bfindcmd
s/.*CMD_ENT.*CMD_//
s/,.*//
p
n
bfindcmd
' < fvwm/functable.c`
DOC_COMMANDS=`echo $DOC_COMMANDS`
# with .xml suffix
DOC_COMMANDS_XML=`for i in $DOC_COMMANDS; do echo ${i}.xml; done`
DOC_COMMANDS_XML=`echo $DOC_COMMANDS_XML`
# with .xml suffix and path
DOC_COMMANDS_XML_PATH=`
for i in $DOC_COMMANDS; do
echo ../commands/${i}.xml;
done
`
DOC_COMMANDS_XML_PATH=`echo $DOC_COMMANDS_XML_PATH`
# with .html suffix
DOC_COMMANDS_HTML=`for i in $DOC_COMMANDS; do echo ${i}.html; done`
DOC_COMMANDS_HTML=`echo $DOC_COMMANDS_HTML`
# extract module names
DOC_MODULES=""
DOC_MODULES=`
for i in modules/*; do echo "$i"; done |
sed -n '
:search
/^modules.Fvwm/bfound
bnext
:found
s/modules.//
/FvwmTabs/bnext
p
:next
n
bsearch
'
`
DOC_MODULES=`echo $DOC_MODULES`
DOC_MODULES_HTML=`for i in $DOC_MODULES; do echo ${i}.html; done`
DOC_MODULES_HTML=`echo $DOC_MODULES_HTML`
# extract man page section names
DOC_SECTIONS=`cat doc/fvwm/sections`
DOC_SECTIONS=`echo $DOC_SECTIONS`
DOC_SECTIONS_XML=`for i in $DOC_SECTIONS; do echo ${i}.xml; done`
DOC_SECTIONS_XML=`echo $DOC_SECTIONS_XML`
DOC_SECTIONS_XML_PATH=`for i in $DOC_SECTIONS; do echo ${i}.xml; done`
DOC_SECTIONS_XML_PATH=`echo $DOC_SECTIONS_XML`
else
DOC_COMMANDS=""
DOC_COMMANDS_XML=""
DOC_COMMANDS_XML_PATH=""
DOC_COMMANDS_HTML=""
DOC_MODULES=""
DOC_MODULES_HTML=""
DOC_SECTIONS=""
DOC_SECTIONS_XML=""
DOC_SECTIONS_XML_PATH=""
fi
AC_SUBST(DOC_COMMANDS)
AC_SUBST(DOC_COMMANDS_XML)
AC_SUBST(DOC_COMMANDS_XML_PATH)
AC_SUBST(DOC_COMMANDS_HTML)
AC_SUBST(DOC_MODULES)
AC_SUBST(DOC_MODULES_HTML)
AC_SUBST(DOC_SECTIONS)
AC_SUBST(DOC_SECTIONS_XML)
AC_SUBST(DOC_SECTIONS_XML_PATH)
problem_mandoc=""
AC_CHECK_PROG(XSLTPROC, xsltproc, xsltproc, "")
AC_ARG_ENABLE(mandoc,
AS_HELP_STRING([--disable-mandoc],
[disable 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="not specified, check" ]
)
if test ! x"$with_mandoc" = xno; then
if test x"$XSLTPROC" = x ; then
with_mandoc="no"
problem_mandoc=": No xsltproc found in PATH"
elif test x"$SED" = x ; then
with_mandoc="no"
problem_mandoc=": No sed found in PATH"
elif test x"$HAVE_PERL_FOR_DOCS" = x0 ; then
with_mandoc="no"
problem_mandoc=": No perl found in PATH"
else
with_mandoc="yes"
fi
fi
AM_CONDITIONAL([FVWM_BUILD_MANDOC], [test x"$with_mandoc" = xyes])
problem_htmldoc=""
AC_ARG_ENABLE(htmldoc,
AS_HELP_STRING([--enable-htmldoc],[enable generation of HTML documentation]),
[ 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"$XSLTPROC" = x ; then
with_htmldoc="no"
problem_htmldoc=": No xsltproc found in PATH"
elif test x"$SED" = x ; then
with_htmldoc="no"
problem_htmldoc=": No sed found in PATH"
elif test x"$HAVE_PERL_FOR_DOCS" = x0 ; then
with_htmldoc="no"
problem_htmldoc=": No perl found in PATH"
else
with_htmldoc="yes"
fi
fi
AM_CONDITIONAL([FVWM_BUILD_HTMLDOC], [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])
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))
# ********* xineramA
problem_xinerama=""
AC_ARG_ENABLE(xinerama,
AS_HELP_STRING([--disable-xinerama],[disable Xinerama multi screen support]),
[ if test x"$enableval" = xyes; then
with_xinerama="yes, check"
else
with_xinerama="no"
problem_xinerama=": Explicitly disabled"
fi ],
[ with_xinerama="not specified, check" ]
)
AH_TEMPLATE([HAVE_XINERAMA],[Define if Xinerama library is used.])
AH_TEMPLATE([HAVE_SOLARIS_XINERAMA],
[Define if Solaris' Xinerama calls are being used.
(Solaris 7 11/99 and later)])
AH_TEMPLATE([HAVE_SOLARIS_XINERAMA_H],
[Define if Solaris' X11/extensions/xinerama.h header is provided.
(Solaris 9 and later)])
if test ! x"$with_xinerama" = xno; then
$UNSET ac_cv_lib_Xinerama_XineramaIsActive
_check_solaris_xinerama=no
AC_CHECK_LIB(Xinerama, XineramaIsActive,
with_xinerama=yes; Xinerama_LIBS=-lXinerama; AC_DEFINE(HAVE_XINERAMA),
_check_solaris_xinerama=yes,
[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
if test x"$_check_solaris_xinerama" = xyes; then
AC_CHECK_LIB(Xext, XineramaGetState,
[ AC_DEFINE(HAVE_XINERAMA) AC_DEFINE(HAVE_SOLARIS_XINERAMA)
with_xinerama=yes; Xinerama_LIBS=-lXext
my_CPPFLAGS="$CPPFLAGS"; CPPFLAGS="$X_CPPFLAGS $CPPFLAGS"
my_hdr="X11/extensions/xinerama.h"
AC_CHECK_HEADER($my_hdr, AC_DEFINE(HAVE_SOLARIS_XINERAMA_H)
problem_xinerama=" (Using Solaris Xinerama calls)",
problem_xinerama=" (Using Solaris 9 prototypes for missing header)")
CPPFLAGS="$my_CPPFLAGS"],
with_xinerama=no; Xinerama_LIBS=
problem_xinerama=": Failed to detect libXinerama",
[$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
fi
$UNSET _check_solaris_xinerama
fi
AC_SUBST(Xinerama_LIBS)
AC_SUBST(Xinerama_CFLAGS)
# ********* xinerama-emulation
smr_SWITCH(
xinerama-emulation,
[Xinerama emulation on one screen (useful only for developers)], off,
USE_XINERAMA_EMULATION,,
[Define if Xinerama should be emulated on a single screen.])
if test x"$enable_xinerama_emulation" = xyes; then
with_xinerama_emulation=yes
else
with_xinerama_emulation=no
fi
# ********* 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)
# ********* xft
problem_xft=""
AC_ARG_ENABLE(xft,
AS_HELP_STRING([--disable-xft],[disable Xft anti-aliased font rendering]),
[ if test x"$enableval" = xyes; then
with_xft="yes, check"
else
with_xft="no"
problem_xft=": Explicitly disabled"
fi ],
[
with_xft="not specified, check"
]
)
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])
if test ! x"$with_xft" = xno; then
# first check for freetype2
have_freetype=no
AM_CHECK_FT2(6.1.0)
if test x"$no_ft" = x; then
have_freetype=yes
else
have_freetype=no
problem_xft=": Can't detect freetype2 >= 6.1.0/2.0.6"
fi
# 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
fi
AC_SUBST(Xft_LIBS)
AC_SUBST(Xft_CFLAGS)
# ********* 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)
# XPMROOT=xpmroot AC_SUBST(XPMROOT)
# FVWMSCRIPT=FvwmScript AC_SUBST(FVWMSCRIPT)
else
xpm_LIBS=
xpm_CFLAGS=
fi
fi
AC_SUBST(xpm_LIBS)
AC_SUBST(xpm_CFLAGS)
# ********* png
problem_png=": png library or header not found"
$UNSET ac_cv_header_png_h
$UNSET ac_cv_lib_png_png_read_info
smr_CHECK_LIB(png, png, for coloured or shaped icons,
png_read_info, png.h, -lz -lm,)
if test ! x"$png_LIBS" = x; then
# Check for proper version of png
AC_MSG_CHECKING([for libpng 1.0.4a or better])
my_CPPFLAGS="$CPPFLAGS"
my_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $png_CFLAGS"
LIBS="$LIBS $png_LIBS -lz -lm"
AC_TRY_RUN([#include <png.h>
int main(int c, char **v) {
return c == 1 ? 0 : (PNG_LIBPNG_VER < 10005) ? 2 : 0 ;}],
[./conftest dummy_arg; png_status=$?;
if test x"$png_status" = x0; then
with_png=yes;
else
with_png=no;
if test x"$png_status" = x2; then
problem_png=": png library version is too old"
else
problem_png=": Internal png detection logic error"
fi
fi],
[with_png="no"; problem_png=": png test error, see config.log"],
[echo $ac_n "cross compiling; assumed OK... $ac_c"])
AC_MSG_RESULT($with_png)
CPPFLAGS="$my_CPPFLAGS"
LIBS="$my_LIBS"
fi
AH_TEMPLATE([HAVE_PNG],[Define if ppm library is used.])
if test x"$with_png" = xyes; then
AC_DEFINE(HAVE_PNG)
png_LIBS="$png_LIBS -lz"
problem_png=""
else
with_png=no
fi
AC_SUBST(png_LIBS)
AC_SUBST(png_CFLAGS)
# ** needed by the png support
AC_C_BIGENDIAN
# ********* 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" = xno ; 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)
# ********* rplay
$UNSET ac_cv_header_rplay_h
$UNSET ac_cv_lib_rplay_rplay_create
# Add in X_EXTRA_LIBS here to get things like connect().
smr_CHECK_LIB(rplay, , adds audio capability, rplay_create, rplay.h,
$X_EXTRA_LIBS)
AH_TEMPLATE([HAVE_RPLAY],[Define if rplay library is used.])
test ! x"$rplay_LIBS" = x && AC_DEFINE(HAVE_RPLAY)
AC_SUBST(rplay_LIBS)
AC_SUBST(rplay_CFLAGS)
# ********* stroke
$UNSET ac_cv_header_stroke_h
$UNSET ac_cv_lib_stroke_stroke_init
dnl Add in X_LIBS for MOUSE_DROPPINGS?
dnl As of 23/Mar/2000 the only libstroke RPM has /usr/X11R6/include/stroke.h
AH_TEMPLATE([HAVE_STROKE],[Define if stroke library is used.])
smr_CHECK_LIB(stroke, , mouse strokes recognition,
stroke_init, stroke.h,
[$X_LIBS -lX11], $X_CFLAGS -I/usr/X11R6/include)
test ! x"$stroke_LIBS" = x &&
AC_DEFINE(HAVE_STROKE)
AH_VERBATIM([_HAVE_STROKE],
[#ifdef HAVE_STROKE