From bd584d5985d5f4a1c2de7bbef797bcdb89085167 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 9 Aug 2002 19:47:35 +0000 Subject: [PATCH] Added qpak.c to build systems. --- Makefile.am.newautomake | 1 + archivers/Makefile.am | 3 ++- configure.in | 13 ++++++++++++- makeos2.cmd | 3 ++- physfs.c | 15 +++++++++++++++ 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/Makefile.am.newautomake b/Makefile.am.newautomake index 6e9c852c..7495d10f 100644 --- a/Makefile.am.newautomake +++ b/Makefile.am.newautomake @@ -49,6 +49,7 @@ libphysfs_la_SOURCES = \ archivers/dir.c \ archivers/grp.c \ archivers/zip.c \ + archivers/qpak.c \ platform/unix.c \ platform/posix.c \ $(ZLIB_SRC) diff --git a/archivers/Makefile.am b/archivers/Makefile.am index e4c5b273..2eed0211 100644 --- a/archivers/Makefile.am +++ b/archivers/Makefile.am @@ -9,5 +9,6 @@ endif libarchivers_la_SOURCES = \ dir.c \ grp.c \ - zip.c + zip.c \ + qpak.c diff --git a/configure.in b/configure.in index 0cd49fee..de5c2bf0 100644 --- a/configure.in +++ b/configure.in @@ -108,7 +108,7 @@ if test x$enable_zip = xyes; then fi -dnl Check for zip archiver inclusion... +dnl Check for grp archiver inclusion... AC_ARG_ENABLE(grp, [ --enable-grp enable Build Engine GRP support [default=yes]], , enable_grp=yes) @@ -117,6 +117,15 @@ if test x$enable_grp = xyes; then fi +dnl Check for qpak archiver inclusion... +AC_ARG_ENABLE(qpak, +[ --enable-qpak enable Quake PAK support [default=yes]], + , enable_qpak=yes) +if test x$enable_qpak = xyes; then + AC_DEFINE([PHYSFS_SUPPORTS_QPAK], 1, [define if qpak support is enabled]) +fi + + AC_ARG_ENABLE(internal-zlib, [ --enable-internal-zlib use included zlib [default=only if needed]], , enable_internal_zlib=maybe) @@ -415,6 +424,8 @@ dnl AC_TYPE_SIZE_T AC_FUNC_MEMCMP AC_CHECK_FUNCS([memset strrchr]) +AC_CHECK_SIZEOF(int, 4) + CFLAGS="$CFLAGS -D_REENTRANT -D_THREAD_SAFE" LDFLAGS="$LDFLAGS -no-undefined" diff --git a/makeos2.cmd b/makeos2.cmd index 1b683f3f..0b9d3f49 100644 --- a/makeos2.cmd +++ b/makeos2.cmd @@ -7,7 +7,7 @@ rem Patches go to icculus@clutteredmind.org ... set PHYSFSLANG=PHYSFS_LANG_ENGLISH set DEBUGFLAGS=-D_NDEBUG -O2 -s -set CFLAGS=%DEBUGFLAGS% -Wall -Werror -Zomf -Zmt -Zmtd -I. -Izlib114 -c -D__ST_MT_ERRNO__ -DOS2 -DPHYSFS_SUPPORTS_ZIP -DPHYSFS_SUPPORTS_GRP -DPHYSFS_LANG=%PHYSFSLANG% +set CFLAGS=%DEBUGFLAGS% -Wall -Werror -Zomf -Zmt -Zmtd -I. -Izlib114 -c -D__ST_MT_ERRNO__ -DOS2 -DPHYSFS_SUPPORTS_ZIP -DPHYSFS_SUPPORTS_GRP -DPHYSFS_SUPPORTS_QPAK -DPHYSFS_LANG=%PHYSFSLANG% @echo on mkdir bin @@ -107,6 +107,7 @@ gcc %CFLAGS% -o bin/os2.obj platform/os2.c gcc %CFLAGS% -o bin/dir.obj archivers/dir.c gcc %CFLAGS% -o bin/grp.obj archivers/grp.c gcc %CFLAGS% -o bin/zip.obj archivers/zip.c +gcc %CFLAGS% -o bin/zip.obj archivers/qpak.c gcc %CFLAGS% -o bin/adler32.obj zlib114/adler32.c gcc %CFLAGS% -o bin/compress.obj zlib114/compress.c diff --git a/physfs.c b/physfs.c index 52329d31..d0f11ee1 100644 --- a/physfs.c +++ b/physfs.c @@ -57,8 +57,15 @@ extern const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_GRP; extern const DirFunctions __PHYSFS_DirFunctions_GRP; #endif +#if (defined PHYSFS_SUPPORTS_QPAK) +extern const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_QPAK; +extern const DirFunctions __PHYSFS_DirFunctions_QPAK; +#endif + extern const DirFunctions __PHYSFS_DirFunctions_DIR; + +// !!! FIXME: This is stored with dirFunctions now, too. static const PHYSFS_ArchiveInfo *supported_types[] = { #if (defined PHYSFS_SUPPORTS_ZIP) @@ -69,6 +76,10 @@ static const PHYSFS_ArchiveInfo *supported_types[] = &__PHYSFS_ArchiveInfo_GRP, #endif +#if (defined PHYSFS_SUPPORTS_QPAK) + &__PHYSFS_ArchiveInfo_QPAK, +#endif + NULL }; @@ -82,6 +93,10 @@ static const DirFunctions *dirFunctions[] = &__PHYSFS_DirFunctions_GRP, #endif +#if (defined PHYSFS_SUPPORTS_QPAK) + &__PHYSFS_DirFunctions_QPAK, +#endif + &__PHYSFS_DirFunctions_DIR, NULL };