Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

try out redo as alternative build system.

  • Loading branch information
akrennmair committed Jan 14, 2011
1 parent 49e7cc8 commit 4e2b7a7559ed5c0f0550aa846058ef4874f8cd80
Showing with 156 additions and 0 deletions.
  1. +75 −0 _conf.sh.do
  2. +2 −0 all.do
  3. +2 −0 clean.do
  4. +4 −0 default.o.do
  5. +1 −0 filter/clean.do
  6. +4 −0 filter/default.o.do
  7. +10 −0 libbeuter.a.do
  8. +10 −0 libfilter.a.do
  9. +10 −0 librsspp.a.do
  10. +10 −0 newsbeuter.do
  11. +1 −0 po/clean.do
  12. +1 −0 po/default.mo.do
  13. +9 −0 podbeuter.do
  14. +1 −0 rss/clean.do
  15. +4 −0 rss/default.o.do
  16. +1 −0 src/clean.do
  17. +8 −0 src/default.o.do
  18. +1 −0 stfl/clean.do
  19. +1 −0 stfl/default.h.do
  20. +1 −0 xlicense.h.do
@@ -0,0 +1,75 @@
echo "CXX=c++"
echo "CXXFLAGS=\"-Wall -Wextra -ggdb -DLOCALEDIR=\\\"$localedir\\\"\""
echo "LDFLAGS=-L."

FAILSTATUS=""
CXXFLAGS=""
LDFLAGS=""

check_pkg() {
pkgname=$1
pkgconfig_args=$2
echo -n "Checking for package ${pkgname}... " >&2
if pkg-config --silence-errors "${pkgname}" ; then
echo "found" >&2
CXXFLAGS="$CXXFLAGS `pkg-config --cflags $pkgconfig_args ${pkgname}`"
LDFLAGS="$LDFLAGS `pkg-config --libs $pkgconfig_args ${pkgname}`"
else
echo "not found" >&2
return 1
fi
return 0
}

check_custom() {
pkgname=$1
customconfig=$2
echo -n "Checking for package ${pkgname} using ${customconfig}... " >&2
if ${customconfig} --cflags > /dev/null 2>&1 ; then
echo "found" >&2
CXXFLAGS="$CXXFLAGS `${customconfig} --cflags $pkgconfig_args ${pkgname}`"
LDFLAGS="$LDFLAGS `${customconfig} --libs $pkgconfig_args ${pkgname}`"
else
echo "not found" >&2
return 1
fi
return 0
}

fail() {
pkgname=$1
rm -f config.mk
dlurl=`grep -i "$pkgname" README | awk '{ print $NF }'`
echo "" >&2
echo "You need package ${pkgname} in order to compile this program." >&2
echo "Please make sure it is installed." >&2
echo "" >&2
echo "You can download ${pkgname} from here: ${dlurl}" >&2
FAILSTATUS="1"
}

fail_custom() {
err=$1
echo "" >&2
echo "ERROR: ${err}" >&2
FAILSTATUS="1"
}

all_aboard_the_fail_boat() {
if [ "x$FAILSTATUS" != "x" ] ; then
rm -f config.mk
echo "" >&2
echo "One or more dependencies couldn\'t be found. Please install" >&2
echo "these packages and retry compilation." >&2
exit 1
fi
}

check_pkg "sqlite3" || fail "sqlite3"
check_pkg "libcurl" || check_custom "libcurl" "curl-config" || fail "libcurl"
check_pkg "libxml-2.0" || check_custom "libxml2" "xml2-config" || fail "libxml2"
check_pkg "stfl" "--static" || fail "stfl"
all_aboard_the_fail_boat

echo "CXXFLAGS=\"\$CXXFLAGS $CXXFLAGS\""
echo "LDFLAGS=\"\$LDFLAGS $LDFLAGS\""
2 all.do
@@ -0,0 +1,2 @@
redo-ifchange _conf.sh
redo-ifchange newsbeuter podbeuter
@@ -0,0 +1,2 @@
rm -f *.o *.a xlicense.h newsbeuter podbeuter _conf.sh
redo rss/clean filter/clean src/clean stfl/clean po/clean
@@ -0,0 +1,4 @@
redo-ifchange _conf.sh
. ./_conf.sh

