forked from lda/telodendria
Fix handling of STATIC and broken compilation on GNU systems.
This commit is contained in:
parent
31866a14b4
commit
609890654e
2 changed files with 20 additions and 11 deletions
3
TODO.txt
3
TODO.txt
|
@ -36,6 +36,9 @@ Milestone: v0.4.0
|
||||||
|
|
||||||
[ ] Move general-purpose code to separate library
|
[ ] Move general-purpose code to separate library
|
||||||
[ ] HTTP/1.1 support
|
[ ] HTTP/1.1 support
|
||||||
|
[ ] Content-Length
|
||||||
|
[ ] Keep connections open
|
||||||
|
[ ] Chunked encoding
|
||||||
|
|
||||||
[ ] Client-Server API
|
[ ] Client-Server API
|
||||||
[ ] 6: Filtering
|
[ ] 6: Filtering
|
||||||
|
|
28
tools/bin/td
28
tools/bin/td
|
@ -59,16 +59,14 @@ if [ -n "$TLS_IMPL" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CFLAGS="${CFLAGS} ${DEFINES} ${INCLUDES}"
|
CFLAGS="${CFLAGS} ${DEFINES} ${INCLUDES}"
|
||||||
LDFLAGS="${LDFLAGS} ${STATIC}"
|
|
||||||
|
|
||||||
MAIN="Main"
|
MAIN="Main"
|
||||||
|
|
||||||
if [ "$DEBUG" = "1" ]; then
|
if [ "$DEBUG" = "1" ]; then
|
||||||
CFLAGS="$CFLAGS -O0 -g"
|
CFLAGS="$CFLAGS -O0 -g"
|
||||||
LDFLAGS="${LDFLAGS} ${TLS_LIBS}"
|
|
||||||
PROG="$PROG-debug"
|
PROG="$PROG-debug"
|
||||||
else
|
else
|
||||||
LDFLAGS="${LDFLAGS} ${LD_EXTRA} ${TLS_LIBS}"
|
LDFLAGS="${LDFLAGS} ${LD_EXTRA}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check the modificiation time of a file. This is used to do
|
# Check the modificiation time of a file. This is used to do
|
||||||
|
@ -142,7 +140,7 @@ recipe_build() {
|
||||||
|
|
||||||
echo "CC = ${CC}"
|
echo "CC = ${CC}"
|
||||||
echo "CFLAGS = ${CFLAGS}"
|
echo "CFLAGS = ${CFLAGS}"
|
||||||
echo "LDFLAGS = ${LDFLAGS}"
|
echo "LDFLAGS = ${LDFLAGS} ${STATIC}"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
do_rebuild=0
|
do_rebuild=0
|
||||||
|
@ -166,20 +164,28 @@ recipe_build() {
|
||||||
done
|
done
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
if [ $do_rebuild -eq 1 ] || [ ! -f "build/$PROG" ]; then
|
|
||||||
echo "LD $PROG"
|
|
||||||
$CC -o "build/$PROG" $objs ${LDFLAGS} "build/$MAIN.o"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $do_rebuild -eq 1 ] || [ ! -f "build/lib${PROG}.a" ]; then
|
if [ $do_rebuild -eq 1 ] || [ ! -f "build/lib${PROG}.a" ]; then
|
||||||
echo "AR lib${PROG}.a"
|
echo "AR lib${PROG}.a"
|
||||||
$AR rcs "build/lib${PROG}.a" $objs
|
if ! $AR rcs "build/lib${PROG}.a" $objs; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $do_rebuild -eq 1 ] || [ ! -f "build/lib${PROG}.so" ]; then
|
if [ $do_rebuild -eq 1 ] || [ ! -f "build/lib${PROG}.so" ]; then
|
||||||
echo "LD lib${PROG}.so"
|
echo "LD lib${PROG}.so"
|
||||||
$CC -shared -o "build/lib${PROG}.so" $objs
|
if ! $CC -shared -o "build/lib${PROG}.so" $objs ${LDFLAGS}; then
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $do_rebuild -eq 1 ] || [ ! -f "build/$PROG" ]; then
|
||||||
|
echo "LD $PROG"
|
||||||
|
if ! $CC -o "build/$PROG" "build/$MAIN.o" -Lbuild -ltelodendria ${LDFLAGS} ${STATIC}; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
for src in $(find tools/src -name '*.c'); do
|
for src in $(find tools/src -name '*.c'); do
|
||||||
out=$(basename "$src" .c)
|
out=$(basename "$src" .c)
|
||||||
|
@ -188,7 +194,7 @@ recipe_build() {
|
||||||
if [ $(mod_time "$src") -ge $(mod_time "$out") ] || [ $do_rebuild -eq 1 ]; then
|
if [ $(mod_time "$src") -ge $(mod_time "$out") ] || [ $do_rebuild -eq 1 ]; then
|
||||||
echo "CC $(basename $out)"
|
echo "CC $(basename $out)"
|
||||||
mkdir -p "$(dirname $out)"
|
mkdir -p "$(dirname $out)"
|
||||||
if ! $CC $CFLAGS -Isrc/include -Lbuild -ltelodendria -o "$out" ${LDFLAGS} "$src"; then
|
if ! $CC $CFLAGS -Isrc/include -o "$out" "$src" -Lbuild -ltelodendria ${LDFLAGS} ${STATIC}; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue