-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
879 lines (741 loc) · 29.2 KB
/
configure.in
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
dnl ================================================= IceWM configure script ===
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
dnl ========================================================= Initialization ===
dnl --------------------------------------------------------- Setup autoconf ---
dnl
AC_INIT(configure.in)
AC_PREREQ([2.50])
AC_CONFIG_HEADER(src/config.h)
AC_CANONICAL_TARGET
dnl --------------------------------------------------- Some basic variables ---
dnl
TARGETS=base
APPLICATIONS='icewm icewm-session icesh icewmhint icewmbg icewmtray'
TESTCASES=`echo src/test*.cc | sed 's%src/\([[^ ]]*\)\.cc%\1%g'`
TESTCASES="$TESTCASES iceview icesame iceicon icerun icelist icebar" # iceclock
features=''
dnl ---------- Checking for a C compiler in hope that it understands C++ too ---
dnl
AC_LANG_CPLUSPLUS
AC_PROG_CXX
dnl ----------- If both CC and CXX are GNU compilers, it is better to use CC ---
dnl ---- for linking.
dnl Unfortunately this has problems with newer g++/gcc/... :(
dnl if test x"$ac_cv_prog_gxx" != x; then
dnl AC_PROG_CC
dnl if test x"$ac_cv_prog_gcc" != x; then
dnl CXX_LINK=${CC}
dnl AC_DEFINE(NEED_ALLOC_OPERATORS, 1,
dnl [ Define if you need an implementation of the allocation operators. (gcc 3.0) ])
dnl fi
dnl fi
dnl ---------- Also check how to turn off RTTI and exception handling ---
dnl --- SunONE C++ supports no-rtti flag only in compat=4 mode
if test -z "`${CXX} -V 2>&1 | grep Sun`"; then
ICE_CXX_FLAG_ACCEPT(no_rtti, -fno-rtti)
fi
dnl --- Intel C++ supports -fno-rtti, but doens't support -fno-*-exceptions
if test $(basename $CXX) != "icc"; then
if test -n "`${CXX} -V 2>&1 | grep Sun`"; then
dnl --- Sun ONE C++ syntax for "no exceptions"
ICE_CXX_FLAG_ACCEPT(no_exceptions, -features=no%except)
else
if test $(basename $CXX) = "g++" ||
test $(basename $CXX) = "gcc"; then
ICE_CXX_FLAG_ACCEPT(no_exceptions, -fno-exceptions)
if test x"$no_exceptions_ok" = xno; then
ICE_CXX_FLAG_ACCEPT(no_exceptions, -fno-handle-exceptions)
fi
fi
fi
fi
if test $(basename $CXX) = "g++" ||
test $(basename $CXX) = "gcc" ; then
ICE_CXX_FLAG_ACCEPT(warn_xxx, -Wall -Wpointer-arith -Wwrite-strings -Woverloaded-virtual -W)
ICE_CXX_FLAG_ACCEPT(permissive, -fpermissive)
else
dnl --- Sun ONE doesn't support GCC -W* and -fpermissive
dnl --- Intel C++ doesn't supports lots of GCC -W* and -fpermissive
if test $(basename $CXX) = "icc"; then
dnl --- Using -w0 to avoid noisy "remark" messages
ICE_CXX_FLAG_ACCEPT(warn_xxx, -w0)
fi
fi
if test x"$CXX_LINK" = x; then
CXX_LINK=$CXX
fi
AC_SUBST(CXX_LINK)
if test x"$HOSTCXX" = x; then
HOSTCXX=$CXX
fi
AC_SUBST(HOSTCXX)
if test x"$HOSTCXX_LINK" = x; then
HOSTCXX_LINK=$CXX
fi
AC_SUBST(HOSTCXX_LINK)
#this test is broken, because AC_TRY_LINK calls g++
#AC_MSG_CHECKING([if we need our own C++ allocation operators])
#AC_TRY_LINK([ void icewm_alloc() {
# char * cp = new char; delete cp;
# char *ca = new char[23]; delete[] ca; } ],,
# [ AC_MSG_RESULT(no) ],
# [ AC_MSG_RESULT(yes)
# AC_DEFINE(NEED_ALLOC_OPERATORS, 1,
# [ Define if you need an implementation of the allocation operators. (gcc 3.0) ]) ])
AC_PROG_INSTALL
dnl ================================ Checks for things which don't require X ===
dnl ------------------------------------------------ Checks for header files ---
dnl
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/ioctl.h sys/time.h unistd.h)
AC_CHECK_HEADERS(linux/threads.h linux/tasks.h)
AC_CHECK_HEADERS(sched.h sys/dkstat.h sys/param.h sys/sysctl.h uvm/uvm_param.h)
AC_CHECK_HEADERS(libgen.h) dnl -- basename() for FreeBSD
AC_CHECK_HEADERS(machine/apmvar.h)
AC_CHECK_HEADERS(machine/apm_bios.h)
AC_CHECK_HEADERS(kstat.h,
[ CORE_LIBS="${CORE_LIBS} -lkstat"
AC_MSG_CHECKING([if have old kstat])
AC_TRY_COMPILE([#include <kstat.h>], [kstat_named_t k; k.value.ui32],
[ AC_MSG_RESULT(no) ],
[ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_OLD_KSTAT, 1,
[define if have old kstat (Solaris only?)])])])
dnl ---------- Checks for typedefs, structures, and compiler characteristics ---
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
dnl ------------------------------------------- Checks for library functions ---
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(gettimeofday putenv select socket strtol strtoul basename)
AC_CHECK_FUNCS(sysctlbyname)
AC_FUNC_SELECT_ARGTYPES
dnl ------ Checking for getloadavg(). Compatible with gcc 3.3 on FreeBSD 5.2 ---
AC_MSG_CHECKING([for getloadavg])
AC_TRY_LINK([#include <stdlib.h>],
[double loadavg[3]; getloadavg(loadavg, 3) == 0;],
[ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GETLOADAVG2, 1, [getloadavg() is available])],
[ AC_MSG_RESULT(no) ])
dnl ---------------------------------------- Check for kern.cp_time MIB item ---
AC_MSG_CHECKING([for kern.cp_time])
if /sbin/sysctl kern.cp_time 2>&1 | grep 'kern.cp_time *[[:=]]' >/dev/null; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SYSCTL_CP_TIME, 1, [kern.cp_time MIB item is available])
else
AC_MSG_RESULT(no)
fi
dnl ------------------------------------------------------- Checking for X11 ---
AC_PATH_XTRA
if test x"$no_x" != x; then
AC_MSG_ERROR([X Window System or development libraries not found. Make sure you have headers and libraries installed!])
fi
dnl ===================================================== Maintaince Support ===
dnl
AC_ARG_ENABLE(depend,
[ --enable-depend Automatic .h dependencies. Requires GNU make and gcc.],
[ if test "${enable_depend}" != "no"; then
features="${features} depend"
GCCDEP=-MMD
fi ])
AC_ARG_ENABLE(debug,
[ --enable-debug Use this option if you want to debug IceWM],
[ if test "${enable_debug}" = "yes"; then
AC_DEFINE(DEBUG, 1, [Define if you want to debug IceWM])
DEBUG="-g -DDEBUG -O0"
features="${features} debugging-symbols"
else
DEBUG=
fi ])
dnl =========================================================== I18N Support ===
dnl
AC_ARG_ENABLE(i18n,
[ --disable-i18n Disable internationalization])
if test "$enable_i18n" != "no"; then
AC_CHECK_HEADERS(langinfo.h,,
[ AC_MSG_ERROR([I18N support has been requested but langinfo.h wasn´t found.
*** Check your system configuration.])])
AC_CHECK_FUNC(nl_langinfo,,
[ AC_MSG_ERROR([I18N support has been requested but nl_langinfo wasn´t found.
*** Check your system configuration.])])
ice_nl_codesets=""
ICE_CHECK_NL_ITEM(CODESET,
[ ice_nl_codesets="${ice_nl_codesets} CODESET," ])
ICE_CHECK_NL_ITEM(_NL_CTYPE_CODESET_NAME,
[ ice_nl_codesets="${ice_nl_codesets} _NL_CTYPE_CODESET_NAME," ])
if test "${ice_nl_codesets}" = ""; then
AC_MSG_ERROR([I18N support has been requested but nl_langinfo doesn't
*** return any information about the locale's codeset. Check your manuals.
*** Ask your vendor. Contact icewm-devel@lists.sourceforge.net when you know
*** the name of the locale-dependent parameter for your platform.])
fi
ice_nl_codesets="${ice_nl_codesets} 0"
AC_DEFINE_UNQUOTED(CONFIG_NL_CODESETS, ${ice_nl_codesets},
[define how to query the current locale's codeset])
ice_iconv_cxxflags="${CXXFLAGS}"
AC_CHECK_HEADERS(iconv.h,,
[ AC_MSG_ERROR([I18N support has been requested but iconv.h wasn´t found.
*** Check your system configuration.
***
*** You might have to upgrade your C runtime library. If your system is
*** based on the GNU C library (glibc) you'll need version 2.2 or newer.
*** You also have the chance to install GNU libiconv available
*** from ftp://ftp.gnu.org/pub/gnu/libiconv/.
***
*** Alternatively you could call configure with the --disable-i18n switch.])])
AC_CHECK_DECL(_libiconv_version,
[ AC_MSG_RESULT(assuming iconv.h belongs to GNU libiconv)
LIBS="-liconv $LIBS"
AC_TRY_LINK([#include <iconv.h>], [iconv(0,0,0,0,0);],
AC_TRY_LINK([#include <iconv.h>], [iconv_open(0,0);],
AC_TRY_LINK([#include <iconv.h>], [iconv_close(0);],
CXXFLAGS="${CXXFLAGS}"
CORE_LIBS="${CORE_LIBS} -liconv"
AC_DEFINE(CONFIG_LIBICONV, 1, [Define when using libiconv]),
AC_MSG_ERROR([iconv.h appears to be part of libiconv but linking failed.
*** Check your system configuration.
***
*** You might have to upgrade your C runtime library. If your system is
*** based on the GNU C library (glibc) you'll need version 2.2 or newer.
*** You also have the chance to install GNU libiconv available
*** from ftp://ftp.gnu.org/pub/gnu/libiconv/.
***
*** Alternatively you could call configure with the --disable-i18n switch.]))))],
[ AC_MSG_RESULT(assuming iconv.h belongs to the C library)
AC_CHECK_FUNCS(iconv iconv_open iconv_close,,
AC_MSG_ERROR([iconv.h appears to be part of libc but linking failed.
*** Check your system configuration.
***
*** You might have to upgrade your C runtime library. If your system is
*** based on the GNU C library (glibc) you'll need version 2.2 or newer.
*** You also have the chance to install GNU libiconv available
*** from ftp://ftp.gnu.org/pub/gnu/libiconv/.
***
*** Alternatively you could call configure with the --disable-i18n switch.]))],
[#include <iconv.h>])
AC_ARG_WITH(unicode-set,
[ --with-unicode-set=CODESET your iconv's unicode set in machine endian encoding
(e.g. WCHAR_T, UCS-4-INTERNAL, UCS-4LE, UCS-4BE)],
AC_DEFINE_UNQUOTED(CONFIG_UNICODE_SET, "$with_unicode_set",
[preferred Unicode set]),
with_unicode_set=UCS-4//TRANSLIT)
if test "$with_unicode_set" = "UCS-4//TRANSLIT" ; then
ice_sufficent_iconv=no
ICE_CHECK_CONVERSION(UTF-8,$with_unicode_set,no,$ice_libiconv,
ice_sufficent_iconv=yes)
if test "$ice_sufficent_iconv" != "yes"
then
AC_MSG_WARN([Your implementation of iconv doesn't grok TRANSLIT])
with_unicode_set=UCS-4
fi
fi
ice_sufficent_iconv=no
ICE_CHECK_CONVERSION(ISO-8859-1,$with_unicode_set,no,$ice_libiconv,
ICE_CHECK_CONVERSION(ISO-8859-2,$with_unicode_set,no,$ice_libiconv,
ICE_CHECK_CONVERSION(UTF-8,$with_unicode_set,no,$ice_libiconv,
ice_sufficent_iconv=yes)))
CXXFLAGS="${ice_iconv_cxxflags}"
if test "$ice_sufficent_iconv" != "yes"
then
AC_MSG_ERROR([Your implementation of iconv isn't able to perform
*** the codeset conversions required. Check your system configuration.
***
*** You might have to upgrade your C runtime library. If your system is
*** based on the GNU C library (glibc) you'll need version 2.2 or newer.
*** You also have the chance to install GNU libiconv available
*** from ftp://ftp.gnu.org/pub/gnu/libiconv/.
***
*** Alternatively you could call configure with the --disable-i18n switch.])
fi
AC_DEFINE(CONFIG_I18N, 1, [Define to enable internationalization])
features="${features} i18n"
fi
dnl ============================================================ NLS Support ===
dnl
AC_ARG_ENABLE(nls,
[ --disable-nls Disable internationalized message])
if test "$enable_nls" != "no"; then
AC_CHECK_FUNC(bindtextdomain,,
[ AC_CHECK_LIB(intl, bindtextdomain,
[ CORE_LIBS="${CORE_LIBS} -lintl"
],
[ AC_MSG_ERROR([NLS (national language support) has been requested but
*** the 'bindtextdomain' function neither has been found in your C runtime library
*** nor in an external library called 'libintl'.
***
*** Install your vendor's version of libintl or get GNU gettext available
*** from ftp://ftp.gnu.org/pub/gnu/gettext/.
***
*** Alternatively you could call configure with the --disable-nls switch.])])])
AC_DEFINE(ENABLE_NLS, 1, [Define to enable internationalized message])
features="${features} nls"
TARGETS=$TARGETS' nls'
AC_PATH_PROG(XGETTEXT, xgettext)
AC_PATH_PROG(MSGMERGE, msgmerge)
AC_PATH_PROG(MSGFMT, msgfmt)
MSGMERGE="${MSGMERGE}" # --indent --verbose"
MSGFMT="${MSGFMT}" # --check --statistics --verbose"
if test ! -x "$MSGFMT" ; then
AC_MSG_ERROR(['msgfmt' not found. Perhaps you need to install 'gettext'?.])
fi
AC_SUBST(XGETTEXT)
AC_SUBST(MSGMERGE)
AC_SUBST(MSGFMT)
NLS_SOURCES=`grep -l '\<_\>' "src/"*.cc | sed 's%^%\$(top_srcdir)/%g'`
NLS_SOURCES=`echo ${NLS_SOURCES}`
NLS_POFILES=`cd "${srcdir}/po"; echo *.po`
NLS_POXFILES=`echo ${NLS_POFILES} | sed 's%\.po%.pox%g'`
NLS_MOFILES=`echo ${NLS_POFILES} | sed 's%\.po%.mo%g'`
AC_SUBST(NLS_SOURCES)
AC_SUBST(NLS_POFILES)
AC_SUBST(NLS_POXFILES)
AC_SUBST(NLS_MOFILES)
localedir='${datadir}/locale'
fi
dnl ================================================ Features of the XServer ===
dnl
CORE_CFLAGS="${X_CFLAGS}"
CORE_LIBS="${X_PRE_LIBS} ${CORE_LIBS} -lX11 ${X_LIBS} ${X_EXTRA_LIBS}"
no_x_libs=$LIBS
LIBS=$CORE_LIBS
AC_CHECK_LIB(X11, XInternAtoms,
[ AC_DEFINE(HAVE_XINTERNATOMS, 1, [Define to enable XInternAtoms]) ])
AC_ARG_ENABLE(sm,
[ --disable-sm Don't support the X session managment protocol])
if test "$enable_sm" != "no"; then
AC_CHECK_LIB(ICE, IceConnectionNumber,
[ AC_DEFINE(CONFIG_SESSION, 1, [Define to support the X session managment protocol]) ],
[ AC_MSG_WARN([Unable to use X shared memory extension]) ])
fi
ac_have_shape=no
AC_ARG_ENABLE(shape,
[ --disable-shape Don't use X shape extension])
if test "$enable_shape" != "no"; then
AC_CHECK_LIB(Xext, XShapeCombineRectangles,
[ CORE_LIBS="${CORE_LIBS} -lXext"
AC_DEFINE(CONFIG_SHAPE, 1, [Define to enable X shape extension])
ac_have_shape=yes ],
[ AC_MSG_WARN([Unable to use X shape extension]) ])
fi
if test "$ac_have_shape" = "yes"; then
AC_ARG_ENABLE(shaped-decorations,
[ --disable-shaped-decorations
Disable transparent frame decoration (titlebar,
borders), requires X shape extension (experimental) ])
if test "$enable_shaped_decorations" != "no"; then
AC_DEFINE(CONFIG_SHAPED_DECORATION, 1, [Define to allow transparent frame borders.])
features="${features} shaped-decorations"
fi
fi
AC_ARG_ENABLE(gradients,
[ --disable-gradients Support gradients])
if test "$enable_gradients" != "no"; then
AC_DEFINE(CONFIG_GRADIENTS, 1, [Define to enable gradient support.])
enable_antialiasing=yes
features="${features} gradients"
fi
dnl AC_ARG_ENABLE(antialiasing,
dnl [ --enable-antialiasing Support antialiasing (experimental,
dnl implies --enable-xfreetype) ])
dnl if test "$enable_antialiasing" = "yes"; then
dnl AC_DEFINE(CONFIG_ANTIALIASING, 1, [Define to enable antialiasing.])
dnl features="${features} antialiasing"
dnl
dnl if test "$enable_xfreetype" = "" ; then
dnl enable_xfreetype=implied
dnl fi
dnl fi
AC_ARG_ENABLE(xrandr,
[ --disable-xrandr Disable XRANDR extension support])
if test "$enable_xrandr" != "no"; then
AC_DEFINE(CONFIG_XRANDR, 1, [Define to enable XRANDR extension])
CORE_LIBS="$LIBS -lXrandr -lXrender -lXext"
fi
AC_ARG_ENABLE(corefonts,
[ --enable-corefonts Support X11 core fonts])
AC_ARG_ENABLE(xfreetype,
[ --disable-xfreetype Don't use XFreeType for text rendering.
Requires --enable-i18n. ])
if test "$enable_corefonts" != "yes" -a "$enable_xfreetype" = no; then
AC_MSG_ERROR("xfreetype or core fonts must be enabled")
fi
if test "$enable_xfreetype" != "no" -o "$enable_xfreetype" = "implied"; then
AC_PATH_PROG(XFT_CONFIG, xft-config,, ${with_xft_arg-${PATH}})
if test "${XFT_CONFIG}" = ""; then
AC_PATH_PROG(PKG_CONFIG, pkg-config)
if test "${PKG_CONFIG}" != ""; then
${PKG_CONFIG} xft 2>/dev/null
if test $? -eq 0 ; then
XFT_CONFIG='pkg-config freetype2 xft'
fi
fi
fi
if test "${XFT_CONFIG}" != ""; then
XFT_CFLAGS=`${XFT_CONFIG} --cflags`
XFT_LIBS=`${XFT_CONFIG} --libs`
AC_DEFINE(CONFIG_XFREETYPE, 2, [Define to enable XFreeType support.])
CORE_CFLAGS="${CORE_CFLAGS} $XFT_CFLAGS"
CORE_LIBS="${CORE_LIBS} $XFT_LIBS"
features="${features} xfreetype"
else
AC_CHECK_HEADERS(X11/Xft/Xft.h,
[ AC_CHECK_LIB(Xft, XftDrawCreate,
[ AC_DEFINE(CONFIG_XFREETYPE, 1, [Define to enable XFreeType support.])
CORE_LIBS="${CORE_LIBS} -lXft"
enable_corefonts=yes
features="${features} xfreetype" ],
[ if test "$enable_xfreetype" != "implied"; then
AC_MSG_ERROR([Xft support has been requested but libraries were not found.
*** Configure your X server to support XFreeType.
*** Information about how to do this can be found in RELNOTES for XFree86.])
fi ])],
[ if test "$enable_xfreetype" != "implied"; then
AC_MSG_ERROR([Xft support has been requested but headers were not found.
*** Configure your X server to support XFreeType.
*** Information about how to do this can be found in RELNOTES for XFree86.])
fi ])
fi
fi
if test "$enable_corefonts" = "yes"; then
AC_DEFINE(CONFIG_COREFONTS, 1, [Define to enable X11 core conts.])
features="${features} corefonts"
fi
dnl ============================================================= GUI Events ===
dnl
AC_ARG_ENABLE(guievents,
[ --enable-guievents Enable GUI events (experimental)],
[ if test "$enable_guievents" != "no"; then
AC_DEFINE(CONFIG_GUIEVENTS, 1, [Define to enable GUI events support.])
features="${features} gui-events"
AC_ARG_WITH(icesound,
[ --with-icesound=interfaces]
[ List of audio interfaces for icesound. Requires]
[ support for GUI events. Default: OSS,Y,ESound],,
[ with_icesound='OSS,Y,ESound' ])
for iface in `[ echo ${with_icesound} |
sed -e 's/\([^,][^,]*\)\(,\|$\)/\1 /g' ]`; do
case ${iface} in
OSS|oss)
AC_DEFINE(ENABLE_OSS, 1, [Define to enable OSS support.])
CONFIG_OSS=yes;;
Y|Y2|YIFF|y|y2|yiff)
AC_CHECK_HEADERS(Y2/Y.h,
AC_CHECK_LIB(Y2, YOpenConnection,
[ AC_DEFINE(ENABLE_YIFF, 1, [Define to enable YIFF support.])
AUDIO_LIBS="${AUDIO_LIBS} -lY2"
CONFIG_YIFF=yes ]));;
ESound|ESD|esound|esd)
AC_ARG_WITH(esd-config,
[ --with-esd-config=path Path to esd-config],
[ ESD_CONFIG=$with_esd_config ],
[ AC_PATH_PROG(ESD_CONFIG, esd-config) ])
if test "${ESD_CONFIG}" != ""; then
ESD_CFLAGS="`${ESD_CONFIG} --cflags`"
ESD_LIBS="`${ESD_CONFIG} --libs`"
ac_flags="$CXXFLAGS ${ESD_CFLAGS}"
ac_libs="$LIBS ${ESD_LIBS}"
# CXXFLAGS="${CXXFLAGS} ${ESD_CFLAGS}"
# LIBS="${LIBS} ${ESD_LIBS}"
AC_CHECK_HEADERS(esd.h,,
[ AC_MSG_ERROR([Invalid compiler flags returned by ${ESD_CONFIG}.
*** Check your installation.])])
AC_CHECK_LIB(esd, esd_open_sound,,
[ AC_MSG_ERROR([Invalid linker flags returned by ${ESD_CONFIG}.
*** Check your installation.])])
CXXFLAGS="$ac_flags"
LIBS="$ac_libs"
AC_DEFINE(ENABLE_ESD, 1, [Define to enable ESD support.])
AUDIO_CFLAGS="${AUDIO_CFLAGS} ${ESD_CFLAGS}"
AUDIO_LIBS="${AUDIO_LIBS} ${ESD_LIBS}"
CONFIG_ESD=yes
fi;;
*)
AC_MSG_WARN([Invalid audio interface: ${iface}])
esac
done
for iface in OSS YIFF ESD; do
eval test \"\${CONFIG_${iface}}\" = "yes" &&
audio_support="${audio_support} ${iface}"
done
if test "${audio_support}" = ""; then
AC_MSG_ERROR([You have to specify at least one valid audio interface.])
else
APPLICATIONS="${APPLICATIONS} icesound"
fi
fi ])
AC_ARG_ENABLE(xinerama,
[ --disable-xinerama Disable xinerama support])
if test "$enable_xinerama" = "no"; then
echo ;
else
LIBS="$LIBS -lXinerama -lXext "
AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
[
CORE_LIBS="-lXinerama $CORE_LIBS"
AC_DEFINE(XINERAMA, 1, [Define to enable Xinerama support])],
[ AC_MSG_ERROR([Xinerama can not be found])])
fi
AC_ARG_ENABLE(x86-asm,
[ --disable-x86-asm Don't use optimized x86 assembly code ])
case $target_cpu in
i[[3-6]]86) ice_x86_target=yes;;
*) ice_x86_target=no;;
esac
if test "$ice_x86_target" = "yes"; then
test "$enable_x86_asm" != "no" && enable_x86_asm=yes \
|| enable_x86_asm=no
fi
if test "$enable_x86_asm" = "yes"; then
AC_DEFINE(CONFIG_X86_ASM, 1, [Define to enable x86 assembly code.])
features="${features} x86-asm"
fi
AC_ARG_ENABLE(prefs,
[ --disable-prefs Disable configurable preferences])
if test "$enable_prefs" = "no"; then
AC_DEFINE(NO_CONFIGURE, 1, [Define to disable preferences support.])
fi
AC_ARG_ENABLE(keyconf,
[ --disable-keyconf Disable configurable keybindings])
if test "$enable_keyconf" = "no"; then
AC_DEFINE(NO_KEYBIND, 1, [Define to disable keybinding support.])
fi
AC_ARG_ENABLE(menuconf,
[ --disable-menuconf Disable configurable menus])
if test "$enable_menuconf" = "no"; then
AC_DEFINE(NO_CONFIGURE_MENUS, 1, [Define to disable configurable menu support.])
fi
AC_ARG_ENABLE(winoptions,
[ --disable-winoptions Disable configurable window options])
if test "$enable_winoptions" = "no"; then
AC_DEFINE(NO_WINDOW_OPTIONS, 1, [Define to disable configurable window options support.])
fi
dnl ======================================== Stripped down versions of IceWM ===
dnl
AC_ARG_ENABLE(taskbar,
[ --disable-taskbar Disable builtin taskbar])
if test "$enable_taskbar" = "no"; then
echo;
else
AC_DEFINE(CONFIG_TASKBAR, 1, [Define to to enable the builtin taskbar.])
fi
AC_ARG_ENABLE(winmenu,
[ --disable-winmenu Disable the window list menu])
if test "$enable_winmenu" = "no"; then
echo;
else
AC_DEFINE(CONFIG_WINMENU, 1, [Define to to enable the window list menu.])
fi
AC_ARG_ENABLE(lite,
[ --enable-lite Build lightweight version of IceWM],,
[ enable_lite=no ])
if test "${enable_lite}" != "yes"; then
AC_DEFINE(CONFIG_TOOLTIP, 1, [Tooltips])
if test "${enable_taskbar}" != "no"; then
AC_DEFINE(CONFIG_TASKBAR, 1, [Taskbar])
AC_DEFINE(CONFIG_ADDRESSBAR, 1, [Address bar])
AC_DEFINE(CONFIG_TRAY, 1, [Window tray])
AC_DEFINE(CONFIG_APPLET_MAILBOX, 1, [Mailbox applet])
AC_DEFINE(CONFIG_APPLET_CPU_STATUS, 1, [CPU status applet])
AC_DEFINE(CONFIG_APPLET_NET_STATUS, 1, [Network status applet])
AC_DEFINE(CONFIG_APPLET_CLOCK, 1, [LCD clock applet])
AC_DEFINE(CONFIG_APPLET_APM, 1, [APM status applet])
fi
AC_DEFINE(CONFIG_WINLIST, 1, [OS/2 like window list])
if test "${enable_winmenu}" != "no"; then
AC_DEFINE(CONFIG_WINMENU, 1, [Window menu])
fi
APPLICATIONS="${APPLICATIONS} icehelp"
else
AC_DEFINE(LITE, 1, [Lite version])
fi
IMAGE_CFLAGS=`pkg-config gdk-pixbuf-xlib-2.0 --cflags`
IMAGE_LIBS=`pkg-config gdk-pixbuf-xlib-2.0 --libs`
AC_DEFINE(CONFIG_GDK_PIXBUF_XLIB, 1, [Define to use gdk_pixbuf_xlib for image rendering])
image_library=gdk_pixbuf_xlib
dnl --------------------- We need mkfontdir to create fonts.dir for Infadel2 ---
AC_ARG_WITH(mkfontdir,
[ --with-mkfontdir=path Path to mkfontdir],
[ MKFONTDIR=$with_mkfontdir ],
[ AC_PATH_PROG(MKFONTDIR, mkfontdir,, $PATH:/usr/X11R6/bin) ])
LIBS=$no_x_libs
dnl Path adjustment
AC_ARG_WITH(kdedatadir,
[ --with-kdedatadir=path KDE's data directory (\$KDEDIR/share)],
[ if test x"$with_kdedatadir" = x -o "$with_kdedatadir" = "yes"; then
AC_MSG_ERROR([Invalid usage of --with-kdedatadir argument])
else
kdedatadir=$with_kdedatadir
fi ],
[ if test x"$KDEDIR" != x; then
kdedatadir="${KDEDIR}/share"
else
kdedatadir="${datadir}"
fi ]
)
dnl ======================================================== Some path stuff ===
dnl
AC_ARG_WITH(libdir,
[ --with-libdir=path Default data directory (\$datadir/icewm)],
[ if test x"$with_libdir" = x -o "$with_libdir" = "yes"; then
AC_MSG_ERROR([Invalid usage of --with-libdir argument])
else
libdatadir=$with_libdir
fi ],
[ libdatadir='${datadir}/icewm' ])
AC_ARG_WITH(cfgdir,
[ --with-cfgdir=path System configuration directory (/etc/icewm)],
[ if test x"$with_cfgdir" = x -o "$with_cfgdir" = "yes"; then
AC_MSG_ERROR([Invalid usage of --with-cfgdir argument])
else
cfgdatadir=$with_cfgdir
fi ],
[ cfgdatadir='/etc/icewm' ])
AC_ARG_WITH(docdir,
[ --with-docdir=path Documentation directory (\$prefix/doc)],
[ if test x"$with_docdir" = x -o "$with_docdir" = "yes"; then
AC_MSG_ERROR([Invalid usage of --with-docdir argument])
else
docdir=$with_docdir
fi ],
[ docdir='${datadir}/doc' ])
dnl ============================================================ GNOME stuff ===
dnl
AC_ARG_ENABLE(menus-gnome2,
[ --enable-menus-gnome2 Display GNOME 2 menus],
[ if test "${enable_menus_gnome2}" = "yes"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config)
if test "${PKG_CONFIG}" != ""; then
GNOME_VER=2
GNOME2_CFLAGS=`pkg-config --cflags gnome-desktop-2.0 libgnomeui-2.0`
GNOME2_LIBS=`pkg-config --libs gnome-desktop-2.0 libgnomeui-2.0`
AC_DEFINE(CONFIG_GNOME_MENUS, 1, [Define to make IceWM more GNOME-friendly])
APPLICATIONS="${APPLICATIONS} icewm-menu-gnome2"
GNOME2_PREFIX=`pkg-config --variable=prefix gnome-desktop-2.0`
GWMDIR="${GNOME2_PREFIX}/share/gnome/wm-properties/"
CONFIG_GNOME2_MENU_DIR="${GNOME2_PREFIX}/share/desktop-directories/"
fi
if test "${GNOME2_CFLAGS}" = ""; then
AC_MSG_ERROR([gnome 2 can not be found via pkg-config.
*** Install the GNOME´s development packages.])
fi
fi ])
CONFIG_KDE_MENU_DIR="`kde-config --path apps | sed -e 's/.*://'`"
AC_SUBST(GNOME_VER)
AC_SUBST(CONFIG_GNOME2_MENU_DIR)
AC_SUBST(CONFIG_KDE_MENU_DIR)
AC_DEFINE(WMSPEC_HINTS, 1, [wmspec hints])
AC_DEFINE(GNOME1_HINTS, 1, [GNOME1 hints])
dnl ====================================================== Write out results ===
dnl ---------------------------------------- First adjust some substitutions ---
AC_SUBST(PACKAGE,`sed -ne 's/PACKAGE=//p' VERSION`)
AC_SUBST(VERSION,`sed -ne 's/VERSION=//p' VERSION`)
AC_SUBST(HOSTOS,`uname -sr || echo unknown`)
AC_SUBST(HOSTCPU,`uname -m || echo unknown`)
dnl -------------------------------------------- Compiler flags, definitions ---
AC_SUBST(DEBUG)
AC_SUBST(GCCDEP)
AC_SUBST(CORE_CFLAGS)
AC_SUBST(IMAGE_CFLAGS)
AC_SUBST(AUDIO_CFLAGS)
AC_SUBST(GNOME2_CFLAGS)
AC_SUBST(CORE_LIBS)
AC_SUBST(IMAGE_LIBS)
AC_SUBST(AUDIO_LIBS)
AC_SUBST(GNOME2_LIBS)
ICE_EXPAND(PREFIX,${prefix})
ICE_EXPAND(BINDIR,${bindir})
ICE_EXPAND(LIBDIR,${libdatadir})
ICE_EXPAND(CFGDIR,${cfgdatadir})
ICE_EXPAND(LOCDIR,${localedir})
ICE_EXPAND(KDEDIR,${kdedatadir})
ICE_EXPAND(DOCDIR,${docdir})
ICE_EXPAND(MANDIR,${mandir})
AC_SUBST(PREFIX)
AC_SUBST(BINDIR)
AC_SUBST(LIBDIR)
AC_SUBST(CFGDIR)
AC_SUBST(LOCDIR)
AC_SUBST(KDEDIR)
AC_SUBST(DOCDIR)
AC_SUBST(MANDIR)
AC_SUBST(GWMDIR)
dnl ---------------------------------------------------------- Build targets ---
DEPENDENCIES=""
BASEOBJS=""
BASEBINS=""
for binary in ${APPLICATIONS}; do
BASEOBJS="${BASEOBJS} \$(${binary}_OBJS)"
BASEBINS="${BASEBINS} ${binary}\$(EXEEXT)"
done
AC_SUBST(BASEOBJS)
AC_SUBST(BASEBINS)
TESTOBJS=""
TESTBINS=""
for binary in ${TESTCASES}; do
TESTOBJS="${TESTOBJS} \$(${binary}_OBJS)"
TESTBINS="${TESTBINS} ${binary}\$(EXEEXT)"
done
AC_SUBST(TESTOBJS)
AC_SUBST(TESTBINS)
dnl -------------------------------------------------------- Install targets ---
TARGETS_INSTALL=`for target in ${TARGETS}; do echo $ECHO_N "install-${target} $ECHO_C"; done`
BINFILES=`for binary in ${APPLICATIONS}; do echo $ECHO_N "\\\$(top_srcdir)/src/${binary}\\\$(EXEEXT) $ECHO_C"; done`
AC_SUBST(TARGETS)
AC_SUBST(TARGETS_INSTALL)
AC_SUBST(APPLICATIONS)
AC_SUBST(TESTCASES)
AC_SUBST(BINFILES)
AC_SUBST(INSTALL)
AC_SUBST(INSTALLDIR,"${INSTALL} -m 755 -d")
AC_SUBST(INSTALLBIN,"${INSTALL_PROGRAM}")
AC_SUBST(INSTALLLIB,"${INSTALL_DATA}")
AC_SUBST(INSTALLETC,"${INSTALL_DATA}")
AC_SUBST(INSTALLMAN,"${INSTALL_DATA}")
dnl --------------------------------------------------------- Generate files ---
AC_CONFIG_COMMANDS(config.status, [
for binary in ${ac_targets_binaries}; do
echo "${binary}\$(EXEEXT): \$(${binary}_OBJS)" >> "${srcdir}/src/Makefile"
done
if test "${ac_depend}" = "yes"; then
echo >> "${srcdir}/src/Makefile"
echo '-include $(OBJECTS:.o=.d)' >> "${srcdir}/src/Makefile"
echo '-include $(genpref_OBJS:.o=.d)' >> "${srcdir}/src/Makefile"
fi
],[
ac_targets_binaries="${APPLICATIONS} ${TESTCASES}"
ac_depend="${enable_depend}"
])
AC_OUTPUT(
Makefile
src/Makefile
po/Makefile
lib/keys
lib/menu
lib/programs
lib/toolbar
lib/winoptions
)
dnl -------------------------------------------------------- Display results ---
AC_MSG_RESULT()
ICE_MSG_VALUE([Build targets], TARGETS)
ICE_MSG_VALUE([Applications], APPLICATIONS)
ICE_MSG_VALUE([Image library], image_library)
ICE_MSG_VALUE([Audio support], audio_support)
ICE_MSG_VALUE([Features], features)
ICE_MSG_VALUE([Paths: PREFIX], prefix)
ICE_MSG_VALUE([ BINDIR], bindir)
ICE_MSG_VALUE([ LOCDIR], localedir)
ICE_MSG_VALUE([ LIBDIR], libdatadir)
ICE_MSG_VALUE([ CFGDIR], cfgdatadir)
ICE_MSG_VALUE([ KDEDIR], kdedatadir)
ICE_MSG_VALUE([ DOCDIR], docdir)
ICE_MSG_VALUE([ MANDIR], mandir)