$CXX $CXXFLAGS -Iinclude -Istfl -Ifilter -I. -Irss -o $3 -c $1.cpp
@@ -0,0 +1 @@
rm -f *.o
@@ -0,0 +1,4 @@
redo-ifchange ../_conf.sh
. ../_conf.sh

$CXX $CXXFLAGS -I../include -I../stfl -I../filter -I.. -I../rss -o $3 -c $1.cpp
@@ -0,0 +1,10 @@
redo-ifchange _conf.sh
. ./_conf.sh

OBJS=`cat libbeuter.deps | sed 's/.cpp/.o/g'`

redo-ifchange $OBJS

rm -f $1
ar qc $3 $OBJS
ranlib $3
@@ -0,0 +1,10 @@
redo-ifchange _conf.sh
. ./_conf.sh

OBJS="filter/Scanner.o filter/Parser.o filter/FilterParser.o"

redo-ifchange $OBJS

rm -f $1
ar qc $3 $OBJS
ranlib $3
@@ -0,0 +1,10 @@
redo-ifchange _conf.sh
. ./_conf.sh

RSSPPLIB_OBJS=`ls rss/*.cpp | sed 's/.cpp/.o/g'`
redo-ifchange $RSSPPLIB_OBJS
rm -f $1
ar qc $3 $RSSPPLIB_OBJS
ranlib $3
@@ -0,0 +1,10 @@
redo-ifchange _conf.sh
. ./_conf.sh

NEWSBEUTER_LIBS="-lbeuter -lfilter -lpthread -lrsspp"
MOFILES=`ls po/*.po | sed 's/.po/.mo/g'`
NEWSBEUTER_OBJS=`cat newsbeuter.deps | sed 's/.cpp/.o/g'`
LIBS="libbeuter.a librsspp.a libfilter.a"
redo-ifchange $MOFILES $NEWSBEUTER_OBJS $LIBS
$CXX $CXXFLAGS -Iinclude -Istfl -Ifilter -I. -Irss -o $3 $NEWSBEUTER_OBJS $NEWSBEUTER_LIBS $LDFLAGS
@@ -0,0 +1 @@
rm -f *.mo
@@ -0,0 +1 @@
msgfmt --statistics -o $3 $1.po
@@ -0,0 +1,9 @@
redo-ifchange _conf.sh
. ./_conf.sh

PODBEUTER_LIBS="-lbeuter -lpthread"
PODBEUTER_OBJS=`cat podbeuter.deps | sed 's/.cpp/.o/g'`
LIBS="libbeuter.a"

redo-ifchange $MODFILES $PODBEUTER_OBJS $LIBS
$CXX $CXXFLAGS -Iinclude -Istfl -Ifilter -I. -Irss -o $3 $PODBEUTER_OBJS $PODBEUTER_LIBS $LDFLAGS
@@ -0,0 +1 @@
rm -f *.o
@@ -0,0 +1,4 @@
redo-ifchange ../_conf.sh
. ../_conf.sh

$CXX $CXXFLAGS -I../include -I../stfl -I../filter -I.. -I../rss -o $3 -c $1.cpp
@@ -0,0 +1 @@
rm -f *.o
@@ -0,0 +1,8 @@
redo-ifchange ../_conf.sh
. ../_conf.sh

# TODO: moves this to an own view.o.do file as soon as redo can handle this correctly.
STFLHDRS=`ls ../stfl/*.stfl | sed 's/.stfl$/.h/g'`
redo-ifchange $STFLHDRS ../xlicense.h
$CXX $CXXFLAGS -I../include -I../stfl -I../filter -I.. -I../rss -o $3 -c $1.cpp
@@ -0,0 +1 @@
rm -f *.h
@@ -0,0 +1 @@
../txt2h.pl $1.stfl .stfl > $3
@@ -0,0 +1 @@
./txt2h.pl LICENSE > $3

0 comments on commit 4e2b7a7

Please sign in to comment.
You can’t perform that action at this time.