File: build-Use-PKG_PROG_PKG_CONFIG-to-check-for-pkg-config.patch

package info (click to toggle)
libsdl1.2 1.2.15%2Bdfsg2-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 17,596 kB
  • sloc: ansic: 128,539; cpp: 11,192; sh: 9,887; asm: 2,553; objc: 2,128; makefile: 349; csh: 248; perl: 35; pascal: 8
file content (89 lines) | stat: -rw-r--r-- 3,812 bytes parent folder | download
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
From: Simon McVittie <smcv@debian.org>
Date: Tue, 30 Nov 2021 16:25:35 +0000
Subject: build: Use PKG_PROG_PKG_CONFIG to check for pkg-config

Part of f3bc60c4 "multiple updates to autotools build system from default
SDL2 branch" upstream.

Origin: upstream, commit:f3bc60c4
---
 configure.in | 52 +++-------------------------------------------------
 1 file changed, 3 insertions(+), 49 deletions(-)

diff --git a/configure.in b/configure.in
index 08c8e1e..6f638b5 100644
--- a/configure.in
+++ b/configure.in
@@ -60,6 +60,7 @@ AC_PROG_CXX
 AC_PROG_INSTALL
 AC_PROG_MAKE_SET
 AC_CHECK_TOOL(WINDRES, [windres], [:])
+PKG_PROG_PKG_CONFIG
 
 dnl Set up the compiler and linker flags
 INCLUDE="-I$srcdir/include"
@@ -493,20 +494,7 @@ CheckPulseAudio()
 AC_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]),
                   , enable_pulseaudio=yes)
     if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then
-        audio_pulse=no
-
-        PULSE_REQUIRED_VERSION=0.9
-
-        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-        AC_MSG_CHECKING(for PulseAudio $PULSE_REQUIRED_VERSION support)
-        if test x$PKG_CONFIG != xno; then
-            if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSE_REQUIRED_VERSION libpulse-simple; then
-                PULSE_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple`
-                PULSE_LIBS=`$PKG_CONFIG --libs libpulse-simple`
-                audio_pulse=yes
-            fi
-        fi
-        AC_MSG_RESULT($audio_pulse)
+        PKG_CHECK_MODULES([PULSE], [libpulse-simple >= 0.9], audio_pulse=yes, audio_pulse=no)
 
         if test x$audio_pulse = xyes; then
             AC_ARG_ENABLE(pulseaudio-shared,
@@ -1259,41 +1247,7 @@ CheckDirectFB()
 AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=yes]]]),
                   , enable_video_directfb=yes)
     if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
-        video_directfb=no
-
-        DIRECTFB_REQUIRED_VERSION=0.9.15
-
-        AC_PATH_PROG(DIRECTFBCONFIG, directfb-config, no)
-        if test x$DIRECTFBCONFIG = xno; then
-            AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-            if test x$PKG_CONFIG != xno; then
-                if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
-                    DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
-                    DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
-                    video_directfb=yes
-                fi
-            fi
-        else
-            set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'`
-            NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
-            set -- `directfb-config --version | sed 's/\./ /g'`
-            HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
-            if test $HAVE_VERSION -ge $NEED_VERSION; then
-                DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
-                DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
-                video_directfb=yes
-            fi
-        fi
-        if test x$video_directfb = xyes; then
-            # SuSE 11.1 installs directfb-config without directfb-devel
-            save_CFLAGS="$CFLAGS"
-            CFLAGS="$CFLAGS $DIRECTFB_CFLAGS"
-            AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no)
-            CFLAGS="$save_CFLAGS"
-            video_directfb=$have_directfb_hdr
-        fi
-        AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
-        AC_MSG_RESULT($video_directfb)
+        PKG_CHECK_MODULES([DIRECTFB], [directfb >= 0.9.15], video_directfb=yes, video_directfb=no)
 
         if test x$video_directfb = xyes; then
             AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB)