-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
1343 lines (1213 loc) · 44.7 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# -*- Autoconf -*-
dnl#
dnl# File: configure.ac
dnl# Revision: $Id: ed9cdf94e42cc99c71ddb5de1295f1fca06c7066 $
dnl# Created: 1994/06/18
dnl# Author: Leif Hedstrom<hedstrom@inf.ethz.ch>
dnl# Martin S. Utesch <wstd@hl.siemens.de>
dnl# Peter W. Osel <pwo@GUUG.DE>
dnl# R.K. Owen <rk@owen.sj.ca.us>
dnl#
dnl# Process this file with autoconf to produce a configure script
dnl# You need autoconf 2.52 or better!
dnl# (Actually make that whichever value is in AC\_PREREQ below -
dnl# autoupdate likes to make it the most recent version of autoconf)
dnl#
dnl#-----------------------------------------------------------------------
dnl#
AC_INIT([modules],[3.2],[modules-interest@lists.sourceforge.net])dnl
AC_PREFIX_DEFAULT([/usr/local/Modules])dnl
AC_CONFIG_AUX_DIR([config])dnl
AC_REQUIRE_AUX_FILE([compile])dnl
AC_REQUIRE_AUX_FILE([depcomp])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
AC_CONFIG_MACRO_DIR([m4])dnl
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([1.9.6 foreign dejagnu no-installinfo dist-bzip2 -Wall])dnl
AM_MAINTAINER_MODE
AC_EXEEXT
AC_CONFIG_SRCDIR([version.c])dnl
AC_CONFIG_HEADERS([config.h])dnl
AC_PREREQ([2.69])dnl
dnl#
dnl#-----------------------------------------------------------------------
dnl# Autoheader "templates" (was acconfig.h)
dnl#
dnl#TODO: have version number automatically be updated:
AH_TOP([
/*****
** ** Module Header *************************************************** **
** **
** Modules Revision 3.2 **
** Providing a flexible user environment **
** **
** Description: config.h.in (generated by autoheader from **
** configure.ac) **
** **
** ******************************************************************** **
****/
/** ** Copyright ******************************************************* **
** **
** Copyright 1991-1994 by John L. Furlan. **
** see LICENSE.GPL, which must be provided, for details **
** **
** ******************************************************************** **/
#ifndef __CONFIG_H__
#define __CONFIG_H__ 1
])dnl
AH_BOTTOM([
#endif /* !__CONFIG_H__ */
])dnl
dnl#
dnl#-----------------------------------------------------------------------
dnl#
dnl# Some special substitution we need:
dnl#
dnl#-----------------------------------------------------------------------
dnl# Need to know if versioning is asked for before setting certain paths
dnl# --enable-versioning Use modules versioning [DEF]
dnl# --disable-versioning Without - "" -
dnl#-----------------------------------------------------------------------
dnl#
AC_SUBST([WANTS_VERSIONING])dnl
AC_SUBST([VERSIONING])dnl
AC_SUBST([NOTVERSIONING])dnl
AH_TEMPLATE([WANTS_VERSIONING],[
WANTS_VERSIONING: Does the system want to use Modules versions?])dnl
AC_ARG_ENABLE([versioning],
[AS_HELP_STRING([--enable-versioning],
[use modules versioning [[yes]]])],
[if test "x${enableval}" = "xyes"; then
WANTS_VERSIONING=1
AC_DEFINE([WANTS_VERSIONING],[1],
[Define to 1 if system wants Modules versions])
dnl#TODO: use an automake conditional for this:
VERSIONING=""
NOTVERSIONING="#"
else
WANTS_VERSIONING=0
AC_DEFINE([WANTS_VERSIONING],[0],
[Define to 0 if system prefers Modules unversioned])
VERSIONING="#"
NOTVERSIONING=""
fi],[WANTS_VERSIONING=1
AC_DEFINE([WANTS_VERSIONING],[1],
[Define to 1 if system wants Modules versions])
VERSIONING=""
NOTVERSIONING="#"
])dnl
dnl#
dnl#-----------------------------------------------------------------------
dnl# Get Modules version & date
dnl#-----------------------------------------------------------------------
dnl# DATE Module package date
dnl# VERSION Module package version
dnl#
AC_SUBST([VERSION])dnl
AC_SUBST([DATE])dnl
VERSION='(unknown)'
VERSION=`sed -n -e 's/^.*version_string.*"\(.*\)";$/\1/p' ${srcdir}/version.c`
AC_MSG_RESULT([VERSION = ${VERSION}])
DATE='(DDMmmYYYY)'
DATE=`sed -n -e 's/^.*date_string.*"\(.*\)";$/\1/p' ${srcdir}/version.c`
AC_MSG_RESULT([DATE = ${DATE}])
echo "configuring for Modules ${VERSION} (${DATE})"
dnl#
dnl#-----------------------------------------------------------------------
dnl# Set PREFIX and related based on WANTS_VERSIONING
dnl#-----------------------------------------------------------------------
dnl#
AC_SUBST([DEFAULTPATH])dnl
AC_SUBST([BASEPREFIX])dnl
DEFAULTPATH=default
AH_TEMPLATE([BASEPREFIX],[BASEPREFIX: Usually equivalent to /usr/local])dnl
AH_TEMPLATE([PREFIX],[
PREFIX: Usually equivalent to /usr/local/Modules[/version_number]])dnl
AH_TEMPLATE([MODULES_INIT_DIR],[
MODULES_INIT_DIR: Directory that contains the modules init files.])dnl
if test "x${exec_prefix}" != "xNONE" ; then
EXECPREFIX=${exec_prefix}
# can not have versioning if specifying exec-prefix:
if test "${WANTS_VERSIONING}" -eq 1 ; then
AC_MSG_ERROR([You can not have versioning if --exec-prefix is
specified: must disable with --disable-versioning])
fi
fi
if test "x${prefix}" != "xNONE" ; then
if test "${WANTS_VERSIONING}" -eq 1 ; then
DEFAULTPATH=${prefix}/Modules/default
NODEFAULTPATH=${prefix}/Modules/${VERSION}
BASEPREFIX=${prefix}
prefix=${BASEPREFIX}/Modules/${VERSION}
export prefix
else
DEFAULTPATH=${prefix}/Modules
NODEFAULTPATH=${prefix}/Modules
BASEPREFIX=${prefix}
prefix=${BASEPREFIX}/Modules
export prefix
fi
PREFIX=${prefix}
else
if test "${WANTS_VERSIONING}" -eq 1 ; then
DEFAULTPATH=${ac_default_prefix}/Modules/default
NODEFAULTPATH=${ac_default_prefix}/Modules/${VERSION}
BASEPREFIX=${ac_default_prefix}
ac_default_prefix=${BASEPREFIX}/Modules/${VERSION}
export ac_default_prefix
else
DEFAULTPATH=${ac_default_prefix}/Modules
NODEFAULTPATH=${ac_default_prefix}/Modules
BASEPREFIX=${ac_default_prefix}
ac_default_prefix=${BASEPREFIX}/Modules
export ac_default_prefix
fi
PREFIX=${ac_default_prefix}
fi
if test "x${exec_prefix}" != "xNONE" ; then
EXECPREFIX=${exec_prefix}
else
EXECPREFIX=${PREFIX}
fi
MODULES_INIT_DIR=${EXECPREFIX}/init
dnl#
dnl#-----------------------------------------------------------------------
dnl# --enable-use-default Use PREFIX/default/ in init scripts [DEF]
dnl# --disable-use-default Use PREFIX/VERSION/ in init scripts
dnl#-----------------------------------------------------------------------
dnl#
AC_DEFINE_UNQUOTED([MODULES_INIT_DIR],["${MODULES_INIT_DIR}"])dnl
AC_ARG_ENABLE([use-default],
[AS_HELP_STRING([--enable-use-default],
[use DEFAULTPATH in init scripts [[yes]]])],
[if test "x${enableval}" = "xno" -o ${WANTS_VERSIONING} -eq 0; then
DEFAULTPATH=${NODEFAULTPATH}
fi])dnl
AC_MSG_RESULT([DEFAULTPATH = ${DEFAULTPATH}])
AC_MSG_RESULT([BASEPREFIX = ${BASEPREFIX}])
AC_MSG_RESULT([PREFIX = ${PREFIX}])
AC_MSG_RESULT([EXECPREFIX = ${EXECPREFIX}])
AC_DEFINE_UNQUOTED([BASEPREFIX],["${BASEPREFIX}"])dnl
AC_DEFINE_UNQUOTED([PREFIX],["${PREFIX}"])dnl
export DEFAULTPATH
export NODEFAULTPATH
export BASEPREFIX
export MODULES_INIT_DIR
dnl#
dnl#-----------------------------------------------------------------------
dnl# Some standard autoconf stuff
dnl#-----------------------------------------------------------------------
dnl# Checks for programs
dnl#-----------------------------------------------------------------------
dnl#
AB_INIT
AC_PROG_CC
AM_PROG_CC_C_O
XORG_PROG_RAWCPP
AC_LANG([C])
AC_PROG_CXX
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AM_PROG_INSTALL_STRIP
AM_PROG_INSTALL_SH
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_USE_SYSTEM_EXTENSIONS
AM_PROG_AR
LT_INIT([win32-dll dlopen disable-static])
LT_LANG([C])
XORG_LD_WRAP
AC_SEARCH_LIBS([strerror],[cposix]) dnl# used to be AC\_ISC\_POSIX
AC_PATH_PROG([UNAME],[uname],[:])dnl
AX_CHECK_GNU_MAKE
AX_CVS([anonymous@cvs.modules.sourceforge.net:/cvsroot/modules])
PKG_PROG_PKG_CONFIG([0.9])dnl
dnl# I18N support:
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.18.3])
SC_ENABLE_LANGINFO
dnl#
dnl#-----------------------------------------------------------------------
dnl# Checks for different scripting languages
dnl#-----------------------------------------------------------------------
dnl#
AM_PATH_PYTHON
AM_PATH_LISPDIR
CMAKE_FIND_BINARY
XORG_WITH_PERL
AX_PROG_TCL([8.3])dnl
dnl#
dnl#-----------------------------------------------------------------------
dnl# Checks for header files
dnl#-----------------------------------------------------------------------
dnl#
AC_SYS_POSIX_TERMIOS
AC_HEADER_DIRENT
AC_HEADER_STAT
AC_HEADER_TIOCGWINSZ
AC_CHECK_HEADERS([assert.h ctype.h dejagnu.h fcntl.h libintl.h \
locale.h modules_def.h ndir.h stdarg.h stdio.h sysconf.h syslog.h \
sys/dir.h sys/ioctl.h sys/mode.h sys/ndir.h sys/termios.h \
termio.h varargs.h])dnl
gl_AC_HEADER_INTTYPES_H
SC_MISSING_POSIX_HEADERS
if test "x${ac_cv_header_strings_h}" = "x"; then
test -z "${ac_cv_header_strings_h}"
AC_CHECK_HEADERS([strings.h])
fi
dnl#
dnl#-----------------------------------------------------------------------
dnl# Checks for typedefs, structures, and compiler characteristics.
dnl#-----------------------------------------------------------------------
dnl#
XORG_CWARNFLAGS
SC_CONFIG_CFLAGS
SC_TCL_EARLY_FLAGS
SC_TCL_64BIT_FLAGS
AC_C_PROTOTYPES
AC_C_CONST
AC_C_INLINE
AC_TYPE_INTPTR_T
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_LONG_LONG_INT
gl_AC_TYPE_UINTMAX_T
AC_STRUCT_TM
dnl#
dnl#-----------------------------------------------------------------------
dnl# Checks for library functions.
dnl#-----------------------------------------------------------------------
dnl#
AC_FUNC_MALLOC
XORG_CHECK_MALLOC_ZERO
AC_FUNC_REALLOC
AC_FUNC_STAT
AC_FUNC_STRCOLL
AC_FUNC_STRNLEN
## unexpected EOF somewhere after here? Add this space to try to avoid it.
AC_CHECK_FUNCS([atexit dup2 exit feof fread gethostname getdomainname \
ioctl memset mktemp qsort setlocale strcasecmp strchr strcpy \
strcspn strdup strlen strncmp strncpy strrchr strstr strtok \
syslog tmpnam tempnam umask uname])dnl
## decls, too:
AC_CHECK_DECLS([buffer, environ, index, remove, shell_name, strtok])dnl
dnl#
dnl#-----------------------------------------------------------------------
dnl# Checks for libraries
dnl#-----------------------------------------------------------------------
dnl# Solaris 2.x: This requires -lnsl and -lsocket. If AC_PATH_XTRA
dnl# did not search for these, search them explicitly.
dnl# MUST be done BEFORE AC_PATH_XTRA!
dnl#-----------------------------------------------------------------------
dnl#
AC_CHECK_LIB([socket],[socket])dnl
AC_CHECK_LIB([nsl],[t_accept])dnl
dnl#
dnl#-----------------------------------------------------------------------
dnl# Check for X11 things
dnl#-----------------------------------------------------------------------
dnl#
AC_PATH_X
AC_PATH_XTRA
if test "x${no_x}" != "xyes"; then
AH_TEMPLATE([HAS_X11LIBS],[
HAS_X11LIBS:
This symbol, if defined, indicates that the C program can use X11
directly.])dnl
AC_DEFINE([HAS_X11LIBS],[1],
[This symbol, if defined, indicates that the C program can use X11 directly.])dnl
AC_CHECK_LIB([X11],[XMaxRequestSize],[],[
AC_CHECK_LIB([X11],[main],[],[],
[-I${ac_x_includes:-.} -L${ac_x_libraries:-.}])],
[-I${ac_x_includes:-.} -L${ac_x_libraries:-.}])dnl
AC_CHECK_LIB([Xmu],[XmuGetHostname],[],[
AC_CHECK_LIB([Xmu],[main],[],[],
[-I${ac_x_includes:-.} -L${ac_x_libraries:-.}])],
[-I${ac_x_includes:-.} -L${ac_x_libraries:-.}])dnl
SC_PATH_X
else
AC_CHECK_LIB([X11],[XMaxRequestSize],[],[
AC_CHECK_LIB([X11],[main])
])dnl
AC_CHECK_LIB([Xmu],[XmuGetHostname],[],[
AC_CHECK_LIB([Xmu],[main])
])dnl
test -z "${no_x}"
fi
XORG_MEMORY_CHECK_FLAGS
dnl#-----------------------------------------------------------------------
AH_TEMPLATE([CPPSTDIN],[
CPPSTDIN:
This symbol contains the first part of the string which will invoke
the C preprocessor on the standard input and produce to standard
output. Typical value of "cc -E" or "/lib/cpp".])dnl
EM_PATH_PROG_SEARCH([_CPPSTDIN],[cpp],[/lib /usr/lib /usr/lang \
/usr/local/lang /usr/ccs/lib],[${CC} -E])
AC_DEFINE_UNQUOTED([CPPSTDIN],["${_CPPSTDIN}"])dnl
dnl#-----------------------------------------------------------------------
AH_TEMPLATE([CPPMINUS],[
CPPMINUS:
This symbol contains the second part of the string which will invoke
the C preprocessor on the standard input and produce to standard
output. This symbol will have the value "-" if CPPSTDIN needs a minus
to specify standard input, otherwise the value is "".])dnl
AC_DEFINE([CPPMINUS],[""])dnl
dnl#-----------------------------------------------------------------------
AH_TEMPLATE([PHOSTNAME],[
PHOSTNAME:
Last resort to get the hostname, if uname() and gethostname()
are not available.])dnl
AC_PATH_PROG([_PHOST],[hostname],[""])dnl
test "x${_PHOST}" != "x" && AC_DEFINE_UNQUOTED([PHOSTNAME],["${_PHOST}"])dnl
AM_MISSING_PROG([RUNTEST_POSSIBLY_MISSING],[runtest])dnl
AC_PATH_PROG([RUNTEST_PROG],[runtest],["./not_installed"])dnl
## now do stuff with it:
AS_IF([test "x${RUNTEST_PROG}" = "x"],[
test -z "${RUNTEST_PROG}" && echo "Install DEJAGNU and rerun configure if \
you want to run the testsuite"
],[
AS_IF([test "x${RUNTEST_PROG}" = "x./not_installed"],[
test ! -e "${RUNTEST_PROG}" && echo "Install DEJAGNU and rerun configure if \
you want to run the testsuite"
],[
test -n "${RUNTEST_PROG}" && test -x "${RUNTEST_PROG}" && test -z "${RUNTEST}" && export RUNTEST="${RUNTEST_PROG}"
])dnl
])dnl
## one other way:
AS_IF([test "x${RUNTEST}" = "x" && test "${RUNTEST_POSSIBLY_MISSING}" != "x"],[
test -n "${RUNTEST_POSSIBLY_MISSING}" && test -x "${RUNTEST_POSSIBLY_MISSING}" && test -z "${RUNTEST}" && export RUNTEST="${RUNTEST_POSSIBLY_MISSING}"
])dnl
dnl#
dnl#-----------------------------------------------------------------------
dnl#
dnl# Here we define some --with & --enable things:
dnl#
dnl# --with-split-size[=<size>] With split size=<size> [TEST]
dnl# --without-split-size Without - "" -
dnl#
dnl# --enable-cache With directory cache
dnl# --disable-cache Without - "" - [DEF]
dnl#
dnl# --enable-shell-funcs With sh functions [TEST]
dnl# --disable-shell-funcs Without - "" -
dnl#
dnl# --enable-shell-alias With sh aliases [TEST]
dnl# --disable-shell-alias Without - "" -
dnl#
dnl# --enable-shell-eval With shell alias eval
dnl# --disable-shell-eval Without - "" - [DEF]
dnl#
dnl# --enable-free With free() calls
dnl# --disable-free Without - "" - [DEF]
dnl#
dnl# --with-debug[=<option>] Set up debugging level
dnl# --without-debug Without - "" - [DEF]
dnl#
dnl# --enable-version-magic Set .version magic requirement [DEF]
dnl# --disable-version-magic .version need not have magic cookie
dnl#
dnl# --enable-beginenv Use .modulesbeginenv for initial env. [TEST]
dnl# --disable-beginenv Do not use .modulesbeginenv
dnl#
dnl#-----------------------------------------------------------------------
dnl#
AH_TEMPLATE([LMSPLIT_SIZE],[
LMSPLIT_SIZE:
This symbol, if defined, will force the environment variable
_LM_FILES_ to be split into smaller "chunks".])dnl
AC_MSG_CHECKING([if /bin/csh supports large environment variables])
#
# test to see how many chars can be set in the C-shell env.var.
#
em_split_size_total=0
if test -x /bin/csh ; then
cat >_EMEOF.$$ <<'_EMEOF'
cat <<'!' | /bin/csh 2> /dev/null | tail -1
setenv X ""
setenv ZZZ "0"
@ num=2
while ( $num < 10000 )
setenv X $X$ZZZ
echo $num
@ num++
end
!
_EMEOF
em_split_size_total=`/bin/sh _EMEOF.$$`
rm _EMEOF.$$
fi
if test "x${cross_compiling}" = "xyes"; then
em_split_size="cross"
AC_MSG_WARN([You must specify --with-split-size[=<size>] when cross compiling... configure can not guess whether the target system C-shell can handle large environment variables or not.])
elif test ${em_split_size_total} -gt 4000 ; then
em_split_size="no"
AC_MSG_RESULT([yes - ${em_split_size_total} > 4000])
else
# set split-size a little less
em_split_size=`expr ${em_split_size_total} - 20`
if test ${em_split_size} -lt 0 ; then
em_split_size=1000
fi
AC_MSG_RESULT([no - ${em_split_size_total} < 4000 - splitting at ${em_split_size}])
fi
AC_ARG_WITH([split-size],
[AS_HELP_STRING([--with-split-size[=<size>]],[use split size=<size> [[test]]])],
[if test "${withval+set}" = "set" -a "x${withval}" != "xno"; then
if test "x${withval}" = "xyes"; then
withval=1000
fi
AC_MSG_NOTICE([csh split-size set to ${withval}])
AC_DEFINE_UNQUOTED([LMSPLIT_SIZE],[${withval}])
else
AC_MSG_NOTICE([csh split-size not set])
fi],
[if test "x${em_split_size}" != "xno" -a "x${em_split_size}" != "xcross"; then
AC_MSG_NOTICE([csh split-size set to ${em_split_size}])
AC_DEFINE_UNQUOTED([LMSPLIT_SIZE],[${em_split_size}])
else
AC_MSG_NOTICE([csh split-size not set])
fi])dnl
dnl#
dnl#-----------------------------------------------------------------------
dnl# --with-static[=<option>] With static linking
dnl# --without-static Without - "" - [DEF]
dnl# STATIC Link the binary 'static'
dnl#
dnl# Also check for shared library support here, too, as a contrast
dnl#
AC_SUBST([STATIC])dnl
AC_ARG_WITH([static],
[AS_HELP_STRING([--with-static[[=<option>]]],[use static linking [[no]]])],
[EM_SET_STATIC([STATIC],[${withval}])])dnl
SC_ENABLE_SHARED
dnl#-----------------------------------------------------------------------
AH_TEMPLATE([HAS_BOURNE_FUNCS],[
HAS_BOURNE_FUNCS:
This symbol, if defined, indicates that the Bourne shell can define aliases
as shell functions.])dnl
AC_MSG_CHECKING([if /bin/sh supports functions])
if test "x${cross_compiling}" = "xyes"; then
em_bourne_funcs="cross"
AC_MSG_WARN([You must specify --enable-shell-funcs or --disable-shell-funcs
when cross compiling ... configure can not guess whether the target system
Bourne shell can handle shell functions or not.])
elif (
cat <<_EMEOF | /bin/sh 2> /dev/null
if (xxx() { ls; }) > /dev/null 2>&1; then
(exit 0); exit 0
else
(exit 42); exit 42
fi
_EMEOF
if test $? = 0 ; then
(exit 0); exit 0
else
(exit 42); exit 42
fi
) ; then
em_bourne_funcs="yes"
else
em_bourne_funcs="no"
fi
AC_MSG_RESULT([${em_bourne_funcs}])
AC_ARG_ENABLE([shell-funcs],
[AS_HELP_STRING([--enable-shell-funcs],[use sh functions [[test]]])],
[if test "x${enableval}" = "xyes" ; then
AC_DEFINE([HAS_BOURNE_FUNCS],[1],
[This symbol, if defined to 1, indicates that the Bourne shell can define aliases as shell functions.])
fi],
[if test "x${em_bourne_funcs}" = "xcross" ; then
AC_MSG_ERROR([You did not --enable-shell-funcs or --disable-shell-funcs
when cross compiling ... aborting!])
elif test "x${em_bourne_funcs}" = "xyes" ; then
AC_DEFINE([HAS_BOURNE_FUNCS],[1],
[This symbol, if defined to 1, indicates that the Bourne shell can define aliases as shell functions.])
fi])dnl
dnl#-----------------------------------------------------------------------
AH_TEMPLATE([HAS_BOURNE_ALIAS],[
HAS_BOURNE_ALIAS:
This symbol, if defined, indicates that the Bourne shell can define aliases
(in other words not a "true" Bourne shell).])dnl
AC_MSG_CHECKING([if /bin/sh supports aliases])
if test "x${cross_compiling}" = "xyes"; then
em_bourne_alias="cross"
AC_MSG_WARN([You must specify --enable-shell-alias or --disable-shell-alias
when cross compiling ... configure can not guess whether the target system
Bourne shell can handle shell aliases or not.])
elif (
cat <<_EMEOF | /bin/sh 2> /dev/null
if (alias xxx='ls') > /dev/null 2>&1; then
(exit 0); exit 0
else
(exit 42); exit 42
fi
_EMEOF
if test $? = 0 ; then
(exit 0); exit 0
else
(exit 42); exit 42
fi
) ; then
em_bourne_alias="yes"
else
em_bourne_alias="no"
fi
AC_MSG_RESULT([${em_bourne_alias}])
AC_ARG_ENABLE([shell-alias],
[AS_HELP_STRING([--enable-shell-alias],[use sh aliases [[test]]])],
[if test "x${enableval}" = "xyes" ; then
AC_DEFINE([HAS_BOURNE_ALIAS],[1],
[This symbol, if defined to 1, indicates that the Bourne shell can define aliases])
fi],
[if test "x${em_bourne_alias}" = "xcross" ; then
AC_MSG_ERROR([You did not --enable-shell-alias or --disable-shell-alias
when cross compiling ... aborting!])
elif test "x${em_bourne_alias}" = "xyes" ; then
AC_DEFINE([HAS_BOURNE_ALIAS],[1],
[This symbol, if defined to 1, indicates that the Bourne shell can define aliases])
fi])dnl
dnl#-----------------------------------------------------------------------
AH_TEMPLATE([EVAL_ALIAS],[
EVAL_ALIAS:
This symbol, if defined, indicates that Modules should ask the shell
to evaluate aliases via stdout like other environment changes instead
of opening a file and then asking the shell to source the file and
then remove it.])dnl
AC_ARG_ENABLE([shell-eval],
[AS_HELP_STRING([--enable-shell-eval],[use shell alias eval [[yes]]])],
[if test "x${enableval}" = "xyes"; then
AC_DEFINE([EVAL_ALIAS],[1])
fi],[AC_DEFINE([EVAL_ALIAS],[1])])dnl
dnl#-----------------------------------------------------------------------
AH_TEMPLATE([USE_FREE],[
USE_FREE:
By default, Modules will not call free() for any dynamic data. This
define enables these calls.])dnl
AC_ARG_ENABLE([free],
[AS_HELP_STRING([--enable-free],[use free() calls [[no]]])],
[if test "x${enableval}" = "xyes"; then
AC_DEFINE([USE_FREE],[1],[This define enables calls to free()])
fi])dnl
dnl#-----------------------------------------------------------------------
AH_TEMPLATE([CACHE_AVAIL],[
CACHE_AVAIL:
This symbol, if defined, indicates that Modules should cache the
directories in MODULEPATH when doing an avail.])dnl
AC_ARG_ENABLE([cache],
[AS_HELP_STRING([--enable-cache],[use directory cache [[no]]])],
[if test "x${enableval}" = "xyes"; then
AC_DEFINE([CACHE_AVAIL],[1],
[This symbol, if defined to 1, indicates that Modules should cache the directories in MODULEPATH when doing an avail.])
fi])dnl
dnl#-----------------------------------------------------------------------
AH_TEMPLATE([CACHE_UMASK],[
CACHE_UMASK:
This symbol, if defined, is used as the umask for creating
cachefiles for the module avail command.])dnl
AC_ARG_WITH([cache-umask],
[AS_HELP_STRING([--with-cache-umask=<umask>],[use cache files umask=<umask> [[000]]])],
[if test "x${withval}" != "xno"; then
test "${withval}" = "yes" && withval=0
AC_DEFINE_UNQUOTED([CACHE_UMASK],[${withval}])
fi])dnl
dnl#-----------------------------------------------------------------------
dnl# "44" is the highest value that changes anything:
AH_TEMPLATE([WITH_DEBUG_INFO],
[WITH_DEBUG_INFO: Debug info level if defined
("44" is the highest value that changes anything)])dnl
AC_ARG_WITH([debug],
[AS_HELP_STRING([--with-debug=<value>],
[set debugging level <value: 0 to 44> [[no]]])],
[if test "x${withval}" != "xno"; then
test "x${withval}" = "xyes" && withval="1"
AC_DEFINE_UNQUOTED([WITH_DEBUG_INFO],[${withval}])dnl
fi])dnl
SC_ENABLE_SYMBOLS
dnl#-----------------------------------------------------------------------
AH_TEMPLATE([VERSION_MAGIC],[
VERSION_MAGIC:
By default, .version files will be required to have the modulefile
magic cookie to be valid, else an error message will be printed out.])dnl
AC_ARG_ENABLE([version-magic],
[AS_HELP_STRING([--enable-version-magic],[set .version magic requirement [[yes]]])],
[if test "x${enableval}" != "xno"; then
AC_DEFINE([VERSION_MAGIC],[1])dnl
else
AC_DEFINE([VERSION_MAGIC],[0])dnl
fi],[AC_DEFINE([VERSION_MAGIC],[1])])dnl
dnl#-----------------------------------------------------------------------
AH_TEMPLATE([BEGINENV],[
BEGINENV:
Modules can save the initial user environment in the .modulesbeginenv
when the first module is loaded. If enabled then the module update
subcommand will work. If set to test, then this essentially enables
this feature, but will only work if the MODULESBEGINENV env.var is
set to a file name (e.g. '${HOME}/.modulesbeginenv.$$'- modules will
do one-level of variable expansion.)])dnl
AC_ARG_ENABLE([beginenv],
[AS_HELP_STRING([--enable-beginenv],[use .modulesbeginenv for initial env [[test]]])],
[if test "x${enableval}" = "xyes"; then
AC_DEFINE([BEGINENV],[1])dnl
elif test "x${enableval}" = "xtest"; then
AC_DEFINE([BEGINENV],[99])dnl
fi],[AC_DEFINE([BEGINENV],[99])])dnl
dnl#
dnl#-----------------------------------------------------------------------
dnl# Logging
dnl# The following option allow switching logging on and off
dnl# and provide a possibility to set up the default facilities
dnl#-----------------------------------------------------------------------
dnl# WITH_LOGGING Whether syslogging is enabled
dnl#
AC_SUBST([WITH_LOGGING])dnl
AH_TEMPLATE([WITH_LOGGING],[WITH_LOGGING: Syslog logging & facilities])dnl
AH_TEMPLATE([WITH_LOG_DIR],[])dnl
AH_TEMPLATE([WITH_LOG_FACILITY_VERBOSE],[])dnl
AH_TEMPLATE([WITH_LOG_FACILITY_INFO],[])dnl
AH_TEMPLATE([WITH_LOG_FACILITY_DEBUG],[])dnl
AH_TEMPLATE([WITH_LOG_FACILITY_TRACE],[])dnl
AH_TEMPLATE([WITH_LOG_FACILITY_WARN],[])dnl
AH_TEMPLATE([WITH_LOG_FACILITY_PROB],[])dnl
AH_TEMPLATE([WITH_LOG_FACILITY_ERROR],[])dnl
AH_TEMPLATE([WITH_LOG_FACILITY_FATAL],[])dnl
AH_TEMPLATE([WITH_LOG_FACILITY_PANIC],[])dnl
WITH_LOGGING=0
AC_ARG_ENABLE([logging],
[AS_HELP_STRING([--enable-logging],[turn logging on [[no]]])],
[if test "x${enableval}" = "xyes"; then
AC_DEFINE([WITH_LOGGING],[1])
WITH_LOGGING=1
fi])dnl
AC_ARG_WITH([log-dir],
[AS_HELP_STRING([--with-log-dir=<value>],
[select an alternate log dir. [[no]]])],
[if test "x${withval}" != "xno"; then
test "x${withval}" = "xyes" && withval="/tmp"
AC_DEFINE_UNQUOTED([WITH_LOG_DIR],["${withval}"])
fi])dnl
AC_ARG_WITH([log-facility-verbose],
[AS_HELP_STRING([--with-log-facility-verbose[=<facility>]],
[Log facility [[stderr]]])],
[if test "x${withval}" != "xno"; then
test "${withval}" = "yes" && withval="stderr"
AC_DEFINE_UNQUOTED([WITH_LOG_FACILITY_VERBOSE],
["${withval}"])
fi])dnl
AC_ARG_WITH([log-facility-info],
[AS_HELP_STRING([--with-log-facility-info[=<facility>]],
[Log facility [[local7.notice]]])],
[if test "x${withval}" != "xno"; then
test "x${withval}" = "xyes" && withval="local7.notice"
AC_DEFINE_UNQUOTED([WITH_LOG_FACILITY_INFO],["${withval}"])
fi])dnl
AC_ARG_WITH([log-facility-debug],
[AS_HELP_STRING([--with-log-facility-debug[=<facility>]],
[Log facility [[local7.notice]]])],
[if test "x${withval}" != "xno"; then
test "x${withval}" = "xyes" && withval="local7.notice"
AC_DEFINE_UNQUOTED([WITH_LOG_FACILITY_DEBUG],
["${withval}"])
fi])dnl
AC_ARG_WITH([log-facility-trace],
[AS_HELP_STRING([--with-log-facility-trace[=<facility>]],
[Log facility [[local7.notice]]])],
[if test "x${withval}" != "xno"; then
test "x${withval}" = "xyes" && withval="local7.notice"
AC_DEFINE_UNQUOTED([WITH_LOG_FACILITY_TRACE],
["${withval}"])
fi])dnl
AC_ARG_WITH([log-facility-warn],
[AS_HELP_STRING([--with-log-facility-warn[=<facility>]],
[Log facility [[local7.warning]]])],
[if test "x${withval}" != "xno"; then
test "x${withval}" = "xyes" && withval="local7.warning"
AC_DEFINE_UNQUOTED([WITH_LOG_FACILITY_WARN],["${withval}"])
fi])dnl
AC_ARG_WITH([log-facility-problem],
[AS_HELP_STRING([--with-log-facility-problem[=<facility>]],
[Log facility [[local7.error]]])],
[if test "x${withval}" != "xno"; then
test "x${withval}" = "xyes" && withval="local7.error"
AC_DEFINE_UNQUOTED([WITH_LOG_FACILITY_PROB],["${withval}"])
fi])dnl
AC_ARG_WITH([log-facility-error],
[AS_HELP_STRING([--with-log-facility-error[=<facility>]],
[Log facility [[local7.error]]])],
[if test "x${withval}" != "xno"; then
test "x${withval}" = "xyes" && withval="local7.error"
AC_DEFINE_UNQUOTED([WITH_LOG_FACILITY_ERROR],
["${withval}"])
fi])dnl
AC_ARG_WITH([log-facility-fatal],
[AS_HELP_STRING([--with-log-facility-fatal[=<facility>]],
[Log facility [[local7.error]]])],
[if test "x${withval}" != "xno"; then
test "x${withval}" = "xyes" && withval="local7.error"
AC_DEFINE_UNQUOTED([WITH_LOG_FACILITY_FATAL],
["${withval}"])
fi])dnl
AC_ARG_WITH([log-facility-panic],
[AS_HELP_STRING([--with-log-facility-panic[=<facility>]],
[Log facility [[local7.error]]])],
[if test "x${withval}" != "xno"; then
test "x${withval}" = "xyes" && withval="local7.error"
AC_DEFINE_UNQUOTED([WITH_LOG_FACILITY_PANIC],
["${withval}"])
fi])dnl
dnl#
dnl#-----------------------------------------------------------------------
dnl# Tracing
dnl# The following option allow switching tracing on and off on a
dnl# per module command basis
dnl#-----------------------------------------------------------------------
dnl#
AH_TEMPLATE([WITH_TRACE_LOAD],[Tracking])dnl
AH_TEMPLATE([WITH_TRACE_UNLOAD],[])dnl
AH_TEMPLATE([WITH_TRACE_SWITCH],[])dnl
AH_TEMPLATE([WITH_TRACE_DISP],[])dnl
AH_TEMPLATE([WITH_TRACE_LIST],[])dnl
AH_TEMPLATE([WITH_TRACE_AVAIL],[])dnl
AH_TEMPLATE([WITH_TRACE_HELP],[])dnl
AH_TEMPLATE([WITH_TRACE_INIT],[])dnl
AH_TEMPLATE([WITH_TRACE_USE],[])dnl
AH_TEMPLATE([WITH_TRACE_UNUSE],[])dnl
AH_TEMPLATE([WITH_TRACE_UPDATE],[])dnl
AH_TEMPLATE([WITH_TRACE_PURGE],[])dnl
AH_TEMPLATE([WITH_TRACE_CLEAR],[])dnl
AH_TEMPLATE([WITH_TRACE_WHATIS],[])dnl
AH_TEMPLATE([WITH_TRACE_APROPOS],[])dnl
AC_ARG_WITH([trace-load],
[AS_HELP_STRING([--with-trace-load=<value>],
[specify a pattern for trace [[no]]])],
[if test "x${withval}" != "xno"; then
if test "x${withval}" = "xyes"; then
AC_DEFINE_UNQUOTED([WITH_TRACE_LOAD],[_all_on])
else
AC_DEFINE_UNQUOTED([WITH_TRACE_LOAD],
["${withval}"])
fi
fi])dnl
AC_ARG_WITH([trace-unload],
[AS_HELP_STRING([--with-trace-unload=<value>],
[specify a pattern for trace [[no]]])],
[if test "x${withval}" != "xno"; then
if test "x${withval}" = "xyes"; then
AC_DEFINE_UNQUOTED([WITH_TRACE_UNLOAD],[_all_on])
else
AC_DEFINE_UNQUOTED([WITH_TRACE_UNLOAD],
["${withval}"])
fi
fi])dnl
AC_ARG_WITH([trace-switch],
[AS_HELP_STRING([--with-trace-switch=<value>],
[specify a pattern for trace [[no]]])],
[if test "x${withval}" != "xno"; then
if test "x${withval}" = "xyes"; then
AC_DEFINE_UNQUOTED([WITH_TRACE_SWITCH],[_all_on])
else
AC_DEFINE_UNQUOTED([WITH_TRACE_SWITCH],
["${withval}"])
fi
fi])dnl
AC_ARG_WITH([trace-disp],
[AS_HELP_STRING([--with-trace-disp=<value>],
[specify a pattern for trace [[no]]])],
[if test "x${withval}" != "xno"; then
if test "x${withval}" = "xyes"; then
AC_DEFINE_UNQUOTED([WITH_TRACE_DISP],[_all_on])
else
AC_DEFINE_UNQUOTED([WITH_TRACE_DISP],
["${withval}"])
fi
fi])dnl
AC_ARG_WITH([trace-list],
[AS_HELP_STRING([--with-trace-list=<value>],
[specify a pattern for trace [[no]]])],
[if test "x${withval}" != "xno"; then
if test "x${withval}" = "xyes"; then
AC_DEFINE_UNQUOTED([WITH_TRACE_LIST],[_all_on])
else
AC_DEFINE_UNQUOTED([WITH_TRACE_LIST],
["${withval}"])
fi
fi])dnl
AC_ARG_WITH([trace-avail],
[AS_HELP_STRING([--with-trace-avail=<value>],
[specify a pattern for trace [[no]]])],
[if test "x${withval}" != "xno"; then
if test "x${withval}" = "xyes"; then
AC_DEFINE_UNQUOTED([WITH_TRACE_AVAIL],[_all_on])
else
AC_DEFINE_UNQUOTED([WITH_TRACE_AVAIL],
["${withval}"])
fi
fi])dnl
AC_ARG_WITH([trace-help],
[AS_HELP_STRING([--with-trace-help=<value>],
[specify a pattern for trace [[no]]])],
[if test "x${withval}" != "xno"; then
if test "x${withval}" = "xyes"; then
AC_DEFINE_UNQUOTED([WITH_TRACE_HELP],[_all_on])
else
AC_DEFINE_UNQUOTED([WITH_TRACE_HELP],
["${withval}"])
fi
fi])dnl
AC_ARG_WITH([trace-init],
[AS_HELP_STRING([--with-trace-init=<value>],
[specify a pattern for trace [[no]]])],
[if test "x${withval}" != "xno"; then
if test "x${withval}" = "xyes"; then
AC_DEFINE_UNQUOTED([WITH_TRACE_INIT],[_all_on])
else
AC_DEFINE_UNQUOTED([WITH_TRACE_INIT],
["${withval}"])
fi
fi])dnl
AC_ARG_WITH([trace-use],
[AS_HELP_STRING([--with-trace-use=<value>],
[specify a pattern for trace [[no]]])],
[if test "x${withval}" != "xno"; then
if test "x${withval}" = "xyes"; then
AC_DEFINE_UNQUOTED([WITH_TRACE_USE],[_all_on])
else
AC_DEFINE_UNQUOTED([WITH_TRACE_USE],["${withval}"])
fi
fi])dnl
AC_ARG_WITH([trace-unuse],
[AS_HELP_STRING([--with-trace-unuse=<value>],
[specify a pattern for trace [[no]]])],
[if test "x${withval}" != "xno"; then
if test "x${withval}" = "xyes"; then
AC_DEFINE_UNQUOTED([WITH_TRACE_UNUSE],[_all_on])
else
AC_DEFINE_UNQUOTED([WITH_TRACE_UNUSE],
["${withval}"])
fi
fi])dnl
AC_ARG_WITH([trace-update],
[AS_HELP_STRING([--with-trace-update=<value>],
[specify a pattern for trace [[no]]])],
[if test "x${withval}" != "xno"; then
if test "x${withval}" = "xyes"; then
AC_DEFINE_UNQUOTED([WITH_TRACE_UPDATE],[_all_on])
else
AC_DEFINE_UNQUOTED([WITH_TRACE_UPDATE],
["${withval}"])
fi
fi])dnl
AC_ARG_WITH([trace-purge],
[AS_HELP_STRING([--with-trace-purge=<value>],
[specify a pattern for trace [[no]]])],
[if test "x${withval}" != "xno"; then
if test "x${withval}" = "xyes"; then
AC_DEFINE_UNQUOTED([WITH_TRACE_PURGE],[_all_on])
else
AC_DEFINE_UNQUOTED([WITH_TRACE_PURGE],
["${withval}"])
fi
fi])dnl