7 # NEURO_MICRO_VERSION += 1 when bug fixes were done or small changes
8 # NEURO_MINOR_VERSION += 1 when new functions and or modules were added, anything more than mere bug fixes or small changes
9 # NEURO_MAJOR_VERSION += 1 when set goals for the whole projects are met, example when neuro will be done, we will raise that by 1. After it is 1, it only raise when most(like more than half) of the code was changes.
12 NEURO_MINOR_VERSION=49
13 NEURO_MICRO_VERSION=33
17 NEURO_VERSION=$NEURO_MAJOR_VERSION.$NEURO_MINOR_VERSION.$NEURO_MICRO_VERSION
19 AC_SUBST(NEURO_MAJOR_VERSION)
20 AC_SUBST(NEURO_MINOR_VERSION)
21 AC_SUBST(NEURO_MICRO_VERSION)
22 AC_SUBST(NEURO_INTERFACE_AGE)
23 AC_SUBST(NEURO_BINARY_AGE)
24 AC_SUBST(NEURO_VERSION)
28 LT_CURRENT=$NEURO_INTERFACE_AGE
29 LT_REVISION=$NEURO_REVISION
30 LT_AGE=$NEURO_BINARY_AGE
36 #AC_INIT(Neuro, $NEURO_VERSION)
37 AC_CONFIG_SRCDIR([src/neuro_main.c])
38 AC_CONFIG_HEADERS([include/neuro/config.h])
41 AM_INIT_AUTOMAKE(neuro, $NEURO_VERSION)
43 # call canonical host to get valuable informations about the current system
45 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
48 #dnl ----- set some variables ------
52 # ANSI C compiler check
55 # C preprocessor check
62 # check for cygwin stuff
70 CFLAGS="$CFLAGS -std=iso9899:1990 -Wall -pedantic -I\$(top_srcdir)/src"
71 NEUROFLAGS="-D__USE_GNU -I\${top_srcdir}/include -I\${top_srcdir}/include/neuro"
72 NEUROLDFLAGS="-export-symbols \$(top_srcdir)/include/libneuro.sym"
73 SDLFLAGS="`sdl-config --libs`"
75 dnl ------ Configure Arguments ------
77 AC_ARG_ENABLE(Debug, [ --enable-Debug enable the debugging of this program [[default=no]]], , enable_Debug=no)
80 [ --with-lowlib=<lowlib> the low library Neuro will use;]
81 [ only a single value is valid here;]
83 [ Possible low libraries are :]
85 lowlib="$withval", lowlib="sdl")
87 AC_ARG_ENABLE(video, [ --disable-video disables all the video particularities of this library [[default=no]]], enable_Video=no, enable_Video=yes)
89 AC_ARG_ENABLE(neuronet, [ --disable-neuronet disables the neuronet library from being built [[default=no]]], enable_Neuronet=no, enable_Neuronet=yes)
93 # host related checkings
95 AC_MSG_CHECKING([if we need -no-undefined])
97 *-*-cygwin | *-*-mingw* | *-*-pw32*)
98 NEUROFLAGS="$NEUROFLAGS -DWIN32"
99 NEUROLDFLAGS="$NEUROLIBFLAGS -no-undefined"
100 need_no_undefined=yes
102 #LIBS="$LIBS -lc -lgcc_s -ldl"
105 #by default we now compile against X11 on POSIX machines
111 AC_MSG_RESULT($need_no_undefined)
112 AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
116 AC_CHECK_HEADERS([windows.h], , [AC_MSG_ERROR([the required header windows is missing.])])
117 #AC_CHECK_FUNCS([GetTickCount], , [AC_MSG_ERROR([a required function is missing.])])
126 AC_CHECK_HEADERS([unistd.h], , [AC_MSG_ERROR([the required header unistd is missing.])])
127 AC_CHECK_FUNCS([gettimeofday], , [AC_MSG_ERROR([a required function is missing.])])
131 dnl --------- Checks -------------
134 dnl check for header files.
138 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h], , [AC_MSG_ERROR([a required header is missing.])])
140 # Checks for typedefs, structures, and compiler characteristics.
146 # Checks for library functions.
148 AC_CHECK_FUNCS([memchr memset strchr], , [AC_MSG_ERROR([a required function is missing.])])
151 dnl List of libraries Neuro can use
153 SELECTED_LOWLIB=`echo $lowlib`
158 AM_CONDITIONAL(USE_VIDEO, test x$enable_Video = xyes)
159 if test $enable_Video = no; then
160 # we disable the low library by putting it to the dummy driver
161 SELECTED_LOWLIB=dummy
167 AM_CONDITIONAL(USE_SDL, test x$SELECTED_LOWLIB = xsdl)
168 if test $SELECTED_LOWLIB = sdl; then
169 if test $targ = unix; then
170 AC_CHECK_LIB(SDL, SDL_Init,
171 [AC_DEFINE(USE_SDL, 1, ["SDL main flag"]) LIBS="$LIBS $SDLFLAGS"
172 NEUROFLAGS="$NEUROFLAGS `sdl-config --cflags`"],
173 [AC_MSG_ERROR(You don't have libSDL you can get it from http://www.libsdl.org)
178 AC_CHECK_LIB(SDL, SDL_Init,
179 [AC_DEFINE(USE_SDL, 1, ["SDL main flag"]) LIBS="$LIBS -lSDL"],
180 [AC_MSG_ERROR(You don't have libSDL you can get it from http://www.libsdl.org)
191 AC_CHECK_LIB(z, gzgetc,
192 [AC_DEFINE(USE_ZLIB, , ["ZLIB main flag"])] LIBS="$LIBS -lz",
193 [AC_MSG_ERROR(You don't have the Z library)])
199 AM_CONDITIONAL(USE_X11, test x$SELECTED_LOWLIB = xX11)
200 if test $SELECTED_LOWLIB = X11; then
203 LDFLAGS="$CFLAGS $X_LIBS"
204 CFLAGS="$CFLAGS $X_CFLAGS"
205 AC_CHECK_LIB(X11, XCreateGC,
206 [AC_DEFINE(USE_X11, 1, ["X11 main flag"]) LIBS="$LIBS -lX11 $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS"],
207 [AC_MSG_ERROR(You don't have libX11)])
208 # LIBS="$LIBS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS"
209 # NEUROFLAGS="$NEUROFLAGS $X_CFLAGS"
217 AC_CHECK_LIB(m, log10, , [AC_MSG_ERROR(You don't have libm -- math)])
223 if test x$freetype_enable = xyes; then
224 AC_CHECK_LIB(freetype, FT_New_Face,
225 [LIBS="$LIBS `freetype-config --libs`" CFLAGS="$CFLAGS `freetype-config --cflags`"],
226 [AC_MSG_ERROR(You don't have the libfreetype2 library you can get it from freetype.sourceforge.net)])
233 if test x$enable_Debug = xyes; then
234 #NEUROFLAGS="$NEUROFLAGS -g"
237 #NEUROFLAGS="$NEUROFLAGS -O2 -s"
238 CFLAGS="$CFLAGS -Os -s"
242 AC_SUBST(NEUROLDFLAGS)
244 # set the installation path for the headers
245 includedir=$includedir/neuro
249 # enumerate the Makefiles to be created
253 include/neuro/Makefile
260 src/misc/bitmap/Makefile
264 # if the neuronet project is in the house, we handle it
265 AM_CONDITIONAL(USE_NEURONET, test x$enable_Neuronet = xyes)
266 if test x$enable_Neuronet = xyes; then
267 if test -d src/neuronet/src; then
268 AC_CONFIG_LINKS(src/neuronet/include/ebuf.h:include/neuro/ebuf.h)
269 AC_CONFIG_SUBDIRS([src/neuronet])
273 #AC_MSG_NOTICE([This is the low library Neuro will use : $SELECTED_LOWLIB])
278 echo "This is the low library Neuro will use : $SELECTED_LOWLIB"