5a88cb1bf77a8484c411263faf342e57c000ca7d
[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])
89 AC_CHECK_LIB([gslcblas],[cblas_dgemm])
90 AC_CHECK_LIB([gsl],[gsl_blas_dgemm])
91
92 GLOBAL_CFLAGS="$GLOBAL_CFLAGS $GSL_CFLAGS"
93 GLOBAL_LDFLAGS="$GLOBAL_LDFLAGS $GSL_LIBS"
94
95 AC_SUBST(GSL_CFLAGS)
96 AC_SUBST(GSL_LIBS)
97
98
99 AC_SUBST(GLOBAL_CFLAGS)
100 AC_SUBST(GLOBAL_LDFLAGS)
101 AC_OUTPUT([
102   Makefile
103   src/Makefile
104   util/Makefile
105   sim-static/Makefile
106   jit/Makefile
107   matlab/Makefile
108   gsl/Makefile
109 ])