File: configure.in

package info (click to toggle)
lxdoom 1.4.4main-0.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,092 kB
  • ctags: 6,838
  • sloc: ansic: 53,874; sh: 1,944; asm: 650; makefile: 141
file content (210 lines) | stat: -rw-r--r-- 6,319 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
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
198
199
200
201
202
203
204
205
206
207
208
209
210
dnl Process this file with autoconf to produce a configure script.
dnl $Id: configure.in,v 1.16 2000/03/27 10:33:22 cph Exp $
AC_INIT(src/d_main.c)

dnl --- Check for system type
AC_CANONICAL_SYSTEM

case "$target" in
i?86-*) AC_DEFINE(I386) is_i386=yes ;;
esac

AM_CONDITIONAL(I386_ASM, test "$is_i386" = yes)

case "$target" in
*-linux) AC_DEFINE(LINUX) AC_DEFINE(SECURE_UID) ;;
*-linux-*) AC_DEFINE(LINUX) AC_DEFINE(SECURE_UID) ;;
*-freebsd) AC_DEFINE(FREEBSD) ;;
esac

dnl --- some defaults for CFLAGS : josh
if test -z "$CFLAGS" ; then 
	CFLAGS="-O2 -Wall -Winline -Wcast-align -Wwrite-strings -ffast-math -fomit-frame-pointer"
fi
export CFLAGS

dnl --- Fire up automake
AM_INIT_AUTOMAKE(lxdoom, 1.4.4)
AM_CONFIG_HEADER(config.h)

dnl --- Checks for programs.
AC_PROG_CC

dnl --- Try for processor optimisations
AC_ARG_ENABLE(cpu-opt,[  --disable-cpu-opt	  turns off cpu specific optimisations],,[
case "$target" in
	# marginal gains from aligning code
i386-*) SYS_CFLAGS="-m386" ;;
i486-*) SYS_CFLAGS="-m486" ;;
	# nothing special for pentium
	# CMOV op on ppro/II/686 can help us
i686-*) SYS_CFLAGS="-mcpu=i686 -march=i686" ;;
esac

