-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
748 lines (722 loc) · 26 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
dnl
dnl File: configure.in
dnl Revision: $Id$
dnl Created: 1994/06/18
dnl Author: Leif Hedstrom<[email protected]>
dnl Martin S. Utesch <[email protected]>
dnl Peter W. Osel <[email protected]>
dnl R.K. Owen <[email protected]>
dnl
dnl Process this file with autoconf to produce a configure script
dnl You need autoconf 2.52 or better!
dnl
dnl ---------------------------------------------------------------------------
AC_INIT(modules,3.2)
AC_PREFIX_DEFAULT([/usr/local/Modules])
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE(1.9.6 foreign dejagnu no-installinfo dist-bzip2)
AC_CONFIG_SRCDIR([version.c])
AM_CONFIG_HEADER(config.h)
AC_AIX
AC_PROG_MAKE_SET
AC_PREREQ(2.59)
dnl I18N support
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.14.5])
dnl ---------------------------------------------------------------------------
dnl Get Modules version & date
dnl ---------------------------------------------------------------------------
dnl DATE Module package date
dnl VERSION Module package version
dnl
AC_SUBST(VERSION)
AC_SUBST(DATE)
VERSION='(unknown)'
VERSION=`sed -n -e 's/^.*version_string.*"\(.*\)";$/\1/p' ${srcdir}/version.c`
DATE='(DDMmmYYYY)'
DATE=`sed -n -e 's/^.*date_string.*"\(.*\)";$/\1/p' ${srcdir}/version.c`
echo "configuring for Modules $VERSION $DATE"
dnl
AC_MSG_RESULT([VERSION = $VERSION])
AC_MSG_RESULT([DATE = $DATE])
dnl ---------------------------------------------------------------------------
dnl Autoheader "templates" (was acconfig.h)
AH_TOP([
/*****
** ** Module Header ******************************************************* **
** **
** Modules Revision 3.0 **
** 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 **
** **
** ************************************************************************ **/
])
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)
AC_SUBST(VERSIONING)
AC_SUBST(NOTVERSIONING)
AH_TEMPLATE([WANTS_VERSIONING],[
WANTS_VERSIONING Does the system want to use modules versions])
AC_ARG_ENABLE(versioning,
AC_HELP_STRING([--enable-versioning], [use modules versioning [[yes]]]),
if test "$enableval" = "yes"; then
WANTS_VERSIONING=1
AC_DEFINE(WANTS_VERSIONING,1)
VERSIONING=""
NOTVERSIONING="#"
else
WANTS_VERSIONING=0
AC_DEFINE(WANTS_VERSIONING,0)
VERSIONING="#"
NOTVERSIONING=""
fi, WANTS_VERSIONING=1
AC_DEFINE(WANTS_VERSIONING,1)
VERSIONING=""
NOTVERSIONING="#"
)
dnl ---------------------------------------------------------------------------
dnl Set PREFIX and related based on WANTS_VERSIONING
dnl ---------------------------------------------------------------------------
AC_SUBST(PREFIX)
AC_SUBST(BASEPREFIX)
DEFAULTPATH=default
dnl PREFIX: Usually equivalent to /usr/local/Modules[/version_number]])
if test "$exec_prefix" != "NONE" ; 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 "$prefix" != "NONE" ; then #{{
if test "$WANTS_VERSIONING" -eq 1 ; then #{{
DEFAULTPATH=$prefix/default
NODEFAULTPATH=$prefix/$VERSION
BASEPREFIX=$prefix
prefix=$BASEPREFIX/$VERSION
export prefix
else #}{
DEFAULTPATH=$prefix
NODEFAULTPATH=$prefix
BASEPREFIX=$prefix
prefix=$BASEPREFIX
export prefix
fi #}}
PREFIX=$prefix
else #}{
if test "$WANTS_VERSIONING" -eq 1 ; then #{{
DEFAULTPATH=$ac_default_prefix/default
NODEFAULTPATH=$ac_default_prefix/$VERSION
BASEPREFIX=$ac_default_prefix
ac_default_prefix=$BASEPREFIX/$VERSION
export ac_default_prefix
else #}{
DEFAULTPATH=$ac_default_prefix
NODEFAULTPATH=$ac_default_prefix
BASEPREFIX=$ac_default_prefix
ac_default_prefix=$BASEPREFIX
export ac_default_prefix
fi #}}
PREFIX=$ac_default_prefix
fi #}}
if test "$exec_prefix" != "NONE" ; then #{
EXECPREFIX=$exec_prefix
else
EXECPREFIX=$PREFIX
fi #}
dnl ---------------------------------------------------------------------------
dnl --enable-use-default Use PREFIX/default/ in init scripts [DEF]
dnl --disable-use-default Use PREFIX/VERSION/ in init scripts
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(use-default,
AC_HELP_STRING([--enable-use-default],[use DEFAULTPATH in init scripts [[yes]]]),
if test "$enableval" = "no" -o $WANTS_VERSIONING -eq 0; then
DEFAULTPATH=$NODEFAULTPATH
fi)
AC_MSG_RESULT([DEFAULTPATH = $DEFAULTPATH])
AC_MSG_RESULT([BASEPREFIX = $BASEPREFIX])
AC_MSG_RESULT([PREFIX = $PREFIX])
AC_MSG_RESULT([EXECPREFIX = $EXECPREFIX])
dnl ---------------------------------------------------------------------------
dnl Some standard autoconfig stuff
dnl Checks for programs
dnl ---------------------------------------------------------------------------
AC_PROG_CC
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AM_PROG_CC_C_O
AC_PROG_MAKE_SET
AC_ISC_POSIX
AC_PATH_PROG([UNAME],[uname],[""])
dnl ---------------------------------------------------------------------------
dnl Checks for header files
dnl ---------------------------------------------------------------------------
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h memory.h stdlib.h unistd.h termio.h fcntl.h ctype.h \
stdarg.h varargs.h syslog.h stdint.h)
AC_CHECK_HEADERS([sys/ioctl.h sys/termios.h sys/mode.h sys/stat.h sys/param.h \
errno.h assert.h locale.h])
dnl ---------------------------------------------------------------------------
dnl Checks for typedefs, structures, and compiler characteristics.
dnl ---------------------------------------------------------------------------
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_SIZE_T
AC_TYPE_INTPTR_T
AC_STRUCT_TM
dnl ---------------------------------------------------------------------------
dnl Checks for library functions.
dnl ---------------------------------------------------------------------------
AC_FUNC_STRCOLL
AC_CHECK_FUNCS([uname gethostname getdomainname \
mktemp tmpnam tempnam \
syslog dup2 setenv putenv setlocale])
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 ---------------------------------------------------------------------------
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, t_accept)
dnl ---------------------------------------------------------------------------
dnl Check for X11 things
dnl ---------------------------------------------------------------------------
AC_PATH_X
AC_PATH_XTRA
if test "$no_x" != "yes"; then
AH_TEMPLATE([HAS_X11LIBS],[
HAS_X11LIBS:
This symbol, if defined, indicates that the C program can use X11
directly.])
AC_DEFINE(HAS_X11LIBS)
AC_CHECK_LIB(X11, XMaxRequestSize,,,
[-I ${ac_x_includes:-.} -L ${ac_x_libraries:-.}])
dnl AC_CHECK_LIB(Xmu, XmuGetHostname,,,
dnl [-I ${ac_x_includes:-.} -L ${ac_x_libraries:-.}])
fi
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".])
EM_PATH_PROG_SEARCH(_CPPSTDIN, cpp, /lib /usr/lib /usr/lang \
/usr/local/lang /usr/ccs/lib, [${CC} -E])
AC_DEFINE_UNQUOTED(CPPSTDIN, "$_CPPSTDIN")
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 "".])
AC_DEFINE(CPPMINUS, "")
dnl ---------------------------------------------------------------------------
AH_TEMPLATE([PHOSTNAME],[
PHOSTNAME:
Last resort to get the hostname, if uname() and gethostname()
are not available.])
AC_PATH_PROG([_PHOST],[hostname],[""])
test "$_PHOST" != "" && AC_DEFINE_UNQUOTED(PHOSTNAME, "$_PHOST")
AC_PATH_PROG(RUNTEST, runtest, "./not_installed")
test "$RUNTEST" = "" && echo "Install DEJAGNU and rerun configure if you \
want to run the testsuite"
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-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. [NO]
dnl --disable-beginenv Do not use .modulesbeginenv
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".])
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 "$cross_compiling" = "yes"; 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,
AC_HELP_STRING([--with-split-size[=<size>]],[use split size=<size> [[test]]]),
if test "${withval+set}" = "set" -a "$withval" != "no"; then
if test "$withval" = "yes"; 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 "$em_split_size" != "no" -a "$em_split_size" != "cross" ; 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 --with-static[=<option>] With static linking
dnl --without-static Without - " - [DEF]
dnl STATIC Link the binary 'static'
dnl
AC_SUBST(STATIC)
AC_ARG_WITH(static,
AC_HELP_STRING([--with-static[[=<option>]]],[use static linking [[no]]]),
EM_SET_STATIC(STATIC, $withval))
dnl ---------------------------------------------------------------------------
AH_TEMPLATE([HAS_BOURNE_FUNCS],[
HAS_BOURNE_FUNCS:
This symbol, if defined, indicates that the Bourne shell can define aliases
as shell functions.])
AC_MSG_CHECKING([if /bin/sh supports functions])
if test "$cross_compiling" = "yes"; 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,
AC_HELP_STRING([--enable-shell-funcs],[use sh functions [[test]]]),
if test "$enableval" = "yes" ; then
AC_DEFINE(HAS_BOURNE_FUNCS)
fi,
if test "$em_bourne_funcs" = "cross" ; then
AC_MSG_ERROR([You did not --enable-shell-funcs or --disable-shell-funcs
when cross compiling ... aborting!])
elif test "$em_bourne_funcs" = "yes" ; then
AC_DEFINE(HAS_BOURNE_FUNCS)
fi)
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).])
AC_MSG_CHECKING([if /bin/sh supports aliases])
if test "$cross_compiling" = "yes"; 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,
AC_HELP_STRING([--enable-shell-alias],[use sh aliases [[test]]]),
if test "$enableval" = "yes" ; then
AC_DEFINE(HAS_BOURNE_ALIAS)
fi,
if test "$em_bourne_alias" = "cross" ; then
AC_MSG_ERROR([You did not --enable-shell-alias or --disable-shell-alias
when cross compiling ... aborting!])
elif test "$em_bourne_alias" = "yes" ; then
AC_DEFINE(HAS_BOURNE_ALIAS)
fi)
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.])
AC_ARG_ENABLE(shell-eval,
AC_HELP_STRING([--enable-shell-eval],[use shell alias eval [[yes]]]),
if test "$enableval" = "yes"; then
AC_DEFINE(EVAL_ALIAS)
fi, AC_DEFINE(EVAL_ALIAS))
dnl ---------------------------------------------------------------------------
AH_TEMPLATE([USE_FREE],[
USE_FREE:
By default, Modules will not call free() for any dynamic data. This
define enables these calls.])
AC_ARG_ENABLE(free,
AC_HELP_STRING([--enable-free],[use free() calls [[no]]]),
if test "$enableval" = "yes"; then
AC_DEFINE(USE_FREE)
fi)
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.])
AC_ARG_ENABLE(version-magic,
AC_HELP_STRING([--enable-version-magic],[set .version magic requirement [[yes]]]),
if test "$enableval" != "no"; then
AC_DEFINE(VERSION_MAGIC,1)
else
AC_DEFINE(VERSION_MAGIC,0)
fi, AC_DEFINE(VERSION_MAGIC,1))
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.)])
AC_ARG_ENABLE(beginenv,
AC_HELP_STRING([--enable-beginenv],[use .modulesbeginenv for initial env [[no]]]),
if test "$enableval" = "yes"; then
AC_DEFINE(BEGINENV,1)
elif test "$enableval" = "test"; then
AC_DEFINE(BEGINENV,99)
fi)
dnl fi, AC_DEFINE(BEGINENV,99))
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)
AH_TEMPLATE([WITH_LOGGING],[WITH_LOGGING: Syslog logging and facilities])
AH_TEMPLATE([WITH_LOG_FACILITY],[WITH_LOG_FACILITY: Syslog facility (usualy local7)])
WITH_LOGGING=0
AC_ARG_ENABLE(logging,
AC_HELP_STRING([--enable-logging],[turn syslogging on [[no]]]),
if test "$enableval" = "yes"; then
AC_DEFINE(WITH_LOGGING)
WITH_LOGGING=1
fi)
AC_ARG_WITH(log-facility,
AC_HELP_STRING([--with-log-facility[=<facility>]],
[Log facility [[local7]]]),
if test "$withval" != "no"; then
test "$withval" = "yes" && withval="local7"
AC_DEFINE_UNQUOTED(WITH_LOG_FACILITY, "$withval")
fi)
dnl ---------------------------------------------------------------------------
dnl Find libraries, functions and special programs
dnl The dynamic loader library should only be probed for, if
dnl static linking is not switched on!
dnl ---------------------------------------------------------------------------
AC_CHECK_LIB(m, log)
if test "${STATIC-foobar}" = "foobar"; then
AC_CHECK_LIB(dl, dlopen)
fi
dnl
dnl--------------------------------------------------------------------
dnl Load the tclConfig.sh file
dnl--------------------------------------------------------------------
SC_PATH_TCLCONFIG
SC_LOAD_TCLCONFIG
EM_SET_TCL
EM_CHECK_TCL
dnl--------------------------------------------------------------------
dnl Load the tclxConfig.sh file
dnl search for tclx after tcl, not before, to benefit from tcl_includes
dnl--------------------------------------------------------------------
EM_PATH_TCLXCONFIG
EM_LOAD_TCLXCONFIG
EM_SET_TCLX
EM_CHECK_TCLX
if test x"$no_tclx" != x"true"; then
AH_TEMPLATE([HAS_TCLXLIBS],[
HAS_TCLXLIBS:
This symbol, if defined, indicates that Modules should support
extended TCL (tclX) commands.])
AC_DEFINE(HAS_TCLXLIBS)
fi
dnl ---------------------------------------------------------------------------
dnl
dnl --with-module-path
dnl --with-version-path
dnl --with-tmp-dir
dnl --with-autoload-path
dnl
dnl ---------------------------------------------------------------------------
dnl MODULEPATH The modulepath we want
dnl
AC_SUBST(MODULEPATH)
AC_ARG_WITH(module-path,
AC_HELP_STRING([--with-module-path=<path>],[use module path=<path> [[PREFIX/modulefiles]]]),
MODULEPATH="$withval"
AC_MSG_RESULT([MODULEPATH = $with_module_path])
,
withval="$BASEPREFIX/modulefiles"
AC_MSG_WARN([will use MODULEPATH=$withval : rerun configure using --with-module-path to override default])
MODULEPATH="$withval"
)
dnl ---------------------------------------------------------------------------
dnl VERSIONPATH The modulepath different versions of modules
dnl
AC_SUBST(VERSIONPATH)
AC_ARG_WITH(version-path,
AC_HELP_STRING([--with-version-path=<path>],[use version path=<path> [[PREFIX/versions]]]),
VERSIONPATH="$withval"
AC_MSG_RESULT([VERSIONPATH = $with_version_path])
,
withval="$BASEPREFIX/versions"
AC_MSG_WARN([will use VERSIONPATH=$withval : rerun configure using --with-version-path to override default])
VERSIONPATH="$withval"
)
dnl ---------------------------------------------------------------------------
dnl INITPATH Init script location
dnl
AC_SUBST(INITPATH)
AC_ARG_WITH(init-path,
AC_HELP_STRING([--with-init-path=<path>],[use init path=<path> [[PREFIX/init]]]),
INITPATH="$withval"
AC_MSG_RESULT([INITPATH = $with_init_path])
,
withval="$PREFIX/init"
AC_MSG_WARN([will use INITPATH=$withval : rerun configure using --with-init-path to override default])
INITPATH="$withval"
)
dnl ---------------------------------------------------------------------------
AH_TEMPLATE([TMP_DIR],[TMP_DIR: tmp directory name])
AC_ARG_WITH(tmp-dir,
AC_HELP_STRING([--with-tmp-dir=<dir>],[use <dir> as a temporary dir [[/tmp]]]),
if test ! -d $withval ; then
AC_MSG_ERROR([tmp dir $withval does not exist])
fi
AC_DEFINE_UNQUOTED(TMP_DIR, "$withval")
AC_MSG_RESULT([TMP_DIR = $withval]),
if test -d "/tmp" ; then
AC_DEFINE_UNQUOTED(TMP_DIR, "/tmp")
elif test -d "/var/tmp" ; then
AC_DEFINE_UNQUOTED(TMP_DIR, "/var/tmp")
fi
)
dnl ---------------------------------------------------------------------------
AH_TEMPLATE([DEFAULTMANPATH],[DEFAULTMANPATH: default man path])
AC_ARG_WITH(man-path,
AC_HELP_STRING([--with-man-path=<dir>],[use <dir> for the default MANPATH [[/usr/man:/usr/share/man]]]),
AC_DEFINE_UNQUOTED(DEFAULTMANPATH, "$withval")
AC_MSG_RESULT([DEFAULTMANPATH = $withval]),
if test -d "/usr/man" ; then
withval="/usr/man"
if test -d "/usr/share/man" ; then
withval="$withval:/usr/share/man"
fi
elif test -d "/usr/share/man" ; then
withval="/usr/share/man"
fi
AC_DEFINE_UNQUOTED(DEFAULTMANPATH, "$withval")
)
AC_MSG_RESULT([DEFAULTMANPATH = $withval])
dnl ---------------------------------------------------------------------------
dnl AUTOLOADPATH directories where Tcl will search for libraries to load
dnl
AC_SUBST(AUTOLOADPATH)
AH_TEMPLATE([AUTOLOADPATH],[
AUTOLOADPATH:
This symbol, if defined, is the "default" path of directories
Tcl will look for functions to autoload. It is space separated!])
AC_ARG_WITH(autoload-path,
AC_HELP_STRING([--with-autoload-path=<path>],[use autoload path=<path> [[PREFIX/lib/tcl]]]),
if test "$withval" = "no" || test "$withval" = "yes"; then
if test "$prefix" != "NONE" ; then
withval="$prefix/lib/tcl"
else
withval="$ac_default_prefix/lib/tcl"
fi
fi
AUTOLOADPATH="$withval"
AC_DEFINE_UNQUOTED(AUTOLOADPATH, "$withval")
)
dnl ---------------------------------------------------------------------------
dnl --with-etc-path
dnl --with-skel-path
dnl --with-dot-ext
dnl ---------------------------------------------------------------------------
dnl ETCPATH Where to find the /etc/"login" files
dnl
AC_SUBST(ETCPATH)
AC_ARG_WITH(etc-path,
AC_HELP_STRING([--with-etc-path=<path>],[use etc path=<path> [[/etc]]]),
[if test "$withval" = "no" || test "$withval" = "yes"; then
AC_MSG_WARN(
[if using '--with-etc-path': need to specify a path! Using /etc])
withval="/etc"
fi
ETCPATH="$withval"]
,
ETCPATH="/etc")
dnl ---------------------------------------------------------------------------
dnl SKELPATH Where to find the $HOME/dot file skeletons
AC_SUBST(SKELPATH)
AC_ARG_WITH(skel-path,
AC_HELP_STRING([--with-skel-path=<path>],[use skel path=<path> [[/etc/skel]]]),
if test "$withval" = "no" || test "$withval" = "yes"; then
AC_MSG_WARN([if using '--with-skel-path': need to specify a path! Using /etc/skel])
withval="/etc/skel"
fi
SKELPATH="$withval"
,
SKELPATH="/etc/skel")
dnl ---------------------------------------------------------------------------
dnl DOT_EXT Whether to use a dot-file extension
dnl EXTDIR Which add.* script to include
AC_SUBST(DOT_EXT)
AC_SUBST(EXTDIR)
AH_TEMPLATE([DOT_EXT],[
DOT_EXT:
Set this to some extension value (e.g. .ext) to be appended onto
each shell dot-file name in the list for each shell for processing
the "module init*" commands. For example - C-shell: .cshrc.ext,
.login.ext.])
AC_ARG_WITH(dot-ext,
AC_HELP_STRING([--with-dot-ext=<.ext>],[append <.ext> (default=.ext) to shell dot files [[no]]]),
if test "$withval" != "no"; then
test "$withval" = "yes" && withval=".ext"
AC_DEFINE_UNQUOTED(DOT_EXT, "$withval")
EXTDIR="ext"
else
AC_DEFINE(DOT_EXT, "")
EXTDIR="etc"
fi,
AC_DEFINE(DOT_EXT, "")
EXTDIR="etc"
)
dnl ---------------------------------------------------------------------------
dnl helpful configure --help comments
m4_divert_once([HELP_WITH],[[
The default value or disposition is listed in the square brackets above.
Beware of new defaults for beginenv.
Depending on the above configuration options the files are approximately
placed in the following directory structure :
PREFIX/Modules/($MODULES_VERSION/ if modules-versioning)
bin/
init/
share/man/
man1/
man4/
modulefiles/
(versions/ if modules-versioning)
System modulefiles can safely be placed in:
PREFIX/Modules/modulefiles
]])
dnl ---------------------------------------------------------------------------
dnl Now put it all out!
dnl ---------------------------------------------------------------------------
AC_CONFIG_FILES([Makefile modules.lsm .spec doc/Makefile po/Makefile.in
init/Makefile init/.modulespath
doc/module.1 doc/modulefile.4
etc/Makefile etc/add.modules etc/mkroot
etc/skel/.cshrc etc/skel/.login
etc/skel/.kshenv etc/skel/.profile
etc/global/csh.cshrc etc/global/csh.login etc/global/csh.modules
etc/global/bashrc etc/global/profile etc/global/profile.modules
ext/Makefile ext/add.ext ext/mkroot
ext/common/.cshrc ext/common/.login
ext/common/.kshenv ext/common/.profile
modulefiles/Makefile modulefiles/modules
modulefiles/module-git modulefiles/module-info modulefiles/null
modulefiles/use.own modulefiles/dot modulefiles/version
modulefiles/HOME modulefiles/notavail
])
dnl We want the init/ scripts to be recreated for each install
AC_CONFIG_COMMANDS([default],[[date > stamp-h]],[[]])
AC_OUTPUT
dnl