more work towards compiling under cygwin
authorPatrik Gornicz <Gornicz.P@gmail.com>
Sun, 20 Sep 2009 21:08:00 +0000 (17:08 -0400)
committerPatrik Gornicz <Gornicz.P@gmail.com>
Sun, 20 Sep 2009 21:08:00 +0000 (17:08 -0400)
lib/include/bear/debug.h
lib/vars.mk
physics/src/handleSignal.cpp
physics/src/input/inputManager.cpp
physics/vars.mk
tests/vars.mk
vars.mk

index c8635bc..7dafd6b 100644 (file)
@@ -48,18 +48,15 @@ namespace bear
 
 } // namespace bear
 
-#if 0
-
-#include <assert.h>
 
 #define BEAR_CASSERT(f)   typedef struct bear::cassert_typedef_dummy<sizeof(bear::CASSERT_FAILURE<f>)> cassert_typedef
-#define BEAR_DASSERT(f)   ((f) ? (void)0 : bear::debug::printTrace(), assert(f))
-
-#else
 
-#define BEAR_CASSERT(f)   (void)0
-#define BEAR_DASSERT(f)   (void)0
+#if 0
+    #include <assert.h>
 
+    #define BEAR_DASSERT(f)   ((f) ? (void)0 : bear::debug::printTrace(), assert(f))
+#else
+    #define BEAR_DASSERT(f)   (void)(f)
 #endif
 
 
index f22cca6..78e26e5 100644 (file)
@@ -60,9 +60,9 @@ ifeq (${G_BUILD},${B_WIN32})
     REALNAME_$P    := bear.dll
 else
 ifeq (${G_BUILD},${B_CYGWIN})
-    LINKERNAME_$P  := bear.dll
-    SONAME_$P      := bear.dll
-    REALNAME_$P    := bear.dll
+    LINKERNAME_$P  := libbear.so
+    SONAME_$P      := libbear.so.0
+    REALNAME_$P    := libbear.so.0.0
 else
     $(error 'G_BUILD = ${G_BUILD}' is invalid.)
 endif
index d8b3ed9..04b63cb 100644 (file)
 
 /// ***** Private Method Headers *****
 
+#if 0 //ndef __WIN32__
 static void sighandler( int iSig );
