From 75e487d82390580614b6a36f642b14f5860f1d98 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 26 Jun 2009 16:59:24 +0000 Subject: Fixed a couple of things up, now build creates a shared object as well as a non shared, checkinst.sh makes sure that symlinks are in /usr/lib and /usr/include so that you don't need a libbu++ symlink in any directories. If you still want the static version, then just delete the shared object, or switch your link line to do this: -Wl,-Bstatic -lbu++ -Wl,-Bdynamic Instead of just -lbu++, it'll include libbu++ as static, and everything else as dynamic. You could always just use -static, but then the whole thing is going to be static. Also, the dynamic library is already linked against all the extra libs you need, so no need to link against pthread or libbz2. --- build.conf | 16 +++++++++++++++- checkinst.sh | 10 ++++++++++ src/buffer.cpp | 20 ++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100755 checkinst.sh diff --git a/build.conf b/build.conf index 9094c7a..5117d8d 100644 --- a/build.conf +++ b/build.conf @@ -5,7 +5,7 @@ # This file is part of the libbu++ library and is released under the # terms of the license contained in the file LICENSE. -default action: check group "lnhdrs", check "libbu++.a", check group "tools" +default action: check group "lnhdrs", check "libbu++.a", check "libbu++.so", check group "tools" "tests" action: check group "lnhdrs", check group "tests" "all" action: check group "lnhdrs", check targets() @@ -27,6 +27,14 @@ filesIn("src") filter regexp("^src/(.*)\\.h$", "bu/{re:1}.h"): set "CXXFLAGS" += "-I. -fPIC", input filesIn("src") filter regexp("^.*\\.cpp$") +"libbu++.so": + rule "so", + target file, + set "CXXFLAGS" += "-I. -fPIC", + set "LDFLAGS" += "-lpthread -lbz2", + input filesIn("src") filter regexp("^.*\\.cpp$") + + directoriesIn("src/tests","tests/"): rule "exe", target file, @@ -82,6 +90,12 @@ rule "lib": aggregate toString(" "), perform command("ar cr {target} {match}") +rule "so": + matches regexp("(.*)\\.o$"), + aggregate toString(" "), + perform command("g++ -shared -o {target} {match} {LDFLAGS}") +# perform command("ld -G -o {target} {match}") + rule "cpp": matches regexp("(.*)\\.cpp$"), produces "{re:1}.o", diff --git a/checkinst.sh b/checkinst.sh new file mode 100755 index 0000000..957267c --- /dev/null +++ b/checkinst.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +CMD="ln -svf $PWD/libbu++.so /usr/lib; ln -svf $PWD/bu /usr/include" + +if [ $UID == 0 ]; then + bash -c "$CMD" +else + echo This script needs root access... + su root -c "$CMD" +fi diff --git a/src/buffer.cpp b/src/buffer.cpp index abb4fed..fef64b1 100644 --- a/src/buffer.cpp +++ b/src/buffer.cpp @@ -15,3 +15,23 @@ Bu::Buffer::~Buffer() { } +void Bu::Buffer::start() +{ +} + +size_t Bu::Buffer::stop() +{ +} + +size_t Bu::Buffer::read( void *pBuf, size_t nBytes ) +{ +} + +size_t Bu::Buffer::write( const void *pBuf, size_t nBytes ) +{ +} + +void Bu::Buffer::flush() +{ +} + -- cgit v1.2.3