-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
800 lines (647 loc) · 21.4 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
dnl Process this file with autoconf to produce a configure script.
dnl $Id$
dnl configure.in
dnl Autoconf script for SCWM
dnl (C) 1998, 1999, 2000 Greg J. Badros and Maciej Stachowiak
dnl ## Initialize autoconf ##
AC_INIT(src/scwm.c)
. $srcdir/SCWM-VERSION
AC_PREREQ(2.4)
dnl ## Initialize automake ##
AM_INIT_AUTOMAKE(scwm, $VERSION, no-define)
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(include/scwmconfig.h)
## This will try to create the named directory if it does not exist
AC_DEFUN([SCWM_ARG_PATH],
[
AC_ARG_WITH($1,[$2],[
if test -z "${withval}" || test "yes" = "${withval}" || test "no" = "${withval}"; then
AC_MSG_ERROR(missing pathname argument to --with-$1)
else
if test ! -d "${withval}"; then
AC_MSG_WARN(directory for --with-$1: ${withval} does not exist -- creating)
mkdir -p ${withval} || mkdirhier ${withval}
fi
$3
fi],
$4)
])
## This does not permit non-existing directories
AC_DEFUN([SCWM_ARG_PATH_MAYBE_EMPTY],
[
AC_ARG_WITH($1,[$2],[
if test ! -z "${withval}" && test ! "yes" = "${withval}" && test ! "no" = ${withval} && test ! -d "${withval}"; then
AC_MSG_ERROR(invalid pathname argument to --with-$1: ${withval})
else
$3
fi],
$4)
])
dnl ## Checks for programs ##
AC_ARG_ENABLE(cflags,
[ --enable-cflags=FLAGS Set CFLAGS to FLAGS [-g -O2]],
[case "$enableval" in
yes|no) echo "Please specify a parameter for --enable-cflags"
exit;;
esac
CFLAGS="$enableval"; export CFLAGS
])
AC_ARG_ENABLE(cppflags,
[ --enable-cppflags=FLAGS Set CPPFLAGS to FLAGS [-g -O2]],
[case "$enableval" in
yes|no) echo "Please specify a parameter for --enable-cppflags"
exit;;
esac
CPPFLAGS="$enableval"; export CPPFLAGS
])
AC_ARG_ENABLE(cxxflags,
[ --enable-cxxflags=FLAGS Set CXXFLAGS to FLAGS [-g -O2]],
[case "$enableval" in
yes|no) echo "Please specify a parameter for --enable-cxxflags"
exit;;
esac
CXXFLAGS="$enableval"; export CXXFLAGS
])
AC_PROG_CC
AC_PROG_CXX
AC_CHECK_PROGS(GTAR, gnutar gtar tar, "no")
AC_DEFUN([scwm_TAR_IS_GNU_TAR],
[AC_MSG_CHECKING(whether $GTAR is GNU tar)
AC_CACHE_VAL(scwm_cv_TAR_IS_GNU_TAR,
[
if $GTAR --version >/dev/null 2>&1
then
scwm_cv_TAR_IS_GNU_TAR="yes";
else
scwm_cv_TAR_IS_GNU_TAR="no";
fi])dnl
TAR_IS_GNU_TAR="$scwm_cv_TAR_IS_GNU_TAR";
if test "yes" = "$TAR_IS_GNU_TAR"
then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
])
scwm_TAR_IS_GNU_TAR
if test "no" = "$TAR_IS_GNU_TAR"; then
TAR_CF="$GTAR cf";
TAR_SUFFIX="tar";
else
TAR_CF="$GTAR zcf";
TAR_SUFFIX="tar.gz";
fi
AC_SUBST(TAR_CF)
AC_SUBST(TAR_SUFFIX)
dnl Ensure compiler sanity on pathological platforms
AC_ISC_POSIX
AC_AIX
AC_MINIX
dnl Use ANSI mode
AM_PROG_CC_STDC
AC_PROG_LIBTOOL
if test "NONE" = "$prefix"; then
PREFIX_INCLUDES="-I$ac_default_prefix/include"
else
PREFIX_INCLUDES="-I$prefix/include"
fi
dnl # check for build-guile #
GUILE_BIN_DIR=""
GUILE_INCLUDES=""
guile_lib_path=""
if test "NONE" = "$exec_prefix"; then
if test "NONE" = "$prefix"; then
guile_lib_path="$ac_default_prefix/lib"
else
guile_lib_path="$prefix/lib"
fi
else
guile_lib_path="$exec_prefix/lib"
fi
if test "NONE" = "$prefix"; then
GUILE_INCLUDES="-I$ac_default_prefix/include"
else
GUILE_INCLUDES="-I$prefix/include"
fi
SCWM_ARG_PATH(guile-prefix,
[ --with-guile-prefix=DIR Expect guile to be installed in DIR [optional]],
[
AC_MSG_CHECKING(where to expect to find guile)
guile_prefix="${withval}"
GUILE_BIN_DIR="${guile_prefix}/bin"
GUILE_INCLUDES="-I${guile_prefix}/include"
guile_lib_path="${guile_prefix}/lib"
AC_MSG_RESULT("${guile_prefix}")
])
SCWM_ARG_PATH(guile-exec-prefix,
[ --with-guile-exec-prefix=DIR
Expect guile binaries to be installed in DIR
[optional]],
[
AC_MSG_CHECKING(where to expect to find guile binaries)
guile_exec_prefix="${withval}"
GUILE_BIN_DIR="${guile_exec_prefix}"
AC_MSG_RESULT("${guile_exec_prefix}")
])
if test -z "${GUILE_BIN_DIR}"; then
AC_PATH_PROGS(GUILE_CONFIG, guile-config build-guile, no)
else
AC_PATH_PROGS(GUILE_CONFIG, guile-config build-guile, no, ${GUILE_BIN_DIR})
fi
if test "no" != "$GUILE_CONFIG"; then
AC_MSG_CHECKING(whether guile-config or build-guile works)
if (${GUILE_CONFIG} link) >/dev/null 2>&1; then
GUILE_CONFIG_works=yes
else
GUILE_CONFIG_works=no
fi
AC_MSG_RESULT($GUILE_CONFIG_works)
else
GUILE_CONFIG_works=no
fi
if test "no" = "$GUILE_CONFIG_works"; then
AC_MSG_ERROR(Need a working guile-config script in your \$PATH --- check installation of Guile-1.8.0 or later)
exit -1
fi
if test -z "${GUILE_BIN_DIR}"; then
AC_PATH_PROG(GUILE, guile, no)
else
AC_PATH_PROG(GUILE, guile, no, ${GUILE_BIN_DIR})
fi
AC_SUBST(GUILE)
PKG_PROG_PKG_CONFIG()
AC_SUBST(GUILE_EXTENSIONS_DIR, `${PKG_CONFIG} --variable=extensiondir guile-2.0`)
AC_PATH_PROGS(PERL, perl perl5, no)
AC_SUBST(PERL)
dnl ## Find paths ##
AC_PATH_X
AC_PATH_XTRA
AM_PATH_LISPDIR
SCWM_ARG_PATH(lispdir,
[ --with-lispdir=DIR Install Emacs Lisp files in DIR
[PREFIX/share/site-lisp]],
[
AC_MSG_CHECKING(where .elc files should go)
lispdir="${withval}"
AC_MSG_RESULT("${lispdir}")
])
PROPLIST_INCLUDES=""
PROPLIST_LIBS=""
PROPLIST_OBJECTS=""
SCWM_ARG_PATH_MAYBE_EMPTY(proplist,
[ --with-proplist=DIR Use libPropList installation from DIR
can omit DIR to use $prefix ],
[
AC_DEFINE(USE_PROPLIST, 1, [Define this if you want to use libproplist])
AC_DEFINE(CL_NO_TRACE, 1, [Define tihs if you want to turn debug support off for cassowary])
HAVE_PROPLIST="yes"
AC_MSG_CHECKING(where to expect to find libPropList headers and library)
if test -z "${withval}" || test "yes" = "${withval}"; then
AC_MSG_RESULT("defaulting to the prefix = ${prefix}")
withval=${prefix}
else
AC_MSG_RESULT("${withval}")
fi
PROPLIST_INCLUDES="-I${withval}/include"
case "$ac_R_nospace" in
"yes") prop_lib_path="-L${withval}/lib -R${withval}/lib" ;;
"no") prop_lib_path="-L${withval}/lib -R ${withval}/lib" ;;
*) prop_lib_path="-L${withval}/lib" ;;
esac
PROPLIST_LIBS="$prop_lib_path -lPropList"
])
AM_CONDITIONAL(HAVE_PROPLIST, test "$HAVE_PROPLIST" = yes)
AC_SUBST(PROPLIST_INCLUDES)
AC_SUBST(PROPLIST_LIBS)
AC_SUBST(PROPLIST_OBJECTS)
## check for GTL library that cassowary might need
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
dnl below is a hack using -L prefixes with -lGTL in the
dnl extra libs position to be sure that it looks in the right place
old_libs=$LIBS
LIBS="-L${prefix}/lib -L${exec_prefix}/lib -lGTL"
GTL_LIB=""
dnl AC_CHECK_LIB(GTL, GML_init, [
AC_TRY_LINK_FUNC(GML_init, [
GTL_LIB="-lGTL"
dnl AC_DEFINE(HAVE_GTL)
], no_gtl_lib=yes)
LIBS="${old_libs}"
## check for cassowary library
CASSOWARY_INCLUDES=""
CASSOWARY_LIBS=""
CASSOWARY_STATIC_LIBS=""
CASSOWARY_OBJECTS=""
SCWM_ARG_PATH_MAYBE_EMPTY(cassowary,
[ --with-cassowary=DIR Use Cassowary constraint solver from DIR
can omit DIR to use $prefix ],
[
if test "no" = "${withval}"; then
AC_MSG_RESULT("****** Cassowary constraint solver is *not* being used")
else
AC_DEFINE(USE_CASSOWARY, 1,
[Define this and use C++ compiler if you want to use constraint solver])
AC_DEFINE(CL_NO_TRACE, 1, [Define tihs if you want to turn debug support off for cassowary])
AC_MSG_CHECKING(where to expect to find cassowary headers and library)
if test -z "${withval}" || test "yes" = "${withval}"; then
AC_MSG_RESULT("defaulting to the prefix = ${prefix}")
withval=${prefix}
else
AC_MSG_RESULT("${withval}")
fi
CASSOWARY_INCLUDES="-I${withval}/include"
cassolibdir="${withval}/lib"
case "$ac_R_nospace" in
"yes") cas_lib_path="-L${cassolibdir} -R${cassolibdir}" ;;
"no") cas_lib_path="-L${cassolibdir} -R ${cassolibdir}" ;;
*) cas_lib_path="-L${cassolibdir}" ;;
esac
## Was ${GTL_LIB} below
CASSOWARY_LIBS="$cas_lib_path -lconstraints -lcassowary -lstdc++ `cassowary-config --gtllibs || echo ""`"
CASSOWARY_STATIC_LIBS="$cassolibdir/libconstraints.a $cassolibdir/libcassowary.a -lstdc++ `cassowary-config --gtllibs || echo ""`"
CASSOWARY_OBJECTS='$(cassowary_objs)'
fi
])
AC_SUBST(CASSOWARY_INCLUDES)
AC_SUBST(CASSOWARY_LIBS)
AC_SUBST(CASSOWARY_STATIC_LIBS)
AC_SUBST(CASSOWARY_OBJECTS)
AC_LANG_RESTORE
dnl ## Checks for libraries ##
dnl # X Window system checks #
if test -z "$x_includes"; then
x_includes="/usr/include"
fi
saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
CFLAGS="$X_CFLAGS"
LDFLAGS="$X_LDFLAGS $X_LIBS"
orig_x_libs="$x_libs"
dnl # check for math library
AC_CHECK_LIB(m, main)
dnl # Check for the X11 library ##
AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", no_x11_lib=yes, $X_EXTRA_LIBS)
dnl # Check for the Xext library (needed for Shape extention) ##
XEXT_LIB=""
AC_CHECK_LIB(Xext, XShapeCombineMask, [
XEXT_LIB="-lXext"
AC_DEFINE(HAVE_SHAPE, 1,
[Define this if your Xext library supports the X extension (wether your server does or not will be determined at runtime])
], no_xext_lib=yes, $x_libs)
dnl # Check for the XTest library (needed for better simulated event support, quoting) ##
XTST_LIB=""
have_xtest=no
AC_CHECK_LIB(Xtst, XTestQueryExtension, [
XTST_LIB="-lXtst"
AC_DEFINE(HAVE_XTEST, 1, [Define this if you have libXtst, the XTest X server extension.])
have_xtest=yes
], AC_MSG_WARN(libXtst not found -- simulated events will not be supported)
,$x_libs $XEXT_LIB)
AM_CONDITIONAL(HAVE_XTEST, test "$have_xtest" = yes)
dnl # Check for the Xpm library #
XPM_LIB=""
AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, [
XPM_LIB="-lXpm"
AC_DEFINE(HAVE_LIBXPM, 1, [Define this if you have libXpm.])
], AC_MSG_WARN(libXpm not found -- try ftp://ftp.x.org/contrib/libraries/xpm-3.4k.tar.gz)
, $x_libs)
dnl # Check for the Xmu library #
XMU_LIB=""
AC_CHECK_LIB(Xmu, XmuPrintDefaultErrorMessage, [
XMU_LIB="-lXmu"
AC_DEFINE(HAVE_LIBXMU, 1, [Define this if you have libXmu.])
], , $x_libs)
dnl # check if X11 library was compiled with X_LOCALE definition
AC_CHECK_LIB(X11, _Xsetlocale, [ AC_DEFINE(X_LOCALE, 1, [Define this if you want to compile with X_LOCALE define.]) ], [], $x_libs)
dnl # Check for libSM, libIce
SM_LIB=""
SESSION_MANAGER_OBJECTS=""
AC_CHECK_LIB(SM, SmcOpenConnection, [
AC_CHECK_HEADERS(X11/SM/SMlib.h, [
AC_CHECK_LIB(ICE, IceAddConnectionWatch, [
SM_LIB="-lSM -lICE"
SESSION_MANAGER_OBJECTS='$(session_manager_objs)'
AC_DEFINE(HAVE_LIBSM_LIBICE, 1, [Define this if you have libSM and libIce for session manager support])
], AC_MSG_WARN(libICE not found -- no session manager support)
, $x_libs)
], AC_MSG_WARN(SMlib.h not found -- no session manager support))
], AC_MSG_WARN(libSM not found -- no session manager support)
, $x_libs -lICE)
AC_ARG_ENABLE(dump, [ --enable-dump Enable the --dump option (reqs libunexec.a)],
enable_dump=yes,
enable_dump=no)
if test x"$enable_dump" = x"yes"; then
AC_MSG_RESULT(Be sure symlink to libunexec.a exists in src/)
UNEXEC_LIB="libunexec.a"
AM_CONDITIONAL(ENABLE_DUMP, true)
AC_DEFINE(ENABLE_DUMP, 1, [Define this if you want the --dump option])
else
AC_MSG_RESULT(No --dump option will exist)
AM_CONDITIONAL(ENABLE_DUMP, false)
UNEXEC_LIB=""
fi
AC_SUBST(UNEXEC_LIB)
AC_ARG_ENABLE(esd, [ --disable-esd Do not use ESD even if it exists],
enable_esd=no,
enable_esd=yes)
if test x"$enable_esd" = x"no"; then
AC_MSG_RESULT(Not using ESD due to --disable-esd option)
AM_CONDITIONAL(HAVE_ESD, false)
else
AM_PATH_ESD(0.2.7, HAVE_ESD=yes, HAVE_ESD=no)
AM_CONDITIONAL(HAVE_ESD, test "$HAVE_ESD" = yes)
fi
AM_PATH_GTK(1.0.0, HAVE_GTK=yes, HAVE_GTK=no)
AM_CONDITIONAL(HAVE_GTK, test $HAVE_GTK = yes)
HAVE_GNOME_CORBA=no
AC_MSG_CHECKING(whether to enable gnome-corba module)
AC_ARG_ENABLE(gnome-corba, [ --enable-gnome-corba Use GNOME Corba module ],[
if test "yes" = "$enableval"; then
HAVE_GNOME_CORBA=yes
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
],AC_MSG_RESULT(no))
AM_CONDITIONAL(HAVE_GNOME_CORBA, test "$HAVE_GNOME_CORBA" = yes)
AC_SUBST(SESSION_MANAGER_OBJECTS)
x_cflags="$X_CFLAGS"
x_ldflags="$X_LDFLAGS $X_LIBS"
AC_SUBST(x_cflags)
AC_SUBST(x_includes)
AC_SUBST(x_ldflags)
AC_SUBST(x_libs)
AC_SUBST(XEXT_LIB)
AC_SUBST(XTST_LIB)
AC_SUBST(XPM_LIB)
AC_SUBST(XMU_LIB)
AC_SUBST(SM_LIB)
CFLAGS="$saved_cflags"
LDFLAGS="$saved_ldflags"
dnl # Check for readline library #
AC_CHECK_LIB(termcap, tgoto, [
AC_CHECK_LIB(readline, readline, [
READLINE_LIB="-lreadline -ltermcap"
AC_DEFINE(HAVE_READLINE, 1, [Define this if you have the readline library])
AC_CHECK_LIB(readline, add_history, AC_DEFINE(HAVE_HISTORY, 1, [Define this if your readline also has add_history()]),,"-ltermcap")
], READLINE_LIB="", "-ltermcap")
], AC_CHECK_LIB(ncurses, tgoto, [
AC_CHECK_LIB(readline, readline, [
READLINE_LIB="-lreadline -lncurses"
AC_DEFINE(HAVE_READLINE, 1, [Define this if you have the readline library])
AC_CHECK_LIB(readline, add_history, AC_DEFINE(HAVE_HISTORY, 1, [Define this if your readline also has add_history()]),,"-lncurses")
], READLINE_LIB="", "-lncurses")
], READLINE_LIB=""))
AC_SUBST(READLINE_LIB)
dnl # Guile checks #
SCWM_ARG_PATH(guile-lib-prefix,
[ --with-guile-lib-prefix=DIR
Expect guile libraries to be installed in DIR
[optional]],
[
AC_MSG_CHECKING(where to expect guile libraries)
guile_lib_prefix="${withval}"
GUILE_LIB_PRE="-L${guile_lib_prefix}"
AC_MSG_RESULT("${guile_lib_prefix}")
])
case "$ac_R_nospace" in
"yes") GUILE_LIBS_PRE="-L${guile_lib_path} -R${guile_lib_path}" ;;
"no") GUILE_LIBS_PRE="-L${guile_lib_path} -R ${guile_lib_path}" ;;
*) GUILE_LIBS_PRE="-L${guile_lib_path}" ;;
esac
DL_SUPPORT=false
dnl FIXJTL: readline is sometimes needed too; hopefully anybody with
dnl a guile with readline support has a working guile-config or build-guile
AC_MSG_CHECKING(for guile libraries)
GUILE_LIBS="${GUILE_LIBS_PRE} `${GUILE_CONFIG} link`"
GUILE_STATIC_LIBS="`${GUILE_CONFIG} info libdir`/libguile.a"
GUILE_EXTRA_LIBS="${GUILE_LIBS_PRE} `${GUILE_CONFIG} link`" #this really should not have -lguile in it
GUILE_INCLUDES="`${GUILE_CONFIG} compile`"
AC_MSG_RESULT($GUILE_LIBS)
SCWM_ARG_PATH(guile-include-prefix,
[ --with-guile-include-prefix=DIR
Expect guile header files to be installed in DIR
[optional]],
[
AC_MSG_CHECKING(where to expect guile header files)
guile_include_prefix="${withval}"
GUILE_INCLUDES="-I${guile_include_prefix}"
AC_MSG_RESULT("${guile_include_prefix}")
])
AC_SUBST(GUILE_INCLUDES)
AC_SUBST(GUILE_LIBS)
AC_SUBST(GUILE_STATIC_LIBS)
AC_SUBST(GUILE_EXTRA_LIBS)
AM_CONDITIONAL(DL_SUPPORT, test "DL_SUPPORT" = true)
dnl ## Checks for header files ##
AC_STDC_HEADERS
AC_CHECK_HEADERS(getopt.h, AC_DEFINE(HAVE_GETOPT_H, 1, [Define this if your system has a <getopt.h> header file.]))
AC_CHECK_HEADERS(sys/select.h, AC_DEFINE(HAVE_SYS_SELECT_H, 1, [Define this if your system has a <sys/select.h> header file.]))
dnl ## Check for library functions ##
# AC_CHECK_FUNCS(select)
AC_CHECK_FUNCS(getopt_long)
AC_CHECK_FUNCS(gethostname waitpid sysconf uname)
AC_CHECK_FUNCS(strerror strcasecmp strncasecmp)
AC_CHECK_FUNCS(usleep)
AC_CHECK_FUNCS(setlinebuf setvbuf)
AC_CHECK_FUNCS(setenv)
dnl # Check for recent guile funcs
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$GUILE_LIBS"
dnl This checks (roughly) if the guile lib is a sufficiently recent snapshot
dnl to have a scm_eval_string that is safe against re-entry by continuations.
dnl I was to lazy to write a real test macro so I just check for a function
dnl that was added soon after.
dnl AC_CHECK_LIB(guile, scm_done_malloc, AC_DEFINE(HAVE_SAFE_SCM_EVAL_STRING), ,$GUILE_LIBS)
dnl This checks if the new printer functions are available, and should
dnl be used instead of the old ones.
dnl AC_CHECK_LIB(guile, scm_puts, AC_DEFINE(HAVE_SCM_PUTS), ,$GUILE_LIBS)
dnl This checks if we have a guile with readline support
dnl AC_CHECK_LIB(guile, scm_readline, AC_DEFINE(HAVE_SCM_READLINE), ,$GUILE_LIBS)
dnl AC_CHECK_LIB(guile, scm_parse_path, AC_DEFINE(HAVE_SCM_PARSE_PATH), ,$GUILE_LIBS)
LDFLAGS="${saved_LDFLAGS}"
dnl check for scm_the_last_fluid in place of scm_the_last_stack_var
dnl saved_LIBS="${LIBS}"
dnl LIBS="${LIBS} ${GUILE_LIBS}"
dnl saved_CFLAGS="${CFLAGS}"
dnl CFLAGS="${CFLAGS} ${GUILE_INCLUDES}"
dnl AC_MSG_CHECKING(for scm_the_last_stack_fluid in -lguile)
dnl AC_TRY_LINK([
dnl #include <guile/gh.h>
dnl ],[
dnl return scm_the_last_stack_fluid;
dnl ], [
dnl AC_DEFINE(HAVE_SCM_THE_LAST_STACK_FLUID)
dnl AC_MSG_RESULT(yes)
dnl ],[
dnl AC_MSG_RESULT(no)
dnl ])
dnl
dnl LIBS="${saved_LIBS}"
dnl CFLAGS="${saved_CFLAGS}"
dnl ## Checks for typedefs, structures, and compiler characteristics. ##
AC_C_CONST
AC_C_INLINE
dnl check for imlib
AM_PATH_IMLIB
if test ! "x" = x"$imlib_prefix"; then
PREFIX_INCLUDES="$PREFIX_INCLUDES -I$imlib_prefix/include"
fi
AC_SUBST(PREFIX_INCLUDES)
AC_ARG_ENABLE(imlib, [ --disable-imlib Do not use IMLIB library even if it exists],
enable_imlib=no,
enable_imlib=yes)
if test x"$enable_imlib" = x"no"; then
AC_MSG_RESULT(Not using imlib due to --disable-imlib option)
elif test ! -z "$IMLIB_LIBS" ; then
LIBS="$LIBS $IMLIB_LIBS"
## CFLAGS="$CFLAGS $IMLIB_CFLAGS" # this does not affect anything --07/01/99 gjb
USE_IMLIB="true"
AC_DEFINE(USE_IMLIB, 1, [Define this if you want to use imlib pixmap/bitmap support])
fi
dnl ## Define directories ##
scwm_load_path=${datadir}/${PACKAGE}/modules
scwm_schemedir=${scwm_load_path}/app/scwm
scwm_themedir=${datadir}/${PACKAGE}/themes
scwm_bin_load_path=${libdir}/${PACKAGE}/modules
scwm_moduledir=${scwm_bin_load_path}/app/scwm
scwm_utildir=${libdir}/${PACKAGE}/util
scwm_pixmapdir=${datadir}/${PACKAGE}/pixmaps
SCWM_ARG_PATH(scwmrcdir,
[ --with-scwmrcdir=DIR Install configuration files in DIR
[DATADIR/scwm/scwmrc]],
[
AC_MSG_CHECKING(where configuration files should go; e.g., system.scwmrc)
scwmrcdir="${withval}"
AC_MSG_RESULT("${scwmrcdir}")
],
[
scwmrcdir="${datadir}/${PACKAGE}/scwmrc"
])
SCWM_ARG_PATH(docdir,
[ --with-docdir=DIR Install documentation files in DIR
[DATADIR/doc/PACKAGE]],
[
AC_MSG_CHECKING(where documentation files should go)
scwm_docdir="${withval}"
AC_MSG_RESULT("${scwm_docdir}")
],
[
scwm_docdir="${datadir}/doc/${PACKAGE}"
])
SCWM_ARG_PATH(examplesdir,
[ --with-examplesdir=DIR Install examples in DIR
[${scwm_docdir}/examples]],
[
AC_MSG_CHECKING(where examples should go)
scwm_examplesdir="${withval}"
AC_MSG_RESULT("${scwm_examplesdir}")
],
[
scwm_examplesdir="${scwm_docdir}/examples"
])
# open the parentheses
scwm_image_load_path="(\\\"${scwm_pixmapdir}\\\" ";
for i in \
${x_includes}/X11/bitmaps \
${x_includes}/X11/pixmaps \
${orig_x_libs}/X11/mini-icons \
${includedir}/X11/pixmaps \
${includedir}/X11/bitmaps \
${libdir}/X11/mini-icons \
@prefix@/share/pixmaps \
@prefix@/share/icons \
@prefix@/share/icons/mini \
; do
if test -d $i; then
# add the directory to the list as a string
scwm_image_load_path="$scwm_image_load_path \\\"$i\\\""
fi
done
# close the parentheses
scwm_image_load_path="${scwm_image_load_path})";
AC_SUBST(scwm_load_path)
AC_SUBST(scwm_bin_load_path)
AC_SUBST(scwm_schemedir)
AC_SUBST(scwm_themedir)
AC_SUBST(scwm_pixmapdir)
AC_SUBST(scwm_moduledir)
AC_SUBST(scwmrcdir)
AC_SUBST(scwm_image_load_path)
AC_SUBST(scwm_utildir)
AC_SUBST(scwm_docdir)
AC_SUBST(scwm_examplesdir)
AC_SUBST(SCWM_MAJOR_VERSION)
AC_SUBST(SCWM_MINOR_VERSION)
AC_SUBST(SCWM_VERSION)
dnl # Check for optional settings #
AC_MSG_CHECKING(whether to enable multibyte support)
AC_ARG_ENABLE(multibyte,
[ --enable-multibyte Handle multibyte strings for window titles, etc],
[
if test "yes" = "$enableval"; then
AC_DEFINE(I18N, 1, [Define this if you want multibyte support.])
fi
AC_MSG_RESULT($enableval);
],
[
AC_MSG_RESULT(no);
])
I18N_LIB=""
if test x"$enable_multibyte" = x"yes" ; then
# check if system has xpg4 library ( for FreeBSD )
AC_CHECK_LIB(xpg4, _xpg4_setrunelocale, [
I18N_LIB="-lxpg4"
],[])
fi
AC_SUBST(I18N_LIB)
CPPEXTRAFLAGS=""
AC_ARG_ENABLE(warnings,
[ --enable-warnings Turn on most compiler warnings (may require gcc)]
,[if test "yes" = "$enableval"; then
CPPEXTRAFLAGS="-Wall -W -Wno-sign-compare"
fi
])
AC_SUBST(CPPEXTRAFLAGS)
AC_OUTPUT([Makefile \
scwm.spec \
ANNOUNCE \
README \
sample.scwmrc/Makefile \
src/Makefile \
src/scwm-doc-snarf \
src/scwm-versiondat.h \
scheme/Makefile \
pixmaps/Makefile \
app/Makefile \
modules/Makefile \
modules/background/Makefile \
modules/c-animation/Makefile \
modules/esdsound/Makefile \
modules/overlay-plane/Makefile \
modules/pie-menus/Makefile \
modules/xlib-drawing/Makefile \
modules/xpm-menus/Makefile \
modules/proplist/Makefile \
modules/xtest/Makefile \
utilities/Makefile \
utilities/libscwmexec/Makefile \
utilities/scwmexec/Makefile \
utilities/scwmrepl/Makefile \
utilities/pidproperty/Makefile \
utilities/run-renamed/Makefile \
utilities/dev/Makefile \
utilities/emacs/Makefile \
utilities/misc/Makefile \
doc/Makefile \
themes/Makefile \
utilities/dev/scwmdoc \
utilities/dev/scwmdoc.scm \
utilities/dev/scwm-usage-counter \
utilities/dev/X-error-describe \
utilities/dev/create-dependency-dot-graph \
],[chmod +x src/scwm-doc-snarf ] \
)
## modules/scwmgtkhelper/Makefile
## modules/corba/Makefile