Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configure.ac: modernize physfs check
Browse files Browse the repository at this point in the history
Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com>
hanetzer committed Jan 8, 2018
1 parent 2717179 commit 4179679
Showing 2 changed files with 12 additions and 16 deletions.
25 changes: 12 additions & 13 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -250,19 +250,18 @@ AS_IF([test x$enable_speex = xyes], [
])

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
enable_physfs="yes"
else
enable_physfs="no"
fi
fi

PKG_CHECK_MODULES([PHYSFS],[physfs],[physfs_found=yes],[physfs_found=no])
AC_ARG_ENABLE([physfs],
AS_HELP_STRING([--enable-physfs],[enable PhysicsFS in playsound [default=yes]]),
[],[enable_physfs=yes])
AS_IF([test x$enable_physfs = xyes], [
AS_IF([test x$physfs_found = xyes], [
enable_physfs="yes"
AX_APPEND_COMPILE_FLAGS([-DSUPPORT_PHYSFS],[PHYSFS_CFLAGS])
], [
enable_physfs="no"
])
])

# Checks for header files.
AC_HEADER_STDC
3 changes: 0 additions & 3 deletions playsound/Makefile.am
Original file line number Diff line number Diff line change
@@ -4,11 +4,8 @@ AM_CPPFLAGS = -I$(top_srcdir)

if USE_PHYSICSFS
PHYSFS_CFLG = -DSUPPORT_PHYSFS=1
PHYSFS_LIBS = -lphysfs
else
PHYSFS_CFLG =
PHYSFS_SRCS =
PHYSFS_LIBS =
endif

playsound_CFLAGS = $(PHYSFS_CFLG)

0 comments on commit 4179679

Please sign in to comment.