File: configure.in

package info (click to toggle)
fillets-ng 1.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,792 kB
  • ctags: 2,426
  • sloc: cpp: 15,348; sh: 9,781; ansic: 2,363; makefile: 119
file content (197 lines) | stat: -rw-r--r-- 5,921 bytes parent folder | download | duplicates (3)
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# Process this file with autoconf to produce a configure script.
AC_INIT(AUTHORS)
AC_CANONICAL_TARGET

# The AM_INIT_AUTOMAKE macro tells automake the name and version number
# of the software package so it can generate rules for building a source
# archive.
AM_INIT_AUTOMAKE(fillets-ng, 1.0.1)

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB

###################################################
# Check for libm
AC_CHECK_LIB(m, sin, LIBS="$LIBS -lm")

###################################################
# Test FriBidi
PKG_CHECK_MODULES(FRIBIDI, fribidi, [have_fribidi="yes"], [have_fribidi="no"])
AC_SUBST(FRIBIDI_CFLAGS)
AC_SUBST(FRIBIDI_LIBS)
if test "x$have_fribidi" = xyes; then
    AC_DEFINE(HAVE_FRIBIDI)
fi

###################################################
# Check for lua and define LUA_CFLAGS and LUA_LIBS

dnl ---- lua check ------------- (stolen from Stratagus)
AC_ARG_WITH(lua,   [  --with-lua=PFX          Prefix where Lua is installed],
    LUAPFX="$withval", LUAPFX="")
if test "x$LUAPFX" != x ; then
    LUA_CFLAGS="-I$LUAPFX"
    LUA_LIBS="-L$LUAPFX -llua -llualib"
else
    PKG_CHECK_MODULES(LUA, [lua5.1], [], [
        AC_MSG_ERROR([*** Lualib5.1 is required.
                      You can download lua from http://www.lua.org])])
fi
AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_LIBS)
dnl ---- end of lua check ------


###################################################
# Check for SDL, and define SDL_CFLAGS and SDL_LIBS
SDL_VERSION=1.2.0
AM_PATH_SDL($SDL_VERSION,
    :, [AC_MSG_ERROR([*** library SDL-devel version $SDL_VERSION not found!])]
)

###################################################
# Checks for C libraries.
# SDL_mixer
AC_CHECK_LIB([SDL_mixer], [Mix_OpenAudio],
             SDL_LIBS="-lSDL_mixer $SDL_LIBS",
             [AC_MSG_ERROR([*** SDL_mixer-devel library not found!])],
             $SDL_CFLAGS $SDL_LIBS
)
# SDL_image
AC_CHECK_LIB([SDL_image], [IMG_Load],
             SDL_LIBS="-lSDL_image $SDL_LIBS",
             [AC_MSG_ERROR([*** SDL_image-devel library not found!])],
             $SDL_CFLAGS $SDL_LIBS
)
# SDL_ttf
AC_CHECK_LIB([SDL_ttf], [TTF_OpenFont],
             SDL_LIBS="-lSDL_ttf $SDL_LIBS",
             [AC_MSG_ERROR([*** SDL_ttf-devel library not found!])],
             $SDL_CFLAGS $SDL_LIBS
)

###################################################
# Test X11
X_LIBS=""
have_x11="no"
AC_ARG_WITH(X,
   [AC_HELP_STRING([--with-x],[enable X window manager support [default=detect]])],
   [with_x11=$withval],[with_x11="maybe"])
if test "x$with_x11" != "xno" ; then
   AC_CHECK_LIB([X11], [Xutf8TextListToTextProperty], [with_x11="yes"], [with_x11="no"])
   if test "x$with_x11" != "xno" ; then
       OLD_CPPFLAGS="$CPPFLAGS"
       CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
       AC_TRY_COMPILE([
           #include "SDL.h"
           #include "SDL_syswm.h"
           #include <X11/Xutil.h>
           ], [
           SDL_SysWMinfo info;
           info.subsystem = SDL_SYSWM_X11;
           ], [have_x11="yes"], [have_x11="no"])
       CPPFLAGS="$OLD_CPPFLAGS"
       if test "x$have_x11" = xyes; then
           AC_DEFINE(HAVE_X11)
           X_LIBS="-lX11"
       fi
   fi
fi
AC_SUBST(X_LIBS)

###################################################
# enable C++ language
AC_LANG(C++)

###################################################
# Checks for C++ libraries.
# boost_filesystem, only need for nonPOSIX systems

AC_ARG_WITH(boost, [  --with-boost=PFX        Prefix where boost is installed],
    BOOSTPFX="$withval", BOOSTPFX="")
if test "x$BOOSTPFX" != x ; then
    BOOST_LIBS="-lboost_filesystem"
    if test "x$BOOSTPFX" != xyes ; then
        BOOST_CFLAGS="-I$BOOSTPFX"
        BOOST_LIBS="-L$BOOSTPFX $BOOST_LIBS"
    fi
fi
AM_CONDITIONAL(WITH_BOOST, test "x$BOOSTPFX" != x)
AC_SUBST(BOOST_CFLAGS)
AC_SUBST(BOOST_LIBS)

###################################################
# Check for SMPEG
AC_CHECK_LIB([smpeg], [SMPEG_new], [have_smpeg="yes"], [have_smpeg="no"],
             $SDL_LIBS)
if test "x$have_smpeg" = xyes; then
    SDL_LIBS="-lsmpeg $SDL_LIBS"
    AC_DEFINE(HAVE_SMPEG)
fi

###################################################
# Check for windres for win32 icon.
case "$target" in
    *-mingw32*)
        AC_CHECK_PROGS(WINDRES, [i386-mingw32msvc-windres i586-mingw32msvc-windres], "")
        AM_CONDITIONAL(HAVE_WINDRES, test "x$WINDRES" != x)
        AC_SUBST(WINDRES)
        have_windres="yes"
        ;;
    *)
        WINDRES=""
        AM_CONDITIONAL(HAVE_WINDRES, false)
        have_windres="no"
        ;;
esac

###################################################
# Mung up datadir if need be
if test "${datadir}" = '${datarootdir}' ; then
   datadir='${datarootdir}/games/${PACKAGE}'
fi

###################################################
# Debug on/off
AC_ARG_ENABLE(debug,
              [  --enable-debug          Print debug messages],
              [case "${enableval}" in
                 yes) debug=true ;;
                 no)  debug=false ;;
                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
               esac],[debug=false]
               )
CXXFLAGS="$CXXFLAGS -Wall -W -Wpointer-arith -Wcast-qual \
-Wcast-align -Woverloaded-virtual \
-Wconversion -Wshadow"
if test "x$debug" = "xtrue"; then
    CXXFLAGS="$CXXFLAGS -pedantic -ansi -pipe -g3 -O0"
fi

###################################################
AC_OUTPUT([
           Makefile
           src/Makefile
           src/SDL_gfx/Makefile
           src/gengine/Makefile
           src/effect/Makefile
           src/widget/Makefile
           src/plan/Makefile
           src/option/Makefile
           src/state/Makefile
           src/level/Makefile
           src/menu/Makefile
           src/game/Makefile
           ])

AC_MSG_RESULT([

Fish Fillets NG are now configured.
   Checked components: X11=$have_x11, WINDRES=$have_windres, FRIBIDI=$have_fribidi, SMPEG=$have_smpeg

You can now run make.
])