echo -n "checking whether $CC supports CPU optimisations $SYS_CFLAGS..."
echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} $SYS_CFLAGS -c conftest.c 2>&1`"; then
	CFLAGS="$CFLAGS $SYS_CFLAGS"
	echo "yes"
else
	echo "no"
fi
])

dnl --- Checks for typedefs
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_TYPE_UID_T

AC_DECL_SYS_SIGLIST

dnl --- Compiler characteristics
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN

if test "$ac_cv_c_bigendian" != no
then AC_DEFINE(__BIG_ENDIAN__)
fi

dnl --- Libraries
AC_PATH_X
AC_PATH_XTRA
if test "x$x_includes" != x; then
  CFLAGS="$CFLAGS -I$x_includes"
else
  CFLAGS="$CFLAGS"
fi
echo "CFLAGS complete: $CFLAGS"
LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS"
dnl --- cphipps - no longer need sqrt(3) AC_CHECK_LIB(m,sqrt)
AC_CHECK_LIB(Xext,XShmCreateImage,AC_DEFINE(HAVE_LIBXEXT) LIB_XEXT=-lXext,LIB_XEXT=,-lXext -lX11)
dnl --- CPhipps - disable XFree86 DGA support for release
dnl AC_CHECK_LIB(Xxf86dga,XF86DGADirectVideo,AC_DEFINE(HAVE_LIBXXF86DGA) LIB_XDGA=-lXxf86dga,LIB_XDGA=,-lXxf86dga -lXext -lX11)
AC_CHECK_LIB(vga,vga_setpalvec,BUILD_LSDOOM=lsdoom,BUILD_LSDOOM=)

dnl --- Library functions
AC_CHECK_FUNC(stricmp,,AC_DEFINE(stricmp,strcasecmp)) 
AC_CHECK_FUNC(strnicmp,,AC_DEFINE(strnicmp,strncasecmp)) 
AC_CHECK_FUNCS(inet_aton)

dnl --- Check for headers
dnl - First, joystick
AC_CHECK_HEADERS(linux/joystick.h)
dnl - wait(2)
AC_HEADER_SYS_WAIT
dnl - non-blocking IO ioctl
AC_CHECK_HEADERS(sys/ioctl.h)
AC_CHECK_HEADERS(sys/filio.h)
dnl - Check for soundcard.h
BUILD_SNDSERV=
AC_CHECK_HEADERS(sys/soundcard.h,BUILD_SNDSERV=sndserv)
AC_CHECK_HEADERS(machine/soundcard.h,BUILD_SNDSERV=sndserv)
AC_CHECK_HEADERS(linux/soundcard.h,BUILD_SNDSERV=sndserv)

dnl --- Always use highres mode, unless explicitely --disabled
AC_ARG_ENABLE(highres,[  --disable-highres	  disables support for resulutions greater than 320x200],,AC_DEFINE(HIGHRES))
dnl --- By default, simple checks with little overhead are done to catch memory corruption, or
dnl --- problems with new code
AC_ARG_ENABLE(checks,[  --disable-checks	  disables some basic internal sanity checks],,
AC_DEFINE(SIMPLECHECKS)
AC_DEFINE(ZONEIDCHECK))
dnl --- Option to enable debugging
AC_ARG_ENABLE(debug,[  --enable-debug	  turns on various debugging features, like range checking and internal heap diagnostics],
AC_DEFINE(RANGECHECK)
AC_DEFINE(INSTRUMENTED)
AC_DEFINE(TIMEDIAG))
AC_ARG_ENABLE(heapcheck,[  --enable-heapcheck	  turns on continuous heap checking (very slow)],AC_DEFINE(CHECKHEAP))


dnl --- Decide what programs to build
if test "$no_x" != yes
then BUILD_LXDOOM=lxdoom
else
BUILD_LXDOOM=
fi

AC_SUBST(BUILD_SNDSERV)
AC_SUBST(BUILD_LXDOOM)
AC_SUBST(BUILD_LSDOOM)
AC_SUBST(LIB_XEXT)
AC_SUBST(LIB_XDGA)

dnl --- Pass install dirs to C pre-processor
dnl --- YUCK! but I can't see a better way to do this
if test "$prefix" = "NONE"
then prefix="/usr/local"
fi
if test "$exec_prefix" = "NONE"
then exec_prefix=$prefix
fi

dnl --- decide directories
gamesdir=$prefix/games
exp_gamesdir=`eval "echo $gamesdir"`
exp_datadir=`eval "echo $datadir"`
waddir=$exp_datadir/games/doom
dnl --- now finally spit them out
AC_DEFINE_UNQUOTED(SNDSERV_PATH,"$exp_gamesdir/sndserv")
AC_DEFINE_UNQUOTED(MUSSERV_PATH,"$exp_gamesdir/musserv")
AC_DEFINE_UNQUOTED(DOOMWADDIR,"$waddir")

dnl --- output
AC_OUTPUT(Makefile src/Makefile doc/Makefile data/Makefile lxdoom.spec)

dnl
dnl $Log: configure.in,v $
dnl Revision 1.16  2000/03/27 10:33:22  cph
dnl Bump version number
dnl
dnl Revision 1.15  2000/03/17 00:12:02  cph
dnl Bump version number
dnl Move SYS_CFLAGS stuff after compiler detection
dnl Add option to not set CPU optimisation flags (for RPMs)
dnl Test CPU optimisation flags (so gcc 2.7.2 works)
dnl
dnl Revision 1.14  2000/03/16 20:14:08  cph
dnl Add docs to make install, add RPM building
dnl
dnl Revision 1.13  2000/02/26 19:22:53  cph
dnl Add pid_t test for src/d_client.c, uid_t for l_video_svgalib.c, and sys/wait.h for src/d_client.c
dnl
dnl Revision 1.12  2000/02/19 23:49:09  cphipps
dnl Fix build problems on systems with X headers in include path by default
dnl
dnl Revision 1.11  2000/01/26 08:44:24  cphipps
dnl Support filio.h so Solaris can get the non-blocking socket ioctl
dnl
dnl Revision 1.10  2000/01/25 21:33:22  cphipps
dnl Fix security in case of being setuid
dnl
dnl Revision 1.9  1999/12/18 22:25:10  cphipps
dnl Remove -pipe from the CFLAGS, as this is only guaranteed to work with GNU as(1)
dnl
dnl Revision 1.8  1999/12/18 15:48:06  cphipps
dnl Use autoconf script to detect inet_aton
dnl
dnl Revision 1.7  1999/11/04 13:02:20  cphipps
dnl Remove check/use of libm
dnl
dnl Revision 1.6  1999/11/01 00:16:09  cphipps
dnl Added checks for inline and sys_siglist
dnl Update version number to 1.4.2
dnl
dnl Revision 1.5  1999/10/27 07:43:58  cphipps
dnl Added stuff to set up CFLAGS right for different architectures,
dnl thanks to patch from Josh Parsons.
dnl
dnl Revision 1.4  1999/10/18 19:16:42  cphipps
dnl Version 1.4.1
dnl
dnl Revision 1.3  1999/10/12 15:42:50  cphipps
dnl Changed version to 1.4.0
dnl
dnl Revision 1.2  1999/10/02 11:43:37  cphipps
dnl Added autoconf options to control diagnostics
dnl
dnl Revision 1.1  1999/09/10 19:52:44  cphipps
dnl Initial revision
dnl
dnl