forked from jbarber/maui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
548 lines (470 loc) · 14 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT(maui, 3.3.2, help@supercluster.org)
AC_CONFIG_SRCDIR([src/mcom/MConst.c])
#AC_CONFIG_HEADER([config.h])
# Checks for programs.
AC_PROG_CC
#AC_PROG_INSTALL
AC_PROG_LN_S
# Assign desired prefix default
AC_PREFIX_DEFAULT([/usr/local/maui])
# Handle spooldir (homedir)
AC_ARG_WITH(spooldir,
[ --with-spooldir=DIR where config files, log and stat directories are maintained [[/usr/local/maui]]],
SPOOLDIR=$withval, SPOOLDIR=/usr/local/maui)
AC_SUBST(SPOOLDIR)
# Machine Name
MACHINENAME=`echo ${ac_hostname} | tr '[[:lower:]]' '[[:upper:]]'`
AC_ARG_WITH(machine,
[ --with-machine=NAME system name (defaults to uppercased hostname)],
MACHINE=$withval, MACHINE=$MACHINENAME)
AC_SUBST(MACHINE)
# Handle Checksum seed
AC_ARG_WITH(key,
[ --with-key=SEED security checksum key (defaults to a random integer)], SEED=$withval, SEED=$RANDOM)
AC_SUBST(SEED)
# Determine OPSYS
OS=`uname`
if test "$OS" = "AIX"; then
if test `uname -v` = 4; then
if test `uname -r` = 1; then
OPSYS="__AIX41"
elif test `uname -r` = 2; then
OPSYS="__AIX42"
elif test `uname -r` = 3; then
OPSYS="__AIX43"
else
OPSYS="__AIX43"
RELEASE=`uname -r`
AC_MSG_WARN([Unexpected OS release 'AIX4$RELEASE', attempting build with OPSYS=$OPSYS])
fi
else
OPSYS=__AIX43
OSLEVEL=`oslevel`
AC_MSG_WARN([Unexpected AIX level: $OSLEVEL, attempting build with OPSYS=$OPSYS])
fi
elif echo "$OS" | grep -q "CYGWIN"; then
OPSYS="__CYGWIN"
elif test "$OS" = "Linux"; then
OPSYS="__LINUX"
elif test "$OS" = "HP-UX"; then
OPSYS="__HPUX"
elif test "$OS" = "HP-UX"; then
OPSYS="__HPUX"
elif test "$OS" = "IRIX" -o "$OS" = "IRIX64"; then
OPSYS="__IRIX"
OS="IRIX"
elif test "$OS" = "NT"; then
OPSYS="__NT"
OS="NT"
elif test "$OS" = "OSF1"; then
OPSYS="__OSF"
OS="OSF"
else
OPSYS="__LINUX"
AC_MSG_WARN([Unsupported OS: $OS, attempting build with OPSYS=$OPSYS])
OS="LINUX"
fi
AC_SUBST(OPSYS)
AC_SUBST(OS)
# Make generic variable Substitutions
AC_SUBST([PACKAGE_NAME])
AC_SUBST([PACKAGE_VERSION])
AC_SUBST([PACKAGE_TARNAME])
AC_SUBST([HOSTNAME], ${ac_hostname})
AC_SUBST([USER], `whoami`)
AC_SUBST([BUILDDATE], `date`)
AC_SUBST([BUILDDIR], `pwd`)
# LoadLeveler
AC_ARG_WITH(loadl,
[ --with-loadl[[=VERSION]] use LoadLeveler Resource Manager (version [[3]])],
[LLVERSION=$withval],
[LLVERSION='FALSE'])
if test "$LLVERSION" != 'FALSE'; then
if test "$LLVERSION" = 'yes'; then
LLVERSION=3;
else
LLVERSION=${withval%.*};
fi
if test "$RMTYPE" = ''; then
RMTYPE=LL
AC_SUBST(RMTYPE)
AC_SUBST_FILE(rm_config)
rm_config=include/maui.cfg.dist.inc.rm
else
AC_MSG_ERROR([Only one Resource Manager can be specified (LL, $RMTYPE)])
fi
if test "$LLVERSION" -lt "3"; then
LLDIR="/usr/lpp/LoadL/full"
LLDEF="-D__MLL22"
else
LLDIR="/home/loadl"
LLDEF="-D__MLL31"
fi
AC_SUBST(LLDIR)
AC_SUBST(LLDEF)
AC_SUBST_FILE(ll_definitions)
ll_definitions=include/Makefile.inc.ll
fi
# SDR
AC_ARG_WITH(sdr,
[ --with-sdr use the IBM SP2 SDR to obtain node info],
[USESDR='TRUE'],
[USESDR='FALSE'])
if test "$USESDR" != 'FALSE'; then
AC_SUBST_FILE(sdr_definitions)
sdr_definitions=include/Makefile.inc.sdr
fi
# PBS
AC_ARG_WITH(pbs,
[ --with-pbs[[=DIR]] use PBS Resource Manager (target directory (location of pbs lib dir) [[/usr/local]])],
[PBSTARGETDIR=$withval],
[PBSTARGETDIR='FALSE'])
if test "$PBSTARGETDIR" != 'FALSE'; then
if test "$PBSTARGETDIR" = 'yes'; then
if pbs-config --prefix 1>/dev/null 2>&1;then
PBSTARGETDIR=`pbs-config --prefix`
else
PBSTARGETDIR='/usr/local'
fi
elif test -f "$PBSTARGETDIR/bin/pbs-config"; then
PBSTARGETDIR=`$PBSTARGETDIR/bin/pbs-config --prefix`
elif test -f "$PBSTARGETDIR/../bin/pbs-config"; then
PBSTARGETDIR=`$PBSTARGETDIR/../bin/pbs-config --prefix`
elif test -f "$PBSTARGETDIR/pbs-config"; then
PBSTARGETDIR=`$PBSTARGETDIR/pbs-config --prefix`
elif test -f "$PBSTARGETDIR"; then
PBSTARGETDIR=`$PBSTARGETDIR --prefix`
fi
if test "$RMTYPE" = ''; then
RMTYPE=PBS
AC_SUBST(RMTYPE)
AC_SUBST_FILE(rm_config)
rm_config=include/maui.cfg.dist.inc.rm
else
AC_MSG_ERROR([Only one Resource Manager can be specified (PBS, $RMTYPE)])
fi
AC_SUBST(PBSTARGETDIR)
AC_SUBST_FILE(pbs_definitions)
pbs_definitions=include/Makefile.inc.pbs
fi
# RMS
AC_ARG_WITH(rms,
[ --with-rms[[=standalone]] use Quadrics RMS (default is not as a standalone Resource Manager [[]])],
[USERMS=$withval],
[USERMS='FALSE'])
if test "$USERMS" != 'FALSE'; then
if test "$USERMS" = 'yes'; then
USERMS='supporting';
fi
if test "$USERMS" = 'standalone'; then
if test "$RMTYPE" = ''; then
RMTYPE=RMS
else
AC_MSG_ERROR([Only one Resource Manager can be specified (RMS, $RMTYPE)])
fi
#AC_SUBST_FILE(rms_definitions)
#rms_definitions=include/Makefile.inc.rms
fi
fi
# SGE
AC_ARG_WITH(sge,
[ --with-sge[[=DIR]] use SGE Resource Manager (build directory (location of SGE include and lib directories) [[/usr/local/sge/source]])],
[SGEBUILDDIR=$withval],
[SGEBUILDDIR='FALSE'])
if test "$SGEBUILDDIR" != 'FALSE'; then
if test "$SGEBUILDDIR" = 'yes'; then
SGEBUILDDIR='/usr/local/sge/source';
fi
if test "$RMTYPE" = ''; then
RMTYPE=SGE
AC_SUBST(RMTYPE)
AC_SUBST_FILE(rm_config)
rm_config=include/maui.cfg.dist.inc.rm
else
AC_MSG_ERROR([Only one Resource Manager can be specified (SGE, $RMTYPE)])
fi
SGEOSDIR=`(cd $SGEBUILDDIR; ./aimk -no-mk)`
AC_SUBST(SGEBUILDDIR)
AC_SUBST(SGEOSDIR)
AC_SUBST_FILE(sge_definitions)
sge_definitions=include/Makefile.inc.sge
fi
# LSF
AC_ARG_WITH(lsf,
[ --with-lsf[[=DIR]] use LSF Resource Manager (install directory (location of LSF include and lib directories) [[/usr/local/lsf]])],
[LSFDIR=$withval],
[LSFDIR='FALSE'])
if test "$LSFDIR" != 'FALSE'; then
if test "$LSFDIR" = 'yes'; then
LSFDIR='/usr/local/lsf';
fi
if test "$RMTYPE" = ''; then
RMTYPE=LSF
AC_SUBST(RMTYPE)
AC_SUBST_FILE(rm_config)
rm_config=include/maui.cfg.dist.inc.rm
else
AC_MSG_ERROR([Only one Resource Manager can be specified (LSF, $RMTYPE)])
fi
if test "$USERMS" = 'supporting'; then
LSFLIBS="-lextsch -lbat -llsf -lrmsemu -lnsl -ldl"
LSFDEFS="-D__MLSF -D__MLSFRMS"
else
LSFLIBS="-lextsch -lbat -llsf -lnsl -ldl"
LSFDEFS="-D__MLSF"
fi
AC_SUBST(LSFDIR)
AC_SUBST(LSFLIBS)
AC_SUBST(LSFDEFS)
AC_SUBST_FILE(lsf_definitions)
lsf_definitions=include/Makefile.inc.lsf
fi
# Wiki
AC_ARG_WITH(wiki,
[ --with-wiki use Wiki Resource Manager],
[USEWIKI='TRUE'],
[USEWIKI='FALSE'])
if test "$USEWIKI" != 'FALSE'; then
if test "$RMTYPE" != ''; then
AC_MSG_ERROR([Only one Resource Manager can be specified (WIKI, $RMTYPE)])
fi
RMTYPE=WIKI
fi
# Bamboo Job Manager
AC_ARG_WITH(bamboo,
[ --with-bamboo use Bamboo Resource Manager],
[USEBAMBOO='TRUE'],
[USEBAMBOO='FALSE'])
if test "$USEBAMBOO" != 'FALSE'; then
if test "$RMTYPE" != ''; then
AC_MSG_ERROR([Only one Resource Manager can be specified (BAMBOO, $RMTYPE)])
fi
RMTYPE=SSS
RMPORT=" PORT=4204"
RMHOST=" HOST=$HOSTNAME"
RMSOCKETPROTOCOL=" SOCKETPROTOCOL=HTTP"
RMWIREPROTOCOL=" WIREPROTOCOL=SSS2"
RMVERSION=" VERSION=SSS2.0"
fi
# Other SSS Resource Manager
AC_ARG_WITH(sss-rm,
[ --with-sss-rm[[=PORT]] use SSS Resource Manager (default port [[7865]])],
[SSSRMPORT=$withval],
[SSSRMPORT='FALSE'])
if test "$SSSRMPORT" != 'FALSE'; then
if test "$SSSRMPORT" = 'yes'; then
SSSRMPORT='7865';
fi
if test "$RMTYPE" != ''; then
AC_MSG_ERROR([Only one Resource Manager can be specified (SSS-RM, $RMTYPE)])
fi
RMTYPE=SSS
RMPORT=" PORT=$SSSRMPORT"
RMHOST=" HOST=$HOSTNAME"
RMSOCKETPROTOCOL=" SOCKETPROTOCOL=HTTP"
RMWIREPROTOCOL=" WIREPROTOCOL=SSS2"
RMVERSION=" VERSION=SSS2.0"
fi
if test "$RMTYPE" = ''; then
AC_MSG_WARN([Resource Manager not specified - attempting build with pbs])
RMTYPE=PBS
AC_SUBST(RMTYPE)
AC_SUBST_FILE(rm_config)
rm_config=include/maui.cfg.dist.inc.rm
if pbs-config --prefix 1>/dev/null 2>&1;then
PBSTARGETDIR=`pbs-config --prefix`
else
PBSTARGETDIR='/usr/local';
fi
fi
if test "$RMTYPE" = "PBS" ;then
if $PBSTARGETDIR/bin/pbs-config --cflags 1>/dev/null 2>&1;then
PBSCFLAGS=`$PBSTARGETDIR/bin/pbs-config --cflags`
else
PBSCFLAGS=-I$PBSTARGETDIR/include
fi
if $PBSTARGETDIR/bin/pbs-config --libs 1>/dev/null 2>&1;then
PBSLDFLAGS=`$PBSTARGETDIR/bin/pbs-config --libs`
elif test -f $PBSTARGETDIR/lib/libpbs.a ;then
if test "$OS" = "OSF"; then
PBSLDFLAGS="$PBSTARGETDIR/ilib/libnet.a -L$PBSTARGETDIR/lib -lpbs"
else
PBSLDFLAGS="-L$PBSTARGETDIR/lib -lnet -lpbs"
fi
else
AC_MSG_ERROR([can't find pbs-config or libpbs.a])
fi
AC_SUBST(PBSCFLAGS)
AC_SUBST(PBSLDFLAGS)
AC_SUBST_FILE(pbs_definitions)
pbs_definitions=include/Makefile.inc.pbs
fi
# Warehouse Node Monitor
AC_ARG_WITH(warehouse,
[ --with-warehouse use Warehouse System Monitor],
[USEWAREHOUSE='TRUE'],
[USEWAREHOUSE='FALSE'])
if test "$USEWAREHOUSE" != 'FALSE'; then
if test "$NMTYPE" = ''; then
RMNMPORT=" NMPORT=12321"
RMNMHOST=" NMHOST=$HOSTNAME"
fi
fi
AC_SUBST(RMTYPE)
AC_SUBST(RMPORT)
AC_SUBST(RMHOST)
AC_SUBST(RMSOCKETPROTOCOL)
AC_SUBST(RMWIREPROTOCOL)
AC_SUBST(RMVERSION)
AC_SUBST(RMNMPORT)
AC_SUBST(RMNMHOST)
# END RM CONFIG --------------------------------------
# START AM CONFIG ------------------------------------
# QBank
AC_ARG_WITH(qbank,
[ --with-qbank use QBank Allocation Manager],
[USEQBANK='TRUE'],
[USEQBANK='FALSE'])
if test "$USEQBANK" != 'FALSE'; then
if test "$AMTYPE" != ''; then
AC_MSG_ERROR([Only one Allocation Manager can be specified (QBANK, $AMTYPE)])
fi
AMTYPE=QBANK
AMHOST=" HOST=$HOSTNAME"
AMPORT=" PORT=7111"
AMOTHER=" CHARGEPOLICY=DEBITALLWC JOBFAILUREACTION=NONE TIMEOUT=15"
fi
# Gold
AC_ARG_WITH(gold,
[ --with-gold use Gold Allocation Manager],
[USEGOLD='TRUE'],
[USEGOLD='FALSE'])
if test "$USEGOLD" != 'FALSE'; then
if test "$AMTYPE" != ''; then
AC_MSG_ERROR([Only one Allocation Manager can be specified (GOLD, $AMTYPE)])
fi
AMTYPE=GOLD
AMHOST=" HOST=$HOSTNAME"
AMPORT=" PORT=7112"
AMSOCKETPROTOCOL=" SOCKETPROTOCOL=HTTP"
AMWIREPROTOCOL=" WIREPROTOCOL=XML"
AMOTHER=" CHARGEPOLICY=DEBITALLWC JOBFAILUREACTION=NONE TIMEOUT=15"
fi
# Other SSS Allocation Manager
AC_ARG_WITH(sss-am,
[ --with-sss-am[[=PORT]] use SSS Allocation Manager (default port [[8865]])],
[SSSAMPORT=$withval],
[SSSAMPORT='FALSE'])
if test "$SSSAMPORT" != 'FALSE'; then
if test "$SSSAMPORT" = 'yes'; then
SSSAMPORT='8865';
fi
if test "$AMTYPE" != ''; then
AC_MSG_ERROR([Only one Allocation Manager can be specified (SSS-AM, $AMTYPE)])
fi
AMTYPE=SSS
AMHOST=" HOST=$HOSTNAME"
AMPORT=" PORT=$SSSAMPORT"
AMOTHER=" CHARGEPOLICY=DEBITALLWC JOBFAILUREACTION=NONE TIMEOUT=15"
fi
if test "$AMTYPE" = ''; then
AMTYPE=NONE
fi
AC_SUBST(AMTYPE)
AC_SUBST(AMHOST)
AC_SUBST(AMPORT)
AC_SUBST(AMSOCKETPROTOCOL)
AC_SUBST(AMWIREPROTOCOL)
AC_SUBST(AMOTHER)
# END AM CONFIG ---------------------------------
# MX
AC_ARG_WITH(mx,
[ --with-mx use MX],
[USEMX='TRUE'],
[USEMX='FALSE'])
if test "$USEMX" != 'FALSE'; then
AC_SUBST_FILE(mx_definitions)
mx_definitions=include/Makefile.inc.mx
fi
# PCRE
AC_ARG_WITH(pcre,
[ --with-pcre[[=DIR]] use PCRE (pcre dir (location of PCRE include and lib directories) [[/path/to/pcre]]],
[PCREDIR=$withval],
[PCREDIR='FALSE'])
if test "$PCREDIR" != 'FALSE'; then
if test "$PCREDIR" = 'yes'; then
PCREDIR='/path/to/pcre';
fi
AC_SUBST(PCREDIR)
AC_SUBST_FILE(pcre_definitions)
pcre_definitions=include/Makefile.inc.pcre
fi
# CYGRUNSRV
AC_ARG_WITH(cygrunsrv,
[ --with-cygrunsrv run as Windows service for Cygwin (do not use a background daemon)],
[DAEMONDEF="-D__CYGRUNSRV"],
[DAEMONDEF=""])
AC_SUBST(DAEMONDEF)
# Make sure one RM was specified
if test "$RMTYPE" = ''; then
AC_MSG_ERROR([At least one Resource Manager must be specified])
fi
# Checks for libraries.
AC_CHECK_LIB([m], [sqrt])
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STAT
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_HEADER_TIME
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MKTIME
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_SETPGRP
AC_FUNC_SETVBUF_REVERSED
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_STRTOD
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([gethostbyaddr gethostbyname gethostname gettimeofday inet_ntoa memchr memset pow putenv regcmp regcomp select setlocale socket strchr strdup strerror strrchr strstr strtol strtoul])
# Configure the output files, and generate them.
AC_CONFIG_FILES([include/Makefile.inc.ll
include/Makefile.inc.sdr
include/Makefile.inc.pbs
include/Makefile.inc.sge
include/Makefile.inc.lsf
include/Makefile.inc.mx
include/Makefile.inc.pcre])
AC_CONFIG_FILES([Makefile], [chmod 700 Makefile])
AC_CONFIG_FILES([include/maui.cfg.dist.inc.rm
maui.cfg.dist
maui-private.cfg.dist])
AC_CONFIG_FILES([etc/maui.sh etc/maui.csh])
AC_CONFIG_FILES([include/moab-local.h], [chmod 600 include/moab-local.h])
AC_OUTPUT
# Do miscellaneous configure steps
touch maui.ck
touch maui-private.cfg
test -d bin || mkdir bin
test -d lib || mkdir lib
# Display final messages
if test -z "`echo $PATH | grep \"$prefix\" 2>/dev/null`"; then
AC_MSG_NOTICE([
Remember to add $prefix/bin to your PATH])
fi
AC_MSG_NOTICE([NOTE: link 'docs/mauidocs.html' to your local website for access to user and admin documentation
NOTE: latest downloads, patches, etc are available at 'http://supercluster.org/maui'
configure successful.])