This repository has been archived by the owner on Oct 10, 2019. It is now read-only.
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
try out redo as alternative build system.
- Loading branch information
1 parent
49e7cc8
commit 4e2b7a7
Showing
20 changed files
with
156 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
redo-ifchange _conf.sh | ||
redo-ifchange newsbeuter podbeuter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
redo-ifchange _conf.sh | ||
. ./_conf.sh | ||
|
||
$CXX $CXXFLAGS -Iinclude -Istfl -Ifilter -I. -Irss -o $3 -c $1.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rm -f *.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rm -f *.mo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
msgfmt --statistics -o $3 $1.po |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rm -f *.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rm -f *.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rm -f *.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../txt2h.pl $1.stfl .stfl > $3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./txt2h.pl LICENSE > $3 |