+#endif // __WIN32__
 
 /// ***** Public Methods *****
 
 void installSignal()
 {
-#ifndef __WIN32__
+#if 0 //ndef __WIN32__
     // register signal handler
     struct sigaction sa;
     sigemptyset( &sa.sa_mask );
@@ -45,10 +47,11 @@ void installSignal()
 
 /// ***** Private Methods *****
 
+#if 0 //ndef __WIN32__
+
 // signal handler function
 void sighandler( int iSig )
 {
-#ifndef __WIN32__
     switch(iSig)
     {
         case SIGINT:
@@ -60,5 +63,6 @@ void sighandler( int iSig )
     }
 
     abort();
-#endif // __WIN32__
 }
+
+#endif // __WIN32__
index b7569b9..e0b0c82 100644 (file)
@@ -55,7 +55,7 @@ void input::clean()
 
 /// ***** Public Methods *****
 
-const Uint32 eventMask = -1; // ALL events
+const Uint32 eventMask = 0xffffffff; // ALL events
 
 void input::update()
 {
index 7e474ad..f4f4e54 100644 (file)
@@ -1,7 +1,7 @@
 
 CXX_$P      := ${G_CXX}
 CXXFLAGS_$P := ${G_CXXFLAGS}
-LNKFLAGS_$P := ${G_LNKFLAGS} -Wl,-rpath,libs/ -rdynamic
+LNKFLAGS_$P := ${G_LNKFLAGS}
 LIBS_$P     := ${G_LIBSDL} ${G_LIBGL}
 
 SRCSDIR_$P := ${CURDIR}/${G_SRCSDIR}
@@ -26,15 +26,21 @@ LIBSDIRNAME_$P := libs
 SRCLIBSDIR_$P  := ${CURDIR}/${LIBSDIRNAME_$P}
 ifeq (${G_BUILD},${B_DEBUG})
     DSTLIBSDIR_$P  := ${BINDIR_$P}/${LIBSDIRNAME_$P}
+    LNKFLAGS_$P    += -Wl,-rpath,libs/ -rdynamic
 else
 ifeq (${G_BUILD},${B_FINAL})
     DSTLIBSDIR_$P  := ${BINDIR_$P}/${LIBSDIRNAME_$P}
+    LNKFLAGS_$P    += -Wl,-rpath,libs/ -rdynamic
 else
 ifeq (${G_BUILD},${B_WIN32})
-    DSTLIBSDIR_$P  := ${BINDIR_$P}
+    #DSTLIBSDIR_$P  := ${BINDIR_$P}
+    DSTLIBSDIR_$P  := ${BINDIR_$P}/${LIBSDIRNAME_$P}
+    LNKFLAGS_$P    += -Wl,-rpath,./
 else
 ifeq (${G_BUILD},${B_CYGWIN})
-    DSTLIBSDIR_$P  := ${BINDIR_$P}
+    #DSTLIBSDIR_$P  := ${BINDIR_$P}
+    DSTLIBSDIR_$P  := ${BINDIR_$P}/${LIBSDIRNAME_$P}
+    LNKFLAGS_$P    += -Wl,-rpath,./
 else
     $(error 'G_BUILD = ${G_BUILD}' is invalid.)
 endif
@@ -59,7 +65,7 @@ ifeq (${G_BUILD},${B_WIN32})
     LIBSCPY_$P += SDL.dll
 else
 ifeq (${G_BUILD},${B_CYGWIN})
-    LIBSCPY_$P += SDL.dll
+    LIBSCPY_$P += libSDL-1.2.so.0
 else
     $(error 'G_BUILD = ${G_BUILD}' is invalid.)
 endif
index 4821e15..8e966f5 100644 (file)
@@ -1,7 +1,7 @@
 
 CXX_$P      := ${G_CXX}
 CXXFLAGS_$P := ${G_CXXFLAGS}
-LNKFLAGS_$P := ${G_LNKFLAGS} -Wl,-rpath,./ -rdynamic
+LNKFLAGS_$P := ${G_LNKFLAGS}
 LIBS_$P     := ${G_LIBSDL} ${G_LIBGL}
 
 SRCSDIR_$P := ${CURDIR}/${G_SRCSDIR}
@@ -9,6 +9,26 @@ DEPSDIR_$P := ${CURDIR}/${G_DEPSDIR}
 OBJSDIR_$P := ${CURDIR}/${G_OBJSDIR}
 BINDIR_$P  := ${CURDIR}/${G_BINDIR}
 
+
+ifeq (${G_BUILD},${B_DEBUG})
+    LNKFLAGS_$P    += -Wl,-rpath,./ -rdynamic
+else
+ifeq (${G_BUILD},${B_FINAL})
+    LNKFLAGS_$P    += -Wl,-rpath,./ -rdynamic
+else
+ifeq (${G_BUILD},${B_WIN32})
+    LNKFLAGS_$P    += -Wl,-rpath,./
+else
+ifeq (${G_BUILD},${B_CYGWIN})
+    LNKFLAGS_$P    += -Wl,-rpath,./
+else
+    $(error 'G_BUILD = ${G_BUILD}' is invalid.)
+endif
+endif
+endif
+endif
+
+
 # HACK
 T_INCDIRS_$P := lib/include
     INCFLAGS_$P  := $(addprefix -I, ${T_INCDIRS_$P})
diff --git a/vars.mk b/vars.mk
index a07ed49..1616d19 100644 (file)
--- a/vars.mk
+++ b/vars.mk
@@ -107,23 +107,26 @@ endif
 endif
 
 G_SRCSDIR := src
-G_DEPSDIR := deps
 
 ifeq (${G_BUILD},${B_DEBUG})
     G_OBJSDIR := objsd
     G_BINDIR  := bind
+    G_DEPSDIR := depsd
 else
 ifeq (${G_BUILD},${B_FINAL})
     G_OBJSDIR := objs
     G_BINDIR  := bin
+    G_DEPSDIR := deps
 else
 ifeq (${G_BUILD},${B_WIN32})
     G_OBJSDIR := objs-mingw32
     G_BINDIR  := bin-mingw32
+    G_DEPSDIR := deps-mingw32
 else
 ifeq (${G_BUILD},${B_CYGWIN})
-    G_OBJSDIR := objs
-    G_BINDIR  := bin
+    G_OBJSDIR := objs-cygwin
+    G_BINDIR  := bin-cygwin
+    G_DEPSDIR := deps-cygwin
 else
     $(error 'G_BUILD = ${G_BUILD}' is invalid.)
 endif