From 3c6cb7f2347aed974543f9082a0ccd297577db41 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 15 Sep 2008 19:26:32 +0000 Subject: david - made precompiler not do wordexp stuff in expand function on win32 targets... added buildMinGW.conf file for targeting win32... undef-d cpy macro in fstring --- buildMinGW.conf | 47 +++++++++++++++++++++++++++++++++++++++++++++++ src/fstring.h | 10 ++++++++++ 2 files changed, 57 insertions(+) create mode 100644 buildMinGW.conf diff --git a/buildMinGW.conf b/buildMinGW.conf new file mode 100644 index 0000000..03c9b38 --- /dev/null +++ b/buildMinGW.conf @@ -0,0 +1,47 @@ +# Build config file for libbu++ +# +# Copyright (C) 2007-2008 Xagasoft, All rights reserved. +# +# 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++win.a" +"tests" action: check group "lnhdrs", check group "tests" +"all" action: check group "lnhdrs", check targets() + +set "CXXFLAGS" += "-ggdb -Wall" + +filesIn("src") filter regexp("^src/(.*)\\.h$", "bu/{re:1}.h"): + rule "hln", + group "lnhdrs", + target file, + input "src/{re:1}.h" + +"libbu++win.a": + rule "lib", + target file, + set "CXXFLAGS" += "-I.", + #input filesIn("src") filter regexp("^.*\\.cpp$") + input ["src/list.cpp", "src/exceptionbase.cpp", "src/exceptions.cpp", "src/fstring.cpp", "src/file.cpp", "src/hash.cpp", "src/sptr.cpp", "src/tafnode.cpp", "src/tafreader.cpp", "src/tafwriter.cpp", "src/stdstream.cpp", "src/stream.cpp", "src/archive.cpp", "src/archival.cpp"] + +rule "exe": + matches regexp("(.*)\\.win_o$"), + aggregate toString(" "), + perform command("wine c:/MinGW/bin/mingw32-g++.exe -o {target} {match} {LDFLAGS}") + +rule "lib": + matches regexp("(.*)\\.win_o$"), + aggregate toString(" "), + perform command("wine c:/MinGW/bin/ar.exe cr {target} {match}") + +rule "cpp": + matches regexp("(.*)\\.cpp$"), + produces "{re:1}.win_o", + requires commandToList("wine c:/MinGW/bin/mingw32-g++.exe -M {CXXFLAGS} {match}", "make"), + perform command("wine c:/MinGW/bin/mingw32-g++.exe {CXXFLAGS} -c -o {target} {match}") + +rule "hln": + matches regexp("src/(.*)\\.h"), + produces "bu/{re:1}.h", + perform command("ln -s ../src/{re:1}.h {target}") + diff --git a/src/fstring.h b/src/fstring.h index 93216a1..31b55d2 100644 --- a/src/fstring.h +++ b/src/fstring.h @@ -11,7 +11,11 @@ #include #include #include + +#ifndef WIN32 #include +#endif + #include "bu/archival.h" #include "bu/archive.h" #include "bu/hash.h" @@ -531,6 +535,7 @@ namespace Bu { flatten(); +#ifndef WIN32 wordexp_t result; /* Expand the string for the program to run. */ @@ -550,6 +555,7 @@ namespace Bu default: /* Some other error. */ return; } +#endif } /** @@ -1061,4 +1067,8 @@ namespace Bu #include std::basic_ostream& operator<< (std::basic_ostream &os, const Bu::FString &val ); +#ifndef VALTEST +#undef cpy +#endif + #endif -- cgit v1.2.3