This repository has been archived by the owner on Jan 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
configure.ac
206 lines (171 loc) · 5.95 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
AC_PREREQ(2.52)
AC_INIT([stdpmodule], [1.0], [nest_user@nest-initiative.org])
# Exporting source and build directories requires full path names.
# Thus we have to expand.
# Here, we are in top build dir, since source dir must exist, we can just
# move there and call pwd
if test "x$srcdir" = x ; then
PKGSRCDIR=`pwd`
else
PKGSRCDIR=`cd $srcdir && pwd`
fi
PKGBUILDDIR=`pwd`
# If this is not called, install-sh will be put into .. by bootstrap.sh
# moritz, 06-26-06
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE([tar-ustar])
# obtain host system type; HEP 2004-12-20
AC_CANONICAL_HOST
# ------------------------------------------------------------------------
# Handle options
#
# NOTE: No programs/compilations must be run in this section;
# otherwise CFLAGS and CXXFLAGS may take on funny default
# values.
# HEP 2004-12-20
# ------------------------------------------------------------------------
# nest-config
NEST_CONFIG=`which nest-config`
AC_ARG_WITH(nest,[ --with-nest=script nest-config script including path],
[
if test "$withval" != yes; then
NEST_CONFIG=$withval
else
AC_MSG_ERROR([--with-nest-config expects the nest-config script as argument. See README for details.])
fi
])
# ---------------------------------------------------------------
# Do not build dynamic libraries for user models if on BlueGene
# ---------------------------------------------------------------
configure_bluegene=`$NEST_CONFIG --configure-bluegene`
AM_CONDITIONAL(BUILD_DYNAMIC_USER_MODULES, test x$configure_bluegene = xno)
if test x$configure_bluegene = xyes ; then
AC_DISABLE_SHARED
AC_ENABLE_STATIC
else
AC_DISABLE_STATIC
AC_ENABLE_SHARED
fi
# -------------------------------------------
# END Handle options
# -------------------------------------------
# does nest-config work
AC_MSG_CHECKING([for nest-config ])
AC_CHECK_FILE($NEST_CONFIG, HAVE_NEST=yes,
AC_MSG_ERROR([No usable nest-config was found. You may want to use --with-nest-config.]))
AC_MSG_RESULT(found)
# the following will crash if nest-config does not run
# careful, lines below must not break
AC_MSG_CHECKING([for NEST directory information ])
NEST_PREFIX=`$NEST_CONFIG --prefix`
NEST_CPPFLAGS=`$NEST_CONFIG --cflags`
NEST_COMPILER=`$NEST_CONFIG --compiler`
if test $prefix = NONE; then prefix=`$NEST_CONFIG --prefix`; fi
AC_MSG_RESULT($NEST_CPPFLAGS)
# Set the platform-dependent compiler flags based on the canonical
# host string. These flags are placed in AM_{C,CXX}FLAGS. If
# {C,CXX}FLAGS are given as environment variables, then they are
# appended to the set of automatically chosen flags. After
# {C,CXX}FLAGS have been read out, they must be cleared, since
# system-dependent defaults will otherwise be placed into the
# Makefiles. HEP 2004-12-20.
# Before we can determine the proper compiler flags, we must know
# which compiler we are using. Since the pertaining AC macros run the
# compiler and set CFLAGS, CXXFLAGS to system-dependent values, we
# need to save command line/enviroment settings of these variables
# first. AC_AIX must run before the compiler is run, so we must run it
# here.
# HEP 2004-12-21
STDPModule_SAVE_CXXFLAGS=$CXXFLAGS
# Must first check if we are on AIX
AC_AIX
# Check for C++ compiler, looking for the same compiler
# used with NEST
AC_PROG_CXX([ $NEST_COMPILER ])
# the following is makeshift, should have the macro set proper
# STDPModule_SET_CXXFLAGS
AM_CXXFLAGS=$STDPModule_SAVE_CXXFLAGS
CXXFLAGS=
## Configure C environment
AC_PROG_LD
AC_PROG_INSTALL
AC_LIBLTDL_CONVENIENCE ## put libltdl into a convenience library
AC_PROG_LIBTOOL ## use libtool
AC_CONFIG_SUBDIRS(libltdl) ## also configure subdir containing libltdl
#-- Set the language to C++
AC_LANG_CPLUSPLUS
#-- Look for programs needed in the Makefile
AC_PROG_CXXCPP
AM_PROG_LIBTOOL
AC_PATH_PROGS([MAKE],[gmake make],[make])
# ---------------------------------------------------------------
# Configure directories to be built
# ---------------------------------------------------------------
PKGDATADIR=$datadir/$PACKAGE
PKGDOCDIR=$datadir/doc/$PACKAGE
# set up directories from which to build help
# second line replaces space with colon as separator
HELPDIRS="$PKGSRCDIR $PKGSRCDIR/sli"
HELPDIRS=`echo $HELPDIRS | tr " " ":"`
#-- Replace these variables in *.in
AC_SUBST(HAVE_NEST)
AC_SUBST(NEST_CONFIG)
AC_SUBST(NEST_CPPFLAGS)
AC_SUBST(NEST_COMPILER)
AC_SUBST(NEST_PREFIX)
AC_SUBST(HELPDIRS)
AC_SUBST(PKGSRCDIR)
AC_SUBST(PKGBUILDDIR)
AC_SUBST(PKGDATADIR)
AC_SUBST(PKGDOCDIR)
AC_SUBST(KERNEL)
AC_SUBST(HOST)
AC_SUBST(SED)
AC_SUBST(LD)
AC_SUBST(host_os)
AC_SUBST(host_cpu)
AC_SUBST(host_vendor)
AC_SUBST(AS)
AC_SUBST(CXX)
AC_SUBST(AR)
AC_SUBST(ARFLAGS)
AC_SUBST(CXX_AR)
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(AM_CFLAGS)
AC_SUBST(MAKE)
AC_SUBST(MAKE_FLAGS)
AC_SUBST(INCLTDL)
AC_SUBST(LIBLTDL)
AC_CONFIG_HEADER(stdpmodule_config.h:stdpmodule_config.h.in)
AC_CONFIG_FILES(Makefile)
# -----------------------------------------------
# Create output
# -----------------------------------------------
AC_OUTPUT
# -----------------------------------------------
# Report, after output at end of configure run
# Must come after AC_OUTPUT, so that it is
# displayed after libltdl has been configured
# -----------------------------------------------
echo
echo "-------------------------------------------------------"
echo "STDPModule Configuration Summary"
echo "-------------------------------------------------------"
echo
echo "C++ compiler : $CXX"
echo "C++ compiler flags : $AM_CXXFLAGS"
echo "NEST compiler flags : $NEST_CPPFLAGS"
# these variables will still contain '${prefix}'
# we want to have the versions where this is resolved, too:
eval eval eval PKGDOCDIR_AS_CONFIGURED=$PKGDOCDIR
eval eval eval PKGDATADIR_AS_CONFIGURED=$PKGDATADIR
eval eval eval LIBDIR_AS_CONFIGURED=$libdir
echo
echo "-------------------------------------------------------"
echo
echo "You can build and install STDP module now, using"
echo " make"
echo " make install"
echo
echo "STDPModule will be installed to: $LIBDIR_AS_CONFIGURED"
echo