Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/neutrinolabs/pulseaudio-module-xrdp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatt335672 <30179339+matt335672@users.noreply.github.com>2021-11-18 13:12:33 +0300
committerGitHub <noreply@github.com>2021-11-18 13:12:33 +0300
commit27f51ee718d5568c469cba9dbd3fb5dc9ff07421 (patch)
treec1386182b8a7ac7bcab2360d437d6cd8f818b3d3
parentfc9fc663b90793b5a889c931e72b8579b656a39a (diff)
parentc4a4e89be24fb351d71bef758a92e04178989c53 (diff)
Merge pull request #68 from matt335672/pa15_support
Add support for Meson build system used by Pulseaudio 15
-rw-r--r--configure.ac36
-rwxr-xr-xscripts/install_pulseaudio_sources_apt.sh40
-rw-r--r--src/Makefile.am2
3 files changed, 65 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index f4bf72d..78793cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,16 @@ fi
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+dnl ------------------------------------------------------------------
+dnl FIND_CONFIG_H(TOP_DIRECTORY)
+dnl Find the config.h file under TOP_DIRECTORY
+dnl
+dnl Outputs the enclosing directory. Only the first match is returned.
+dnl ------------------------------------------------------------------
+m4_define([FIND_CONFIG_H],
+ [find $1 -type f -maxdepth 3 -type f -name config.h | \
+ sed -e 's#/config.h##' -e '2,$d'])
+
# get system's pulseaudio version
m4_define([pa_major], [`$PKG_CONFIG --modversion libpulse | cut -d. -f1`])
m4_define([pa_minor], [`$PKG_CONFIG --modversion libpulse | cut -d. -f2`])
@@ -52,6 +62,7 @@ PKG_CHECK_MODULES([LIBPULSE], [libpulse])
m4_define([PULSE_MSG], [PULSE_DIR not specified. Follow the instructions in README.md.])
+# Check PULSE_DIR is specified
AC_ARG_VAR([PULSE_DIR], [pulseaudio source code directory])
AS_IF([test x"$PULSE_DIR" == x""],
cat <<__MSG__
@@ -60,6 +71,31 @@ __MSG__
AC_MSG_ERROR([PULSE_DIR not specified])
)
+# Does PULSE_DIR appear to be valid?
+AS_IF([test -e "$PULSE_DIR/src/pulsecore/macro.h"],,
+ AC_MSG_WARN([PULSE_DIR may not be valid - can't find expected file]))
+
+# Look for config.h, using PULSE_CONFIG_DIR if specified
+AC_ARG_VAR([PULSE_CONFIG_DIR], [pulseaudio config.h source code directory (optional)])
+AS_IF([test x"$PULSE_CONFIG_DIR" == x""],
+ AC_MSG_NOTICE([PULSE_CONFIG_DIR not defined])
+ AC_MSG_CHECKING([Searching for config.h under PULSE_DIR])
+ PULSE_CONFIG_DIR="`FIND_CONFIG_H(\"$PULSE_DIR\")`"
+ [AS_IF([test -e "$PULSE_CONFIG_DIR/config.h" ],
+ AC_MSG_RESULT([$PULSE_CONFIG_DIR/config.h])
+ ,
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Can't find config.h under PULSE_DIR. Define PULSE_CONFIG_DIR?]))]
+ ,
+ AC_MSG_NOTICE([PULSE_CONFIG_DIR is defined])
+ AC_MSG_CHECKING([Looking for config.h in PULSE_CONFIG_DIR])
+ [AS_IF([test -e "$PULSE_CONFIG_DIR/config.h"],
+ AC_MSG_RESULT([$PULSE_CONFIG_DIR/config.h])
+ ,
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Can't find config.h in PULSE_CONFIG_DIR.]))])
+
+
# use the prefix as same as pulseaudio
AC_PREFIX_PROGRAM(pulseaudio)
diff --git a/scripts/install_pulseaudio_sources_apt.sh b/scripts/install_pulseaudio_sources_apt.sh
index c5cf024..8daef48 100755
--- a/scripts/install_pulseaudio_sources_apt.sh
+++ b/scripts/install_pulseaudio_sources_apt.sh
@@ -50,7 +50,7 @@ while [ $# -gt 0 ]; do
esac
done
-if [ ! -d $PULSE_DIR ]; then
+if [ ! -d "$PULSE_DIR" ]; then
# Operating system release ?
RELEASE="$(lsb_release -si)-$(lsb_release -sr)"
echo "Building for : $RELEASE"
@@ -70,25 +70,41 @@ if [ ! -d $PULSE_DIR ]; then
;;
esac
- cd $(dirname $PULSE_DIR)
+ cd "$(dirname $PULSE_DIR)"
apt-get source pulseaudio
- pulse_dir=$(find . -maxdepth 1 -name pulseaudio-[0-9]\*)
- if [[ -z $pulse_dir ]]; then
- echo "** Can't find pulse dir in $(ls)" >&2
+ build_dir="$(find . -maxdepth 1 -name pulseaudio-[0-9]\*)"
+ if [ -z "$build_dir" ]; then
+ echo "** Can't find build directory in $(ls)" >&2
exit 1
fi
- cd $pulse_dir
- ./configure
+ cd "$build_dir"
+ if [ -x ./configure ]; then
+ # This version of PA uses autotools to build
+ # This command creates ./config.h
+ ./configure
+ elif [ -f ./meson.build ]; then
+ # Meson only
+ rm -rf build
+ # This command creates ./build/config.h
+ meson build
+ else
+ echo "** Unable to configure pulseaudio from files in $(pwd)" >&2
+ false
+ fi
- # We only need the src/ directory and config.h
echo "- Removing unnecessary files"
- find . -mindepth 1 -maxdepth 1 -name src -o -name config.h -o -exec rm -rf {} +
-
- echo "- Renaming $(pwd)/$pulse_dir as $PULSE_DIR"
+ # We only need .h files...
+ find . -type f \! -name \*.h -delete
+ # .. in src/ and /build directories
+ find . -mindepth 1 -maxdepth 1 \
+ -name src -o -name build -o -name config.h \
+ -o -exec rm -rf {} +
+
+ echo "- Renaming $(pwd)/$build_dir as $PULSE_DIR"
cd ..
- mv $pulse_dir $PULSE_DIR
+ mv "$build_dir" "$PULSE_DIR"
fi
exit 0
diff --git a/src/Makefile.am b/src/Makefile.am
index 9a82e18..b3692b9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,6 @@
AM_CFLAGS = -O2 \
-fPIC \
- -I $(PULSE_DIR) \
+ -I $(PULSE_CONFIG_DIR) \
-I $(PULSE_DIR)/src \
$(XRDP_CFLAGS)