forked from hpc/Spindle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
118 lines (105 loc) · 4.23 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
AC_INIT([spindle], m4_esyscmd([tr -d '\n' < VERSION]), m4_esyscmd([tr -d '\n' < BUG_EMAIL]))
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([scripts])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([foreign])
AM_SILENT_RULES([yes])
AM_PROG_AR
AC_PROG_CC
AC_PROG_CXX
AC_PROG_SED
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([doc/Makefile testsuite/Makefile Makefile])
AC_PROG_LIBTOOL
AC_PROG_LN_S
LT_INIT
#Include common ops
m4_include([configure.common.ac])
m4_include([m4/ax_tls.m4])
m4_include([m4/lmon.m4])
AX_TLS
#MPI detection
AC_ARG_ENABLE(testsuite,
[AS_HELP_STRING([--enable-testsuite],[Chooses whether to build the Spindle testsuite. Default yes])],
[BUILD_TESTSUITE=${enableval}],
[BUILD_TESTSUITE=yes])
AM_CONDITIONAL([BLD_TESTSUITE], [test "x$BUILD_TESTSUITE" == "xyes"])
m4_include([m4/lx_find_mpi.m4])
AC_LANG_PUSH(C)
LX_FIND_MPI
AC_LANG(C++)
LX_FIND_MPI
AC_LANG_POP
AC_ARG_VAR([BE_CC], [CC for back end])
AC_ARG_VAR([BE_CFLAGS], [CFLAGS back end])
AC_ARG_VAR([BE_LDFLAGS], [LDFLAGS for back end])
AC_ARG_VAR([BE_LIBS], [LIBS for back end])
AC_ARG_VAR([BE_CPPFLAGS], [CPPFLAGS for back end])
AC_ARG_VAR([BE_CXX], [CXX for back end])
AC_ARG_VAR([BE_CXXFLAGS], [CXXFLAGS for back end])
AC_ARG_VAR([BE_CPP], [CPP for back end])
AC_ARG_VAR([BE_CXXCPP], [CXXCPP for back end])
AC_ARG_VAR([BE_host], [host to use for back end])
AC_MSG_CHECKING([automake compatibility])
AUTOMAKE_LINE=`head -n 1 ${srcdir}/Makefile.in`
if test "${AUTOMAKE_LINE:0:40}" == "# Makefile.in generated by automake 1.15"; then
if test "x$enable_dependency_tracking" != "xno"; then
AC_MSG_RESULT([no])
AC_MSG_ERROR([Incompatible automake version. This automake does not generate correct dependency information with Spindle. Please run with a different automake (by adding another automake to your PATH and running bootstrap.sh), or by configuring with the --disable-dependency-tracking option.])
fi
fi
AC_MSG_RESULT([yes])
AC_OUTPUT
#Set BE_CC, BE_CXX and related flags
AC_DEFUN([SET_BE_COMPILER_VAR],[
VARNAME=\$BE_$1
BE_VAR=`eval echo $VARNAME`
if test "x$OS_BUILD" == "xbluegene"; then
if test "x$BE_VAR" != "x"; then
CLIENT_$1=$BE_VAR
elif test "x$2" != "x"; then
CLIENT_$1=$2
elif test "x$USER_SPECIFIED_COMPS" == "xtrue"; then
echo Setting CLIENT_$1 to $$1
CLIENT_$1=
else
CLIENT_$1=$$1
fi
SERVER_$1=$$1
FE_$1=$$1
elif test "x$OS_BUILD" == "xlinux"; then
if test "x$BE_VAR" == "x"; then
if test "x$USER_SPECIFIED_COMPS" == "x"; then
BE_VAR=$$1
fi
fi
CLIENT_$1=$BE_VAR
SERVER_$1=$BE_VAR
FE_$1=$$1
fi])
if test "$BE_CC x $BE_CXX x $BE_host" != " x x "; then
USER_SPECIFIED_COMPS="true"
fi
if test "x$OS_BUILD" == "xbluegene"; then
if test -d /bgsys/drivers/toolchain/V1R2M1/gnu-linux/bin; then
BG_COMP_PATH=/bgsys/drivers/toolchain/V1R2M1/gnu-linux/bin/
elif test -d /bgsys/drivers/toolchain/V1R2M0/gnu-linux/bin; then
BG_COMP_PATH=/bgsys/drivers/toolchain/V1R2M0/gnu-linux/bin/
fi
fi
SET_BE_COMPILER_VAR([CC], [${BG_COMP_PATH}powerpc64-bgq-linux-gcc])
SET_BE_COMPILER_VAR([CFLAGS])
SET_BE_COMPILER_VAR([LDFLAGS])
SET_BE_COMPILER_VAR([LIBS])
SET_BE_COMPILER_VAR([CPPFLAGS])
SET_BE_COMPILER_VAR([CXX], [${BG_COMP_PATH}powerpc64-bgq-linux-c++])
SET_BE_COMPILER_VAR([CXXFLAGS])
SET_BE_COMPILER_VAR([CPP], [${BG_COMP_PATH}powerpc64-bgq-linux-cpp])
SET_BE_COMPILER_VAR([CXXCPP])
SET_BE_COMPILER_VAR([STRIP], [${BG_COMP_PATH}powerpc64-bgq-linux-strip])
SET_BE_COMPILER_VAR([AR], [${BG_COMP_PATH}powerpc64-bgq-linux-ar])
SET_BE_COMPILER_VAR([host], [powerpc64-bgq-linux])
m4_include([m4/runconf.m4])
RUN_CONFIG_W_COMPILER([src/client], [$CLIENT_CC], [$CLIENT_CFLAGS], [$CLIENT_LDFLAGS], [$CLIENT_LIBS], [$CLIENT_CPPFLAGS], [$CLIENT_CXX], [$CLIENT_CXXFLAGS], [$CLIENT_CPP], [$CLIENT_CXXCPP], [$CLIENT_STRIP], [$CLIENT_AR], [$CLIENT_host])
RUN_CONFIG_W_COMPILER([src/server], [$SERVER_CC], [$SERVER_CFLAGS], [$SERVER_LDFLAGS], [$SERVER_LIBS], [$SERVER_CPPFLAGS], [$SERVER_CXX], [$SERVER_CXXFLAGS], [$SERVER_CPP], [$SERVER_CXXCPP], [$SERVER_STRIP], [$SERVER_AR], [$SERVER_host])
RUN_CONFIG_W_COMPILER([src/fe], [$FE_CC], [$FE_CFLAGS], [$FE_LDFLAGS], [$FE_LIBS], [$FE_CPPFLAGS], [$FE_CXX], [$FE_CXXFLAGS], [$FE_CPP], [$FE_CXXCPP], [$FE_STRIP], [$FE_AR], [$FE_host])