-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
163 lines (122 loc) · 4.4 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT([tux_aqfh],[1.0.14])
AC_CONFIG_SRCDIR([src/tux.cxx])
AM_INIT_AUTOMAKE([1.16])
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_CHECK_FUNCS([floor])
AC_CHECK_FUNCS([gettimeofday])
AC_CHECK_FUNCS([pow])
AC_CHECK_FUNCS([select])
AC_CHECK_FUNCS([sqrt])
AC_CHECK_FUNCS([strtol])
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS([unistd.h])
AC_C_INLINE
AC_FUNC_STRTOD
plib_suffix="-lplibsl -lplibssg -lplibpu -lplibfnt -lplibsg -lplibul"
AC_PREREQ([2.71])
dnl List files of a given extension in a given directory
file_list() {
for f in $top_srcdir/$1/*.$2; do
echo $(basename $f)
done
}
dnl # Create the list of files
AC_SUBST([DAT_FILES], [$(file_list data dat)])
AC_SUBST([HTML_FILES], [$(file_list doc html)])
AC_SUBST([PNG_FILES], [$(file_list doc png)])
AC_SUBST([TXF_FILES], [$(file_list fonts txf)])
AC_SUBST([RGB_FILES], [$(file_list images rgb)])
AC_SUBST([RGBA_FILES], [$(file_list images rgba)])
AC_SUBST([INT_FILES], [$(file_list images int)])
AC_SUBST([INTA_FILES], [$(file_list images inta)])
AC_SUBST([AC_FILES], [$(file_list models ac)])
AC_SUBST([MOD_FILES], [$(file_list mods mod)])
AC_SUBST([WAV_FILES], [$(file_list wavs wav)])
AC_SUBST([PENGUIN_AC_FILES], [$(file_list penguin ac)])
AC_SUBST([PENGUIN_RGB_FILES], [$(file_list penguin rgb)])
AC_SUBST([PENGUIN_RGBA_FILES], [$(file_list penguin rgba)])
AC_SUBST([SLAM_FILES], [$(file_list slamcode slam)])
dnl Checks for library functions.
dnl check for OpenGL related libraries
AC_CHECK_HEADER(windows.h, AC_DEFINE(WIN32))
if test "x$ac_cv_header_windows_h" = "xno" ; then
dnl Check for X11
AC_PATH_XTRA
x_suffix="$X_LIBS $X_PRE_LIBS -lpthread -lX11 -lXi -lXext -lXmu $X_EXTRA_LIBS -lm"
dnl Reasonable stuff non-windoze variants ... :-)
AC_CHECK_LIB(GL, glNewList,,,$x_suffix)
if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
dnl if no GL, check for MesaGL
AC_CHECK_LIB(MesaGL, glNewList,,,$x_suffix)
fi
AC_CHECK_LIB(GLU, gluLookAt,,,$x_suffix)
if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
dnl if no GLU, check for MesaGLU
AC_CHECK_LIB(MesaGLU, gluLookAt,,,$x_suffix)
fi
opengl_LIBS="$LIBS $x_suffix"
AC_CHECK_LIB(glut, glutGetModifiers,,,$opengl_LIBS)
if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno" ; then
dnl if no GLUT, check for freeglut
AC_CHECK_LIB(freeglut, glutGetModifiers,,,$opengl_LIBS)
fi
LIBS="$plib_suffix $LIBS $x_suffix"
else
dnl CygWin under Windoze.
LIBS="$plib_suffix $LIBS -lm -lwinmm -lglut32 -lglu32 -lopengl32 -luser32 -lgdi32"
fi
dnl Check SGI audio library
AC_CHECK_LIB(audio, ALopenport)
if test "x$ac_cv_lib_audio_ALopenport" = "xyes" ; then
dnl this is an SGI machine...
LIBS="$LIBS -laudio"
fi
dnl Checks for header files.
AC_CHECK_HEADERS(GL/gl.h GL/glu.h GL/glut.h)
AC_CHECK_HEADER(windows.h, AC_DEFINE(WIN32))
AC_CHECK_HEADER(joystick.h, AC_DEFINE(JOYSTICK_IS_PRESENT))
AC_CHECK_HEADER(linux/joystick.h, AC_DEFINE(LINUX_JOYSTICK_IS_PRESENT))
dnl Check for audio support
AM_CONDITIONAL(ENABLE_AUDIO, \
test -r /usr/include/soundcard.h \
-o -r /usr/include/linux/soundcard.h \
-o -r /usr/include/machine/soundcard.h \
-o -r /usr/include/audio.h \
-o "x$ac_cv_header_windows_h" = "xyes" )
AM_CONDITIONAL(ENABLE_IRIX_AUDIO, test -r /usr/include/audio.h)
AM_CONDITIONAL(ENABLE_WIN32_AUDIO, test "x$ac_cv_header_windows_h" = "xyes")
if test "x$ac_cv_header_windows_h" != "xyes" ; then
if test "x$GXX" != "xyes" ; then
CFLAGS="$CFLAGS -I/usr/local/include -L/usr/local/lib"
CXXFLAGS="$CXXFLAGS -I/usr/local/include -L/usr/local/lib"
else
CFLAGS="$CFLAGS"
CXXFLAGS="$CXXFLAGS"
fi
else
CFLAGS="$CFLAGS $MACH -malign-double -I/usr/local/include -L/usr/local/lib"
CXXFLAGS="$CXXFLAGS $MACH -malign-double -I/usr/local/include -L/usr/local/lib"
fi
MY_EXPAND_DIR(tux_aqfh_datadir, "$datadir/games/$PACKAGE")
AC_DEFINE_UNQUOTED(TUX_AQFH_DATADIR, "$tux_aqfh_datadir")
AC_CONFIG_FILES([Makefile \
contrib/Makefile \
data/Makefile \
doc/Makefile \
fonts/Makefile \
images/Makefile \
models/Makefile \
mods/Makefile \
penguin/Makefile \
slamcode/Makefile \
src/Makefile \
wavs/Makefile \
])
AC_OUTPUT