File: configure.in

package info (click to toggle)
lbreakout2 2.5.2-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 6,040 kB
  • ctags: 2,374
  • sloc: ansic: 20,911; sh: 2,891; makefile: 374
file content (142 lines) | stat: -rw-r--r-- 3,537 bytes parent folder | download | duplicates (2)
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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(Makefile.am)

AM_CONFIG_HEADER(config.h)

AM_INIT_AUTOMAKE(lbreakout2,2.5.2)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
AC_EXEEXT

dnl Checks for libraries.
AC_CHECK_LIB(m, main,, AC_MSG_ERROR(lib math is needed))
AC_CHECK_LIB(z, main,, AC_MSG_ERROR(libz is needed))
AC_CHECK_LIB(png, main,, AC_MSG_ERROR(libpng is needed))

CFLAGS="$CFLAGS -Wall"

dnl check SDL version
AM_PATH_SDL(1.2.0,, AC_MSG_ERROR(lib SDL is needed))
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"

dnl check warp mouse flag
warp_flag=""
AC_ARG_ENABLE( warp,
[  --enable-warp               Enable mouse warp (for BeOS and Mac)], warp_flag="-DMOUSE_WARP")
AC_SUBST(warp_flag)

dnl check sound
audio_flag="-DAUDIO_ENABLED"
mixer_flag="-lSDL_mixer"
AC_ARG_ENABLE( audio,
[  --disable-audio             Disables Audio], audio_flag=""; mixer_flag="")

dnl check if SDL_mixer's installed
dnl if not: clear sound_flag and mixer_flag
AC_CHECK_LIB(SDL_mixer, main,
AC_MSG_RESULT("SDL_Mixer found"), 
AC_MSG_RESULT("SDL_Mixer NOT found \(http://libsdl.org\): Audio disabled"); audio_flag=""; mixer_flag="")

AC_SUBST(audio_flag)
AC_SUBST(mixer_flag)

dnl get host info
AC_CANONICAL_HOST

dnl documentation path
doc_dir="/usr/doc"
dnl check if manually overwriting doc path
AC_ARG_WITH( docdir,
[  --with-docdir=DPATH       Directory where documentation is saved.],
doc_dir="$withval",)
AC_SUBST(doc_dir)

dnl network support
network_flag="-DNETWORK_ENABLED"
AC_ARG_ENABLE( network,
[  --disable-network           No network support.], network_flag="" )
AC_SUBST(network_flag)

dnl SDL_net usage
sdlnet_flag=""
sdlnet_lib_flag=""
AC_ARG_ENABLE( sdl-net,
[  --enable-sdl-net           Use SDL_Net for networking.], sdlnet_flag="-DSDL_NET_ENABLED"; sdlnet_lib_flag="-lSDL_net" )
AC_SUBST(sdlnet_flag)
AC_SUBST(sdlnet_lib_flag)
if test "$sdlnet_flag" == "-DSDL_NET_ENABLED" ; then
  dnl check if SDL_net is installed
  AC_CHECK_LIB(SDL_net, main,
  AC_MSG_RESULT("SDL_net found"), 
  AC_MSG_RESULT("SDL_net NOT found \(http://libsdl.org\): Networking disabled"); sdlnet_flag=""; sdlnet_lib_flag=""; network_flag="")
fi

dnl network debug
netdebug_flag=""
AC_ARG_ENABLE( netdebug,
[  --enable-netdebug           Enable net packet debugging.], netdebug_flag="-DNET_DEBUG_MSG" )
AC_SUBST(netdebug_flag)

dnl installation&highscore path
inst_dir="$datadir/lbreakout2"
hi_dir=$localstatedir

dnl check if installation was disabled
AC_ARG_ENABLE( install,
[  --disable-install           No installation. Played from the source directory.], 
inst_dir="." hi_dir="." )

inst_flag="-DSRC_DIR=\\\"$inst_dir\\\""
hi_inst_flag="-DHI_DIR=\\\"$hi_dir\\\""

AC_SUBST(inst_flag)
AC_SUBST(hi_inst_flag)
AC_SUBST(inst_dir)
AC_SUBST(hi_dir)

case "$host" in
	*-mingw32)
		win32="yes"
		win32_inst_script="`pwd -W`/installer.iss"
		arch_flag="-march=i586"
		win32_deps="lbreakout2res.o" ;;
	*) 
		win32="no"
		win32_inst_script=""
		arch_flag=""
		win32_deps="" ;;	
esac

AC_SUBST(win32_deps)
AC_SUBST(arch_flag)

if test "x$win32" = xyes; then 
	AC_PROG_AWK
	AC_PROG_STRIP
dnl	AC_PROG_ISCC
	AC_SUBST(win32_inst_script)
fi

appname="LBreakout2"
AC_SUBST(appname)

AC_OUTPUT(
Makefile 
docs/Makefile 
common/Makefile 
game/Makefile
gui/Makefile 
client/Makefile 
client/gui_theme/Makefile
client/gfx/Makefile 
client/gfx/AbsoluteB/Makefile 
client/gfx/Oz/Makefile 
client/gfx/Moiree/Makefile 
client/gfx/Classic/Makefile 
client/sounds/Makefile 
client/levels/Makefile 
server/Makefile
server/levels/Makefile)