-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
146 lines (122 loc) · 2.97 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
#AC_CONFIG_SRCDIR([tools/Options.h])
#AC_CONFIG_HEADERS([config.h])
AC_PREFIX_DEFAULT(/usr/local/browndeer)
AC_DEFUN([SET_OPT],
[if test x$1 != xno; then
echo "enabled $3"
$2=1
else
echo "disabled $3"
$2=0
fi;]
)
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
#AC_PROG_INSTALL
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([stddef.h stdlib.h string.h sys/time.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([floor gettimeofday pow select sqrt])
PWD=`pwd`
SHMEM_INCLUDE_PATH=/usr/local/include
SHMEM_LIB_PATH=/usr/local/lib
### extract enable/disable options
AC_ARG_ENABLE(shmem,
AC_HELP_STRING(
[--enable-shmem],
[enable shmem support (default=yes)]),
,
enable_shmem=yes
)
SET_OPT($enable_shmem, ENABLE_SHMEM, "enable shmem")
### extract with options
# test for --with-shmem specification
AC_ARG_WITH(shmem,
AC_HELP_STRING(
[--with-shmem=openshmem|crayshmem|arlshmem],
[specify shmem implementation]),
[
if test x$withval = xyes; then
AC_MSG_ERROR([usage: --with-shmem=openshmem|crayshmem|arlshmem])
else
SHMEM=$withval;
fi;
],
[SHMEM=openshmem]
)
if test x$SHMEM = xopenshmem; then
SHMEM_CC=oshcc
SHMEM_LIB_NAME=openshmem
DEFAULT_ARCH_E32=0
elif test x$SHMEM = xcrayshmem; then
SHMEM_CC=gcc
SHMEM_LIB_NAME=sma
# points for creativity
DEFAULT_ARCH_E32=0
elif test x$SHMEM = xarlshmem; then
SHMEM_CC=coprcc
SHMEM_LIB_NAME=shmem
DEFAULT_ARCH_E32=1
else
SHMEM_CC=gcc
SHMEM_LIB_NAME=shmem
DEFAULT_ARCH_E32=0
fi
# test for --with-shmem-include specification
AC_ARG_WITH(shmem-include-path,
AC_HELP_STRING(
[--with-shmem-include-path=DIR],
[specify shmem include path]),
[
if test x$withval = xyes; then
AC_MSG_ERROR([usage: --with-shmem-include-path=DIR])
elif ! test -e $withval/shmem.h; then
AC_MSG_ERROR([bad include path, could not find shmem.h])
else
SHMEM_INCLUDE_PATH=$withval;
fi;
],
[]
)
# test for --with-shmem-lib specification
AC_ARG_WITH(shmem-lib-path,
AC_HELP_STRING(
[--with-shmem-lib-path=DIR],
[specify shmem lbrary path]),
[
if test x$withval = xyes; then
AC_MSG_ERROR([usage: --with-shmem-lib-path=DIR])
elif test -e $withval/lib$SHMEM_LIB_NAME.so; then
SHMEM_LIB_PATH=$withval;
elif test -e $withval/lib$SHMEM_LIB_NAME.a; then
SHMEM_LIB_PATH=$withval;
else
AC_MSG_ERROR([bad lib path, could not find libshmem])
fi;
],
[]
)
AC_SUBST(ENABLE_SHMEM)
AC_SUBST(SHMEM_CC)
AC_SUBST(SHMEM_LIB_NAME)
AC_SUBST(SHMEM_INCLUDE_PATH)
AC_SUBST(SHMEM_LIB_PATH)
AC_SUBST(DEFAULT_ARCH_E32)
AC_CONFIG_FILES([
Makefile
lcc.sh
])
AC_OUTPUT