Added sound and CD configuration.

Compile system, sound and CD drivers into libraries which we link against.
Now Mingw32 compilation works.
This commit is contained in:
Marcus Sundberg 2000-05-21 00:15:03 +00:00
parent 84ff3a3c1b
commit 9d4db93b27
2 changed files with 167 additions and 32 deletions

View file

@ -41,6 +41,7 @@ dnl ==================================================================
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
@ -146,6 +147,7 @@ AC_TRY_COMPILE(
AC_MSG_RESULT(no)
)
dnl ==================================================================
dnl Checks for library functions.
dnl ==================================================================
@ -415,6 +417,127 @@ AC_SUBST(GLX_CFLAGS)
AC_SUBST(GLX_LIBS)
dnl ==================================================================
dnl Checks for system type
dnl ==================================================================
dnl Checks for which system driver to use
AC_MSG_CHECKING(for system driver)
case "${host}" in
i?86-*-mingw32*)
SYSTYPE=WIN32
AC_MSG_RESULT([Win32 driver])
;;
*)
SYSTYPE=POSIX
AC_MSG_RESULT([default POSIX driver])
;;
esac
AM_CONDITIONAL(SYSTYPE_WIN32, test "$SYSTYPE" = "WIN32")
dnl ==================================================================
dnl Checks for sound
dnl ==================================================================
dnl MME
AC_CHECK_LIB(mme,waveOutOpen,HAVE_LIBMME=yes)
if test -z "$SNDTYPE" -a "x$ac_cv_header_mme_mmsystem_h" = "xyes" -a \
"x$HAVE_LIBMME" = "xyes"; then
AC_EGREP_CPP([QF_maGiC_VALUE],[
#include <mme/mmsystem.h>
#ifdef WAVE_OPEN_SHAREABLE
QF_maGiC_VALUE
#endif
], SNDTYPE="MME"
SOUND_LIBS="-lmme")
fi
dnl OSS
if test -z "$SNDTYPE" -a "x$ac_cv_header_sys_soundcard_h" = "xyes"; then
AC_EGREP_CPP([QF_maGiC_VALUE],[
#include <sys/soundcard.h>
#ifdef SNDCTL_DSP_SETTRIGGER
QF_maGiC_VALUE
#endif
], SNDTYPE="OSS")
fi
if test -z "$SNDTYPE" -a "x$ac_cv_header_linux_soundcard_h" = "xyes"; then
AC_EGREP_CPP([QF_maGiC_VALUE],[
#include <linux/soundcard.h>
#ifdef SNDCTL_DSP_SETTRIGGER
QF_maGiC_VALUE
#endif
], SNDTYPE="OSS")
fi
if test -z "$SNDTYPE" -a "x$ac_cv_header_machine_soundcard_h" = "xyes"; then
AC_EGREP_CPP([QF_maGiC_VALUE],[
#include <machine/soundcard.h>
#ifdef SNDCTL_DSP_SETTRIGGER
QF_maGiC_VALUE
#endif
], SNDTYPE="OSS")
fi
dnl Win32
if test -z "$SNDTYPE" -a "x$ac_cv_header_windows_h" = "xyes" -a \
"x$ac_cv_header_mmsystem_h" = "xyes"; then
AC_EGREP_CPP([QF_maGiC_VALUE],[
#include <windows.h>
#include <mmsystem.h>
#ifdef GMEM_MOVEABLE
#ifdef WAVE_FORMAT_PCM
QF_maGiC_VALUE
#endif
#endif
], SNDTYPE="WIN32"
SOUND_LIBS="-lwinmm")
fi
AC_SUBST(SOUND_LIBS)
AM_CONDITIONAL(SNDTYPE_MME, test "$SNDTYPE" = "MME")
AM_CONDITIONAL(SNDTYPE_OSS, test "$SNDTYPE" = "OSS")
AM_CONDITIONAL(SNDTYPE_WIN32, test "$SNDTYPE" = "WIN32")
dnl ==================================================================
dnl Checks for CD-ROM
dnl ==================================================================
dnl Linux/BSD
AC_EGREP_CPP([QF_maGiC_VALUE],[
#include <linux/cdrom.h>
#ifdef CDROMREADTOCENTRY
QF_maGiC_VALUE
#endif
],
AC_DEFINE(USE_LINUX_CD)
CDTYPE=LINUX
,
AC_EGREP_CPP([QF_maGiC_VALUE],[
#include <sys/cdio.h>
#if defined (CDIOREADTOCENTRY) || defined (CDIOREADTOCENTRYS)
QF_maGiC_VALUE
#endif
], AC_DEFINE(USE_BSD_CD))
)
AC_HAVE_STRUCT_FIELD(struct ioc_read_toc_single_entry, entry,[
#include <sys/cdio.h>
])
dnl Win32
if test -z "$CDTYPE" -a "$SYSTYPE" = "WIN32"; then
CDTYPE="WIN32"
fi
AM_CONDITIONAL(CDTYPE_WIN32, test "$CDTYPE" = "WIN32")
AM_CONDITIONAL(CDTYPE_LINUX, test "$CDTYPE" = "LINUX")
dnl ==================================================================
dnl Checks for networking
dnl ==================================================================
NET_LIBS=""
if test "x$ac_cv_func_connect" != "xyes"; then
AC_MSG_CHECKING([for connect in -lwsock32])
@ -574,20 +697,6 @@ case "${host}" in
esac
AC_SUBST(ASM_ARCH)
dnl Checks for which system driver to use
AC_MSG_CHECKING(for system driver)
case "${host}" in
i?86-*-mingw32*)
SYSTYPE=WIN32
AC_MSG_RESULT([Win32 driver])
;;
*)
SYSTYPE=POSIX
AC_MSG_RESULT([default POSIX driver])
;;
esac
AM_CONDITIONAL(SYSTYPE_WIN32, test "$SYSTYPE" = "WIN32")
dnl ==================================================================
dnl Find out what to build and finish

