From ff3fc4bfac24a20baa7672a0318255513a4a7a24 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Sun, 20 Sep 2009 17:08:00 -0400 Subject: [PATCH] more work towards compiling under cygwin --- lib/include/bear/debug.h | 13 +++++-------- lib/vars.mk | 6 +++--- physics/src/handleSignal.cpp | 10 +++++++--- physics/src/input/inputManager.cpp | 2 +- physics/vars.mk | 14 ++++++++++---- tests/vars.mk | 22 +++++++++++++++++++++- vars.mk | 9 ++++++--- 7 files changed, 53 insertions(+), 23 deletions(-) diff --git a/lib/include/bear/debug.h b/lib/include/bear/debug.h index c8635bc..7dafd6b 100644 --- a/lib/include/bear/debug.h +++ b/lib/include/bear/debug.h @@ -48,18 +48,15 @@ namespace bear } // namespace bear -#if 0 - -#include #define BEAR_CASSERT(f) typedef struct bear::cassert_typedef_dummy)> 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 + #define BEAR_DASSERT(f) ((f) ? (void)0 : bear::debug::printTrace(), assert(f)) +#else + #define BEAR_DASSERT(f) (void)(f) #endif diff --git a/lib/vars.mk b/lib/vars.mk index f22cca6..78e26e5 100644 --- a/lib/vars.mk +++ b/lib/vars.mk @@ -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 diff --git a/physics/src/handleSignal.cpp b/physics/src/handleSignal.cpp index d8b3ed9..04b63cb 100644 --- a/physics/src/handleSignal.cpp +++ b/physics/src/handleSignal.cpp @@ -23,13 +23,15 @@ /// ***** 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__ diff --git a/physics/src/input/inputManager.cpp b/physics/src/input/inputManager.cpp index b7569b9..e0b0c82 100644 --- a/physics/src/input/inputManager.cpp +++ b/physics/src/input/inputManager.cpp @@ -55,7 +55,7 @@ void input::clean() /// ***** Public Methods ***** -const Uint32 eventMask = -1; // ALL events +const Uint32 eventMask = 0xffffffff; // ALL events void input::update() { diff --git a/physics/vars.mk b/physics/vars.mk index 7e474ad..f4f4e54 100644 --- a/physics/vars.mk +++ b/physics/vars.mk @@ -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 diff --git a/tests/vars.mk b/tests/vars.mk index 4821e15..8e966f5 100644 --- a/tests/vars.mk +++ b/tests/vars.mk @@ -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 --- 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 -- 2.10.2