diff --git a/libs/gtkutil/Makefile b/libs/gtkutil/Makefile index d9b1754..a531157 100644 --- a/libs/gtkutil/Makefile +++ b/libs/gtkutil/Makefile @@ -1,7 +1,9 @@ # WorldSpawn Makefile GTK_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -LIB_CFLAGS=$(CFLAGS) $(GTK_CFLAGS) -I../../include -I/usr/include/gtkglext-1.0 -I/usr/lib64/gtkglext-1.0/include/ -I../../libs -DGTK_TARGET=2 +GLEXT_CFLAGS=$(shell pkg-config --cflags gtkglext-1.0) + +LIB_CFLAGS=$(CFLAGS) $(GTK_CFLAGS) $(GLEXT_CFLAGS) -I../../include -I../../libs -DGTK_TARGET=2 DO_CXX=$(CXX) -static -fPIC $(LIB_CFLAGS) -o $@ -c $< .cpp.o: @@ -26,7 +28,7 @@ paned.o \ toolbar.o \ widget.o \ window.o \ -xorrectangle.o \ +xorrectangle.o # binary target ../libgtkutil.a: $(WS_OBJS) diff --git a/plugins/brushexport/Makefile b/plugins/brushexport/Makefile index 4ee1c4c..f39c470 100644 --- a/plugins/brushexport/Makefile +++ b/plugins/brushexport/Makefile @@ -1,7 +1,8 @@ # WorldSpawn Plugin Makefile -GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 +GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 GLIB_LDFLAGS=$(shell pkg-config --libs gtk+-2.0) + PLUGIN_CFLAGS=$(CFLAGS) $(GLIB_CFLAGS) -I../../include -I../../libs -fPIC -fvisibility=hidden PLUGIN_LDFLAGS=$(LDFLAGS) $(GLIB_LDFLAGS) -shared diff --git a/plugins/entity/Makefile b/plugins/entity/Makefile index 50b8886..31b2b1c 100644 --- a/plugins/entity/Makefile +++ b/plugins/entity/Makefile @@ -1,7 +1,8 @@ # WorldSpawn Makefile -GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 +GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 GLIB_LDFLAGS=$(shell pkg-config --libs gtk+-2.0) + PLUGIN_CFLAGS=$(CFLAGS) $(GLIB_CFLAGS) -I../../include -I../../libs -fPIC -fvisibility=hidden PLUGIN_LDFLAGS=$(LDFLAGS) $(GLIB_LDFLAGS) -shared diff --git a/plugins/image/Makefile b/plugins/image/Makefile index 658433a..f9dc760 100644 --- a/plugins/image/Makefile +++ b/plugins/image/Makefile @@ -1,9 +1,13 @@ # WorldSpawn Makefile -GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 +GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 GLIB_LDFLAGS=$(shell pkg-config --libs gtk+-2.0) -PLUGIN_CFLAGS=$(CFLAGS) $(GLIB_CFLAGS) -I../../include -I../../libs -fPIC -fvisibility=hidden -PLUGIN_LDFLAGS=$(LDFLAGS) $(GLIB_LDFLAGS) -shared -ljpeg + +JPEG_CFLAGS=$(shell pkg-config --cflags libjpeg) +JPEG_LDFLAGS=$(shell pkg-config --libs libjpeg) + +PLUGIN_CFLAGS=$(CFLAGS) $(GLIB_CFLAGS) $(JPEG_CFLAGS) -I../../include -I../../libs -fPIC -fvisibility=hidden +PLUGIN_LDFLAGS=$(LDFLAGS) $(GLIB_LDFLAGS) $(JPEG_LDFLAGS) -shared DO_CXX=$(CXX) $(PLUGIN_CFLAGS) -o $@ -c $< diff --git a/plugins/iqmmodel/Makefile b/plugins/iqmmodel/Makefile index 933fe0f..a6f8158 100644 --- a/plugins/iqmmodel/Makefile +++ b/plugins/iqmmodel/Makefile @@ -1,7 +1,8 @@ # WorldSpawn Makefile -GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 +GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 GLIB_LDFLAGS=$(shell pkg-config --libs gtk+-2.0) + PLUGIN_CFLAGS=$(CFLAGS) $(GLIB_CFLAGS) -I../../include -I../../libs -fPIC -fvisibility=hidden PLUGIN_LDFLAGS=$(LDFLAGS) $(GLIB_LDFLAGS) -shared diff --git a/plugins/mapq3/Makefile b/plugins/mapq3/Makefile index a10fce1..e2ae3ef 100644 --- a/plugins/mapq3/Makefile +++ b/plugins/mapq3/Makefile @@ -1,7 +1,8 @@ # WorldSpawn Makefile -GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 +GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 GLIB_LDFLAGS=$(shell pkg-config --libs gtk+-2.0) + PLUGIN_CFLAGS=$(CFLAGS) $(GLIB_CFLAGS) -I../../include -I../../libs -fPIC -fvisibility=hidden PLUGIN_LDFLAGS=$(LDFLAGS) $(GLIB_LDFLAGS) -shared diff --git a/plugins/model/Makefile b/plugins/model/Makefile index 9f7f7bc..a363387 100644 --- a/plugins/model/Makefile +++ b/plugins/model/Makefile @@ -1,7 +1,8 @@ # WorldSpawn Makefile -GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 +GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 GLIB_LDFLAGS=$(shell pkg-config --libs gtk+-2.0) + PLUGIN_CFLAGS=$(CFLAGS) $(GLIB_CFLAGS) -I../../include -I../../libs -fPIC -fvisibility=hidden PLUGIN_LDFLAGS=$(LDFLAGS) $(GLIB_LDFLAGS) -shared diff --git a/plugins/prtview/Makefile b/plugins/prtview/Makefile index 9576ed0..4671c7b 100644 --- a/plugins/prtview/Makefile +++ b/plugins/prtview/Makefile @@ -1,7 +1,8 @@ # WorldSpawn Plugin Makefile -GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 +GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 GLIB_LDFLAGS=$(shell pkg-config --libs gtk+-2.0) + PLUGIN_CFLAGS=$(CFLAGS) $(GLIB_CFLAGS) -I../../include -I../../libs -fPIC -fvisibility=hidden PLUGIN_LDFLAGS=$(LDFLAGS) $(GLIB_LDFLAGS) -shared diff --git a/plugins/shaders/Makefile b/plugins/shaders/Makefile index 1dc49d1..f68a381 100644 --- a/plugins/shaders/Makefile +++ b/plugins/shaders/Makefile @@ -1,7 +1,8 @@ # WorldSpawn Makefile -GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 +GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 GLIB_LDFLAGS=$(shell pkg-config --libs gtk+-2.0) + PLUGIN_CFLAGS=$(CFLAGS) $(GLIB_CFLAGS) -I../../include -I../../libs -fPIC -fvisibility=hidden PLUGIN_LDFLAGS=$(LDFLAGS) $(GLIB_LDFLAGS) -shared diff --git a/plugins/vfspk3/Makefile b/plugins/vfspk3/Makefile index 475033d..55e5c82 100644 --- a/plugins/vfspk3/Makefile +++ b/plugins/vfspk3/Makefile @@ -1,7 +1,8 @@ # WorldSpawn Makefile -GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 +GLIB_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) -DGTK_TARGET=2 GLIB_LDFLAGS=$(shell pkg-config --libs gtk+-2.0) + PLUGIN_CFLAGS=$(CFLAGS) $(GLIB_CFLAGS) -I../../include -I../../libs -fPIC -fvisibility=hidden PLUGIN_LDFLAGS=$(LDFLAGS) $(GLIB_LDFLAGS) -shared diff --git a/src/Makefile b/src/Makefile index 7503504..875912a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,30 +3,36 @@ GTK_CFLAGS=$(shell pkg-config --cflags gtk+-2.0) GTK_LDFLAGS=$(shell pkg-config --libs gtk+-2.0) -WS_LIBS= ../libs/libcmdlib.a \ -../libs/libcontainer.a \ -../libs/libddslib.a \ -../libs/libdebugging.a \ -../libs/libetclib.a \ -../libs/libgeneric.a \ -../libs/libgtkutil.a \ -../libs/libl_net.a \ -../libs/libmath.a \ -../libs/libmathlib.a \ -../libs/libmodulesystem.a \ -../libs/libos.a \ -../libs/libpicomodel.a \ -../libs/libprofile.a \ -../libs/libscript.a \ -../libs/libsignal.a \ -../libs/libsplines.a \ -../libs/libstream.a \ -../libs/libstring.a \ -../libs/libuilib.a \ -../libs/libxmllib.a +XML_CFLAGS=$(shell pkg-config --cflags libxml-2.0) +XML_LDFLAGS=$(shell pkg-config --libs libxml-2.0) -WS_CFLAGS=$(CFLAGS) $(GTK_CFLAGS) -I../include -I../libs -DGTK_TARGET=2 $(WS_VERSION) -WS_LDFLAGS=$(LDFLAGS) -lm $(GTK_LDFLAGS) -lX11 -lGL -lxml2 -lgdkglext-x11-1.0 -lgtkglext-x11-1.0 -L../lib $(WS_LIBS) +GLEXT_CFLAGS=$(shell pkg-config --cflags gtkglext-1.0) +GLEXT_LDFLAGS=$(shell pkg-config --libs gtkglext-1.0) + +WS_LIBS= ../libs/libcmdlib.a \ + ../libs/libcontainer.a \ + ../libs/libddslib.a \ + ../libs/libdebugging.a \ + ../libs/libetclib.a \ + ../libs/libgeneric.a \ + ../libs/libgtkutil.a \ + ../libs/libl_net.a \ + ../libs/libmath.a \ + ../libs/libmathlib.a \ + ../libs/libmodulesystem.a \ + ../libs/libos.a \ + ../libs/libpicomodel.a \ + ../libs/libprofile.a \ + ../libs/libscript.a \ + ../libs/libsignal.a \ + ../libs/libsplines.a \ + ../libs/libstream.a \ + ../libs/libstring.a \ + ../libs/libuilib.a \ + ../libs/libxmllib.a + +WS_CFLAGS=$(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) DO_CXX=$(CXX) $(WS_CFLAGS) -o $@ -c $< diff --git a/src/qgl.cpp b/src/qgl.cpp index a1b1211..1d85045 100644 --- a/src/qgl.cpp +++ b/src/qgl.cpp @@ -561,7 +561,7 @@ int QGL_Init(OpenGLBinding &table) qwglGetProcAddress = wglGetProcAddress; #elif defined( XWINDOWS ) qglXGetProcAddressARB = (glXGetProcAddressARBProc) dlsym(RTLD_DEFAULT, "glXGetProcAddressARB"); - if ((qglXQueryExtension == 0) || (qglXQueryExtension(XOpenDisplay(nullptr), 0, 0) != True)) { + if ((qglXQueryExtension == 0)) { return 0; } #elif GDEF_OS_MACOS diff --git a/tools/Makefile b/tools/Makefile index 6c67863..268086d 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -2,16 +2,29 @@ # ws libs vmap uses LIBOBJS=../libs/libddslib.a \ - ../libs/libetclib.a \ - ../libs/libfilematch.a \ - ../libs/libl_net.a \ - ../libs/libmathlib.a \ - ../libs/libpicomodel.a + ../libs/libetclib.a \ + ../libs/libfilematch.a \ + ../libs/libl_net.a \ + ../libs/libmathlib.a \ + ../libs/libpicomodel.a GLIB_CFLAGS=$(shell pkg-config --cflags glib-2.0) GLIB_LDFLAGS=$(shell pkg-config --libs glib-2.0) -VMAP_CFLAGS=$(CFLAGS) $(GLIB_CFLAGS) -I../include -I./common -I../libs -Wno-narrowing -VMAP_LDFLAGS=$(LDFLAGS) $(GLIB_LDFLAGS) -lm -lpthread -L../lib -lxml2 -ljpeg -lpng -lminizip $(LIBOBJS) + +XML_CFLAGS=$(shell pkg-config --cflags libxml-2.0) +XML_LDFLAGS=$(shell pkg-config --libs libxml-2.0) + +MINIZIP_CFLAGS=$(shell pkg-config --cflags minizip) +MINIZIP_LDFLAGS=$(shell pkg-config --libs minizip) + +JPEG_CFLAGS=$(shell pkg-config --cflags libjpeg) +JPEG_LDFLAGS=$(shell pkg-config --libs libjpeg) + +PNG_CFLAGS=$(shell pkg-config --cflags libpng) +PNG_LDFLAGS=$(shell pkg-config --libs libpng) + +VMAP_CFLAGS=$(CFLAGS) $(GLIB_CFLAGS) $(XML_CFLAGS) $(MINIZIP_CFLAGS) $(JPEG_CFLAGS) $(PNG_CFLAGS) -I../include -I./common -I../libs +VMAP_LDFLAGS=$(LDFLAGS) $(GLIB_LDFLAGS) $(XML_LDFLAGS) $(MINIZIP_LDFLAGS) $(JPEG_LDFLAGS) $(PNG_LDFLAGS) -lm -lpthread -L../lib $(LIBOBJS) DO_CC=$(CC) $(VMAP_CFLAGS) -o $@ -c $<