configure: Generate .pc file with variable-prefixed paths

This commit is contained in:
Alexandre Ratchov 2021-04-23 14:22:47 +02:00
parent a26f7fdf36
commit e450bab99e
3 changed files with 21 additions and 7 deletions

View File

@ -31,6 +31,7 @@ distclean: clean
rm -f \
Makefile aucat/Makefile midicat/Makefile sndiod/Makefile \
libsndio/Makefile \
libsndio/sndio.pc \
sndioctl/Makefile \
examples/Makefile \
contrib/init.d.sndiod \

21
configure vendored
View File

@ -266,7 +266,7 @@ fi
for f in Makefile aucat/Makefile midicat/Makefile sndiod/Makefile \
libsndio/Makefile libsndio/sndio.pc \
libsndio/Makefile \
sndioctl/Makefile \
examples/Makefile \
contrib/init.d.sndiod \
@ -293,6 +293,25 @@ do
< $f.in > $f
done
#
# Generate sndio.pc. Substitute path prefixes with ${prefix} or
# ${exec_prefix} variable names, so that they can be overriden by the
# user
#
cat <<EOF >libsndio/sndio.pc
prefix=${prefix}
exec_prefix=`echo $exec_prefix | sed -e "s:^${prefix}:\\${prefix}:"`
libdir=`echo $libdir | sed -e "s:^${exec_prefix}:\\${exec_prefix}:"`
includedir=`echo $includedir | sed -e "s:^${prefix}:\\${prefix}:"`
Name: sndio
Description: sndio library
Version: 1.7.0
Requires:
Libs: -L\${libdir} -lsndio
Cflags: -I\${includedir}
EOF
chmod +x contrib/init.d.sndiod
cat <<EOF

View File

@ -1,6 +0,0 @@
Name: sndio
Description: sndio library
Version: @version@
Requires:
Libs: -L@libdir@ -lsndio
Cflags: -I@includedir@