configure: fix disabled_packages test + treat oss dvb4linux alsa pulseaudio jack as packages instead of features (#3182)

This commit is contained in:
Aurelien David
2025-04-16 12:11:55 +02:00
parent d5116198de
commit d97e110629
3 changed files with 23 additions and 15 deletions

20
configure vendored
View File

@@ -675,6 +675,10 @@ for opt do
;;
--disable-alsa) append disabled_packages "alsa"
;;
--disable-oss) append disabled_packages "oss"
;;
--disable-dvb4linux) append disabled_packages "dvb4linux"
;;
--enable-gprof) gprof_build="yes";
;;
--static-build) static_build="yes";
@@ -1483,7 +1487,7 @@ config_package ()
pck_ldflags=""
pname="$1"
case "$disabled_packages" in
case "$disabled_packages " in
*"$pname "*) shift
eval "has_$pname=\"no\""
return
@@ -1771,14 +1775,14 @@ EOF
else
check_has_lib oss "" '#include <sys/ioctl.h>
config_package oss "" "" "" "" '#include <sys/ioctl.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/soundcard.h>
int main( void ) { return 0; }'
if test "$has_oss" = "no" ; then
check_has_lib oss "" '#include <sys/ioctl.h>
config_package oss "" "" "" "" '#include <sys/ioctl.h>
#include <unistd.h>
#include <fcntl.h>
#include <soundcard.h>
@@ -1813,19 +1817,17 @@ return 0;
}'
check_has_lib dvb4linux "" '#include <linux/dvb/dmx.h>
config_package dvb4linux "" "" "" "" '#include <linux/dvb/dmx.h>
#include <linux/dvb/frontend.h>
int main( void ) {return 0;}'
check_has_lib alsa "" '#include <alsa/asoundlib.h>
config_package alsa "libasound" "" "" "" '#include <alsa/asoundlib.h>
int main( void ) {return 0;}'
check_has_lib pulseaudio "" '#include <pulse/pulseaudio.h>
config_package pulseaudio "libpulse" "" "" "" '#include <pulse/pulseaudio.h>
int main( void ) {return 0;}'
check_has_lib jack "" '#include <jack/jack.h>
config_package jack "libjack" "" "" "" '#include <jack/jack.h>
int main( void ) {return 0;}'

View File

@@ -14,11 +14,13 @@ else
#PLUGDIRS+=freenect
endif
ifeq ($(CONFIG_ALSA),yes)
ifeq ($(CONFIG_ALSA),no)
else
PLUGDIRS+=alsa
endif
ifeq ($(CONFIG_JACK),yes)
ifeq ($(CONFIG_JACK),no)
else
PLUGDIRS+=jack
endif
@@ -30,7 +32,8 @@ ifeq ($(CONFIG_CACA),yes)
PLUGDIRS+=caca_out
endif
ifeq ($(CONFIG_PULSEAUDIO),yes)
ifeq ($(CONFIG_PULSEAUDIO),no)
else
PLUGDIRS+=pulseaudio
endif

View File

@@ -65,7 +65,8 @@ ifeq ($(STATIC_MODULES),yes)
CFLAGS+= -DGPAC_STATIC_MODULES
ifeq ($(CONFIG_ALSA),yes)
ifeq ($(CONFIG_ALSA),no)
else
OBJS+=../modules/alsa/alsa.o
CFLAGS+=-DGPAC_HAS_ALSA
EXTRALIBS+= -lasound
@@ -128,13 +129,15 @@ endif
endif
ifeq ($(CONFIG_JACK),yes)
ifeq ($(CONFIG_JACK),no)
else
OBJS+= ../modules/jack/jack.o
CFLAGS+=-DGPAC_HAS_JACK
EXTRALIBS+=-ljack
endif
ifeq ($(CONFIG_PULSEAUDIO),yes)
ifeq ($(CONFIG_PULSEAUDIO),no)
else
OBJS+= ../modules/pulseaudio/pulseaudio.o
CFLAGS+=-DGPAC_HAS_PULSEAUDIO
EXTRALIBS+=-lpulse -lpulse-simple