forked from quozl/netrek-client-cow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
204 lines (167 loc) · 6.47 KB
/
configure.ac
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
dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Netrek installation
dnl to configure the system for the local environment.
AC_INIT(name.c)
AC_CANONICAL_SYSTEM
AC_CONFIG_HEADER(config.h)
AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_CPP
AC_PROG_LN_S
AC_AIX
AC_C_INLINE
#--------------------------------------------------------------------
# Include sys/select.h if it exists and if it supplies things
# that appear to be useful. This appears to be true only on
# the RS/6000 under AIX. Some systems like OSF/1 have a
# sys/select.h that's of no use, and other systems like SCO
# UNIX have a sys/select.h that's pernicious. If there isn't
# a sys/select.h, then make sure that "fd_set" is defined in
# sys/types.h.
#--------------------------------------------------------------------
AC_MSG_CHECKING(if fd_set requires sys/select.h)
AC_TRY_COMPILE( [#include <sys/types.h>], [fd_set readMask, writeMask;],
AC_MSG_RESULT(no) ,
AC_EGREP_HEADER(fd_set, sys/select.h,
AC_DEFINE(NEED_SYS_SELECT_H) AC_MSG_RESULT(yes),
AC_DEFINE(NO_FD_SET) AC_MSG_RESULT(fd_set missing)))
#--------------------------------------------------------------------
# Check for various typedefs and provide substitutes if
# they don't exist.
#--------------------------------------------------------------------
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h memory.h math.h stdlib.h)
AC_CHECK_HEADERS(sys/timeb.h sys/ptyio.h sys/fcntl.h fcntl.h)
AC_CHECK_HEADERS(ctype.h machine/endian.h sys/resource.h)
AC_CHECK_HEADERS(sys/wait.h netinet/in.h netinet/tcp.h sys/filio.h)
AC_TYPE_PID_T
AC_TYPE_UID_T
AC_TYPE_SIZE_T
AC_FUNC_VFORK
AC_STRUCT_TM
AC_MSG_CHECKING(for itimer in time.h)
AC_EGREP_HEADER(itimerval, time.h, AC_MSG_RESULT(yes) , AC_DEFINE(NEED_SYS_TIME_H) AC_MSG_RESULT(no))
AC_CHECK_SIZEOF(long)
AC_MSG_CHECKING(for u_int in sys/types.h)
AC_EGREP_HEADER(u_int, sys/types.h, AC_MSG_RESULT(yes) , AC_DEFINE(NO_U_INT) AC_MSG_RESULT(no))
AC_MSG_CHECKING(for PATH_MAX in limits.h)
AC_EGREP_CPP(PATH_MAX, [
#include <limits.h>
PATH_MAX
], AC_DEFINE(NO_PATH_MAX) AC_MSG_RESULT(no), AC_MSG_RESULT(yes))
AC_CHECK_FUNCS(strcmpi strncmpi)
#--------------------------------------------------------------------
# Locate the X11 header files and the X11 library archive.
#--------------------------------------------------------------------
AC_PATH_X
AC_DEFINE(HAVE_X11)
AC_DEFINE(HAVE_X11_XPM_H)
NOWIN32="#"
if test -z "$NOX11" ; then
if test -z "$x_libraries" ; then
echo checking for X11 header files
XINCLUDES=""
AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="nope")
if test "$XINCLUDES" = nope; then
dirs="/usr/unsupported/include /usr/local/include /usr/X386/include \
/usr/include/X11R4 /usr/X11R5/include /usr/include/X11R5 \
/usr/openwin/include /usr/X11/include /pub/X11R5/include \
/usr/local/X11R5/include /usr/X11R6/include /usr/include/X11R6 \
/pub/X11R6/include /usr/local/X11R6/include"
for i in $dirs ; do
if test -r $i/X11/Intrinsic.h; then
XINCLUDES=" -I$i"
fi
done
fi
if test "$XINCLUDES" = nope; then
echo "Warning: couldn't find any X11 include files."
XINCLUDES=""
fi
echo "checking for X11 library archive"
AC_CHECK_LIB(X11, main, XLIBSWLIB="-lX11", XLIBSWLIB=nope)
if test "$XLIBSWLIB" = nope; then
dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib \
/usr/lib/X11R4 /usr/X11R5/lib /usr/lib/X11R5 /usr/openwin/lib \
/usr/X11/lib /pub/X11R5/lib /usr/local/X11R5/lib \
/usr/X11R6/lib /usr/lib/X11R6 /pub/X11R6/lib /usr/local/X11R6/lib"
for i in $dirs ; do
if test -r $i/libX11.a; then
XLIBSWDIR="-L$i"
XLIBSWLIB="-lX11"
fi
done
fi
if test "$XLIBSWLIB" = nope ; then
AC_CHECK_LIB(Xwindow, main, XLIBSWLIB=-lXwindow)
fi
if test "$XLIBSWLIB" = nope ; then
echo "Warning: couldn't find the X11 library archive. Using -lX11."
XLIBSWLIB=-lX11
fi
else
XINCLUDES="-I$x_includes"
XLIBSWDIR="-L$x_libraries"
XLIBSWLIB="-lX11"
fi
fi
AC_SUBST(NOX11)
AC_SUBST(NOWIN32)
SAVELIBS="$LIBS"
LIBS="$LIBS $XLIBSWDIR $XLIBSWLIB"
SAVEINCS="$INCS"
INCS="$INCS $XINCLUDES"
AC_CHECK_LIB(Xpm, main, [AC_DEFINE(HAVE_XPM) XPMLIBS="-lXpm"])
AC_CHECK_HEADERS(X11/xpm.h)
LIBS="$SAVELIBS"
INCS="$SAVEINCS"
# Fix link order for Xpm
XLIBSW="$XLIBSWDIR $XPMLIBS $XLIBSWLIB"
INCS="$INCS $XINCLUDES"
AC_SUBST(INCS)
LIBS="$LIBS $XLIBSW"
#--------------------------------------------------------------------
# Check for the existence of various libraries. The order here
# is important, so that then end up in the right order in the
# command line generated by Make.
#--------------------------------------------------------------------
AC_CHECK_LIB(Xbsd, main, [LIBS="$LIBS -lXbsd"])
AC_CHECK_LIB(socket, main, [LIBS="$LIBS -lsocket"])
AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"])
AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])
AC_CHECK_LIB(seq, main, [LIBS="$LIBS -lseq"])
AC_CHECK_LIB(sun, main, [LIBS="$LIBS -lsun"])
#--------------------------------------------------------------------
# Check for type of signals
#--------------------------------------------------------------------
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(usleep random setstate strftime ftime)
AC_CHECK_LIB(m, main, [LIBS="$LIBS -lm"])
AC_CHECK_FUNCS(nint)
AC_EGREP_HEADER(rint, math.h, , AC_DEFINE(NEED_RINT_DEC))
AC_REPLACE_FUNCS(usleep setstate strdup rint)
#--------------------------------------------------------------------
# Check for system dependent programs
#--------------------------------------------------------------------
#--------------------------------------------------------------------
# Check for Imlib
#--------------------------------------------------------------------
AC_SEARCH_LIBS([imlib_load_image], [Imlib2], [],
[AC_MSG_ERROR([Could not find Imlib2])])
#--------------------------------------------------------------------
# Check for SDL
#--------------------------------------------------------------------
AM_PATH_SDL(1.2.4, AC_DEFINE(HAVE_SDL),[])
AM_CONDITIONAL(HAVE_SDL, [test x"$no_sdl" != x"yes"])
if test x$no_sdl != xyes; then
have_SDLmixer=no
AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio, [have_SDLmixer=yes SDL_MIXER_LIBS="-lSDL_mixer"])
if test x$have_SDLmixer != xyes; then
AC_MSG_ERROR([*** Can't find the SDL_mixer library Try: http://www.libsdl.org/projects/SDL_mixer/])
AC_SUBST(SDL_MIXER_LIBS)
fi
fi
#--------------------------------------------------------------------
# Emit output
#--------------------------------------------------------------------
AC_OUTPUT(system.mk)