source: branches/r9/lang/configure.in @ 4852

Last change on this file since 4852 was 4837, checked in by gah, 7 years ago
File size: 7.7 KB
Line 
1
2AC_INIT([Rappture],[1.4],[rappture@nanohub.org])
3AC_CONFIG_AUX_DIR(cf)
4
5#------------------------------------------------------------------------
6# Handle the --prefix=... option
7#------------------------------------------------------------------------
8
9if test "${prefix}" = "NONE"; then
10    prefix=/usr/local
11fi
12if test "${exec_prefix}" = "NONE"; then
13    exec_prefix=$prefix
14fi
15AC_PROG_INSTALL
16AC_PROG_INSTALL
17AC_PROG_RANLIB
18AC_PROG_LN_S
19AC_PROG_MKDIR_P
20AC_PROG_MAKE_SET
21
22# Check for C, C++, and FORTRAN
23AC_PROG_CC
24AC_PROG_CXX
25# Avoid g95
26AC_PROG_F77([g77 gfortran f77 fort77 f90 xlf xlf90 fl32])
27
28AC_LANG([C])
29
30AC_HEADER_STDC
31AC_CHECK_FUNC(atol,,AC_MSG_ERROR(oops! no atol ?!?))
32
33AC_LANG([C++])
34AC_PATH_X
35
36AC_ARG_WITH(
37    [install],
38    [AS_HELP_STRING([--with-install[=DIR]],
39        [location of installation @<:@default=yes@:>@])],
40    [],
41    [with_install=yes])
42
43if test "$with_install" != "yes"; then
44    INSTALL_PREFIX=$with_install
45else
46    INSTALL_PREFIX=$prefix
47fi
48
49if test "${libdir}" != "${prefix}/lib"; then
50    LIB_SEARCH_DIRS="-L${prefix}/lib -L${libdir}"
51else
52    LIB_SEARCH_DIRS="-L${libdir}"
53fi
54
55
56AC_CHECK_FUNCS(sysinfo)
57AC_CHECK_FUNCS(gettimeofday)
58AC_CHECK_FUNC(localtime,,AC_MSG_ERROR(oops! no localtime ?!?))
59AC_CHECK_FUNC(getenv,,AC_MSG_ERROR(oops! no getenv ?!?))
60
61AC_CHECK_HEADERS(sys/sysinfo.h)
62
63AC_CHECK_LIB(ncurses, clrtoeol,,AC_MSG_ERROR([ncurses library missing?]))
64AC_CHECK_HEADERS(ncurses.h,,AC_MSG_WARN(ncurses headers missing ?))
65
66AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(librappture requires libstdc++))
67AC_CHECK_HEADERS(algorithm,,AC_MSG_WARN(STL classes missing ?))
68AC_CHECK_HEADERS(cctype,,AC_MSG_WARN(STL classes missing ?))
69AC_CHECK_HEADERS(cfloat,,AC_MSG_WARN(STL classes missing ?))
70AC_CHECK_HEADERS(cmath,,AC_MSG_WARN(STL classes missing ?))
71AC_CHECK_HEADERS(cstdio,,AC_MSG_WARN(STL classes missing ?))
72AC_CHECK_HEADERS(cstdlib,,AC_MSG_WARN(STL classes missing ?))
73AC_CHECK_HEADERS(cstring,,AC_MSG_WARN(STL classes missing ?))
74AC_CHECK_HEADERS(fstream,,AC_MSG_WARN(STL classes missing ?))
75AC_CHECK_HEADERS(list,,AC_MSG_WARN(STL classes missing ?))
76AC_CHECK_HEADERS(iostream,,AC_MSG_WARN(STL classes missing ?))
77AC_CHECK_HEADERS(iterator,,AC_MSG_WARN(STL classes missing ?))
78AC_CHECK_HEADERS(sstream,,AC_MSG_WARN(STL classes missing ?))
79AC_CHECK_HEADERS(stack,,AC_MSG_WARN(STL classes missing ?))
80AC_CHECK_HEADERS(string,,AC_MSG_WARN(STL classes missing ?))
81AC_CHECK_HEADERS(vector,,AC_MSG_WARN(STL classes missing ?))
82
83AC_CHECK_HEADERS(assert.h,,AC_MSG_WARN(C headers missing ?))
84AC_CHECK_HEADERS(ctype.h,,AC_MSG_WARN(C headers missing ?))
85AC_CHECK_HEADERS(errno.h,,AC_MSG_WARN(C headers missing ?))
86AC_CHECK_HEADERS(limits.h,,AC_MSG_WARN(C headers missing ?))
87AC_CHECK_HEADERS(string.h,,AC_MSG_WARN(C headers missing ?))
88AC_CHECK_HEADERS(stdlib.h,,AC_MSG_WARN(C headers missing ?))
89AC_CHECK_HEADERS(stddef.h,,AC_MSG_WARN(C headers missing ?))
90AC_CHECK_HEADERS(float.h,,AC_MSG_WARN(C headers missing ?))
91AC_CHECK_HEADERS(math.h,,AC_MSG_WARN(C headers missing ?))
92dnl AC_CHECK_HEADERS(ieeefp.h,,AC_MSG_WARN(C headers missing ?))
93AC_CHECK_HEADERS(malloc.h,,AC_MSG_WARN(C headers missing ?))
94AC_CHECK_HEADERS(memory.h,,AC_MSG_WARN(C headers missing ?))
95AC_CHECK_HEADERS(unistd.h,,AC_MSG_WARN(C headers missing ?))
96
97AC_CHECK_HEADERS(inttypes.h)
98
99SC_CONFIG_CFLAGS
100
101SVN_VERSION=`svnversion $srcdir`
102
103make_command=""
104for m in "$MAKE" make gmake gnumake ; do
105  if test "x${m}" != "x" ; then
106    if  ( sh -c "$m --version" 2>/dev/null | grep GNU >/dev/null ) ; then
107      make_command=$m; break;
108    fi
109  fi
110done
111if test "x${make_command}" = "x" ; then
112  AC_MSG_ERROR([Requires GNU make. You can specify a version with \$MAKE])
113fi
114
115TCL_VERSION="8.4"
116for dir in \
117 ${exec_prefix} \
118 ${exec_prefix}/lib ; do
119  tclconfig="${dir}/tclConfig.sh"
120  if test -f "$tclconfig" ; then
121    . $tclconfig
122    break
123  fi
124done
125
126AC_ARG_WITH(
127    [tclsh],
128    [AS_HELP_STRING([--with-tclsh[=DIR]],
129        [location of tclsh @<:@default=yes@:>@])],
130    [],
131    [with_tclsh=yes])
132
133TCLSH=""
134if test "${with_tclsh}" != "no" ; then
135  tclsh="tclsh${TCL_VERSION}"
136  if test "${with_tclsh}" = "yes" ; then
137    AC_PATH_PROG(TCLSH, ${tclsh}, [], [${exec_prefix}/bin:${PATH}])
138  else
139    AC_PATH_PROG(TCLSH, ${tclsh}, [], [${with_tclsh}/bin:${with_tclsh}])
140  fi
141  if test "x${TCLSH}" = "x" ; then
142    AC_ERROR([can't find tclsh])
143  fi
144fi
145
146TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
147
148RP_LANG_MATLAB
149RP_LANG_OCTAVE
150RP_LANG_PERL
151RP_LANG_PYTHON
152RP_LANG_JAVA
153RP_LANG_R
154RP_LANG_RUBY
155
156RP_BASE=`pwd`
157
158SC_ENABLE_SHARED
159
160#--------------------------------------------------------------------
161# This macro figures out what flags to use with the compiler/linker
162# when building shared/static debug/optimized objects.  This information
163# is all taken from the tclConfig.sh file.
164#--------------------------------------------------------------------
165
166if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
167  . ${exec_prefix}/lib/tclConfig.sh
168fi
169
170# -----------------------------------------------------------------------
171#
172# Compiler characteristics:
173#   Check for existence of types of size_t and pid_t
174#
175# -----------------------------------------------------------------------
176
177AC_C_BIGENDIAN
178AC_CHECK_SIZEOF(int)
179AC_CHECK_SIZEOF(long)
180AC_CHECK_SIZEOF(long long)
181AC_CHECK_SIZEOF(void *)
182
183SIZEOF_LONG="${ac_cv_sizeof_long}"
184SIZEOF_LONG_LONG="${ac_cv_sizeof_long_long}"
185SIZEOF_VOID_P="${ac_cv_sizeof_void_p}"
186SIZEOF_INT="${ac_cv_sizeof_int}"
187
188
189#--------------------------------------------------------------------
190# Set the default compiler switches based on the --enable-symbols
191# option.
192#--------------------------------------------------------------------
193
194SC_ENABLE_SYMBOLS
195
196AC_SUBST(CFLAGS_DEBUG)
197AC_SUBST(CFLAGS_OPTIMIZE)
198AC_SUBST(HAVE_RUBY_DEVEL)
199AC_SUBST(INSTALL_PREFIX)
200AC_SUBST(JAVA)
201AC_SUBST(JAVAC)
202AC_SUBST(JAVAH)
203AC_SUBST(JAVA_HOME)
204AC_SUBST(JAVA_INC_DIR)
205AC_SUBST(JAVA_INC_SPEC)
206AC_SUBST(LIB_SEARCH_DIRS)
207AC_SUBST(MAKE, ${make_command})
208AC_SUBST(MATLAB)
209AC_SUBST(MCC)
210AC_SUBST(MEX)
211AC_SUBST(MEXEXT)
212AC_SUBST(MEX_ARCH)
213AC_SUBST(MKOCTFILE2)
214AC_SUBST(MKOCTFILE3)
215AC_SUBST(SVN_VERSION)
216AC_SUBST(OCTAVE_VERSION)
217AC_SUBST(OCTAVE_VERSION_MAJOR)
218AC_SUBST(PERL)
219AC_SUBST(PERL_ARCHLIB)
220AC_SUBST(PERL_ARCHLIBEXP)
221AC_SUBST(PERL_CCFLAGS)
222AC_SUBST(PERL_CPPFLAGS)
223AC_SUBST(PERL_INCLUDES)
224AC_SUBST(PERL_INSTALLARCHLIB)
225AC_SUBST(PERL_LIBSPEC)
226AC_SUBST(PERL_PRIVLIB)
227AC_SUBST(PERL_VENDORLIB)
228AC_SUBST(PERL_VERSION)
229AC_SUBST(PERL_VERSION_RV)
230AC_SUBST(PYTHON)
231AC_SUBST(PYTHON_CFLAGS)
232AC_SUBST(PYTHON_DISTUTILS)
233AC_SUBST(PYTHON_INCDIR)
234AC_SUBST(PYTHON_INCLUDES)
235AC_SUBST(PYTHON_LDFLAGS)
236AC_SUBST(PYTHON_LIB)
237AC_SUBST(PYTHON_LIBDIR)
238AC_SUBST(PYTHON_SITE_DIR)
239AC_SUBST(PYTHON_SITE_PACKAGES)
240AC_SUBST(PYTHON_VERSION)
241AC_SUBST(R)
242AC_SUBST(RP_BASE)
243AC_SUBST(RUBY)
244AC_SUBST(RUBY_PLATFORM)
245AC_SUBST(RUBY_VERSION_RV)
246AC_SUBST(SHLIB_CFLAGS)
247AC_SUBST(SHLIB_LD)
248AC_SUBST(SHLIB_LDFLAGS)
249AC_SUBST(SHLIB_SUFFIX)
250AC_SUBST(SIZEOF_INT)
251AC_SUBST(SIZEOF_LONG)
252AC_SUBST(SIZEOF_LONG_LONG)
253AC_SUBST(SIZEOF_VOID_P)
254AC_SUBST(STLIB_LD)
255AC_SUBST(TCLSH)
256AC_SUBST(TCL_INC_SPEC)
257AC_SUBST(TCL_LIB_SPEC)
258AC_SUBST(TCL_CFLAGS_DEBUG)
259AC_SUBST(TCL_CFLAGS_OPTIMIZE)
260AC_SUBST(TCL_SHLIB_CFLAGS)
261AC_SUBST(TCL_SHLIB_LD)
262AC_SUBST(TCL_SHLIB_LDFLAGS)
263AC_SUBST(TCL_SHLIB_SUFFIX)
264AC_SUBST(TCL_VERSION)
265AC_SUBST(TCL_VERSION)
266AC_SUBST(TCL_CFLAGS_DEBUG)
267AC_SUBST(TCL_SHLIB_CFLAGS)
268AC_SUBST(TCL_SHLIB_SUFFIX)
269AC_SUBST(TCL_SHLIB_LD)
270AC_SUBST(TCL_SHLIB_LDFLAGS)
271AC_SUBST(XSUBPP)
272
273dnl read Makefile.in and write Makefile
274AC_CONFIG_FILES([
275    Makefile
276    java/Makefile
277    java/rappture/Makefile
278    perl/Makefile
279    perl/Makefile.PL
280    python/Makefile
281    python/setup.py
282    matlab/Makefile
283    octave/Makefile
284    octave/octave2/Makefile
285    octave/octave3/Makefile
286    R/Makefile
287    ruby/Makefile
288    ruby/build.rb
289    tcl/Makefile
290    tcl/pkgIndex.tcl
291    tcl/scripts/Makefile
292    tcl/src/Makefile
293    tcl/tests/Makefile
294])
295AC_OUTPUT
296       
Note: See TracBrowser for help on using the repository browser.