dnl set the $host variable based on local machine/os
AC_CANONICAL_HOST
-dnl Used on the Irix platform
-AR="ar"
-ARFLAGS="cru"
case "${host}" in
*-*-irix*)
if test "$CXX" = "CC"; then
AR="CC -ar"
ARFLAGS="-o"
+ else
+ AR="ar"
+ ARFLAGS="cru"
fi
;;
+*)
+ AR="ar"
+ ARFLAGS="cru"
+ ;;
esac
AC_SUBST(AR)
AC_SUBST(ARFLAGS)
dnl build a Makefile.in from a Makefile.am which lets us define custom
dnl includes, compile alternative source files, etc.
-# Check for external variables daylight and timezone.
+dnl Check for external variables daylight and timezone.
AC_EXT_DAYLIGHT
if test "$have_daylight" = yes; then
AC_DEFINE([HAVE_DAYLIGHT], 1, [Define if system has daylight variable])
AC_DEFINE([HAVE_TIMEZONE], 1, [Define if system has timezone variable])
fi
-# Check for audio support
+dnl add correct audio libs and configure for audio support
audio_LIBS="-lplibsl -lplibsm"
case "${host}" in
*-*-cygwin* | *-*-mingw32*)
esac
AC_SUBST(audio_LIBS)
+dnl ENABLE_AUDIO_SUPPORT could be depricated at any time in favor of
+dnl just assuming we have audio support on all platform. We can
+dnl depend on plib to hide the details.
+AC_DEFINE([ENABLE_AUDIO_SUPPORT], 1, [Define for audio support])
+
dnl X11 might be installed on Mac OS X or cygwin/mingwin, we don't want
dnl to use it if it is.
case "${host}" in
AC_CHECK_LIB(m, cos)
-dnl MINGW requires libwsock32
-if test "x$is_mingw" = "xyes" ; then
- LIBS="$LIBS -lws2_32"
-fi
-
base_LIBS="$LIBS"
dnl Thread related checks
AC_CHECK_LIB(pthread, pthread_exit)
AC_CHECK_LIB(socket, socket)
+dnl check for glut location
+AC_CHECK_HEADER(GL/glut.h)
+if test "x$ac_cv_header_GL_glut_h" = "xyes"; then
+ AC_DEFINE([GLUT_H], "GL/glut.h", [Define as glut.h include location])
+else
+ AC_CHECK_HEADER(GLUT/glut.h)
+ if test "x$ac_cv_header_GLUT_glut_h" = "xyes"; then
+ AC_DEFINE([GLUT_H], "GLUT/glut.h", [Define as glut.h include location])
+ else
+ echo "Neither GL/glut.h nor GLUT/glut.h found. Cannot continue"
+ exit
+ fi
+fi
+
dnl check for OpenGL related libraries
case "${host}" in
*-*-cygwin* | *-*-mingw32*)
dnl add -lwsock32 for mingwin
case "${host}" in
*-*-mingw32*)
- LIBS="$LIBS -lws2_32"
+ echo "********** BUILDING FOR MINGW32 *************"
+ base_LIBS="$base_LIBS -lws2_32"
;;
esac
AC_CHECK_LIB(MesaGLU, gluLookAt)
fi
- LIBS="$LIBS -lglut"
+ AC_CHECK_LIB(glut, glutGetModifiers)
+ if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno" ; then
+ dnl if no "real" glut, check for freeglut
+ AC_CHECK_LIB(freeglut, glutGetModifiers)
+ fi
;;
esac
-dnl check for glut location
-AC_CHECK_HEADER(GL/glut.h)
-if test "x$ac_cv_header_GL_glut_h" = "xyes"; then
- AC_DEFINE([GLUT_H], "GL/glut.h", [Define as glut.h include location])
-else
- AC_CHECK_HEADER(GLUT/glut.h)
- if test "x$ac_cv_header_GLUT_glut_h" = "xyes"; then
- AC_DEFINE([GLUT_H], "GLUT/glut.h", [Define as glut.h include location])
- else
- echo "Neither GL/glut.h nor GLUT/glut.h found. Cannot continue"
- exit
- fi
-fi
-
opengl_LIBS="$LIBS"
LIBS="$base_LIBS"