-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathacinclude.m4
More file actions
3186 lines (3005 loc) · 110 KB
/
acinclude.m4
File metadata and controls
3186 lines (3005 loc) · 110 KB
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 $Source: bitbucket.org:berkeleylab/gasnet.git/acinclude.m4 $
dnl Description: m4 macros
dnl Copyright 2004, Dan Bonachea <bonachea@cs.berkeley.edu>
dnl Terms of use are as specified in license.txt
dnl insert comments to improve readability of generated configure script
pushdef([gasnet_fun_level],0)
define([gasnet_fun_comment],[# $1])
AC_DEFUN([GASNET_FUN_BEGIN],[
pushdef([gasnet_fun_level],incr(defn([gasnet_fun_level])))
gasnet_fun_comment(vvvvvvvvvvvvvvvvvvvvvv [$1] vvvvvvvvvvvvvvvvvvvvvv (L:gasnet_fun_level))
])
AC_DEFUN([GASNET_FUN_END],[
gasnet_fun_comment(^^^^^^^^^^^^^^^^^^^^^^ [$1] ^^^^^^^^^^^^^^^^^^^^^^ (L:gasnet_fun_level))
popdef([gasnet_fun_level])
])
dnl determine the autoconf version used to build configure script
AC_DEFUN([GASNET_GET_AUTOCONF_VERSION],[
GASNET_FUN_BEGIN([$0])
AC_REQUIRE([AC_PROG_AWK])
AC_MSG_CHECKING(autoconf version)
ifdef([AC_AUTOCONF_VERSION],[
AUTOCONF_VERSION_STR='m4_defn([AC_AUTOCONF_VERSION])'
], [
AUTOCONF_VERSION_STR=`$AWK '/.*enerated.*utoconf.*([[0-9]]+).([[0-9]]+).*/ { [match]([$]0,"[[0-9]]+.[[0-9]]+"); print [substr]([$]0,RSTART,RLENGTH); exit 0 } ' < ${srcdir}/configure`
])
dnl AUTOCONF_VERSION=`echo $AUTOCONF_VERSION_STR | $AWK -F. '{ printf("%i%i",[$]1,[$]2); }'`
AC_MSG_RESULT($AUTOCONF_VERSION_STR)
GASNET_FUN_END([$0])
])
AC_DEFUN([GASNET_FORBID_PROGRAM_TRANSFORM],[
GASNET_FUN_BEGIN([$0])
#echo cross_compiling=$cross_compiling target_alias=$target_alias program_prefix=$program_prefix program_suffix=$program_suffix program_transform_name=$program_transform_name
# undo prefix autoconf automatically adds during cross-compilation
# don't test for cross_compile here as it might not yet be set correctly
if test "$program_prefix" = "${target_alias}-" ; then
program_prefix=NONE
fi
# normalize empty prefix/suffix
if test -z "$program_prefix" ; then
program_prefix=NONE
fi
if test -z "$program_suffix" ; then
program_suffix=NONE
fi
# canonicalize transforms caused by empty prefix/suffix
program_transform_name=`echo "$program_transform_name" | sed -e 's/; *$//;' | sed -e "s/${target_alias}-//"`
if expr "$program_transform_name" : 's.^..$' >/dev/null || \
expr "$program_transform_name" : 's.$$..$' >/dev/null || \
expr "$program_transform_name" : 's.$$..;s.^..$' >/dev/null ; then
program_transform_name="s,x,x,"
fi
if test "$program_prefix$program_suffix$program_transform_name" != "NONENONEs,x,x," ; then
GASNET_MSG_ERROR([This configure script does not support --program-prefix, --program-suffix or --program-transform-name. Users are recommended to instead use --prefix with a unique directory and make symbolic links as desired for renaming.])
fi
GASNET_FUN_END([$0])
])
dnl GASNET_GCC_VERSION_CHECK(type) type=CC or CXX
AC_DEFUN([GASNET_GCC_VERSION_CHECK],[
GASNET_FUN_BEGIN([$0($1)])
AC_MSG_CHECKING(for known buggy compilers)
badgccmsg=""
AC_TRY_COMPILE([
#if __GNUC__ == 3 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ <= 2
# error
#endif
],[ ], [:], [
AC_MSG_RESULT([$1] is gcc 3.2.0-2)
badgccmsg="Use of gcc/g++ 3.2.0-2 for compiling this software is strongly discouraged. \
This version has a serious known bug in the optimizer regarding structure copying, \
which may lead to bad code and incorrect runtime behavior when optimization is enabled. \
Consider using \$[$1] to select a different compiler."
GASNET_IF_ENABLED(allow-gcc32, Allow the use of the known broken gcc/g++ 3.2.0-2 compiler, [
GASNET_MSG_WARN([$badgccmsg])
],[
AC_MSG_ERROR([$badgccmsg \
You may enable use of this broken compiler at your own risk by passing the --enable-allow-gcc32 flag.])
])
])
AC_TRY_COMPILE([
#if __GNUC__ == 4 && __GNUC_MINOR__ < 3
# error
#endif
],[ ], [:], [
AC_MSG_RESULT([$1 is gcc 4.x, for x < 3])
badgccmsg="Use of gcc/g++ 4.0, 4.1 or 4.2 for compiling this software is strongly discouraged. \
These versions have a known bug in the optimizer regarding aliasing analysis which may lead \
to bad code and incorrect runtime behavior when optimization is enabled. \
Consider using \$[$1] to select a different compiler."
GASNET_IF_ENABLED(allow-gcc4, Allow the use of a broken gcc/g++ 4.0-4.2 compiler, [
GASNET_MSG_WARN([$badgccmsg])
],[
AC_MSG_ERROR([$badgccmsg \
You may enable use of this broken compiler at your own risk by passing the --enable-allow-gcc4 flag.\
If you do so, please see the documentation on --enable-conservative-local-copy for a possible \
work around for the gcc-4.x bug.])
])
])
if test -z "$badgccmsg"; then
AC_MSG_RESULT(ok)
fi
GASNET_FUN_END([$0($1)])
])
dnl GASNET_PGI_VERSION_CHECK(type) type=CC or CXX
AC_DEFUN([GASNET_PGI_VERSION_CHECK],[
GASNET_FUN_BEGIN([$0($1)])
AC_MSG_CHECKING(for known buggy compilers)
badpgimsg=""
AC_TRY_COMPILE([
#if ((10000 * __PGIC__) + (100 * __PGIC_MINOR__) + __PGIC_PATCHLEVEL__) < 70205
# error
#endif
],[ ], [:], [
AC_MSG_RESULT([$1] is PGI prior to 7.2-5)
badpgimsg="Use of PGI compilers older than 7.2-5 is not supported.
Consider using \$[$1] to select a different compiler."
])
if test -n "$badpgimsg"; then
AC_MSG_ERROR([$badpgimsg])
else
AC_MSG_RESULT(ok)
fi
GASNET_FUN_END([$0($1)])
])
dnl GASNET_PATHSCALE_VERSION_CHECK(type) type=CC or CXX
AC_DEFUN([GASNET_PATHSCALE_VERSION_CHECK],[
GASNET_FUN_BEGIN([$0($1)])
AC_MSG_CHECKING(for known buggy compilers)
badpathscalemsg=""
AC_TRY_COMPILE([
#if (__PATHCC__ < 3)
# error
#endif
],[ ], [:], [
AC_MSG_RESULT([$1] is PathScale prior to 3.0)
badpathscalemsg="Use of PathScale compilers older than 3.0 is not supported.
Consider using \$[$1] to select a different compiler."
])
if test -n "$badpathscalemsg"; then
AC_MSG_ERROR([$badpathscalemsg])
else
AC_MSG_RESULT(ok)
fi
GASNET_FUN_END([$0($1)])
])
AC_DEFUN([GASNET_FIX_SHELL],[
GASNET_FUN_BEGIN([$0])
AC_MSG_CHECKING(for good shell)
if test "$BASH" = '' && test `uname` = HP-UX; then
AC_MSG_RESULT([no, switching to bash])
case [$]# in
0) exec bash - "[$]0" ;;
*) exec bash - "[$]0" "[$]@" ;;
esac
else
AC_MSG_RESULT(yes)
fi
GASNET_FUN_END([$0])
])
dnl find full pathname for a given header file, if it exists and AC_SUBST it
AC_DEFUN([GASNET_FIND_HEADER],[
GASNET_FUN_BEGIN([$0($1)])
AC_REQUIRE([AC_PROG_AWK])
AC_CHECK_HEADERS($1)
pushdef([lowername],patsubst(patsubst(patsubst([$1], [/], [_]), [\.], [_]), [-], [_]))
pushdef([uppername],translit(lowername,'a-z','A-Z'))
if test "$ac_cv_header_[]lowername" = "yes"; then
AC_MSG_CHECKING(for location of $1)
echo "#include <$1>" > conftest.c
header_pathname=
if test -n "$GASNET_FIND_HEADER_CPP"; then
echo "$GASNET_FIND_HEADER_CPP conftest.c" >&5
header_pathname=`eval "$GASNET_FIND_HEADER_CPP conftest.c 2>&5" | grep $1 | head -1`
header_pathname=`echo $header_pathname | $AWK '{ printf("%s",[$]3); }'`
fi
if test -z "$header_pathname"; then
echo "$CPP conftest.c" >&5
header_pathname=`$CPP conftest.c 2>&5 | grep $1 | head -1`
header_pathname=`echo $header_pathname | $AWK '{ printf("%s",[$]3); }'`
fi
if test -z "$header_pathname"; then
# IBM xlc doesn't always emit include file name in output: try /usr/include
if test -r /usr/include/$1; then
header_pathname="\"/usr/include/$1\""
fi
fi
if test -z "$header_pathname"; then
AC_MSG_RESULT(unknown)
GASNET_MSG_WARN(Unable to detect pathname of $1 - pretending it doesn't exist)
have=0
else
AC_MSG_RESULT($header_pathname)
have=1
fi
else
header_pathname=
have=0
fi
PATH_[]uppername=$header_pathname
HAVE_[]uppername=$have
AC_SUBST(PATH_[]uppername)
AC_SUBST(HAVE_[]uppername)
popdef([uppername])
popdef([lowername])
GASNET_FUN_END([$0($1)])
])
dnl autoconf before 2.50 lacks AC_INCLUDES_DEFAULT
AC_DEFUN([GASNET_INCLUDES_DEFAULT],[
ifdef([AC_INCLUDES_DEFAULT],[AC_INCLUDES_DEFAULT],[
dnl provide fallback include default for autoconf 2.13
/* this should include only C89 headers containing declarations we may want in configure */
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include <signal.h>
#include <errno.h>
#include <math.h>
#include <time.h>
])
])
AC_DEFUN([myeval],[$1])
dnl force our includes into an existing macro expansion
define([_GASNET_INSERT_HEADERS],[
pushdef([hash],[#])
patsubst( [hash] (
$1
[hash] ), [\(#include <.*$\)], \1 GASNET_INCLUDES_DEFAULT)
popdef([hash])
])
ifdef([AC_AUTOCONF_VERSION],[ dnl fix a buggy AC_CHECK_SIZEOF(type *) in AC 2.66
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.66], [
m4_copy([AC_CHECK_SIZEOF],[_GASNET_CHECK_SIZEOF])
m4_defun([AC_CHECK_SIZEOF],[
m4_pushdef([AS_LITERAL_IF],[])
_GASNET_CHECK_SIZEOF($@)
m4_popdef([AS_LITERAL_IF])
])
])
])
dnl do AC_CHECK_SIZEOF and also AC_SUBST the result, second arg is optional prefix
AC_DEFUN([GASNET_CHECK_SIZEOF],[
GASNET_FUN_BEGIN([$0($1,$2)])
pushdef([typename],patsubst(patsubst([$1], [\ ], [_]), [\*], [p]))
pushdef([barename],sizeof_[]typename)
pushdef([lowername],translit($2[]barename,'A-Z','a-z'))
pushdef([uppername],translit($2[]barename,'a-z','A-Z'))
if test "$cross_compiling" = "yes" ; then
uppername=
GASNET_TRY_CACHE_EXTRACT_EXPR([sizeof($1) (binary probe)],uppername,[GASNET_INCLUDES_DEFAULT],[sizeof($1)],uppername)
if test -z "$uppername" ; then # last resort is to use CROSS var
GASNET_CROSS_VAR(uppername,uppername)
fi
ac_cv_[]lowername=$uppername
fi
dnl use bare AC_CHECK_SIZEOF here to get correct .h behavior & avoid duplicate defs
GASNET_PUSHVAR(ac_cv_[]barename,"$ac_cv_[]lowername")
if test "$ac_cv_[]barename" = "" ; then
unset ac_cv_[]barename
unset ac_cv_type_[]typename
fi
if test "$2" != "" ; then
AC_MSG_CHECKING([$2 size:])
fi
ifdef([AC_INCLUDES_DEFAULT], [
AC_CHECK_SIZEOF($1, $uppername)
],[ dnl autoconf 2.13 lacks header support in CHECK_SIZEOF, add ours
_GASNET_INSERT_HEADERS([ AC_CHECK_SIZEOF($1, $uppername) ])
])
gasnet_checksizeoftmp_[]lowername="$ac_cv_[]barename"
GASNET_POPVAR(ac_cv_[]barename)
ac_cv_[]lowername=$gasnet_checksizeoftmp_[]lowername
uppername=$gasnet_checksizeoftmp_[]lowername
if test "$uppername" = "0" -o "$uppername" = "" -o "$ac_cv_[]lowername" != "$uppername"; then
GASNET_MSG_ERROR(failed to find sizeof($1))
fi
if test "$2" != ""; then
dnl work around an irritating autoheader bug -
dnl different autoheader versions handle the auto-AC_DEFINE done by
dnl AC_CHECK_SIZEOF differently. This mantra should ensure we get exactly one
dnl copy of each def in the config.h.in for any autoheader version
ac_cv_[]uppername[]_indirect=uppername
dnl following must appear exactly once to prevent errors
AC_DEFINE_UNQUOTED($ac_cv_[]uppername[]_indirect,$uppername)
fi
AC_SUBST(uppername)
popdef([barename])
popdef([typename])
popdef([lowername])
popdef([uppername])
GASNET_FUN_END([$0($1,$2)])
])
dnl GASNET_CHECK_INTTYPES(headername)
dnl AC_DEFINE and set HAVE_HEADERNAME_H if the header exists
dnl AC_DEFINE and AC_SUBST COMPLETE_HEADERNAME_H if it contains all the inttypes
dnl that we care about (all of which are mandated by C99 and POSIX!)
AC_DEFUN([GASNET_CHECK_INTTYPES_HELPERPROG],[
#include <$1>
int check() {
int8_t i8;
uint8_t u8;
int16_t i16;
uint16_t u16;
int32_t i32;
uint32_t u32;
int64_t i64;
uint64_t u64;
intptr_t ip;
uintptr_t up;
if (sizeof(i8) != 1) return 1;
if (sizeof(u8) != 1) return 1;
if (sizeof(i16) != 2) return 1;
if (sizeof(u16) != 2) return 1;
if (sizeof(i32) != 4) return 1;
if (sizeof(u32) != 4) return 1;
if (sizeof(i64) != 8) return 1;
if (sizeof(u64) != 8) return 1;
if (sizeof(ip) != sizeof(void*)) return 1;
if (sizeof(up) != sizeof(void*)) return 1;
return 0;
}
])
dnl detect whether a given inttypes header is available and complete, with optional prefix
AC_DEFUN([GASNET_CHECK_INTTYPES],[
GASNET_FUN_BEGIN([$0($1,$2)])
pushdef([lowername],patsubst(patsubst(patsubst([$1], [/], [_]), [\.], [_]), [-], [_]))
pushdef([uppername],translit(lowername,'a-z','A-Z'))
GASNET_PUSHVAR(HAVE_[]uppername,"")
dnl force a recheck
unset ac_cv_header_[]lowername
AC_CHECK_HEADERS([$1])
GASNET_POPVAR(HAVE_[]uppername)
if test "$ac_cv_header_[]lowername" = "yes"; then
[$2]HAVE_[]uppername=1
AC_SUBST([$2]HAVE_[]uppername)
AC_DEFINE([$2]HAVE_[]uppername)
if test "$cross_compiling" = "yes" ; then
dnl if cross-compiling, just ensure the header can build the inttypes program and hope for the best
GASNET_TRY_CACHE_CHECK([for a complete $1],[$2]COMPLETE_[]uppername,[
GASNET_CHECK_INTTYPES_HELPERPROG($1)
],[ return check(); ], [
[$2]COMPLETE_[]uppername=1
AC_SUBST([$2]COMPLETE_[]uppername)
AC_DEFINE([$2]COMPLETE_[]uppername)
],[
AC_DEFINE([$2]COMPLETE_[]uppername, 0)
])
else
dnl otherwise, build and run the inttypes program to ensure the header values are actually correct
GASNET_TRY_CACHE_RUN([for a complete $1],[$2]COMPLETE_[]uppername,[
GASNET_CHECK_INTTYPES_HELPERPROG($1)
int main(void) { return check(); }
],[
[$2]COMPLETE_[]uppername=1
AC_SUBST([$2]COMPLETE_[]uppername)
AC_DEFINE([$2]COMPLETE_[]uppername)
],[
AC_DEFINE([$2]COMPLETE_[]uppername, 0)
])
fi
fi
popdef([lowername])
popdef([uppername])
GASNET_FUN_END([$0($1,$2)])
])
dnl PR828: AM_CONDITIONAL must appear on all control paths
dnl this macro runs them for a prefix which is not encountered
AC_DEFUN([GASNET_SETUP_INTTYPES_DUMMY], [
pushdef([cvsizeof],translit(ac_cv_[$1]sizeof_,'A-Z','a-z'))
if test x"$[]cvsizeof[]int$[]cvsizeof[]long$[]cvsizeof[]void_p" = x444; then
$1[]PLATFORM_ILP32=yes
fi
if test x"$[]cvsizeof[]int$[]cvsizeof[]long$[]cvsizeof[]void_p" = x488; then
$1[]PLATFORM_LP64=yes
fi
if test x"$[]cvsizeof[]int$[]cvsizeof[]long$[]cvsizeof[]void_p" = x888; then
$1[]PLATFORM_ILP64=yes
fi
dnl following worksaround buggy automake which mishandles m4 expansions in AM_CONDITIONAL
dnl these versions just shut up its whining (but still provide correct values)
AM_CONDITIONAL(PLATFORM_ILP32, test "$PLATFORM_ILP32" = "yes")
AM_CONDITIONAL(PLATFORM_LP64, test "$PLATFORM_LP64" = "yes")
AM_CONDITIONAL(PLATFORM_ILP64, test "$PLATFORM_ILP64" = "yes")
dnl and now the real versions..
AM_CONDITIONAL($1[]PLATFORM_ILP32, test "$[$1]PLATFORM_ILP32" = "yes")
AM_CONDITIONAL($1[]PLATFORM_LP64, test "$[$1]PLATFORM_LP64" = "yes")
AM_CONDITIONAL($1[]PLATFORM_ILP64, test "$[$1]PLATFORM_ILP64" = "yes")
popdef([cvsizeof])
])
dnl all the inttypes goop required for portable_inttypes.h
dnl second arg is optional prefix for defs
AC_DEFUN([GASNET_SETUP_INTTYPES], [
GASNET_FUN_BEGIN([$0($1,$2)])
AC_CHECK_HEADERS(stddef.h,[
dnl Some platforms define types like ptrdiff_t only in stddef.h
dnl so make sure that AC_CHECK_SIZEOF uses it
echo "#include <stddef.h>" >> confdefs.h
])
GASNET_CHECK_SIZEOF(char, $1)
GASNET_CHECK_SIZEOF(short, $1)
GASNET_CHECK_SIZEOF(int, $1)
GASNET_CHECK_SIZEOF(long, $1)
GASNET_CHECK_SIZEOF(long long, $1)
GASNET_CHECK_SIZEOF(void *, $1)
GASNET_CHECK_SIZEOF(size_t, $1)
GASNET_CHECK_SIZEOF(ptrdiff_t, $1)
GASNET_SETUP_INTTYPES_DUMMY($1)
GASNET_CHECK_INTTYPES(stdint.h,$1)
GASNET_CHECK_INTTYPES(inttypes.h,$1)
GASNET_CHECK_INTTYPES(sys/types.h,$1)
for type in CHAR SHORT INT LONG LONG_LONG VOID_P SIZE_T PTRDIFF_T ; do
eval val="\$[$1]SIZEOF_$type"
GASNET_APPEND_DEFINE([$1]INTTYPES_DEFINES, [$1]SIZEOF_$type, $val)
done
GASNET_APPEND_DEFINE([$1]INTTYPES_DEFINES, [$1]HAVE_STDINT_H)
GASNET_APPEND_DEFINE([$1]INTTYPES_DEFINES, [$1]COMPLETE_STDINT_H)
GASNET_APPEND_DEFINE([$1]INTTYPES_DEFINES, [$1]HAVE_INTTYPES_H)
GASNET_APPEND_DEFINE([$1]INTTYPES_DEFINES, [$1]COMPLETE_INTTYPES_H)
GASNET_APPEND_DEFINE([$1]INTTYPES_DEFINES, [$1]HAVE_SYS_TYPES_H)
GASNET_APPEND_DEFINE([$1]INTTYPES_DEFINES, [$1]COMPLETE_SYS_TYPES_H)
AC_SUBST([$1]INTTYPES_DEFINES)
GASNET_FUN_END([$0($1,$2)])
])
dnl Appends -Dvar_to_define onto target_var, iff var_to_define is set
dnl If value also is provided, adds -Dvar_to_define=value
dnl GASNET_APPEND_DEFINE(target_var, var_to_define [, value] )
AC_DEFUN([GASNET_APPEND_DEFINE],[
GASNET_FUN_BEGIN([$0])
if test "$[$2]" != ""; then
ifelse([$3],[],[
[$1]="$[$1] -D[$2]"
],[
[$1]="$[$1] -D[$2]=$3"
])
fi
GASNET_FUN_END([$0])
])
dnl GASNET_SUBST_TEXT(varname, text to subst)
dnl perform subst for multi-line text fields
AC_DEFUN([GASNET_SUBST_TEXT],[
GASNET_FUN_BEGIN([$0($1,...)])
mkdir -p "$TOP_BUILDDIR/.subst_text"
$1="$TOP_BUILDDIR/.subst_text/$1"
cat > $$1 <<EOF
$2
EOF
AC_SUBST_FILE($1)
GASNET_FUN_END([$0($1,...)])
])
dnl push a new value into variable varname, saving the old value
dnl GASNET_PUSHVAR(varname, new value)
AC_DEFUN([GASNET_PUSHVAR],[
GASNET_FUN_BEGIN([$0($1,$2)])
dnl echo "old value of $1: $[$1]"
if test "$_pushcnt_$1" = "" ; then
_pushcnt_$1=0
fi
if test "$_total_pushcnt" = "" ; then
_total_pushcnt=0
fi
if test "${$1+set}" = set; then
_gasnet_pushvar_isset=1
else
_gasnet_pushvar_isset=0
fi
eval _pushedvar_$1_$_pushcnt_$1=\$[$1]
eval _pushedvarset_$1_$_pushcnt_$1=$_gasnet_pushvar_isset
_pushcnt_$1=`expr $_pushcnt_$1 + 1`
_total_pushcnt=`expr $_total_pushcnt + 1`
$1=$2
echo "pushed new $1 value: $[$1]" >&5
GASNET_FUN_END([$0($1,$2)])
])
dnl push a variable, then unset it
AC_DEFUN([GASNET_PUSHVAR_UNSET],[
GASNET_FUN_BEGIN([$0($1)])
GASNET_PUSHVAR($1,"<unset>")
unset $1
GASNET_FUN_END([$0($1)])
])
dnl restore the old value of varname, from a previous push
dnl GASNET_POPVAR(varname)
AC_DEFUN([GASNET_POPVAR],[
GASNET_FUN_BEGIN([$0($1)])
if test "$_pushcnt_$1" -ge "1"; then
_pushcnt_$1=`expr $_pushcnt_$1 - 1`
_total_pushcnt=`expr $_total_pushcnt - 1`
eval _gasnet_pushvar_isset=\$_pushedvarset_$1_$_pushcnt_$1
if test "$_gasnet_pushvar_isset" = "1" ; then
eval $1=\$_pushedvar_$1_$_pushcnt_$1
echo "popping $1 back to: $[$1]" >&5
else
unset $1
echo "popping $1 back to: <unset>" >&5
fi
else
GASNET_MSG_ERROR([INTERNAL ERROR: GASNET_PUSH/POPVAR underflow on $1])
fi
GASNET_FUN_END([$0($1)])
])
AC_DEFUN([GASNET_PUSHPOP_CHECK],[
GASNET_FUN_BEGIN([$0])
if test "$_total_pushcnt" -ge "1" ; then
GASNET_MSG_ERROR([INTERNAL ERROR: GASNET_PUSH/POPVAR mismatch: $_total_pushcnt more pushes than pops])
fi
GASNET_FUN_END([$0])
])
dnl add file to list of executable outputs that should be marked +x
dnl would be nice to use AC_CONFIG_COMMANDS() for each file, but autoconf 2.53
dnl stupidly fails to execute commands having the same tag as a config output file
dnl on subsequent calls to config.status
AC_DEFUN([GASNET_FIX_EXEC],[
GASNET_FUN_BEGIN([$0($1)])
cv_prefix[]exec_list="$cv_prefix[]exec_list $1"
GASNET_FUN_END([$0($1)])
])
dnl ensure the "default" command is run on every invocation of config.status
AC_DEFUN([GASNET_FIX_EXEC_SETUP],[[
GASNET_FUN_BEGIN([$0])
dnl round-about method ensure autoconf 2.53 picks up depfiles command
if test "\${config_commands+set}" != set ; then
config_commands="default"
fi
CONFIG_COMMANDS="\$config_commands"
cv_prefix[]exec_list="$cv_prefix[]exec_list"
GASNET_FUN_END([$0])
]])
AC_DEFUN([GASNET_FIX_EXEC_OUTPUT],[[
GASNET_FUN_BEGIN([$0])
for file in $cv_prefix[]exec_list; do
case "$CONFIG_FILES" in
*${file}*) chmod +x ${file} ;;
esac
done
GASNET_FUN_END([$0])
]])
dnl bug1657: remove the autoconf-generated PACKAGE_* macros from config.h file
AC_DEFUN([GASNET_SANITIZE_PACKAGE],[[
GASNET_FUN_BEGIN([$0($1)])
if test -f '$1' -a -n "`grep PACKAGE_NAME '$1'`" ; then
mv '$1' '$1.dirty'
cat '$1.dirty' | grep -v '#define PACKAGE_' > '$1'
rm -f '$1.dirty'
fi
GASNET_FUN_END([$0($1)])
]])
dnl allow a true #undef in config.h
dnl Note this requires GASNET_PROG_PERL, although AC_REQUIRE cannot be used in this context
AC_DEFUN([GASNET_TRUE_UNDEF],[[
GASNET_FUN_BEGIN([$0($1)])
if test -f '$1' -a -n "`grep '#trueundef' '$1'`" ; then
PERL=${PERL:-perl}
$PERL -pi.dirty -e 's/^\s*#\s*trueundef\s/#undef /' '$1'
rm -f '$1.dirty'
fi
GASNET_FUN_END([$0($1)])
]])
AC_DEFUN([GASNET_LIBGCC],[
GASNET_FUN_BEGIN([$0])
AC_REQUIRE([AC_PROG_CC])
AC_CACHE_CHECK(for libgcc link flags, cv_prefix[]lib_gcc,
[if test "$GCC" = yes; then
#LIBGCC="`$CC -v 2>&1 | sed -n 's:^Reading specs from \(.*\)/specs$:-L\1 -lgcc:p'`"
if test "$CC_SUBFAMILY" = 'NVIDIA'; then
rm -f conftest.c
echo 'int foo;' > conftest.c
LIBGCC="-L`$CC -c conftest.c -Xcompiler -print-libgcc-file-name | xargs dirname` -lgcc"
rm -rf conftest*
else
LIBGCC="-L`$CC -print-libgcc-file-name | xargs dirname` -lgcc"
fi
if test -z "$LIBGCC"; then
GASNET_MSG_ERROR(cannot find libgcc)
fi
fi
cv_prefix[]lib_gcc="$LIBGCC"])
LIBGCC="$cv_prefix[]lib_gcc"
AC_SUBST(LIBGCC)
GASNET_FUN_END([$0])
])
AC_DEFUN([GASNET_LIBM],[
GASNET_FUN_BEGIN([$0])
AC_REQUIRE([AC_PROG_CC])
GASNET_PUSHVAR(LIBS,"$LIBS")
case "$target_os" in
darwin*)
# libm is just an alias for the system default lib
# Naming it explicitly causes linker failures when linking w/ mpich
;;
*)
# sin should be in everyone's libm if they've got one.
AC_CHECK_LIB(m, sin, LIBM="-lm", LIBM="")
;;
esac
AC_SUBST(LIBM)
GASNET_POPVAR(LIBS)
GASNET_FUN_END([$0])
])
AC_DEFUN([_GASNET_SPLIT_LINKER_OPTS_HELPER], [
gasnet_fn_split_linker_opts()
{
gasnet_lo_ldflags=[$]1
shift
gasnet_lo_libs=[$]1
shift
eval $gasnet_lo_ldflags=
eval $gasnet_lo_libs=
for ac_opt in "[$]@"; do
case "$ac_opt" in
-l* | -L*)
gasnet_lo_append=$gasnet_lo_libs
;;
*.so | *.a)
gasnet_lo_append=$gasnet_lo_libs
;;
*)
gasnet_lo_append=$gasnet_lo_ldflags
;;
esac
case "$ac_opt" in
*' '* | *'$'* | *'`'*) # quote args containing selected dangerous characters
ac_opt_quot="'$ac_opt'"
;;
*)
ac_opt_quot="$ac_opt"
;;
esac
if eval test -z \"\$$gasnet_lo_append\" ; then # avoid extraneous spaces
eval $gasnet_lo_append=\"\$ac_opt_quot\"
else
eval $gasnet_lo_append=\"\$$gasnet_lo_append \$ac_opt_quot\"
fi
done
}
])
dnl GASNET_FILTER_LINKER_OPTS(LDFLAGS, LIBS)
dnl Filter the current contents of $LDFLAGS and $LIBS
dnl Move all -l/-L/*.{a,so} options into LIBS and anything else into LDFLAGS
AC_DEFUN([GASNET_SPLIT_LINKER_OPTS],[
GASNET_FUN_BEGIN([$0($@)])
AC_REQUIRE([_GASNET_SPLIT_LINKER_OPTS_HELPER])
eval gasnet_fn_split_linker_opts $1 $2 [$]$1 [$]$2
#echo "$1=[$]$1"
#echo "$2=[$]$2"
GASNET_FUN_END([$0($@)])
])
AC_DEFUN([_GASNET_CONFIGURE_ARGS],[
# GASNet configure argument processing
# start by capturing raw args, hopefully before autoconf clobbers positional parameters
_gasneti_raw_args=
for arg in "[$]@" ; do
if test -z "$_gasneti_raw_args" ; then
_gasneti_raw_args="'$arg'"
else
_gasneti_raw_args="$_gasneti_raw_args '$arg'"
fi
done
# also capture the enclosing environment, before autoconf changes it
_gasneti_envcmd=env
for envcmd in $ENVCMD /usr/bin/env /bin/env ; do
if test -x $envcmd ; then
_gasneti_envcmd=$envcmd
break
fi
done
rm -f config.env
trap 'rm -f config.env' 0 > /dev/null 2>&1 # prevent a leak on --help/--version
$_gasneti_envcmd > config.env
])
dnl Need to capture the *REAL* user-provided command-line to correctly process variable priorities
dnl $ac_configure_args is useless because autoconf's arg processing adds fake arguments
dnl (eg ac_precious_vars) there which contaminate our GASNET_ENV_DEFAULT priority processing
dnl Later autoconfs document that "$@" is intact with the real args immediately after AC_INIT,
dnl but this is NOT true of some versions (eg autoconf 2.61 clobbers it with CONFIG_SITE).
dnl The only thing that seems to work for all autoconf versions is this nasty hack -
dnl we co-opt the AC_REVISION mechanism to run some code very early
AC_REVISION([
_GASNET_CONFIGURE_ARGS
dnl swallow any autoconf-provided revision suffix:
echo > /dev/null \
])
AC_DEFUN([GASNET_CONFIGURE_ARGS],[
AC_REQUIRE([_GASNET_CONFIGURE_ARGS])
AC_MSG_CHECKING(for configure arguments)
AC_CACHE_VAL(cv_prefix[]configure_args, [
cv_prefix[]configure_args="$_gasneti_raw_args"
])
CONFIGURE_ARGS="$cv_prefix[]configure_args"
AC_SUBST(CONFIGURE_ARGS)
AC_MSG_RESULT([
configure args: $CONFIGURE_ARGS])
])
AC_DEFUN([GASNET_ENV_DEFAULT_HELPER],[
AC_REQUIRE([AC_PROG_AWK])
gasnet_fn_env_helper()
{
gasnet_envh_upper=[$]1
shift
gasnet_envh_norm=[$]1
shift
for ac_opt in "[$]@"; do
case "$ac_opt" in
with:${gasnet_envh_norm}=* | ${gasnet_envh_norm}=*)
ac_optarg=`expr "$ac_opt" : '[[^=]]*=\(.*\)'`
eval cv_prefix[]envvar_${gasnet_envh_upper}=\$ac_optarg
eval envval_src_${gasnet_envh_upper}=given
;;
with:${gasnet_envh_norm})
eval cv_prefix[]envvar_${gasnet_envh_upper}=\$envval_default_${gasnet_envh_upper}
eval envval_src_${gasnet_envh_upper}=default
;;
without:${gasnet_envh_norm})
eval cv_prefix[]envvar_${gasnet_envh_upper}=""
eval envval_src_${gasnet_envh_upper}=disabled
;;
esac
done
}
# normalize configure arguments
gasnet_fn_env_argnorm()
{
cv_prefix[]configure_args_norm=
for ac_opt in "[$]@"; do
# For command-line args VAR is case-insensitive and dash/underscore insensitive
ac_norm=`echo "$ac_opt" | $AWK '{gsub("^--?with-","with:");gsub("^--?without-","without:");gsub("^--?",":");gsub("[[-_]]",""); print tolower([$]0)}'`
case "$ac_norm" in
:*) : ;; # discard irrelevant arguments
*=*) # opts with argument
ac_norm=`expr "X$ac_norm" : 'X\([[^=]]*\)='`
ac_optarg=`expr "X$ac_opt" : '[[^=]]*=\(.*\)$'`
cv_prefix[]configure_args_norm="$cv_prefix[]configure_args_norm '$ac_norm=$ac_optarg'"
;;
*) # bare opts, no argument
cv_prefix[]configure_args_norm="$cv_prefix[]configure_args_norm '$ac_norm'"
;;
esac
done
# echo $cv_prefix[]configure_args_norm
}
if test "${cv_prefix[]configure_args_norm+set}" = ""; then
eval gasnet_fn_env_argnorm $cv_prefix[]configure_args
fi
# normalize environment varnames and convert to a form we can read back in
# currently we assume values do not contain newlines and truncate there
cat config.env | $AWK ['{
line=]$[0;
if (match(line,"^[A-Za-z0-9_]+=")) {
var=substr(line,1,RLENGTH-1);
var=tolower(var);
gsub("[-_]","",var);
val=substr(line,RLENGTH+1);
gsub("\047","\047\042\047\042\047",val);
if (env[var] && env[var] != val) conf[var]=1;
env[var]=val;
}
} END {
for (var in env) {
if (conf[var]) printf("_gasneti_cenv_%s=\047%s\047\n",var,env[var]);
else printf("_gasneti_nenv_%s=\047%s\047\n",var,env[var]);
}
}'] > config.env2
. ./config.env2
rm -f config.env config.env2
])
dnl GASNET_ENV_DEFAULT(envvar-name, default-value, optional-help-text)
dnl load an environment variable, using default value if it's missing from env.
dnl envvar-name must be a literal post-expansion (ie not a shell variable)
dnl if only the first argument is passed, then the variable is left unset by default
dnl caches the results to guarantee reconfig gets the originally loaded value
dnl also adds a --with-foo-bar= option for the env variable FOO_BAR
AC_DEFUN([GASNET_ENV_DEFAULT],[
GASNET_FUN_BEGIN([$0($@)])
pushdef([lowerdashname],patsubst(translit([$1],'A-Z','a-z'),[_],[-]))
pushdef([lowernopunct],patsubst(lowerdashname,[-],[]))
pushdef([UNSET],[__=-=-=-__NOT_SET__-=-=-=__])
dnl create the help prompt just once, and only if not suppressed
ifdef(with_expanded_[$1], [], [
ifdef([GASNET_SUPPRESSHELP], [], [
AC_ARG_WITH(lowerdashname,
GASNET_OPTION_HELP(with-[]lowerdashname[]=, [$1] setting[]ifelse([$3],[],[],[: $3])),
[], [])
])
])
define(with_expanded_[$1], [set])
AC_MSG_CHECKING(for $1 setting)
envval_src_$1="cached"
AC_CACHE_VAL(cv_prefix[]envvar_$1, [
if test "$#" = "1" ; then # no default means unset
envval_default_$1="UNSET"
else
envval_default_$1="[$2]"
fi
# Lowest priority are the enclosing environment and the default value argument (lowest)
if test "${_gasneti_nenv_[]lowernopunct+set}" = "set" ; then
cv_prefix[]envvar_$1="${_gasneti_nenv_[]lowernopunct}"
envval_src_$1=given
elif test "${_gasneti_cenv_[]lowernopunct+set}" = "set" ; then
cv_prefix[]envvar_$1="${_gasneti_cenv_[]lowernopunct}"
envval_src_$1=conf
else
cv_prefix[]envvar_$1=$envval_default_$1
envval_src_$1=default
fi
# Left-to-right parsing of commandline settings that includes both mechanisms
# --with-VAR=val or VAR=val => set to val
# --with-VAR => set to default
# --without-VAR => set to blank (ie "", not "no")
eval gasnet_fn_env_helper $1 lowernopunct $cv_prefix[]configure_args_norm
])
[$1]="$cv_prefix[]envvar_$1"
pushdef([alignarg],[m4_substr([ ],len([$1]))])
pushdef([aligncac],[m4_substr([ ],len([$1]))]) dnl reduce space for (cached) appended by AC_CACHE_VAL
if test "$[$1]" = "UNSET" ; then
unset $1
if test "$envval_src_$1" = "cached"; then
AC_MSG_RESULT([aligncac (not set)])
else
AC_MSG_RESULT([alignarg (not set)])
fi
else
case "$envval_src_$1" in
'cached')
AC_MSG_RESULT([aligncac \"$[$1]\"]) ;;
'default')
AC_MSG_RESULT([alignarg (default) \"$[$1]\"]) ;;
'disabled')
AC_MSG_RESULT([alignarg (disabled) \"$[$1]\"]) ;;
'given')
AC_MSG_RESULT([alignarg (provided) \"$[$1]\"]) ;;
'conf')
AC_MSG_RESULT([alignarg (provided) \"$[$1]\"])
GASNET_MSG_ERROR([Ambiguous environment setting for \$$1. Please configure --with-$1="intended value"])
;;
*) GASNET_MSG_ERROR(_GASNET_ENV_DEFAULT broken)
esac
fi
popdef([aligncac])
popdef([alignarg])
popdef([UNSET])
popdef([lowernopunct])
popdef([lowerdashname])
GASNET_FUN_END([$0($@)])
])
AC_DEFUN([GASNET_DISPLAY_VERSION],[
GASNET_FUN_BEGIN([$0($@)])
AC_MSG_CHECKING(for package version)
display_version_info=""
ifdef([AC_PACKAGE_NAME],[
display_version_info="$display_version_info AC_PACKAGE_NAME"
])
ifdef([AC_PACKAGE_VERSION],[
display_version_info="$display_version_info AC_PACKAGE_VERSION"
])
if test -d "$srcdir/.git" ; then
if test -f "$srcdir/.gasnet_toolsonly_mode"; then
git_describe=`( cd "$srcdir" && ${GIT=git} describe --long --always ) 2> /dev/null`
else
git_describe=`( cd "$srcdir" && ${GIT=git} describe --long --dirty --always ) 2> /dev/null`
fi
if test -n "$git_describe"; then
display_version_info="$display_version_info ($git_describe)"
fi
fi
ifdef([AC_PACKAGE_URL],[
display_version_info="$display_version_info AC_PACKAGE_URL"
])
AC_MSG_RESULT([$display_version_info])
GASNET_FUN_END([$0($@)])
])
dnl $1 = optional env variables to restore
dnl $2 = autoconf env vars to populate (including from command-line)
AC_DEFUN([GASNET_START_CONFIGURE],[
GASNET_FUN_BEGIN([$0($1,$2)])
AC_REQUIRE([GASNET_DISPLAY_VERSION])
AC_REQUIRE([GASNET_CONFIGURE_ARGS])
AC_REQUIRE([GASNET_SET_CROSS_COMPILE]) dnl run early to handle implicit AC_PROG_CC
AC_REQUIRE([GASNET_ENV_DEFAULT_HELPER])
GASNET_RESTORE_AUTOCONF_ENV([CC CXX CFLAGS CXXFLAGS CPPFLAGS LIBS MAKE GMAKE AR AS RANLIB PERL SUM LEX YACC $1])
dnl the following cannot be handled here, as they are already detected: AWK, (G)MAKE, MKDIR_P, INSTALL
GASNET_POPULATE_AUTOCONF_ENV([CC CFLAGS CPP CPPFLAGS LDFLAGS LIBS PERL $2])
if test "${CFLAGS+set}" != "set" ; then # default CFLAGS to empty, overriding autoconf's default of "-g -O2"
CFLAGS=""
fi
if test "${CXXFLAGS+set}" != "set" ; then # same for CXXFLAGS
CXXFLAGS=""
fi
GASNET_PATH_PROGS(PWD_PROG, pwd, pwd)
define([GASNET_CONFIGURE_WARNING_LOCAL],[.[]cv_prefix[]configure_warnings.tmp])
if test -z "$GASNET_CONFIGURE_WARNING_GLOBAL" ; then
GASNET_CONFIGURE_WARNING_GLOBAL="`$PWD_PROG`/GASNET_CONFIGURE_WARNING_LOCAL"
export GASNET_CONFIGURE_WARNING_GLOBAL
fi
rm -f "GASNET_CONFIGURE_WARNING_LOCAL"
dnl Save and display useful info about the configure environment
GASNET_GET_AUTOCONF_VERSION()
dnl ensure the cache is used in all reconfigures
if test "$cache_file" = "/dev/null" ; then
GASNET_MSG_WARN([configure cache_file setting got lost - you may need to run a fresh ./Bootstrap])
cache_file=config.cache
fi
ac_configure_args="$ac_configure_args --cache-file=$cache_file"
dnl don't trust shell's builtin pwd, because it may include symlinks
TOP_SRCDIR=`cd ${srcdir} && ${PWD_PROG}`
AC_MSG_RESULT( TOP_SRCDIR: $TOP_SRCDIR)
AC_SUBST(TOP_SRCDIR)
TOP_BUILDDIR=`${PWD_PROG}`
AC_MSG_RESULT( TOP_BUILDDIR: $TOP_BUILDDIR)
AC_SUBST(TOP_BUILDDIR)
dnl check against bug 1083 (spaces in directory name break things)
if `echo $TOP_SRCDIR | grep ' ' >/dev/null 2>/dev/null`; then
AC_MSG_ERROR(TOP_SRCDIR contains space characters - please unpack the source in a different directory.)
fi
if `echo $TOP_BUILDDIR | grep ' ' >/dev/null 2>/dev/null`; then
AC_MSG_ERROR(TOP_BUILDDIR contains space characters - please build in a different directory.)
fi
dnl set AM_CONDITIONAL BUILD_IS_SRC for ease of use in generated Makefiles
AM_CONDITIONAL(BUILD_IS_SRC, test "$TOP_BUILDDIR" = "$TOP_SRCDIR")
dnl set AC_SUBST variable BUILD_IS_SRC for ease of use in generated scripts
if test "$TOP_BUILDDIR" = "$TOP_SRCDIR"; then
BUILD_IS_SRC=yes
else
BUILD_IS_SRC=no
fi
AC_SUBST(BUILD_IS_SRC)
# Handle prefix defaulting with subconfigures
# When users pass --prefix on the command-line, this is automatically passed to subconfigures
# and everything lives happily in the same tree
# Without --prefix, different packages may default to different directories
# (due to AC_PREFIX_DEFAULT), so ensure that all subconfigures
# default to the same location (as determined by the outermost configure)
if test "$prefix" = "NONE" -a -n "$ac_default_prefix" ; then
GASNET_SUBCONFIGURE_ARG(--prefix="$ac_default_prefix")
fi
SYSTEM_NAME="`hostname`"
AC_SUBST(SYSTEM_NAME)