Some fixes that might help building under MSYS2.

This commit is contained in:
Marco Cawthorne 2022-05-06 17:32:13 -07:00
parent cc5f83e191
commit 743aa026a4
Signed by: eukara
GPG key ID: C196CD8BA993248A
3 changed files with 12 additions and 8 deletions

View file

@ -2,8 +2,9 @@
GTK_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) GTK_CFLAGS=$(shell pkg-config --cflags gtk+-2.0)
GLEXT_CFLAGS=$(shell pkg-config --cflags gtkglext-1.0) GLEXT_CFLAGS=$(shell pkg-config --cflags gtkglext-1.0)
GLIB_CFLAGS=$(shell pkg-config --cflags glib-2.0)
LIB_CFLAGS=$(CFLAGS) $(GTK_CFLAGS) $(GLEXT_CFLAGS) -I../../include -I../../libs -DGTK_TARGET=2 LIB_CFLAGS=$(CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS) $(GLEXT_CFLAGS) -I../../include -I../../libs -DGTK_TARGET=2
DO_CXX=$(CXX) -static -fPIC $(LIB_CFLAGS) -o $@ -c $< DO_CXX=$(CXX) -static -fPIC $(LIB_CFLAGS) -o $@ -c $<
.cpp.o: .cpp.o:

View file

@ -1,5 +1,9 @@
# WorldSpawn Makefile # WorldSpawn Makefile
# may be needed under msys2
GLIB_CFLAGS=$(shell pkg-config --cflags glib-2.0)
GLIB_LDFLAGS=$(shell pkg-config --libs glib-2.0)
GTK_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) GTK_CFLAGS=$(shell pkg-config --cflags gtk+-2.0)
GTK_LDFLAGS=$(shell pkg-config --libs gtk+-2.0) GTK_LDFLAGS=$(shell pkg-config --libs gtk+-2.0)
@ -31,8 +35,8 @@ WS_LIBS= ../libs/libcmdlib.a \
../libs/libuilib.a \ ../libs/libuilib.a \
../libs/libxmllib.a ../libs/libxmllib.a
WS_CFLAGS=$(CFLAGS) $(GTK_CFLAGS) $(XML_CFLAGS) $(GLEXT_CFLAGS) -I../include -I../libs -DGTK_TARGET=2 $(WS_VERSION) WS_CFLAGS=$(CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS) $(XML_CFLAGS) $(GLEXT_CFLAGS) -I../include -I../libs -DGTK_TARGET=2 $(WS_VERSION)
WS_LDFLAGS=$(LDFLAGS) -lm $(GTK_LDFLAGS) $(XML_LDFLAGS) $(GLEXT_LDFLAGS) -L../lib $(WS_LIBS) WS_LDFLAGS=$(LDFLAGS) -lm $(GLIB_LDFLAGS) $(GTK_LDFLAGS) $(XML_LDFLAGS) $(GLEXT_LDFLAGS) -L../lib $(WS_LIBS)
DO_CXX=$(CXX) $(WS_CFLAGS) -o $@ -c $< DO_CXX=$(CXX) $(WS_CFLAGS) -o $@ -c $<

View file

@ -175,7 +175,10 @@ typedef int ( QGL_DLLEXPORT *QGLFunctionPointer )();
QGLFunctionPointer QGL_getExtensionFunc(const char *symbol) QGLFunctionPointer QGL_getExtensionFunc(const char *symbol)
{ {
#if defined( XWINDOWS ) #if GDEF_OS_WINDOWS
ASSERT_NOTNULL( qwglGetProcAddress );
return (QGLFunctionPointer) qwglGetProcAddress( symbol );
#elif defined( XWINDOWS )
//ASSERT_NOTNULL(qglXGetProcAddressARB); //ASSERT_NOTNULL(qglXGetProcAddressARB);
if (qglXGetProcAddressARB == 0) { if (qglXGetProcAddressARB == 0) {
return reinterpret_cast<QGLFunctionPointer>( glInvalidFunction ); return reinterpret_cast<QGLFunctionPointer>( glInvalidFunction );
@ -191,10 +194,6 @@ QGLFunctionPointer QGL_getExtensionFunc(const char *symbol)
if (NSIsSymbolNameDefined(symbolName)) nssymbol = NSLookupAndBindSymbol(symbolName); if (NSIsSymbolNameDefined(symbolName)) nssymbol = NSLookupAndBindSymbol(symbolName);
free(symbolName); free(symbolName);
return nssymbol ? reinterpret_cast<QGLFunctionPointer>(NSAddressOfSymbol(nssymbol)) : reinterpret_cast<QGLFunctionPointer>(glInvalidFunction); return nssymbol ? reinterpret_cast<QGLFunctionPointer>(NSAddressOfSymbol(nssymbol)) : reinterpret_cast<QGLFunctionPointer>(glInvalidFunction);
#elif GDEF_OS_WINDOWS
ASSERT_NOTNULL( qwglGetProcAddress );
return (QGLFunctionPointer) qwglGetProcAddress( symbol );
#else
#error "unsupported platform" #error "unsupported platform"
#endif #endif
} }