summaryrefslogtreecommitdiff
blob: aeaf74aeafbe7503c69c93432b60f3282b6c6042 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- src/Linux/configure.in.old	2006-12-14 10:32:12.000000000 +0100
+++ src/Linux/configure.in	2006-12-14 10:49:26.000000000 +0100
@@ -9,6 +9,8 @@
 AC_CONFIG_HEADER(autoconfig.h)
 AC_CONFIG_FILES([Makefile])
 
+PKG_PROG_PKG_CONFIG
+
 # Define arguments.
 AC_ARG_ENABLE(debug,[  --enable-debug          Enable debug mode],
   [if test "$enableval" = "yes"
@@ -49,7 +51,7 @@
 if test "$HAVE_SDL_CONFIG" = "yes"
 then
   CFLAGS="`sdl-config --cflags` $CFLAGS"
-  LIBSS="`sdl-config --libs` $LIBS"
+  LIBS="`sdl-config --libs` $LIBS"
 else
   AC_MSG_WARN([Can't find sdl-config, guessing required headers and libraries.])
 fi
@@ -94,16 +96,14 @@
 fi
 
 # Checks for libpng.
-AC_CHECK_PROG(HAVE_LIBPNG_CONFIG, [libpng-config], yes)
-if test "$HAVE_LIBPNG_CONFIG" = "yes"
+if PKG_CHECK_MODULES(LIBPNG, libpng)
 then
-  CFLAGS="`libpng-config --cflags` $CFLAGS"
-  LDFLAGS="`libpng-config --ldflags` $LDFLAGS"
+    CFLAGS="$LIBPNG_CFLAGS $CFLAGS"
+    LIBS="$LIBPNG_LIBS $LIBS"
 else
-  AC_MSG_WARN([Can't find libpng-config, guessing required headers and libraries.])
+  AC_CHECK_HEADERS([png.h], , AC_MSG_ERROR([Can't find libpng header.]))
+  AC_CHECK_LIB([png], [png_decompress_chunk], , AC_MSG_ERROR([Can't find libpng library.]))
 fi
-AC_CHECK_HEADERS([png.h], , AC_MSG_ERROR([Can't find libpng header.]))
-AC_CHECK_LIB([png], [png_decompress_chunk], , AC_MSG_ERROR([Can't find libpng library.]))
 
 # Checks for Ogg.
 AC_CHECK_LIB([ogg], [ogg_stream_init], , AC_MSG_ERROR([Can't find Ogg library.]))