mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
autoconfiscate the png support
This commit is contained in:
parent
cb5f57fb51
commit
61a2840870
3 changed files with 32 additions and 2 deletions
18
configure.ac
18
configure.ac
|
@ -543,6 +543,22 @@ if test "x$enable_zlib" != "xno"; then
|
|||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(png,
|
||||
[ --disable-png disaple png support],
|
||||
)
|
||||
HAVE_PNG=no
|
||||
PNG_LIBS=""
|
||||
if test "x$enable_zlib" != "xno"; then
|
||||
AC_CHECK_LIB(png, png_set_read_fn, HAVE_PNG=yes, HAVE_PNG=no, [$LIBS])
|
||||
if test "x$HAVE_PNG" = "xyes"; then
|
||||
AC_CHECK_HEADER(png.h, HAVE_PNG=yes, HAVE_PNG=no)
|
||||
if test "x$HAVE_PNG" = "xyes"; then
|
||||
PNG_LIBS="-lpng"
|
||||
AC_DEFINE(HAVE_PNG, 1, [Define if you have libpng])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(PNG_LIBS)
|
||||
|
||||
AC_ARG_WITH(ipv6,
|
||||
[ --with-ipv6=DIR enable IPv6 support. Optional argument specifies
|
||||
|
@ -2185,7 +2201,7 @@ AC_MSG_RESULT([
|
|||
Sound support :${SOUND_TYPES- no}
|
||||
CD Audio system :${CDTYPE- no}
|
||||
IPv6 networking : $NETTYPE_IPV6
|
||||
Compression support: gz=$HAVE_ZLIB ogg=$HAVE_VORBIS
|
||||
Compression support: gz=$HAVE_ZLIB ogg=$HAVE_VORBIS png=$HAVE_PNG
|
||||
Compiler version : $CCVER
|
||||
Compiler flags : $CFLAGS
|
||||
qfcc cpp invocation: $CPP_NAME
|
||||
|
|
|
@ -5,7 +5,7 @@ INCLUDES= -I$(top_srcdir)/include
|
|||
lib_LTLIBRARIES= libQFimage.la
|
||||
|
||||
libQFimage_la_LDFLAGS= -version-info 1:0:0
|
||||
libQFimage_la_LIBADD= -lpng
|
||||
libQFimage_la_LIBADD= $(PNG_LIBS)
|
||||
libQFimage_la_DEPENDENCIES=
|
||||
libQFimage_la_SOURCES= \
|
||||
image.c pcx.c png.c tga.c
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
static __attribute__ ((unused)) const char rcsid[] =
|
||||
"$Id$";
|
||||
|
||||
#ifdef HAVE_PNG
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
@ -176,3 +178,15 @@ LoadPNG (QFile *infile)
|
|||
|
||||
return (tex);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include "QF/image.h"
|
||||
|
||||
tex_t *
|
||||
LoadPNG (QFile *infile)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue