File: configure.in

package info (click to toggle)
criticalmass 1:1.0.0-6
  • links: PTS
  • area: main
  • in suites: buster, sid
  • size: 17,180 kB
  • ctags: 10,844
  • sloc: ansic: 47,628; cpp: 25,173; sh: 11,803; xml: 3,532; perl: 3,271; makefile: 610; python: 66; awk: 40; lisp: 33
file content (134 lines) | stat: -rw-r--r-- 3,715 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
AC_INIT([Critical_Mass], [1.0.0])
AC_CONFIG_SRCDIR([game/main.cpp])

AC_CANONICAL_HOST
AC_CANONICAL_TARGET

dnl Setup for automake
AM_INIT_AUTOMAKE([foreign])
AM_CONFIG_HEADER(defines.h)

AC_EXEEXT

case $target in
	*mingw*)
		TARGET=WIN32 ;;
	powerpc-apple*) 
		TARGET=APPLE ;;
	*)
		TARGET=UNIX ;;
esac

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB

dnl Checks for libraries.

dnl Checks for header files.

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

dnl Checks for library functions.

AM_CONDITIONAL(APPLE,test "x$TARGET" = xAPPLE)
AM_CONDITIONAL(WIN32,test "x$TARGET" = xWIN32)

CFLAGS="$CFLAGS"
CXXFLAGS="$CXXFLAGS"

if test "x$GCC" = xyes; then
   CFLAGS="$CFLAGS -W -Wall"
   CXXFLAGS="$CXXFLAGS -W -Wall -fno-exceptions -std=gnu++98"
fi

AC_ARG_ENABLE(debug,
[  --enable-debug               Enable debugging [default=off]],
        enable_debug=$enableval, enable_debug=off)
if test "x$enable_debug" = xyes; then
        CFLAGS="$CFLAGS -g"
        CXXFLAGS="$CXXFLAGS -g"
fi

AC_ARG_ENABLE(optimize,
[  --enable-optimize=level      Enable optimization [default=2]],
        enable_optmize=$enableval, enable_optimize=2)
if test "x$enable_optimize" != "xno" ; then
        CFLAGS="$CFLAGS -O$enable_optimize"
        CXXFLAGS="$CXXFLAGS -O$enable_optimize"
fi

AC_ARG_ENABLE(dyngl,
[  --enable-dyngl               Load GL library dynamically [default=off]],
        enable_dyngl=$enableval, enable_dyngl=off)
if test "x$enable_dyngl" = xyes; then
        CFLAGS="$CFLAGS -DDYNAMIC_GL"
        CXXFLAGS="$CXXFLAGS -DDYNAMIC_GL"
fi

AC_ARG_ENABLE(lzma,
[  --enable-lzma                Enable LZMA [default=off]],
        enable_lzma=$enableval, enable_lzma=off)
AM_CONDITIONAL(USE_LZMA,test "x$enable_lzma" = xyes)

AC_ARG_ENABLE(trace,
[  --enable-trace               Enable tracing [default=off]],
        enable_trace=$enableval, enable_trace=off)
if test "x$enable_trace" = xyes; then
        CFLAGS="$CFLAGS -DTRACE"
        CXXFLAGS="$CXXFLAGS -DTRACE"
fi

AC_CHECK_LIB(SDL, main,
    LIBS="$LIBS `sdl-config --libs`" ; \
    CFLAGS="$CFLAGS `sdl-config --cflags`" ; \
    CXXFLAGS="$CXXFLAGS `sdl-config --cflags`" ; \
    HAVE_SDL=1, AC_MSG_ERROR(SDL is needed), `sdl-config --libs`)

AC_CHECK_LIB(SDL_image, main, LIBS="$LIBS -lSDL_image", 
    AC_MSG_ERROR(SDL_image is needed))

AC_CHECK_LIB(SDL_mixer, main, LIBS="$LIBS -lSDL_mixer", 
    AC_MSG_ERROR(SDL_mixer is needed))

if test "x$TARGET" = xWIN32; then
    AC_MSG_RESULT(Adding special ingredients for mingw32)
    LIBS="$LIBS -lopengl32 -lpng -lz -ljpeg -lstdc++ -lws2_32 -lwinmm"
    CXXFLAGS="$CXXFLAGS -DCURL_STATICLIB"
else
    LIBS="-L/usr/local/lib -L/usr/X11R6/lib $LIBS"
    CXXFLAGS="$CXXFLAGS -I/usr/X11R6/include"
	AC_CHECK_LIB(png16, main,, AC_CHECK_LIB(png12, main,, AC_MSG_ERROR(libpng is needed)))
	AC_CHECK_LIB(z, main,, AC_MSG_ERROR(libz is needed))
	if test "x$TARGET" = xUNIX; then
	    if test "x$enable_dyngl" = xoff; then
		AC_CHECK_LIB(GL, glBegin,, AC_MSG_ERROR(OpenGL is needed))
	    fi
	fi
fi

if test "x$TARGET" = xAPPLE; then
    CXXFLAGS="$CXXFLAGS -I/Developer/Headers/FlatCarbon/"
fi

AC_CHECK_LIB(m, sin,, 
    AC_MSG_ERROR(libm is needed))

LIBCURL_CHECK_CONFIG
LIBS="$LIBS $LIBCURL"
CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"

AC_OUTPUT(Makefile utils/Makefile utilssdl/Makefile utilsgl/Makefile game/Makefile tools/Makefile data/Makefile data/music/Makefile tinyxml/Makefile)

echo "Configuration:

Version:                    $VERSION
Source code location:       $srcdir
Install path:               $prefix
Compiler:                   $CC $CXX
C++ flags:                  $CXXFLAGS
host:                       $host
target:                     $target
"