First partially-implemented functional release
[2dsolver.git] / configure.in
1 dnl File generated by Zed2Soft Project Manager for the Zed2Soft Science Environment
2 dnl Creation date: Sat Apr 21 17:34:30 2012
3
4 AC_PREREQ(2.65)
5
6 AC_INIT(2dsolve, 0.1)
7
8 AC_CONFIG_HEADERS(src/config.h)
9 AC_CONFIG_MACRO_DIR([m4])
10
11 AM_AUTOMAKE_VERSION(1.11.1)
12 AM_INIT_AUTOMAKE
13
14 cflags_were_set=false
15 if test "${CFLAGS+set}" = set; then
16   GLOBAL_CFLAGS=$CFLAGS
17   CFLAGS=
18   cflags_were_set=:
19 fi
20
21 AC_PROG_CC
22 AM_PROG_CC_C_O
23 AM_PROG_AS
24
25 AC_PROG_LIBTOOL
26 AC_PROG_INSTALL
27 dnl the following needs to come after the expansion of AC_PROG_CC
28 if $cflags_were_set; then :; else
29   GLOBAL_CFLAGS=$CFLAGS
30   CFLAGS=
31 fi
32
33 AC_SUBST(AM_CFLAGS)
34
35 AC_C_INLINE
36
37 if test "$ac_cv_c_inline" != no ; then
38   AC_DEFINE([HAVE_INLINE], [0], [This compiler supports inline functions])
39   AC_DEFINE(HAVE_INLINE,1)
40   AC_SUBST(HAVE_INLINE)
41 fi
42
43 AC_HEADER_TIME
44
45 dnl Checks for library functions.
46 AC_FUNC_ERROR_AT_LINE
47 AC_FUNC_FORK
48 AC_FUNC_MALLOC
49
50 GLOBAL_LDFLAGS="-lm -lpthread -ldl -export-dynamic -rdynamic"
51
52
53 dnl Macro snippets imported from dependency `util'
54
55 dnl Macro snippets imported from dependency `sim-static'
56 SDL_VERSION=1.2.5
57 AM_PATH_SDL($SDL_VERSION,
58             :,
59             AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
60 )
61
62 GLOBAL_CFLAGS="$SDL_CFLAGS $GLOBAL_CFLAGS"
63 GLOBAL_LDFLAGS="$SDL_LIBS $GLOBAL_LDFLAGS"
64 AC_SUBST(SDL_CFLAGS)
65 AC_SUBST(SDL_LIBS)
66
67
68 dnl Macro snippets imported from dependency `jit'
69 AM_PROG_LEX
70 AC_PROG_YACC
71
72
73 dnl Macro snippets imported from dependency `matlab'
74 AC_CHECK_HEADER(zlib.h,
75                 ,
76                 [ AC_MSG_ERROR("error: zlib not found on your system")])
77 AC_CHECK_LIB(z, compress,
78                 ,
79                 [ AC_MSG_ERROR("error: compress() not found in zlib")])
80 AC_CHECK_LIB(z, uncompress,
81                 ,
82                 [ AC_MSG_ERROR("error: uncompress() not found in zlib")])
83
84 GLOBAL_LDFLAGS="$GLOBAL_LDFLAGS -lz"
85
86
87 dnl Macro snippets imported from dependency `gsl'
88 AC_CHECK_LIB([m],[cos],, [ AC_MSG_ERROR(error: libm not found)])
89 AC_CHECK_LIB([gslcblas],[cblas_dgemm],, [ AC_MSG_ERROR(error: libgslcblas not found (you may need to install GSL devel libraries))])
90 AC_CHECK_LIB([gsl],[gsl_blas_dgemm],, [ AC_MSG_ERROR(error: libgsl not found (you may need to install GSL devel libraries))])
91
92 AC_CHECK_HEADER(gsl/gsl_vector.h,
93                 ,
94                 [ AC_MSG_ERROR(error: GSL include files not found (you may need to install GSL devel libraries))])
95 AC_CHECK_HEADER(gsl/gsl_matrix.h,
96                 ,
97                 [ AC_MSG_ERROR(error: GSL include files not found (you may need to install GSL devel libraries))])
98 AC_CHECK_HEADER(gsl/gsl_linalg.h,
99                 ,
100                 [ AC_MSG_ERROR(error: GSL include files not found (you may need to install GSL devel libraries))])
101
102 GLOBAL_LDFLAGS="$GLOBAL_LDFLAGS -lgsl -lgslcblas -lm"
103
104
105
106 AC_SUBST(GSL_CFLAGS)
107 AC_SUBST(GSL_LIBS)
108
109
110 AC_SUBST(GLOBAL_CFLAGS)
111 AC_SUBST(GLOBAL_LDFLAGS)
112 AC_OUTPUT([
113   Makefile
114   src/Makefile
115   util/Makefile
116   sim-static/Makefile
117   jit/Makefile
118   matlab/Makefile
119   gsl/Makefile
120 ])