source: plugins/base1/se.lu.thep.wenni/trunk/configure.ac @ 936

Last change on this file since 936 was 936, checked in by Peter Johansson, 14 years ago

add --force option in autoreconf call in bootstrap. The reason this is
important is that we want the aux tools in 'autotools/' to be upgraded
when running bootstrap after an autotools upgrade. The reason this was
not added in the first place was that the '--force' option triggers
automake to over-write the INSTALL with the generic FSF INSTALL. This
behavior was now turned off by setting strictness to 'foreign' for
automake. The previous strictness was 'gnu', which implied that files
INSTALL, NEWS, README, AUTHORS, and ChangeLog?, plus one of
COPYING.LIB, COPYING.LESSER or COPYING, were required. I think it is
more important that boostrap behaves as expected than checking that
these files exists.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.5 KB
Line 
1# Process this file with autoconf to produce a configure script.
2#
3# $Id: configure.ac 936 2009-01-08 15:18:56Z peter $
4#
5# Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson
6# Copyright (C) 2007 Peter Johansson
7# Copyright (C) 2008 Jari Häkkinen, Peter Johansson
8# Copyright (C) 2009 Peter Johansson
9#
10# This file is part of WeNNI,
11# http://baseplugins.thep.lu.se/wiki/se.lu.thep.WeNNI
12#
13# WeNNI is free software; you can redistribute it and/or modify it
14# under the terms of the GNU General Public License as published by the
15# Free Software Foundation; either version 3 of the License, or (at
16# your option) any later version.
17#
18# WeNNI is distributed in the hope that it will be useful, but WITHOUT
19# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
21# for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with WeNNI. If not, see <http://www.gnu.org/licenses/>.
25#
26# Author: Jari Hakkinen, jari@thep.lu.se
27#
28# If you grabbed the source from subversion you should, at top-level,
29# execute:
30#   ./bootstrap
31#
32
33AC_PREREQ(2.57)
34AC_INIT([wenni],[0.7pre],[jari@thep.lu.se])
35AC_CONFIG_SRCDIR([lib/weight.h])
36AC_CONFIG_AUX_DIR([autotools])
37AC_PREFIX_DEFAULT([/usr/local])
38AC_CONFIG_MACRO_DIR([m4])
39
40# Build configuration parameters, change only if you know what you do
41BASE2CoreURL="http://base2.thep.lu.se/base/jars/2.9.0"
42PLUGINutilitiesURL="http://baseplugins.thep.lu.se/attachment/wiki/net.sf.basedb.pluginutilties/PluginUtilities-0.1pre.tgz?format=raw"
43PLUGINutilities=PluginUtilities-0.1pre
44
45AM_CONFIG_HEADER([config.h])
46AM_INIT_AUTOMAKE([1.10 foreign])
47
48# Set default programming language
49AC_LANG(C++)
50
51# Let user overide default CXXFLAGS
52if test "${CXXFLAGS+set}" != set; then
53  CXXFLAGS=""  # Setting CXXFLAGS here to prevent expansion in AC_PROG_CXX
54fi
55
56# Checks for programs.
57AC_PROG_CXXCPP
58AC_PROG_CXX
59AC_PROG_INSTALL
60AC_PROG_LIBTOOL
61AC_PROG_SED
62
63# existence of wget and tar should be checked
64
65AM_CXXFLAGS="-Wall -pedantic"
66AM_CPPFLAGS="-DHAVE_INLINE=1"
67AC_ARG_ENABLE(debug,
68              [AS_HELP_STRING([--enable-debug],
69                              [turn on debug options and code])],
70              [AM_CXXFLAGS="$AM_CXXFLAGS -g -O"],
71              [AM_CXXFLAGS="$AM_CXXFLAGS -O3"
72               AM_CPPFLAGS="$AM_CPPFLAGS -DNDEBUG -DGSL_RANGE_CHECK_OFF"])
73
74AC_ARG_ENABLE(state,
75              [AS_HELP_STRING([--enable-state],
76                              [stand-alone, base1, or base2 [default=base2]])],
77              [ if test "x$enableval" = "xstand-alone" ; then
78                    state="stand-alone"
79                elif test "x$enableval" = "xbase1" ; then
80                    state="base1"
81                elif test "x$enableval" = "xbase2" ; then
82                    state="base2"
83                else
84                    AC_MSG_ERROR([dnl
85Unknown value for `--enable-state'
86allowed values are: `base2', `base1', or `stand-alone'])
87                fi ],
88              [ state="base2" ])
89
90AC_DEFINE_UNQUOTED([WeNNI_STATE], ["$state"],
91                   [defined to configured state - base1, base2, or stand-alone])
92AM_CONDITIONAL([BASE1], [test x$state = xbase1])
93AM_CONDITIONAL([BASE2], [test x$state = xbase2])
94
95AC_ARG_ENABLE(downloadBASE2API,
96              [AS_HELP_STRING([--enable-downloadBASE2API=ARG],
97                              [enable download of required BASE2 API files])],
98              [DOWNLOADBASE2API=true],[DOWNLOADBASE2API=false])
99AC_ARG_WITH(basedir,[AS_HELP_STRING([--with-basedir=DIR],
100                                    [root directory for base installation])],
101            [BASEDIR=$withval DOWNLOADBASE2API=false],
102            [BASEDIR=/usr/local/base DOWNLOADBASE2API=true])
103AM_CONDITIONAL([DOWNLOADBASEAPI], [test $DOWNLOADBASE2API = true])
104
105AC_ARG_WITH(plugindir,[AS_HELP_STRING([--with-plugindir=DIR],
106                                      [the base plug-in install directory])],
107            [PLUGINDIR=$withval],
108            [PLUGINDIR=$bindir
109             if (test x$state = xbase1); then
110               PLUGINDIR="$BASEDIR/plugins/bin/wenni"
111             elif (test x$state = xbase2); then
112               PLUGINDIR="$BASEDIR/plugins/se/lu/thep/wenni"
113             fi])
114AC_SUBST(PLUGINDIR)
115
116AC_ARG_WITH(javasourceencoding,
117            [AS_HELP_STRING([--with-javasourceencoding=ARG],
118                            [Use ARG as Java source file character encoding [default=UTF8]])],
119            [JAVASRCENCODING=$withval],[JAVASRCENCODING=UTF8])
120
121if (test x$state = xbase1); then
122  # check for BASE1 API
123  save_CPPFLAGS=$CPPFLAGS;
124  save_LDFLAGS=$LDFLAGS;
125  LDFLAGS="$LDFLAGS -L$BASEDIR/lib"
126  AC_CHECK_LIB([base], [base_finite], [BASELDFLAGS="-L$BASEDIR/lib"],
127               [AC_MSG_FAILURE([cannot find base library])])
128  CPPFLAGS="-I$BASEDIR/include/cxx $CPPFLAGS"
129  AC_CHECK_HEADERS([basefile.h],[BASECPPFLAGS=-I$BASEDIR/include/cxx],
130               [AC_MSG_FAILURE([cannot find base header files])])
131  CPPFLAGS=$save_CPPFLAGS;
132  LDFLAGS=$save_LDFLAGS;
133  AC_SUBST(BASECPPFLAGS)
134  AC_SUBST(BASELDFLAGS)
135  # Set BASE1 plug-in name
136  BASEPLUGINEXECNAME=$PLUGINDIR/wenni.pl
137  AC_SUBST(BASEPLUGINEXECNAME)
138  AC_CONFIG_FILES([base/base1/base_plugin_script/plugin_WeNNI.base])
139elif (test x$state = xbase2); then
140  AC_PROG_JAVAC   
141  AC_PROG_JAR   
142  JAVACFLAGS="-encoding $JAVASRCENCODING"
143  JAVACCLASSPATH="\$(builddir)"
144  if (test $DOWNLOADBASE2API = false); then
145    AC_CHECK_FILE([$BASEDIR/www/WEB-INF/lib/BASE2Core.jar], [],
146                  [AC_MSG_FAILURE([cannot find BASE2Core.jar])])
147    JAVACCLASSPATH+=$BASEDIR/www/WEB-INF/lib/BASE2Core.jar
148    AC_CHECK_FILE([$BASEDIR/www/WEB-INF/lib/BASE2CorePlugins.jar], [],
149                  [AC_MSG_FAILURE([cannot find BASE2CorePlugins.jar])])
150    JAVACCLASSPATH+=":$BASEDIR/www/WEB-INF/lib/BASE2CorePlugins.jar"
151  else
152    JAVACCLASSPATH+=":\$(builddir)/BaseCoreAPI/BASE2CorePlugins.jar:\$(builddir)/BaseCoreAPI/BASE2Core.jar"
153  fi
154  JAVACCLASSPATH+=":\$(builddir)/$PLUGINutilities/$PLUGINutilities.jar"
155  AC_SUBST(PLUGINutilities)
156  AC_SUBST(PLUGINutilitiesURL)
157  AC_SUBST(BASE2CoreURL)
158  AC_SUBST(JAVACFLAGS)
159  AC_SUBST(JAVACCLASSPATH)
160fi
161
162AC_SEARCH_LIBS([sqrt], [m],, AC_MSG_FAILURE([cannot find math library]))
163AC_SEARCH_LIBS([ATL_ctrsv], [atlas],,
164               AC_SEARCH_LIBS(cblas_sdsdot, gslcblas,,
165                        AC_MSG_FAILURE([cannot find cblas library])))
166
167save_LDFLAGS="$LDFLAGS"
168AC_ARG_WITH(gsl,[AS_HELP_STRING([--with-gsl=DIR], [prefix for gsl files])],
169            [GSL_CPPFLAGS="-I$withval/include"; GSL_LDFLAGS="-L$withval/lib"])
170LDFLAGS="$LDFLAGS $GSL_LDFLAGS"
171AC_SEARCH_LIBS([gsl_vector_alloc], [gsl],,
172               AC_MSG_FAILURE([cannot find library GSL]))
173LDFLAGS="$save_LDFLAGS"
174
175AC_SUBST(GSL_LDFLAGS)
176AM_CPPFLAGS="-I\$(top_srcdir)/lib $GSL_CPPFLAGS $AM_CPPFLAGS"
177AC_SUBST(AM_CPPFLAGS)
178AC_SUBST(AM_CXXFLAGS)
179
180CPP_TOOLS_LIBPATH="lib/c++_tools"
181AC_SUBST(CPP_TOOLS_LIBPATH)
182
183AC_CONFIG_FILES([Makefile
184                 base/Makefile
185                 base/base1/Makefile
186                 base/base1/base_plugin_script/Makefile
187                 base/base1/BaseFileConverter/Makefile
188                 base/base2/Makefile
189                 bin/Makefile
190                 bin/NNIFileConverter/Makefile
191                 bin/nni/Makefile
192                 data/Makefile
193                 lib/Makefile
194                 lib/c++_tools/Makefile
195                 lib/c++_tools/gslapi/Makefile
196                 lib/c++_tools/utility/Makefile
197                 test/Makefile])
198
199AC_OUTPUT
200
201
202# Some more messages.
203AC_MSG_NOTICE([])
204AC_MSG_NOTICE([Ready to build WeNNI package containing])
205AC_MSG_NOTICE([])
206if (test x$state = xbase1); then
207  AC_MSG_NOTICE([BASE1 plug-in files:])
208  AC_MSG_NOTICE([    NNIFileConverter])
209  AC_MSG_NOTICE([    nni])
210  AC_MSG_NOTICE([    BaseFileConverter])
211  AC_MSG_NOTICE([    wenni.pl])
212  AC_MSG_NOTICE([])
213  AC_MSG_NOTICE([WeNNI plug-in binaries will be installed in])
214  AC_MSG_NOTICE([    $PLUGINDIR ])
215elif (test x$state = xbase2); then
216  AC_MSG_NOTICE([BASE2 plug-in files:])
217  AC_MSG_NOTICE([    nni])
218  AC_MSG_NOTICE([    WeNNI.jar])
219  AC_MSG_NOTICE([    $PLUGINutilities.jar])
220  AC_MSG_NOTICE([])
221  AC_MSG_NOTICE([If not already done, downloading])
222  AC_MSG_NOTICE([    $PLUGINutilitiesURL])
223  if (test $DOWNLOADBASE2API = true ); then
224    AC_MSG_NOTICE([    BASE2 libraries from $BASE2CoreURL])
225  else
226    AC_MSG_NOTICE([])
227    AC_MSG_NOTICE([Using local BASE2 API in directory])
228    AC_MSG_NOTICE([    $BASEDIR])
229  fi
230  AC_MSG_NOTICE([])
231  AC_MSG_NOTICE([WeNNI plug-in binaries will be installed in])
232  AC_MSG_NOTICE([    $PLUGINDIR ])
233else
234  AC_MSG_NOTICE([stand-alone binaries:])
235  AC_MSG_NOTICE([    NNIFileConverter])
236  AC_MSG_NOTICE([    nni])
237  AC_MSG_NOTICE([])
238  AC_MSG_NOTICE([binaries will be installed in])
239  AC_MSG_NOTICE([    $bindir])
240fi
241AC_MSG_NOTICE([])
242AC_MSG_NOTICE([The following libs and flags will be used:])
243AC_MSG_NOTICE([+++++++++++++++++++++++++++++++++++++++++++++++])
244AC_MSG_NOTICE([  CPPFLAGS     = $CPPFLAGS $AM_CPPFLAGS])
245AC_MSG_NOTICE([  CXXFLAGS     = $CXXFLAGS $AM_CXXFLAGS])
246AC_MSG_NOTICE([  LDFLAGS      = $LDFLAGS])
247AC_MSG_NOTICE([  LIBS         = $LIBS])
248if (test x$state = xbase1); then
249  AC_MSG_NOTICE([  BASECPPFLAGS = $BASECPPFLAGS])
250  AC_MSG_NOTICE([  BASELDFLAGS  = $BASELDFLAGS])
251elif (test x$state = xbase2); then
252  AC_MSG_NOTICE([  JAVACFLAGS     = $JAVACFLAGS])
253  AC_MSG_NOTICE([  JAVACCLASSPATH = $JAVACCLASSPATH])
254fi
255AC_MSG_NOTICE([+++++++++++++++++++++++++++++++++++++++++++++++])
256AC_MSG_NOTICE([])
257if (test x$state = xbase1 || test x$state = xbase2); then
258  AC_MSG_NOTICE([ Now type 'make ; make check ; make install-plugin'.])
259else
260  AC_MSG_NOTICE([ Now type 'make ; make check ; make install'.])
261fi
Note: See TracBrowser for help on using the repository browser.