Skip to content
Snippets Groups Projects
Commit 44cf0992 authored by slevy's avatar slevy
Browse files

Use (from Matt Hall) AC_CANONICAL_HOST rather than AC_MINGW32 to detect the latter.

Try different way of detecting opengl libs in mingw32 case too.
parent 5bed26eb
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,8 @@ dnl ---------------------------------------------------------------------------
AC_MSG_CHECKING([partiview])
AC_INIT(partibrains.c)
AC_INIT
AC_CONFIG_SRCDIR([partibrains.c])
AC_CONFIG_HEADER(config.h)
......@@ -19,10 +20,13 @@ dnl -- checks for system services
AC_HEADER_STDC
AC_CHECK_FUNCS(strchr memcpy snprintf strcasecmp rint sqrtf)
AC_CHECK_HEADERS(malloc.h)
AC_FUNC_ALLOCA
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_MAKE_SET
......@@ -34,8 +38,8 @@ AC_ARG_PROGRAM
AC_ARG_ENABLE(debug, [ --enable-debug compile for debugging], ok=$enableval, ok=no)
if test "$ok" = "yes"; then
CFLAGS="-g"
LDFLAGS="-g"
CFLAGS="${CFLAGS} -g"
LDFLAGS="${LDFLAGS} -g"
# should we define DEBUG too?
fi
......@@ -47,9 +51,14 @@ dnl AC_ARG_WITH(cave, [ --enable-cave compile for CAVE], with_cave=$enable
dnl ---------------------------------------------------------------------
dnl Building on Windows under MINGW32? Used below.
AC_MINGW32
AC_CANONICAL_HOST()
AC_DIAGNOSE([obsolete],[AC_MINGW32 is obsolete: use AC_CANONICAL_HOST and $host_os])case $host_os in
*mingw32* ) MINGW32=yes;;
* ) MINGW32=;;
esac
if test "yes" = "$MINGW32"; then
if test -n "$MINGW32"; then
PV_FLAGS="-D_WIN32"
PORT_OBJS="winjunk.o"
else
......@@ -133,17 +142,16 @@ if test "$with_mesa" != "yes"; then
fi
if test -z "$GLLIBS" && test "no" != "$with_mesa"; then
AC_CHECK_LIB(MesaGL, glBegin,
AC_CHECK_LIB(MesaGLU, gluProject, GLLIBS="-lMesaGLU -lMesaGL",
AC_CHECK_LIB(MesaGLU, gluProject, GLLIBS=[-lMesaGLU -lMesaGL],
:, -lMesaGL $XLIBS -lm), :, $XLIBS -lm)
fi
if test -z "$GLLIBS" && test -n "$MINGW32"; then
dnl Test for both -lglu32 and -lopengl32 together.
dnl Doesn't seem to work to use AC_CHECK_LIB(lib, func) here
dnl on Windows, so we use AC_HAVE_LIBRARY even though it's obsolete.
dnl on Windows, so we use AC_CHECK_LIB([],[main],[],[],[])ac_cv_lib_=ac_cv_lib__main even though it's obsolete.
dnl Feh.
AC_HAVE_LIBRARY(opengl32,
GLLIBS="-lopengl32 -lglu32", ,
-lglu32 $XLIBS -lm)
AC_CHECK_LIB([opengl32],[main],[GLLIBS="-lopengl32 -lglu32"],[],[-lglu32 $XLIBS -lm])ac_cv_lib_opengl32=ac_cv_lib_opengl32_main
fi
if test "$with_mesa" = "yes"; then
AC_CHECK_LIB(GL, glBegin,
......@@ -242,7 +250,7 @@ AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_TYPE_SIGNAL
AC_FUNC_VFORK
AC_FUNC_FORK([])
AC_FUNC_VPRINTF
AC_SEARCH_LIBS(sqrtf, [m], AC_DEFINE(HAVE_SQRTF))
......@@ -359,7 +367,8 @@ if test -f "$NEMOBIN/cc"; then
fi
AC_OUTPUT(Makefile ../cmed/Makefile)
AC_CONFIG_FILES([Makefile ../cmed/Makefile])
AC_OUTPUT
dnl ensure that "Makedepend" exists but don't put anything into it
dnl and force user to "make depend" to fill it in, since we're reconfiguring.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment