Hash :
fa2915fb
Author :
Thomas de Grivel
Date :
2022-03-07T09:36:26
fix compilation
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 90 91 92 93
#!/bin/sh
set -e
. ../config.subr
LIB_SRCDIR="$(dirname $0)"
SOURCES="$(ls *.c | grep -Ev '_type.c$' | tr '\n' ' ')"
DIRS="$(ls -d */)"
CPPFLAGS="$CPPFLAGS"
echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
if [ x"$DEBUG" = x"yes" ]; then
CFLAGS="-DDEBUG -O0 -ggdb"
else
CFLAGS="-DNDEBUG -O3"
fi
CFLAGS="$CFLAGS -W -Wall -Werror -std=c89 -pedantic"
LIBS=""
check_sndio
if ! test "x$HAVE_SNDIO" = "xYes"; then
DIRS="$(echo "$DIRS" | grep -v sndio)"
fi
check_portaudio
if ! test "x$HAVE_PORTAUDIO" = "xYes"; then
DIRS="$(echo "$DIRS" | grep -v portaudio)"
fi
echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
echo "LIBS = $LIBS" >> ${CONFIG_MK}
TYPES=
type_prog music
if test "x$HAVE_PORTAUDIO" = "xYes"; then
type_prog portaudio
fi
type_prog reverb
type_prog signal
type_prog synth
echo "types:${TYPES}" >> ${CONFIG_MK}
LIBRARIES=
for SRC in $SOURCES; do
SRC_LO="$(c2lo "$SRC")"
echo >> ${CONFIG_MK}
lo_rule "$SRC" >> ${CONFIG_MK}
echo "\t${LIBTOOL} --tag=CC --mode=compile \${CC} \${CPPFLAGS} \${CFLAGS} -c $SRC -o $SRC_LO" >> ${CONFIG_MK}
SRC_LA="librtbuf_$(c2la "$SRC")"
echo >> ${CONFIG_MK}
echo "$SRC_LA: $SRC_LO" >> ${CONFIG_MK}
echo "\t${LIBTOOL} --tag=CC --mode=link \${CC} -shared \${LDFLAGS} $SRC_LO \${LIBS} -o $SRC_LA -rpath \${LIBDIR}" >> ${CONFIG_MK}
LIBRARIES="$LIBRARIES $SRC_LA"
done
echo >> ${CONFIG_MK}
echo "libraries:${LIBRARIES} ${TYPES}" >> ${CONFIG_MK}
echo >> ${CONFIG_MK}
echo "install: ${LIBRARIES} subdirs-install" >> ${CONFIG_MK}
for LIB in $LIBRARIES; do
echo "\t\${LIBTOOL} --tag=CC --mode=install \${INSTALL} -o \${OWNER} -g \${GROUP} -m 0755 $LIB \${LIBDIR}" >> ${CONFIG_MK}
done
echo >> ${CONFIG_MK}
echo "subdirs: ${TYPES}" >> ${CONFIG_MK}
for DIR in $DIRS; do
echo "\t\${MAKE} -C \${PWD}/$DIR" >> ${CONFIG_MK}
done
echo >> ${CONFIG_MK}
echo "subdirs-clean:" >> ${CONFIG_MK}
for DIR in $DIRS; do
echo "\t\${MAKE} -C \${PWD}/$DIR clean" >> ${CONFIG_MK}
done
echo >> ${CONFIG_MK}
echo "subdirs-install: libraries" >> ${CONFIG_MK}
for DIR in $DIRS; do
echo "\t\${MAKE} -C \${PWD}/$DIR install" >> ${CONFIG_MK}
done
for DIR in $DIRS; do
(cd $DIR && ./configure)
done