vgmstream/bootstrap

41 lines
2.0 KiB
Plaintext
Raw Normal View History

#!/bin/sh
2017-05-01 11:00:56 +02:00
# audacious-vgmstream script - automake/autoconf init
# gets all files and updates .am scripts to avoid having to do manually (frowned upon by automake, whatevs)
# maybe there is a better way or place for this
VGMSTREAM_SRCS=`(cd ./src/ && ls *.c) | tr '\n' ' '`
VGMSTREAM_HDRS=`(cd ./src/ && ls *.h) | tr '\n' ' '`
CODING_SRCS=`(cd ./src/coding/ && ls *.c) | tr '\n' ' '`
CODING_HDRS=`(cd ./src/coding/ && ls *.h) | tr '\n' ' '`
LAYOUT_SRCS=`(cd ./src/layout/ && ls *.c) | tr '\n' ' '`
LAYOUT_HDRS=`(cd ./src/layout/ && ls *.h) | tr '\n' ' '`
META_SRCS=`(cd ./src/meta/ && ls *.c) | tr '\n' ' '`
META_HDRS=`(cd ./src/meta/ && ls *.h) | tr '\n' ' '`
AUDACIOUS_SRCS=`(cd ./unix/ && ls *.cc) | tr '\n' ' '`
AUDACIOUS_HDRS=`(cd ./unix/ && ls *.h) | tr '\n' ' '`
sed -i -e "s/libvgmstream_la_SOURCES =.*/libvgmstream_la_SOURCES = $VGMSTREAM_SRCS/g" ./src/Makefile.unix.am
sed -i -e "s/EXTRA_DIST =.*/EXTRA_DIST = $VGMSTREAM_HDRS/g" ./src/Makefile.unix.am
sed -i -e "s/libcoding_la_SOURCES =.*/libcoding_la_SOURCES = $CODING_SRCS/g" ./src/coding/Makefile.unix.am
sed -i -e "s/EXTRA_DIST =.*/EXTRA_DIST = $CODING_HDRS/g" ./src/coding/Makefile.unix.am
sed -i -e "s/liblayout_la_SOURCES =.*/liblayout_la_SOURCES = $LAYOUT_SRCS/g" ./src/layout/Makefile.unix.am
sed -i -e "s/EXTRA_DIST =.*/EXTRA_DIST = $LAYOUT_HDRS/g" ./src/layout/Makefile.unix.am
sed -i -e "s/libmeta_la_SOURCES =.*/libmeta_la_SOURCES = $META_SRCS/g" ./src/meta/Makefile.unix.am
sed -i -e "s/EXTRA_DIST =.*/EXTRA_DIST = $META_HDRS/g" ./src/meta/Makefile.unix.am
sed -i -e "s/libvgmstream_la_SOURCES =.*/libvgmstream_la_SOURCES = $AUDACIOUS_SRCS/g" ./unix/Makefile.unix.am
sed -i -e "s/EXTRA_DIST =.*/EXTRA_DIST = $AUDACIOUS_HDRS/g" ./unix/Makefile.unix.am
# get version to show in about dialogs
# again, not very pretty
VGMSTREAM_VERSION=`./version.sh`
sed -i -e "s/VGMSTREAM_VERSION/$VGMSTREAM_VERSION/g" ./unix/Makefile.unix.am
# create fake files expected by automake and process
touch README AUTHORS NEWS ChangeLog
aclocal
autoheader
autoconf
libtoolize --copy --force
automake -a