From 88701b5038d60c65969b6b66494804c6ed1691be Mon Sep 17 00:00:00 2001 From: Marcus Sundberg Date: Sat, 20 May 2000 03:27:04 +0000 Subject: [PATCH] Added MGL target. --- configure.in | 43 +++++++++++++++++++++++++++++++++++++++++-- source/Makefile.am | 19 +++++++++++-------- 2 files changed, 52 insertions(+), 10 deletions(-) diff --git a/configure.in b/configure.in index 03878ff..a1b3e86 100644 --- a/configure.in +++ b/configure.in @@ -176,6 +176,42 @@ fi dnl Checks for working -lm AC_CHECK_LIB(m, pow,, AC_MSG_ERROR([math library (-lm) appears broken])) +dnl Checks for MGL support +AC_ARG_WITH(mgl, +[ --with-mgl[=DIR] use MGL found in DIR], +HAVE_MGL=$withval, HAVE_MGL=auto) +if test "x$HAVE_MGL" != xno; then + if test "x$ac_cv_header_windows_h" != "xyes"; then + HAVE_MGL=no + else + if test "x$HAVE_MGL" != xauto; then + MGL_CFLAGS="$MGL_CFLAGS -I$withval/include" + MGL_LIBS="$MGL_LIBS -L$withval/lib" + fi + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $MGL_CFLAGS" + AC_CHECK_HEADER(mgraph.h, HAVE_MGL=yes, HAVE_MGL=no) + CPPFLAGS="$save_CPPFLAGS" + + dnl Make sure -lmgllt or -lmglfx works + if test "x$HAVE_MGL" = xyes; then + for lib in mglfx mgllt; do + MGL_LIBS="$MGL_LIBS -lgdi32 -lwinmm -ldinput -lddraw" + AC_CHECK_LIB($lib,MGL_registerDriver, + MGL_LIBS="-l$lib $MGL_LIBS" + HAVE_MGL=yes + break, HAVE_MGL=no, [$MGL_LIBS]) + done + fi + fi + if test "x$HAVE_MGL" != xyes; then + MGL_CFLAGS="" MGL_LIBS="" + fi +fi +AC_SUBST(HAVE_MGL) +AC_SUBST(MGL_CFLAGS) +AC_SUBST(MGL_LIBS) + dnl Checks for LibGGI support AC_ARG_WITH(ggi, [ --with-ggi[=DIR] use LibGGI found in DIR], @@ -557,12 +593,15 @@ dnl ================================================================== dnl Find out what to build and finish dnl ================================================================== -if test "x$HAVE_SVGA" = xyes; then - TARGETS="$TARGETS qf-client-svga\$(EXEEXT)" +if test "x$HAVE_MGL" = xyes; then + TARGETS="$TARGETS qf-client-mgl\$(EXEEXT)" fi if test "x$HAVE_GGI" = xyes; then TARGETS="$TARGETS qf-client-ggi\$(EXEEXT)" fi +if test "x$HAVE_SVGA" = xyes; then + TARGETS="$TARGETS qf-client-svga\$(EXEEXT)" +fi if test "x$HAVE_X" = xyes; then TARGETS="$TARGETS qf-client-x11\$(EXEEXT)" if test "x$HAVE_GLX" = xyes; then diff --git a/source/Makefile.am b/source/Makefile.am index 2e3969b..0f5c2a4 100644 --- a/source/Makefile.am +++ b/source/Makefile.am @@ -1,11 +1,11 @@ ## Process this file with automake to produce Makefile.in -INCLUDES= -I$(top_srcdir)/include $(GGI_CFLAGS) $(SVGA_CFLAGS) $(X_CFLAGS) $(GLX_CFLAGS) +INCLUDES= -I$(top_srcdir)/include $(MGL_CFLAGS) $(GGI_CFLAGS) $(SVGA_CFLAGS) $(X_CFLAGS) $(GLX_CFLAGS) bin_PROGRAMS = @TARGETS@ -EXTRA_PROGRAMS= qf-server qf-client-ggi qf-client-svga qf-client-x11 \ - qf-client-glx +EXTRA_PROGRAMS= qf-server qf-client-mgl qf-client-ggi qf-client-svga \ + qf-client-x11 qf-client-glx if SYSTYPE_WIN32 cl_sys = sys_win.c cl_sys_win.c @@ -38,6 +38,7 @@ ogl_SOURCES= gl_draw.c gl_mesh.c gl_model.c gl_ngraph.c gl_part.c \ gl_refrag.c gl_rlight.c gl_rmain.c gl_rmisc.c gl_rsurf.c \ gl_screen.c gl_trans.c gl_view.c gl_warp.c +mgl_SOURCES= vid_mgl.c in_win.c ggi_SOURCES= vid_ggi.c svga_SOURCES= vid_svgalib.c x11_SOURCES= vid_x11.c @@ -48,16 +49,18 @@ EXTRA_qf_server_SOURCES= sys_unix.c cl_sys_unix.c sv_sys_unix.c \ sys_win.c cl_sys_win.c sv_sys_win.c qf_server_SOURCES= $(common_SOURCES) $(server_SOURCES) +qf_client_mgl_SOURCES= $(common_SOURCES) $(client_SOURCES) $(soft_SOURCES) $(mgl_SOURCES) qf_client_ggi_SOURCES= $(common_SOURCES) $(client_SOURCES) $(soft_SOURCES) $(ggi_SOURCES) qf_client_svga_SOURCES= $(common_SOURCES) $(client_SOURCES) $(soft_SOURCES) $(svga_SOURCES) qf_client_x11_SOURCES= $(common_SOURCES) $(client_SOURCES) $(soft_SOURCES) $(x11_SOURCES) qf_client_glx_SOURCES= $(common_SOURCES) $(client_SOURCES) $(ogl_SOURCES) $(glx_SOURCES) -LDADD = $(NET_LIBS) -qf_client_ggi_LDADD= $(GGI_LIBS) -qf_client_svga_LDADD= $(SVGA_LIBS) -qf_client_x11_LDADD= $(X_PRE_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) $(X_SHM_LIB) -qf_client_glx_LDADD= $(GLX_LIBS) $(X_PRE_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) +qf_server_LDADD= $(NET_LIBS) +qf_client_mgl_LDADD= $(MGL_LIBS) $(NET_LIBS) +qf_client_ggi_LDADD= $(GGI_LIBS) $(NET_LIBS) +qf_client_svga_LDADD= $(SVGA_LIBS) $(NET_LIBS) +qf_client_x11_LDADD= $(X_PRE_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) $(X_SHM_LIB) $(NET_LIBS) +qf_client_glx_LDADD= $(GLX_LIBS) $(X_PRE_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) $(NET_LIBS) EXTRA_DIST = makefile.winc makefile.wingl makefile.wins \ qw_client.dsp qw_server.dsp