diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 000000000..e950124df --- /dev/null +++ b/AUTHORS @@ -0,0 +1,58 @@ + +Cinelerra(2) Authors +==================== + +hv=Jack Crossfire +j6t=Johannes Sixt +minmax=Andraz Tori +herman=Herman Robak +baver=Richard Baverstock +pere=Petter Reinholdtsen +tfheen=Tollef Fog Heen +andreask=Andreas Kielb +theraz=Tyler Geddes +dyce=Gergely Erdelyi +dreamlx=David Arendt +ga=Gustavo Iniguez +memenk=Michael Eric Menk +benjif=Benjamin Flaming +cobra=Kevin Brosius +taraba=Mark Taraba +nate=Nathan Kurz +mammique=Camille Harang +kbielefe=Karl Bielefeldt +alexf=Alex Ferrer +pmdumuid=Pierre Dumuid +giskard=Riccardo Setti +jstewart=Joe Stewart +doudou=Sylvain Joyeux +rafael2k=Rafael Diniz +nicolasm=Nicolas Maufrais + +Involved in Lumiera development +=============================== +cehteh=Christian Thaeter +ichthyo=Hermann Vosseler +plouj=Michael Ploujnikov + +_______________________________________________________________ +Further Credits + +Parts of the Proc-Layer Implementation are heavily inspired by +The Loki Library + Copyright (c) 2001 by Andrei Alexandrescu + Loki is governed by a MIT-License. + See: http://loki-lib.sourceforge.net + and the book: + Alexandrescu, Andrei. + "Modern C++ Design: Generic Programming and Design + Patterns Applied". Copyright (c) 2001. Addison-Wesley. + ISBN 0201704315 + + Loki Copyright Notice: + Permission to use, copy, modify, distribute and sell this software for any + purpose is hereby granted without fee, provided that the above copyright + notice appear in all copies and that both that copyright notice and this + permission notice appear in supporting documentation. + The author makes no representations about the suitability of this software + for any purpose. It is provided "as is" without express or implied warranty. diff --git a/SConstruct b/SConstruct index 4d2f2ee9c..cef5ebda0 100644 --- a/SConstruct +++ b/SConstruct @@ -179,7 +179,7 @@ def configurePlatform(env): if not conf.CheckLibWithHeader('pthread', 'pthread.h', 'C'): print 'Did not find the pthread lib or pthread.h, exiting.' else: - conf.env.Append(CPPFLAGS = ' -DHAVE_PTHREAD_H') + conf.env.Append(CPPFLAGS = ' -DHAVE_PTHREAD') conf.env.Append(CCFLAGS = ' -pthread') if conf.CheckCHeader('execinfo.h'): @@ -234,24 +234,29 @@ def defineBuildTargets(env, artifacts): We use a custom function to declare a whole tree of srcfiles. """ - lumobj = ( srcSubtree(env,'$SRCDIR/backend') - + srcSubtree(env,'$SRCDIR/proc') - + srcSubtree(env,'$SRCDIR/common') - + srcSubtree(env,'$SRCDIR/lib') - ) + objback = srcSubtree(env,'$SRCDIR/backend') + objproc = srcSubtree(env,'$SRCDIR/proc') + objlib = ( srcSubtree(env,'$SRCDIR/common') + + srcSubtree(env,'$SRCDIR/lib') + ) plugobj = srcSubtree(env,'$SRCDIR/plugin', isShared=True) - core = env.StaticLibrary('$BINDIR/core.la', lumobj) - #core = lumobj # use this for linking directly + core = ( env.StaticLibrary('$BINDIR/lumiback.la', objback) + + env.StaticLibrary('$BINDIR/lumiproc.la', objproc) + + env.StaticLibrary('$BINDIR/lumi.la', objlib) + ) # use PCH to speed up building - precomp = env.PrecompiledHeader('$SRCDIR/pre') - env.Depends(lumobj, precomp) + precomp = ( env.PrecompiledHeader('$SRCDIR/pre') + + env.PrecompiledHeader('$SRCDIR/pre_a') + ) + env.Depends(objproc, precomp) + env.Depends(objlib, precomp) artifacts['lumiera'] = env.Program('$BINDIR/lumiera', ['$SRCDIR/main.cpp']+ core ) artifacts['plugins'] = env.SharedLibrary('$BINDIR/lumiera-plugin', plugobj) # call subdir SConscript(s) for independent components - SConscript(dirs=[SRCDIR+'/tool'], exports='env artifacts') + SConscript(dirs=[SRCDIR+'/tool'], exports='env artifacts core') SConscript(dirs=[TESTDIR], exports='env artifacts core') @@ -264,7 +269,7 @@ def definePostBuildTargets(env, artifacts): il = env.Alias('install-lib', '$DESTDIR/lib') env.Alias('install', [ib, il]) - build = env.Alias('build', artifacts['lumiera']+artifacts['plugins']) + build = env.Alias('build', artifacts['lumiera']+artifacts['plugins']+artifacts['tools']) allbu = env.Alias('allbuild', build+artifacts['testsuite']) env.Default('build') # additional files to be cleaned when cleaning 'build' diff --git a/admin/vgsuppression.c b/admin/vgsuppression.c new file mode 100644 index 000000000..0e1f41fca --- /dev/null +++ b/admin/vgsuppression.c @@ -0,0 +1,38 @@ +/* + vgsuppression.c - Helper program to generate valgrind suppression files + + Copyright (C) Lumiera.org + 2008, Christian Thaeter + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +#define _GNU_SOURCE + +/* + just place any problematic calls where valgrind whines about in main (with comments please) +*/ + +#include "lib/safeclib.h" + + +int +main () +{ + /* debian etch glibc is lazy about cleaning up TLS */ + lumiera_tmpbuf_provide (100); + lumiera_tmpbuf_freeall (); + + return 0; +} diff --git a/admin/vgsuppression_gen.sh b/admin/vgsuppression_gen.sh new file mode 100755 index 000000000..08814afaa --- /dev/null +++ b/admin/vgsuppression_gen.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +valgrind --leak-check=yes --show-reachable=yes --gen-suppressions=all ./vgsuppression 2>&1 | sed '/==[0-9]*==/d;' diff --git a/src/main.cpp b/src/main.cpp index 398cdc3df..0e04ef89f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,16 +23,24 @@ #include -#include "lumiera.h" +#include "proc/lumiera.hpp" using std::cout; using std::endl; using lumiera::Appconfig; +using lumiera::ON_GLOBAL_INIT; +using lumiera::ON_GLOBAL_SHUTDOWN; int main (int argc, char* argv[]) { cout << "*** Lumiera NLE for Linux ***" << endl - << " Version: " << Appconfig::get("version") << endl; + << " Version: " << Appconfig::get("version") << "\n"; + + Appconfig::lifecycle (ON_GLOBAL_INIT); + + // great things are happening here.... + + Appconfig::lifecycle (ON_GLOBAL_SHUTDOWN); return 0; } diff --git a/src/pre.hpp b/src/pre.hpp new file mode 100644 index 000000000..ca948b7d6 --- /dev/null +++ b/src/pre.hpp @@ -0,0 +1,52 @@ +/* + PRE.hpp - precompiled header collection + + + Copyright (C) Lumiera.org + 2008, Christian Thaeter + Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +/** @file pre.hpp + ** Precompiled Header Collection. + ** Assortment of standard util, error handling and basic lib-boost components, + ** frequently used in conjunction. Precompiling these can speedup building + ** significantly. When used, this header should be included prior to any other + ** headers (and it needs to be compiled by gcc into a "pre.gch" file prior to + ** building the object files including this header). + ** + ** @see mobject.hpp usage example + ** @see pre_a.hpp precompiled header including Asset subsystem + */ + +#ifndef LUMIERA_PRE_HPP +#define LUMIERA_PRE_HPP + +#include +#include +#include +#include +#include +#include +#include + +#include "proc/lumiera.hpp" + + + +#endif /*LUMIERA_PRE_HPP*/ diff --git a/src/proc/DIR_INFO b/src/proc/DIR_INFO new file mode 100644 index 000000000..dac54f26c --- /dev/null +++ b/src/proc/DIR_INFO @@ -0,0 +1 @@ +Lumiera processing core diff --git a/src/proc/lumiera.hpp b/src/proc/lumiera.hpp new file mode 100644 index 000000000..b56ab69b6 --- /dev/null +++ b/src/proc/lumiera.hpp @@ -0,0 +1,46 @@ +/* + LUMIERA.hpp - global definitions and common types for the Proc-Layer + + + Copyright (C) Lumiera.org + 2008, Christian Thaeter + Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef LUMIERA_H +#define LUMIERA_H + + + + + /* common types frequently used... */ + +#include "common/util.hpp" +#include "common/time.hpp" +#include "common/error.hpp" ///< pulls in NoBug via nobugcfg.hpp +#include "lib/appconfig.hpp" + + +namespace lumiera + { + /* additional global configuration goes here... */ + + +} // namespace lumiera + +#endif /*LUMIERA_H*/ diff --git a/src/proc/nobugcfg.cpp b/src/proc/nobugcfg.cpp new file mode 100644 index 000000000..7dc68a9bb --- /dev/null +++ b/src/proc/nobugcfg.cpp @@ -0,0 +1,45 @@ +/* + NoBugCfg - NoBug definitions and initialisation for the Proc-Layer + + Copyright (C) Lumiera.org + 2008, Christian Thaeter + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "proc/nobugcfg.hpp" + +#define NOBUG_INIT_DEFS_ +#include "proc/nobugcfg.hpp" +#undef NOBUG_INIT_DEFS_ + + +namespace lumiera + { + void + initialize_NoBug () + { + NOBUG_INIT; + +#ifdef DEBUG + static uint callCount = 0; + ASSERT ( 0 == callCount++ ); +#endif + } + +} + diff --git a/src/nobugcfg.h b/src/proc/nobugcfg.hpp similarity index 74% rename from src/nobugcfg.h rename to src/proc/nobugcfg.hpp index 916f28663..567838320 100644 --- a/src/nobugcfg.h +++ b/src/proc/nobugcfg.hpp @@ -1,5 +1,5 @@ /* - NOBUGCFG.h - global configuration and definitions for NoBug + NOBUGCFG.hpp - NoBug definitions and initialisation for the Proc-Layer Copyright (C) Lumiera.org @@ -22,17 +22,20 @@ */ -/** @file nobugcfg.h +/** @file nobugcfg.hpp ** This header is for including and configuring NoBug. ** The idea is that configuration and some globally used flag ** declarations are to be kept in one central location. Normally, - ** this header will be included by appconfig.hpp, which in turn gets - ** included by lumiera.h + ** this header will be included via some of the basic headers like + ** error.hpp, which in turn gets included by proc/lumiera.hpp + ** ** @par Besides the usual guarded declarations, this header contains ** one section with the corresponding definitions. This section - ** is to be called by appconfig.cpp only, which deals with application - ** wide configuration values contained in the Singleton class Appconfig. - ** Incidentally, the constructor of Appconfig issues the NOBUG_INIT call + ** is to be included once by some translation unit (currently this is + ** nobugcfg.cpp) in order to generate the necessary definitions. + ** + ** @note this header assures automatic initialisation of NoBug + ** by placing a static ctor call. ** */ @@ -41,10 +44,9 @@ #define NOBUGCFG_H #include - - /* configuration of NoBug goes here... */ - #include +#include "lib/appconfig.hpp" +#include "common/error.hpp" ///< make assertions throw instead of abort() /* declare flags used throughout the code base... */ @@ -54,8 +56,13 @@ NOBUG_DECLARE_FLAG(singleton); NOBUG_DECLARE_FLAG(assetmem); NOBUG_DECLARE_FLAG(mobjectmem); - - + + +namespace lumiera { + void initialize_NoBug (); + namespace { + LifecycleHook schedule_ (ON_BASIC_INIT, &initialize_NoBug); +} } #endif /*NOBUGCFG_H ======= (End) Part 1: DECLARATIONS ======== */ @@ -65,15 +72,6 @@ #ifdef NOBUG_INIT_DEFS_ /*========== Part 2: DEFINITIONS ========= */ -/* ================================= common C Part ========= */ - - - - - - -#ifdef __cplusplus /* ============== C++-Part ============== */ - /* flags used throughout the code base... */ NOBUG_CPP_DEFINE_FLAG(config); @@ -83,11 +81,7 @@ NOBUG_CPP_DEFINE_FLAG_LIMIT(assetmem, LOG_WARNING); NOBUG_CPP_DEFINE_FLAG_LIMIT(mobjectmem, LOG_WARNING); -#include "common/error.hpp" -#endif /* ===================== (End) C++-Part ============= */ - - #endif /*NOBUG_INIT_DEFS_ ==== (End) Part 2: DEFINITIONS ========= */ diff --git a/src/tool/SConscript b/src/tool/SConscript index 738483498..6f4e796a6 100644 --- a/src/tool/SConscript +++ b/src/tool/SConscript @@ -3,11 +3,11 @@ ## SConscript - SCons buildscript for tool subdirectory (called by SConstruct) ## -Import('env','artifacts') +Import('env','artifacts','core') # build the ubiquitous Hello World application (note: C source) artifacts['tools'] = [ env.Program('#$BINDIR/hello-world','hello.c') - + env.Program('#$BINDIR/try', 'try.cpp') #### to try out some feature: + + env.Program('#$BINDIR/try', 'try.cpp') #### to try out some feature... ] diff --git a/src/tool/try.cpp b/src/tool/try.cpp index 349ca7db0..90bdfadf8 100644 --- a/src/tool/try.cpp +++ b/src/tool/try.cpp @@ -7,18 +7,19 @@ // execute with NOBUG_LOG='ttt:TRACE' bin/try // 1/08 - working out a static initialisation problem for Visitor (Tag creation) // 1/08 - check 64bit longs +// 4/08 - comparison operators on shared_ptr #include #include +#include -#include using std::string; using std::cout; -NOBUG_CPP_DEFINE_FLAG(test); + int main (int argc, char* argv[]) @@ -26,12 +27,8 @@ int main (int argc, char* argv[]) NOBUG_INIT; - int64_t lol (1); - cout << sizeof(lol)<< "\n"; + cout << "\ngulp\n"; - cout << "long: "<< std::numeric_limits::max() - <<" 64: " << std::numeric_limits::max() - <<"\n"; return 0; } diff --git a/tests/00test.tests b/tests/00test.tests index 0b894982b..4d8781629 100644 --- a/tests/00test.tests +++ b/tests/00test.tests @@ -1,4 +1,4 @@ -TESTING "test system selftest" cat +TESTING "test system selftest" /bin/cat TEST "test cat'ing stdin to stdout" <>,expect_stderr ;; 'return') - expect_return=$arg + expect_return="$arg" ;; *) echo "UNKOWN TEST COMMAND '$cmd'" 1>&2 @@ -95,7 +95,7 @@ function TEST() echo -n "TEST $name: " echo -en "\nTEST $name: $* " >>,testlog - case $TESTMODE in + case "$TESTMODE" in *FAST*) if grep "^TEST $name: .* FAILED" ,testlog.pre >&/dev/null; then MSGOK=" (fixed)" @@ -121,39 +121,45 @@ function TEST() fails=0 - - if test -f ,send_stdin; then - cat ,send_stdin | $valgrind $TESTBIN "$@" 2>,stderr >,stdout - else - $valgrind $TESTBIN "$@" 2>,stderr >,stdout - fi &>/dev/null - return=$? - echo -n >,testtmp - if test -f ,expect_stdout; then - if ! cmp ,expect_stdout ,stdout &>/dev/null; then - echo "unexpected data on stdout" >>,testtmp - grep -v ': \(TRACE\|INFO\|NOTICE\|WARNING\|ERR\):' <,stdout >,tmp - diff -ua ,expect_stdout ,tmp >>,testtmp - rm ,tmp - ((fails+=1)) - fi - fi - - if test -f ,expect_stderr; then - if ! cmp ,expect_stderr ,stderr &>/dev/null; then - echo "unexpected data on stderr" >>,testtmp - grep -v ': \(TRACE\|INFO\|NOTICE\|WARNING\|ERR\):' <,stderr >,tmp - diff -ua ,expect_stderr ,tmp >>,testtmp - rm ,tmp - ((fails+=1)) - fi - fi - - if test $expect_return != $return; then - echo "unexpected return value $return" >>,testtmp + if ! test -x $TESTBIN; then + echo -n >,stdout + echo "test binary '$TESTBIN' not found" >,stderr ((fails+=1)) + + else + if test -f ,send_stdin; then + cat ,send_stdin | $valgrind $TESTBIN "$@" 2>,stderr >,stdout + else + $valgrind $TESTBIN "$@" 2>,stderr >,stdout + fi &>/dev/null + return=$? + + if test -f ,expect_stdout; then + if ! cmp ,expect_stdout ,stdout &>/dev/null; then + echo "unexpected data on stdout" >>,testtmp + grep -v ': \(TRACE\|INFO\|NOTICE\|WARNING\|ERR\):' <,stdout >,tmp + diff -ua ,expect_stdout ,tmp >>,testtmp + rm ,tmp + ((fails+=1)) + fi + fi + + if test -f ,expect_stderr; then + if ! cmp ,expect_stderr ,stderr &>/dev/null; then + echo "unexpected data on stderr" >>,testtmp + grep -v ': \(TRACE\|INFO\|NOTICE\|WARNING\|ERR\):' <,stderr >,tmp + diff -ua ,expect_stderr ,tmp >>,testtmp + rm ,tmp + ((fails+=1)) + fi + fi + + if test "$expect_return" != "$return"; then + echo "unexpected return value $return" >>,testtmp + ((fails+=1)) + fi fi if test $fails -eq 0; then @@ -191,7 +197,7 @@ function RUNTESTS() if test \( ! "${TESTSUITES/*,*/}" \) -a "$TESTSUITES"; then TESTSUITES="{$TESTSUITES}" fi - for t in $(eval echo $srcdir/*$TESTSUITES*.tests); do + for t in $(eval echo "$srcdir/*$TESTSUITES*.tests"); do echo "$t" done | sort | uniq | { while read i; do