aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--default.bld18
-rw-r--r--mingw.bld23
-rw-r--r--src/compat/linux.h (renamed from src/linux_compatibility.h)0
-rw-r--r--src/compat/osx.h (renamed from src/osx_compatibility.h)0
-rw-r--r--src/compat/win32.cpp (renamed from src/win32_compatibility.cpp)2
-rw-r--r--src/compat/win32.h (renamed from src/win32_compatibility.h)2
-rw-r--r--src/config.h11
-rw-r--r--src/fifo.cpp2
-rw-r--r--src/file.cpp6
-rw-r--r--src/ito.cpp3
-rw-r--r--src/itoserver.cpp5
-rw-r--r--src/multiserver.cpp4
-rw-r--r--src/process.cpp5
-rw-r--r--src/server.cpp2
-rw-r--r--src/server.h3
-rw-r--r--src/serversocket.cpp5
-rw-r--r--src/socket.cpp5
17 files changed, 70 insertions, 26 deletions
diff --git a/default.bld b/default.bld
index 9d94f73..ea83827 100644
--- a/default.bld
+++ b/default.bld
@@ -36,13 +36,23 @@ target files("src/*.h").replace("src/", "bu/")
36 input OUTPUT.replace("bu/","src/"); 36 input OUTPUT.replace("bu/","src/");
37 profile "build" 37 profile "build"
38 { 38 {
39 execute("ln -s ../${INPUT} ${OUTPUT}"); 39 execute("mkdir -p $(dirname ${OUTPUT}); ln -s ../${INPUT} ${OUTPUT}");
40 }
41}
42target files("src/compat/*.h").replace("src/", "bu/")
43{
44 tag "header-links";
45 display "symlink";
46 input OUTPUT.replace("bu/","src/");
47 profile "build"
48 {
49 execute("mkdir -p $(dirname ${OUTPUT}); ln -s ../../${INPUT} ${OUTPUT}");
40 } 50 }
41} 51}
42 52
43target "libbu++.a" 53target "libbu++.a"
44{ 54{
45 input files("src/*.cpp"); 55 input files("src/*.cpp", "src/compat/*.cpp");
46 rule "lib"; 56 rule "lib";
47 CXXFLAGS += "-I. -fPIC"; 57 CXXFLAGS += "-I. -fPIC";
48} 58}
@@ -120,7 +130,9 @@ target "libbu++-r$(svnversion "-n").tar.bz2"
120 files("src/tools/*.cpp"), 130 files("src/tools/*.cpp"),
121 files("src/tools/*.h"), 131 files("src/tools/*.h"),
122 files("src/unit/*.unit"), 132 files("src/unit/*.unit"),
123 files("src/doxy/*.dox") 133 files("src/doxy/*.dox"),
134 files("src/compat/*.cpp"),
135 files("src/compat/*.h")
124 ]; 136 ];
125 rule "tarball"; 137 rule "tarball";
126 tag "pkg"; 138 tag "pkg";
diff --git a/mingw.bld b/mingw.bld
index 61dbeaf..7bdf474 100644
--- a/mingw.bld
+++ b/mingw.bld
@@ -6,13 +6,11 @@
6 6
7CXXFLAGS += "-ggdb -W -Wall"; 7CXXFLAGS += "-ggdb -W -Wall";
8 8
9
10action "default" 9action "default"
11{ 10{
12 build: [targets("header-links"), "libbu++win.a"]; 11 build: [targets("header-links"), "libbu++win.a"];
13} 12}
14 13
15
16target files("src/*.h").replace("src/", "bu/") 14target files("src/*.h").replace("src/", "bu/")
17{ 15{
18 tag "header-links"; 16 tag "header-links";
@@ -20,13 +18,23 @@ target files("src/*.h").replace("src/", "bu/")
20 input OUTPUT.replace("bu/","src/"); 18 input OUTPUT.replace("bu/","src/");
21 profile "build" 19 profile "build"
22 { 20 {
23 execute("ln -s ../${INPUT} ${OUTPUT}"); 21 execute("mkdir -p $(dirname ${OUTPUT}); ln -s ../${INPUT} ${OUTPUT}");
22 }
23}
24target files("src/compat/*.h").replace("src/", "bu/")
25{
26 tag "header-links";
27 display "symlink";
28 input OUTPUT.replace("bu/","src/");
29 profile "build"
30 {
31 execute("mkdir -p $(dirname ${OUTPUT}); ln -s ../../${INPUT} ${OUTPUT}");
24 } 32 }
25} 33}
26 34
27target "libbu++win.a" 35target "libbu++win.a"
28{ 36{
29 input files("src/*.cpp"); 37 input files("src/*.cpp", "src/compat/*.cpp");
30 rule "lib"; 38 rule "lib";
31 CXXFLAGS += "-I. -Isupport/windows"; 39 CXXFLAGS += "-I. -Isupport/windows";
32} 40}
@@ -45,6 +53,13 @@ target "src/regex.win_o"
45 execute("rm -f src/regex.win_o && touch src/regex.win_o && echo NOT BUILDING REGEX RIGHT NOW!!!"); 53 execute("rm -f src/regex.win_o && touch src/regex.win_o && echo NOT BUILDING REGEX RIGHT NOW!!!");
46 } 54 }
47} 55}
56target "src/cachestorefiles.win_o"
57{
58 profile "build"
59 {
60 execute("rm -f src/cachestorefiles.win_o && touch src/cachestorefiles.win_o && echo NOT BUILDING REGEX RIGHT NOW!!!");
61 }
62}
48 63
49function cppToWinObj() 64function cppToWinObj()
50{ 65{
diff --git a/src/linux_compatibility.h b/src/compat/linux.h
index ccc8536..ccc8536 100644
--- a/src/linux_compatibility.h
+++ b/src/compat/linux.h
diff --git a/src/osx_compatibility.h b/src/compat/osx.h
index 7169d7e..7169d7e 100644
--- a/src/osx_compatibility.h
+++ b/src/compat/osx.h
diff --git a/src/win32_compatibility.cpp b/src/compat/win32.cpp
index 98e63a7..6fcac15 100644
--- a/src/win32_compatibility.cpp
+++ b/src/compat/win32.cpp
@@ -5,7 +5,7 @@
5 * terms of the license contained in the file LICENSE. 5 * terms of the license contained in the file LICENSE.
6 */ 6 */
7 7
8#include "bu/win32_compatibility.h" 8#include "bu/compat/win32.h"
9 9
10#ifdef WIN32 10#ifdef WIN32
11 11
diff --git a/src/win32_compatibility.h b/src/compat/win32.h
index 220ed09..6304d4c 100644
--- a/src/win32_compatibility.h
+++ b/src/compat/win32.h
@@ -124,6 +124,8 @@ namespace Bu
124 124
125#undef decltype 125#undef decltype
126 126
127#undef USE_64BIT_IO
128
127#endif /* WIN32 */ 129#endif /* WIN32 */
128#endif 130#endif
129 131
diff --git a/src/config.h b/src/config.h
new file mode 100644
index 0000000..05ef99a
--- /dev/null
+++ b/src/config.h
@@ -0,0 +1,11 @@
1#ifndef BU_CONFIG_H
2#define BU_CONFIG_H
3
4// Use 64 bit IO functions where applicable (i.e. large file support)
5#define USE_64BIT_IO
6
7#include "bu/compat/win32.h"
8#include "bu/compat/osx.h"
9#include "bu/compat/linux.h"
10
11#endif
diff --git a/src/fifo.cpp b/src/fifo.cpp
index ebea927..d1fa960 100644
--- a/src/fifo.cpp
+++ b/src/fifo.cpp
@@ -12,7 +12,7 @@
12#include <fcntl.h> 12#include <fcntl.h>
13#include <unistd.h> 13#include <unistd.h>
14 14
15#include "win32_compatibility.h" 15#include "bu/config.h"
16 16
17namespace Bu { subExceptionDef( FifoException ) } 17namespace Bu { subExceptionDef( FifoException ) }
18 18
diff --git a/src/file.cpp b/src/file.cpp
index 4d79f1e..f1f63e4 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -13,13 +13,19 @@
13#include <unistd.h> 13#include <unistd.h>
14#include <stdlib.h> // for mkstemp 14#include <stdlib.h> // for mkstemp
15 15
16#include "bu/config.h"
17
16namespace Bu { subExceptionDef( FileException ) } 18namespace Bu { subExceptionDef( FileException ) }
17 19
18Bu::File::File( const Bu::FString &sName, int iFlags ) : 20Bu::File::File( const Bu::FString &sName, int iFlags ) :
19 fd( -1 ), 21 fd( -1 ),
20 bEos( true ) 22 bEos( true )
21{ 23{
24#ifdef USE_64BIT_IO
25 fd = ::open64( sName.getStr(), getPosixFlags( iFlags ), 0666 );
26#else
22 fd = ::open( sName.getStr(), getPosixFlags( iFlags ), 0666 ); 27 fd = ::open( sName.getStr(), getPosixFlags( iFlags ), 0666 );
28#endif
23 if( fd < 0 ) 29 if( fd < 0 )
24 { 30 {
25 throw Bu::FileException( errno, "%s: %s", 31 throw Bu::FileException( errno, "%s: %s",
diff --git a/src/ito.cpp b/src/ito.cpp
index 0218ecc..12aee6f 100644
--- a/src/ito.cpp
+++ b/src/ito.cpp
@@ -6,7 +6,8 @@
6 */ 6 */
7 7
8#include "bu/ito.h" 8#include "bu/ito.h"
9#include "bu/osx_compatibility.h" 9
10#include "bu/config.h"
10 11
11Bu::Ito::Ito() 12Bu::Ito::Ito()
12{ 13{
diff --git a/src/itoserver.cpp b/src/itoserver.cpp
index 279310d..a1d804a 100644
--- a/src/itoserver.cpp
+++ b/src/itoserver.cpp
@@ -5,14 +5,13 @@
5 * terms of the license contained in the file LICENSE. 5 * terms of the license contained in the file LICENSE.
6 */ 6 */
7 7
8#include "win32_compatibility.h"
9
10#include "bu/itoserver.h" 8#include "bu/itoserver.h"
11#include <errno.h> 9#include <errno.h>
12#include "bu/serversocket.h" 10#include "bu/serversocket.h"
13#include "bu/client.h" 11#include "bu/client.h"
14#include "bu/socket.h" 12#include "bu/socket.h"
15#include "bu/osx_compatibility.h" 13
14#include "bu/config.h"
16 15
17Bu::ItoServer::ItoServer() : 16Bu::ItoServer::ItoServer() :
18 nTimeoutSec( 1 ), 17 nTimeoutSec( 1 ),
diff --git a/src/multiserver.cpp b/src/multiserver.cpp
index 4eccde8..a6cee36 100644
--- a/src/multiserver.cpp
+++ b/src/multiserver.cpp
@@ -5,12 +5,12 @@
5 * terms of the license contained in the file LICENSE. 5 * terms of the license contained in the file LICENSE.
6 */ 6 */
7 7
8#include "win32_compatibility.h"
9
10#include "bu/multiserver.h" 8#include "bu/multiserver.h"
11#include "bu/protocol.h" 9#include "bu/protocol.h"
12#include "bu/client.h" 10#include "bu/client.h"
13 11
12#include "bu/config.h"
13
14Bu::MultiServer::MultiServer() 14Bu::MultiServer::MultiServer()
15{ 15{
16} 16}
diff --git a/src/process.cpp b/src/process.cpp
index c6c86f2..da38e64 100644
--- a/src/process.cpp
+++ b/src/process.cpp
@@ -15,9 +15,8 @@
15#include <errno.h> 15#include <errno.h>
16 16
17#include <sys/select.h> 17#include <sys/select.h>
18#include "bu/osx_compatibility.h" 18
19#include "bu/win32_compatibility.h" 19#include "bu/config.h"
20#include "bu/linux_compatibility.h"
21 20
22Bu::Process::Process( Flags eFlags, const char *sName, char *const argv[] ) : 21Bu::Process::Process( Flags eFlags, const char *sName, char *const argv[] ) :
23 iStdIn( -1 ), 22 iStdIn( -1 ),
diff --git a/src/server.cpp b/src/server.cpp
index e55713d..64ddf9f 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -11,7 +11,7 @@
11#include "bu/serversocket.h" 11#include "bu/serversocket.h"
12#include "bu/client.h" 12#include "bu/client.h"
13#include "bu/socket.h" 13#include "bu/socket.h"
14#include "bu/osx_compatibility.h" 14#include "bu/config.h"
15 15
16Bu::Server::Server() : 16Bu::Server::Server() :
17 nTimeoutSec( 0 ), 17 nTimeoutSec( 0 ),
diff --git a/src/server.h b/src/server.h
index d83c346..e09246f 100644
--- a/src/server.h
+++ b/src/server.h
@@ -20,7 +20,8 @@
20#include "bu/clientlink.h" 20#include "bu/clientlink.h"
21#include "bu/clientlinkfactory.h" 21#include "bu/clientlinkfactory.h"
22#include "bu/hash.h" 22#include "bu/hash.h"
23#include "bu/win32_compatibility.h" 23
24#include "bu/config.h"
24 25
25namespace Bu 26namespace Bu
26{ 27{
diff --git a/src/serversocket.cpp b/src/serversocket.cpp
index 37eb3d4..87d0035 100644
--- a/src/serversocket.cpp
+++ b/src/serversocket.cpp
@@ -22,9 +22,8 @@
22//#include <termios.h> 22//#include <termios.h>
23#include <fcntl.h> 23#include <fcntl.h>
24#include "bu/serversocket.h" 24#include "bu/serversocket.h"
25#include "bu/osx_compatibility.h" 25
26#include "bu/win32_compatibility.h" 26#include "bu/config.h"
27#include "bu/linux_compatibility.h"
28 27
29namespace Bu { subExceptionDef( ServerSocketException ) } 28namespace Bu { subExceptionDef( ServerSocketException ) }
30 29
diff --git a/src/socket.cpp b/src/socket.cpp
index a175ee9..6a30f44 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -15,9 +15,8 @@
15#include <errno.h> 15#include <errno.h>
16#include <fcntl.h> 16#include <fcntl.h>
17#include "bu/socket.h" 17#include "bu/socket.h"
18#include "bu/osx_compatibility.h" 18
19#include "bu/win32_compatibility.h" 19#include "bu/config.h"
20#include "bu/linux_compatibility.h"
21 20
22#ifndef WIN32 21#ifndef WIN32
23 #include <sys/socket.h> 22 #include <sys/socket.h>