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
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/js/js.h)
AM_INIT_AUTOMAKE(plib, 1.4.1)
# This AC_PREFIX_DEFAULT will place the library files
# into /usr/lib - but will put the include files into
# /usr/include - when /usr/include/plib would be less
# polluting to the filename space.
#
# There is probably a better way to do this.
AC_PREFIX_DEFAULT(/usr)
if echo $includedir | egrep "plib$" > /dev/null; then
echo "includedir is" $includedir "libdir is" $libdir
else
includedir="${includedir}/plib"
echo "includedir changed to" $includedir "libdir is" $libdir
fi
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_INSTALL
AC_PROG_RANLIB
dnl Command line arguments
dnl for Loring Holden's Solaris system
AC_ARG_WITH(GL,
[ --with-GL=DIR set the prefix directory where GL resides],
GL_PREFIX=$withval, GL_PREFIX=auto)
if test "x$GL_PREFIX" != "xauto"; then
LIBS="$LIBS -L$GL_PREFIX/lib"
CPPFLAGS="$CPPFLAGS -I$GL_PREFIX/include"
fi
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" != "xyes" ; then
dnl Check for X11
AC_PATH_XTRA
x_suffix="$X_LIBS $X_PRE_LIBS -lX11 -lXi -lXext -lXmu $X_EXTRA_LIBS -lm"
dnl =========================================================
dnl if test "x$x_includes" != "x"; then
dnl CPPFLAGS="$CPPFLAGS -I$x_includes"
dnl fi
dnl =========================================================
dnl Reasonable stuff non-windoze variants ... :-)
AC_CHECK_LIB(dl, dlclose)
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
dnl if using mesa, check for xmesa.h
if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
AC_CHECK_HEADER(GL/xmesa.h)
AM_CONDITIONAL(ENABLE_XMESA_FX, \
test "x$ac_cv_header_GL_xmesa_h" = "xyes")
else
dnl force a failed check
AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
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"
dnl check for glut...or freeglut
AC_CHECK_LIB(freeglut, glutGetModifiers,,,$opengl_LIBS)
if test "x$ac_cv_lib_freeglut_glutGetModifiers" = "xno" ; then
dnl if no freeglut, check for Real GLUT
AC_CHECK_LIB(glut, glutGetModifiers,,,$opengl_LIBS)
fi
LIBS="$LIBS $x_suffix"
else
dnl CygWin under Windoze.
dnl CygWin doesn't look in this directory
LIBS="$LIBS -L/usr/local/lib"
dnl OpenGL libraries
LIBS="$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_HEADER_STDC
dnl CygWin doesn't look in this directory
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
AC_CHECK_HEADERS(GL/gl.h GL/glu.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))
AC_CHECK_HEADER(GL/glut.h, AC_DEFINE(GLUT_IS_PRESENT))
AC_CHECK_HEADER(GL/freeglut.h, AC_DEFINE(FREEGLUT_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 -O6 -Wall"
CXXFLAGS="$CXXFLAGS -O6 -Wall"
fi
else
CFLAGS="$CFLAGS -O6 -Wall $MACH -malign-double -I/usr/local/include -L/usr/local/lib"
CXXFLAGS="$CXXFLAGS -O6 -Wall $MACH -malign-double -I/usr/local/include -L/usr/local/lib"
fi
dnl Checks for typedefs, structures, and compiler characteristics.
dnl check for socklen_t (in Unix98)
AC_MSG_CHECKING(for socklen_t)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
socklen_t x;
],[],[
AC_MSG_RESULT(yes)],[
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
int accept (int, struct sockaddr *, size_t *);
],[],[
AC_MSG_RESULT(size_t)
AC_DEFINE(socklen_t,size_t)], [
AC_MSG_RESULT(int)
AC_DEFINE(socklen_t,int)])])
AC_OUTPUT( \
Makefile \
src/Makefile \
src/js/Makefile \
src/util/Makefile \
src/pui/Makefile \
src/sg/Makefile \
src/sl/Makefile \
src/ssg/Makefile \
src/ssgAux/Makefile \
src/fnt/Makefile \
src/net/Makefile )
|