changeset 288:259daddc2d6b

PhysicsFS support tied into build system.
author Ryan C. Gordon <icculus@icculus.org>
date Sat, 16 Mar 2002 08:48:00 +0000
parents 2444b4128efd
children fdf50bded850
files configure.in playsound/Makefile.am playsound/playsound.c
diffstat 3 files changed, 28 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Sat Mar 16 08:47:29 2002 +0000
+++ b/configure.in	Sat Mar 16 08:48:00 2002 +0000
@@ -226,6 +226,19 @@
   fi
 fi
 
+dnl Check for PhysicsFS http://icculus.org/physfs/
+AC_ARG_ENABLE(physfs,
+[  --enable-physfs            enable PhysicsFS in playsound [default=yes]],
+              , enable_physfs=yes)
+if test x$enable_physfs = xyes; then
+  AC_CHECK_HEADER(physfs.h, have_physfs_hdr=yes)
+  AC_CHECK_LIB(physfs, PHYSFS_init, have_physfs_lib=yes)
+  if test x$have_physfs_hdr = xyes -a x$have_physfs_lib = xyes; then
+    use_physicsfs="yes"
+  fi
+fi
+
+
 dnl Check for efence (!!! FIXME : This doesn't work.)
 dnl AC_ARG_ENABLE(efence,
 dnl [  --enable-efence            enable ElectricFence usage [default=no]],
@@ -253,6 +266,7 @@
 dnl Add Makefile conditionals
 AM_CONDITIONAL(USE_TIMIDITY, test x$enable_midi = xyes)
 AM_CONDITIONAL(USE_MPGLIB, test x$enable_mpglib = xyes)
+AM_CONDITIONAL(USE_PHYSICSFS, test x$use_physicsfs = xyes)
 
 AC_OUTPUT([
 Makefile
--- a/playsound/Makefile.am	Sat Mar 16 08:47:29 2002 +0000
+++ b/playsound/Makefile.am	Sat Mar 16 08:48:00 2002 +0000
@@ -2,4 +2,17 @@
 
 INCLUDES = -I$(top_srcdir)
 
-playsound_LDADD = ../libSDL_sound.la
+if USE_PHYSICSFS
+PHYSFS_CFLG = -DSUPPORT_PHYSFS=1
+PHYSFS_SRCS = physfsrwops.c
+PHYSFS_LIBS = -lphysfs
+else
+PHYSFS_CFLG =
+PHYSFS_SRCS =
+PHYSFS_LIBS =
+endif
+
+playsound_CFLAGS = $(PHYSFS_CFLG)
+playsound_LDADD = ../libSDL_sound.la $(PHYSFS_LIBS)
+playsound_SOURCES = playsound.c $(PHYSFS_SRCS)
+
--- a/playsound/playsound.c	Sat Mar 16 08:47:29 2002 +0000
+++ b/playsound/playsound.c	Sat Mar 16 08:48:00 2002 +0000
@@ -33,7 +33,6 @@
 #include "SDL.h"
 #include "SDL_sound.h"
 
-#define SUPPORT_PHYSFS 0
 #if SUPPORT_PHYSFS
 #include <alloca.h>
 #include "physfs.h"