View file

@ -7,24 +7,51 @@ bin_PROGRAMS = @TARGETS@
EXTRA_PROGRAMS= qf-server qf-client-mgl qf-client-ggi qf-client-svga \
qf-client-x11 qf-client-glx
noinst_LIBRARIES = libqfsys_cl.a libqfsys_sv.a libqfsnd.a libqfcd.a
if SYSTYPE_WIN32
cl_sys = sys_win.c cl_sys_win.c
sv_sys = sys_win.c sv_sys_win.c
libqfsys_cl_a_SOURCES = sys_win.c cl_sys_win.c
libqfsys_sv_a_SOURCES = sys_win.c sv_sys_win.c
else
cl_sys = sys_unix.c cl_sys_unix.c
sv_sys = sys_unix.c sv_sys_unix.c
libqfsys_cl_a_SOURCES = sys_unix.c cl_sys_unix.c
libqfsys_sv_a_SOURCES = sys_unix.c sv_sys_unix.c
endif
EXTRA_libqfsys_cl_a_SOURCES = sys_unix.c cl_sys_unix.c
EXTRA_libqfsys_sv_a_SOURCES = sys_unix.c sv_sys_unix.c
if SNDTYPE_WIN32
libqfsnd_a_SOURCES = snd_win.c
else
if SNDTYPE_OSS
libqfsnd_a_SOURCES = snd_oss.c
else
libqfsnd_a_SOURCES = snd_null.c
endif
endif
EXTRA_libqfsnd_a_SOURCES = snd_win.c snd_oss.c snd_null.c
if CDTYPE_WIN32
libqfcd_a_SOURCES = cd_win.c
else
if CDTYPE_LINUX
libqfcd_a_SOURCES = cd_linux.c
else
libqfcd_a_SOURCES = cd_null.c
endif
endif
EXTRA_libqfcd_a_SOURCES = cd_win.c cd_linux.c cd_null.c
common_SOURCES= net_chan.c net_com.c net_udp.c pmove.c pmovetst.c zone.c \
mdfour.c mathlib.c math.S cvar.c crc.c common.c model.c cmd.c
server_SOURCES= pr_cmds.c pr_edict.c pr_exec.c sv_init.c sv_main.c sv_misc.c \
sv_model.c sv_nchan.c sv_ents.c sv_send.c sv_move.c sv_phys.c \
sv_user.c sv_ccmds.c world.c worlda.S sv_cvar.c $(sv_sys)
sv_user.c sv_ccmds.c world.c worlda.S sv_cvar.c
client_SOURCES= cl_cmd.c cl_cvar.c cl_demo.c cl_ents.c cl_input.c cl_main.c \
cl_math.S cl_misc.c cl_parse.c cl_pred.c cl_tent.c cl_cam.c \
snd_oss.c cd_linux.c r_view.c wad.c snd_dma.c \
snd_mem.c snd_mix.c snd_mixa.S skin.c sbar.c nonintel.c \
menu.c keys.c console.c sys_x86.S cl_slist.c $(cl_sys)
r_view.c wad.c snd_dma.c snd_mem.c snd_mix.c snd_mixa.S \
skin.c sbar.c nonintel.c menu.c keys.c console.c \
sys_x86.S cl_slist.c
soft_SOURCES= cl_model.c cl_trans.c d_edge.c d_fill.c d_init.c d_modech.c \
d_part.c d_polyse.c d_scan.c d_sky.c d_sprite.c d_surf.c \
d_vars.c d_zpoint.c draw.c r_aclip.c r_alias.c r_bsp.c \
@ -44,10 +71,6 @@ svga_SOURCES= vid_svgalib.c
x11_SOURCES= vid_x11.c
glx_SOURCES= vid_glx.c
# We just has to list these once, but a plain EXTRA_SOURCES isn't allowed
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)
@ -55,12 +78,15 @@ qf_client_svga_SOURCES= $(common_SOURCES) $(client_SOURCES) $(soft_SOURCES) $(sv
qf_client_x11_SOURCES= $(common_SOURCES) $(client_SOURCES) $(soft_SOURCES) $(x11_SOURCES)
qf_client_glx_SOURCES= $(common_SOURCES) $(client_SOURCES) $(ogl_SOURCES) $(glx_SOURCES)
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)
CLIENT_LIBS = -L. -lqfsys_cl -lqfsnd -lqfcd $(SOUND_LIBS) $(NET_LIBS)
qf_server_LDADD= -L. -lqfsys_sv $(NET_LIBS)
qf_client_mgl_LDADD= $(MGL_LIBS) $(CLIENT_LIBS)
qf_client_ggi_LDADD= $(GGI_LIBS) $(CLIENT_LIBS)
qf_client_svga_LDADD= $(SVGA_LIBS) $(CLIENT_LIBS)
qf_client_x11_LDADD= $(X_PRE_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) $(X_SHM_LIB) $(CLIENT_LIBS)
qf_client_glx_LDADD= $(GLX_LIBS) $(X_PRE_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) $(CLIENT_LIBS)
EXTRA_DIST = makefile.winc makefile.wingl makefile.wins \
qw_client.dsp qw_server.dsp