Linux fix patch

Linux geeks and Mac OS hipsters unite! A board for discussion of Supermodel on non-Windows platforms.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

Re: Linux fix patch

Postby sergio-br2 » Mon May 09, 2016 3:53 pm

The patch update:

Code: Select all
Index: trunk/Makefiles/Makefile.SDL.UNIX.GCC
===================================================================
--- trunk.orig/Makefiles/Makefile.SDL.UNIX.GCC   2016-05-08 18:35:59.792549313 -0300
+++ trunk/Makefiles/Makefile.SDL.UNIX.GCC   2016-05-08 18:35:59.756548606 -0300
@@ -70,12 +70,27 @@
 # Compiler and Linker
 ###############################################################################
 
+USE_MINIZIP_STATIC ?= 0
+USE_GLEW_STATIC ?= 0
+
 CC = gcc
 LD = gcc
 COMPILER_FLAGS = $(SDL_CFLAGS) -ISrc/ -ISrc/OSD/SDL/ -ISrc/Pkgs/ -c -Wall -O3
-CFLAGS = $(COMPILER_FLAGS)
-CPPFLAGS = $(COMPILER_FLAGS) -I$(BOOST_INCLUDEPATH) -std=c++11
-LFLAGS = -o $(OUTFILE) $(SDL_LIBFLAGS) -lGL -lGLU -lz -lm -lstdc++
+CFLAGS += $(COMPILER_FLAGS)
+CPPFLAGS += $(CXXFLAGS) $(COMPILER_FLAGS) -std=c++11
+LFLAGS += -o $(OUTFILE) $(SDL_LIBFLAGS) -lGL -lGLU -lz -lm -lstdc++
+
+ifeq ($(USE_GLEW_STATIC), 1)
+   COMPILER_FLAGS += -DGLEW_STATIC
+else
+   LFLAGS += -lGLEW
+endif
+
+ifeq ($(USE_MINIZIP_STATIC), 1)
+   COMPILER_FLAGS += -DMINIZIP_STATIC
+else
+   LFLAGS += -lminizip
+endif
 
 #
 # Build options...
@@ -96,7 +111,7 @@
 #
 HEADERS = Src/Supermodel.h Src/Games.h Src/OSD/SDL/Types.h
 OBJ = $(OBJ_DIR)/PPCDisasm.o $(OBJ_DIR)/Games.o $(OBJ_DIR)/Config.o $(OBJ_DIR)/INIFile.o $(OBJ_DIR)/BlockFile.o $(OBJ_DIR)/93C46.o \
-   $(OBJ_DIR)/ROMLoad.o $(OBJ_DIR)/unzip.o $(OBJ_DIR)/ioapi.o $(OBJ_DIR)/Error.o $(OBJ_DIR)/glew.o $(OBJ_DIR)/Shader.o \
+   $(OBJ_DIR)/ROMLoad.o $(OBJ_DIR)/Error.o $(OBJ_DIR)/Shader.o \
    $(OBJ_DIR)/Real3D.o $(OBJ_DIR)/Legacy3D.o $(OBJ_DIR)/Models.o $(OBJ_DIR)/TextureRefs.o \
    $(OBJ_DIR)/New3D.o $(OBJ_DIR)/Mat4.o $(OBJ_DIR)/Model.o $(OBJ_DIR)/PolyHeader.o $(OBJ_DIR)/Texture.o $(OBJ_DIR)/TextureSheet.o $(OBJ_DIR)/VBO.o $(OBJ_DIR)/Vec.o $(OBJ_DIR)/R3DShader.o \
    $(OBJ_DIR)/Render2D.o $(OBJ_DIR)/TileGen.o \
@@ -113,6 +128,14 @@
    $(OBJ_DIR)/Crypto.o \
    $(OBJ_DIR)/Format.o
 
+ifeq ($(USE_GLEW_STATIC), 1)
+   OBJ += $(OBJ_DIR)/glew.o
+endif
+
+ifeq ($(USE_MINIZIP_STATIC), 1)
+   OBJ += $(OBJ_DIR)/unzip.o $(OBJ_DIR)/ioapi.o
+endif
+
 # If built-in debugger enabled, include all debugging classes
 ifeq ($(strip $(ENABLE_DEBUGGER)),yes)
    OBJ += $(OBJ_DIR)/Debugger.o $(OBJ_DIR)/ConsoleDebugger.o $(OBJ_DIR)/SupermodelDebugger.o $(OBJ_DIR)/CPUDebug.o \
Index: trunk/Makefiles/Makefile.SDL.Win32.GCC
===================================================================
--- trunk.orig/Makefiles/Makefile.SDL.Win32.GCC   2016-05-08 18:35:59.792549313 -0300
+++ trunk/Makefiles/Makefile.SDL.Win32.GCC   2016-05-08 18:35:59.756548606 -0300
@@ -97,7 +97,7 @@
 CC = gcc
 CXX = g++
 LD = g++
-COMPILER_FLAGS = -I$(SDL_INCLUDEPATH) -ISrc/ -ISrc/OSD/ -ISrc/OSD/SDL/ -ISrc/OSD/Windows/ -c -Wall -DSUPERMODEL_WIN32 -DGLEW_STATIC -O3
+COMPILER_FLAGS = -I$(SDL_INCLUDEPATH) -ISrc/ -ISrc/OSD/ -ISrc/OSD/SDL/ -ISrc/OSD/Windows/ -c -Wall -DSUPERMODEL_WIN32 -DGLEW_STATIC -DMINIZIP_STATIC -O3
 CFLAGS = $(COMPILER_FLAGS)
 CPPFLAGS = $(COMPILER_FLAGS) -I$(BOOST_INCLUDEPATH) -std=c++11
 LFLAGS = -o $(OUTFILE) $(OBJ) -L$(SDL_LIBPATH) -lmingw32 -lSDLmain -lSDL -lopengl32 -lglu32 -ldinput8 -ldxguid -lole32 -loleaut32 -lwbemuuid -lz -s #-l:$(WINSDK_LIBPATH)/WbemUuid.lib -s
Index: trunk/Src/Graphics/Legacy3D/Legacy3D.h
===================================================================
--- trunk.orig/Src/Graphics/Legacy3D/Legacy3D.h   2016-05-08 18:35:59.792549313 -0300
+++ trunk/Src/Graphics/Legacy3D/Legacy3D.h   2016-05-08 18:35:59.756548606 -0300
@@ -30,7 +30,11 @@
 #define INCLUDED_LEGACY3D_H
 
 #include "Graphics/IRender3D.h"
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 
 namespace Legacy3D {
 
Index: trunk/Src/Graphics/New3D/Model.h
===================================================================
--- trunk.orig/Src/Graphics/New3D/Model.h   2016-05-08 18:35:59.792549313 -0300
+++ trunk/Src/Graphics/New3D/Model.h   2016-05-08 18:35:59.784549156 -0300
@@ -1,7 +1,11 @@
 #ifndef _MODEL_H_
 #define _MODEL_H_
 
+#ifdef SUPERMODEL_WIN32
 #include "Types.h"
+#else
+#include <sys/types.h>
+#endif
 #include <vector>
 #include <unordered_map>
 #include <map>
@@ -127,4 +131,4 @@
 } // New3D
 
 
-#endif
\ No newline at end of file
+#endif
Index: trunk/Src/Graphics/New3D/New3D.h
===================================================================
--- trunk.orig/Src/Graphics/New3D/New3D.h   2016-05-08 18:35:59.792549313 -0300
+++ trunk/Src/Graphics/New3D/New3D.h   2016-05-08 18:35:59.784549156 -0300
@@ -28,7 +28,11 @@
 #ifndef INCLUDED_NEW3D_H
 #define INCLUDED_NEW3D_H
 
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 #include "Types.h"
 #include "TextureSheet.h"
 #include "Graphics/IRender3D.h"
Index: trunk/Src/Graphics/New3D/R3DShader.h
===================================================================
--- trunk.orig/Src/Graphics/New3D/R3DShader.h   2016-05-08 18:35:59.792549313 -0300
+++ trunk/Src/Graphics/New3D/R3DShader.h   2016-05-08 18:35:59.784549156 -0300
@@ -1,7 +1,11 @@
 #ifndef _R3DSHADER_H_
 #define _R3DSHADER_H_
 
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 #include "Model.h"
 
 namespace New3D {
@@ -67,4 +71,4 @@
 
 } // New3D
 
-#endif
\ No newline at end of file
+#endif
Index: trunk/Src/Graphics/New3D/Texture.h
===================================================================
--- trunk.orig/Src/Graphics/New3D/Texture.h   2016-05-08 18:35:59.792549313 -0300
+++ trunk/Src/Graphics/New3D/Texture.h   2016-05-08 18:35:59.784549156 -0300
@@ -2,7 +2,11 @@
 #define _TEXTURE_H_
 
 #include "Types.h"
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"   //arg
+#else
+#include <GL/glew.h>   //arg
+#endif
 
 namespace New3D {
   
Index: trunk/Src/Graphics/New3D/VBO.h
===================================================================
--- trunk.orig/Src/Graphics/New3D/VBO.h   2016-05-08 18:35:59.792549313 -0300
+++ trunk/Src/Graphics/New3D/VBO.h   2016-05-08 18:35:59.784549156 -0300
@@ -1,7 +1,11 @@
 #ifndef _VBO_H_
 #define _VBO_H_
 
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 
 namespace New3D {
 
Index: trunk/Src/Graphics/Render2D.cpp
===================================================================
--- trunk.orig/Src/Graphics/Render2D.cpp   2016-05-08 18:35:59.792549313 -0300
+++ trunk/Src/Graphics/Render2D.cpp   2016-05-08 18:35:59.788549234 -0300
@@ -275,7 +275,11 @@
  */
 
 #include <cstring>
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 #include "Supermodel.h"
 #include "Graphics/Shaders2D.h" // fragment and vertex shaders
 
Index: trunk/Src/Graphics/Render2D.h
===================================================================
--- trunk.orig/Src/Graphics/Render2D.h   2016-05-08 18:35:59.792549313 -0300
+++ trunk/Src/Graphics/Render2D.h   2016-05-08 18:35:59.788549234 -0300
@@ -28,7 +28,11 @@
 #ifndef INCLUDED_RENDER2D_H
 #define INCLUDED_RENDER2D_H
 
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 
 
 /*
Index: trunk/Src/Graphics/Shader.cpp
===================================================================
--- trunk.orig/Src/Graphics/Shader.cpp   2016-05-08 18:35:59.792549313 -0300
+++ trunk/Src/Graphics/Shader.cpp   2016-05-08 18:35:59.788549234 -0300
@@ -44,7 +44,11 @@
 
 #include <new>
 #include <cstdio>
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 #include "Supermodel.h"
 
 
Index: trunk/Src/Graphics/Shader.h
===================================================================
--- trunk.orig/Src/Graphics/Shader.h   2016-05-08 18:35:59.792549313 -0300
+++ trunk/Src/Graphics/Shader.h   2016-05-08 18:35:59.788549234 -0300
@@ -28,7 +28,11 @@
 #ifndef INCLUDED_SHADER_H
 #define INCLUDED_SHADER_H
 
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 
 /*
  * LoadShaderProgram(shaderProgramPtr, vertexShaderPtr, fragmentShaderPtr,
Index: trunk/Src/OSD/SDL/Main.cpp
===================================================================
--- trunk.orig/Src/OSD/SDL/Main.cpp   2016-05-08 18:35:59.792549313 -0300
+++ trunk/Src/OSD/SDL/Main.cpp   2016-05-08 18:35:59.788549234 -0300
@@ -48,7 +48,11 @@
 #include <cstdarg>
 #include <memory>
 #include <vector>
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 #ifdef SUPERMODEL_OSX
 #include <SDL/SDL.h>
 #else
Index: trunk/Src/ROMLoad.cpp
===================================================================
--- trunk.orig/Src/ROMLoad.cpp   2016-05-08 18:35:59.792549313 -0300
+++ trunk/Src/ROMLoad.cpp   2016-05-08 18:35:59.788549234 -0300
@@ -28,7 +28,11 @@
 #include <new>
 #include <cstring>
 #include "Supermodel.h"
+#ifdef MINIZIP_STATIC
 #include "Pkgs/unzip.h"
+#else
+#include <minizip/unzip.h>
+#endif
 
 static bool IsPowerOfTwo(long x)
 {

sergio-br2
 
Posts: 22
Joined: Wed May 27, 2015 7:14 pm

Re: Linux fix patch

Postby sergio-br2 » Mon May 09, 2016 3:55 pm

Bart, btw, it's missing a

Code: Select all
#include <float.h>


In Src/Graphics/New3D/New3D.cpp
sergio-br2
 
Posts: 22
Joined: Wed May 27, 2015 7:14 pm

Re: Linux fix patch

Postby Bart » Mon May 09, 2016 8:30 pm

I've fixed FLT_MAX in New3D.cpp to use the C++ limits header file instead. Re: the GLEW_STATIC and MINIZIP_STATIC defines, why are they necessary? Note that Supermodel includes glew and both it and libz ought to be linked statically.
User avatar
Bart
Site Admin
 
Posts: 1838
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: Linux fix patch

Postby Ian » Fri May 13, 2016 5:52 am

Bart wrote:I've fixed FLT_MAX in New3D.cpp to use the C++ limits header file instead. Re: the GLEW_STATIC and MINIZIP_STATIC defines, why are they necessary? Note that Supermodel includes glew and both it and libz ought to be linked statically.


In c++ or at least in visual studio the c++ limits just returns the same FLT_MAX define as the C headers :p
Ian
 
Posts: 878
Joined: Tue Feb 23, 2016 9:23 am

Re: Linux fix patch

Postby sergio-br2 » Tue Jul 05, 2016 5:19 pm

It would be nice if the devs tests the build on Linux. It breaks every 2 weeks :D

I fix the patch, and soon it's no useful.

@Bart, if you subscribe to the supermodel team or random stuff team on launchpad, you'll know when it breaks. It builds daily if there's a new commit.
sergio-br2
 
Posts: 22
Joined: Wed May 27, 2015 7:14 pm

Re: Linux fix patch

Postby sergio-br2 » Sun Oct 16, 2016 6:25 pm

The build broke again...

Code: Select all
gcc  obj/PPCDisasm.o obj/Games.o obj/Config.o obj/INIFile.o obj/BlockFile.o obj/93C46.o obj/ROMLoad.o obj/Error.o obj/Shader.o obj/Real3D.o obj/Legacy3D.o obj/Models.o obj/TextureRefs.o obj/New3D.o obj/Mat4.o obj/Model.o obj/PolyHeader.o obj/Texture.o obj/TextureSheet.o obj/VBO.o obj/Vec.o obj/R3DShader.o obj/R3DFloat.o obj/Render2D.o obj/TileGen.o obj/Model3.o obj/ppc.o obj/Main.o obj/Audio.o obj/Thread.o obj/SoundBoard.o obj/SCSP.o obj/SCSPDSP.o obj/68K.o obj/m68kcpu.o obj/m68kopnz.o obj/m68kopdm.o obj/m68kopac.o obj/m68kops.o obj/DSB.o obj/Z80.o obj/IRQ.o obj/53C810.o obj/PCI.o obj/RTC72421.o obj/DriveBoard.o obj/MPC10x.o obj/Input.o obj/Inputs.o obj/InputSource.o obj/InputSystem.o obj/InputTypes.o obj/MultiInputSource.o obj/SDLInputSystem.o obj/Outputs.o obj/amp_audio.o obj/amp_dump.o obj/amp_getbits.o obj/amp_getdata.o obj/amp_huffman.o obj/amp_layer2.o obj/amp_layer3.o obj/amp_misc2.o obj/amp_position.o obj/amp_transform.o obj/amp_util.o obj/Crypto.o obj/Logger.o obj/Format.o obj/unzip.o obj/ioapi.o -o bin/Supermodel `sdl-config --libs` -lGL -lGLU -lz -lm -lstdc++ -lGLEW
obj/New3D.o: In function `New3D::CNew3D::~CNew3D()':
./Src/Graphics/New3D/New3D.cpp:28: undefined reference to `New3D::R3DScrollFog::~R3DScrollFog()'
obj/New3D.o: In function `New3D::CNew3D::CNew3D()':
./Src/Graphics/New3D/New3D.cpp:19: undefined reference to `New3D::R3DScrollFog::R3DScrollFog()'
obj/New3D.o: In function `New3D::CNew3D::DrawScrollFog()':
./Src/Graphics/New3D/New3D.cpp:93: undefined reference to `New3D::R3DScrollFog::DrawScrollFog(float, float, float, float)'
./Src/Graphics/New3D/New3D.cpp:93: undefined reference to `New3D::R3DScrollFog::DrawScrollFog(float, float, float, float)'
sergio-br2
 
Posts: 22
Joined: Wed May 27, 2015 7:14 pm

Re: Linux fix patch

Postby Bart » Tue Oct 18, 2016 3:02 pm

sergio-br2 wrote:It would be nice if the devs tests the build on Linux. It breaks every 2 weeks :D

I fix the patch, and soon it's no useful.

@Bart, if you subscribe to the supermodel team or random stuff team on launchpad, you'll know when it breaks. It builds daily if there's a new commit.


I'll have to check this out. I don't run Linux at home, unfortunately. The build will definitely be fixed when a release happens.
User avatar
Bart
Site Admin
 
Posts: 1838
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: Linux fix patch

Postby Bart » Tue Oct 18, 2016 3:03 pm

To fix the latest build, see this thread.
User avatar
Bart
Site Admin
 
Posts: 1838
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: Linux fix patch

Postby sergio-br2 » Sat Dec 10, 2016 7:18 pm

Last patch

Code: Select all
Index: trunk/Makefiles/Makefile.SDL.UNIX.GCC
===================================================================
--- trunk.orig/Makefiles/Makefile.SDL.UNIX.GCC   2016-12-10 23:53:49.917313984 -0200
+++ trunk/Makefiles/Makefile.SDL.UNIX.GCC   2016-12-10 23:59:52.247078129 -0200
@@ -70,12 +70,27 @@
 # Compiler and Linker
 ###############################################################################
 
+USE_MINIZIP_STATIC ?= 0
+USE_GLEW_STATIC ?= 0
+
 CC = gcc
 LD = gcc
 COMPILER_FLAGS = $(SDL_CFLAGS) -ISrc/ -ISrc/OSD/SDL/ -ISrc/Pkgs/ -c -Wall -O3
-CFLAGS = $(COMPILER_FLAGS)
-CPPFLAGS = $(COMPILER_FLAGS) -I$(BOOST_INCLUDEPATH) -std=c++11
-LFLAGS = -o $(OUTFILE) $(SDL_LIBFLAGS) -lGL -lGLU -lz -lm -lstdc++
+CFLAGS += $(COMPILER_FLAGS)
+CPPFLAGS += $(CXXFLAGS) $(COMPILER_FLAGS) -std=c++11
+LFLAGS += -o $(OUTFILE) $(SDL_LIBFLAGS) -lGL -lGLU -lz -lm -lstdc++
+
+ifeq ($(USE_GLEW_STATIC), 1)
+   COMPILER_FLAGS += -DGLEW_STATIC
+else
+   LFLAGS += -lGLEW
+endif
+
+ifeq ($(USE_MINIZIP_STATIC), 1)
+   COMPILER_FLAGS += -DMINIZIP_STATIC
+else
+   LFLAGS += -lminizip
+endif
 
 #
 # Build options...
@@ -96,9 +111,9 @@
 #
 HEADERS = Src/Supermodel.h Src/Games.h Src/OSD/SDL/Types.h
 OBJ = $(OBJ_DIR)/PPCDisasm.o $(OBJ_DIR)/Games.o $(OBJ_DIR)/Config.o $(OBJ_DIR)/INIFile.o $(OBJ_DIR)/BlockFile.o $(OBJ_DIR)/93C46.o \
-   $(OBJ_DIR)/ROMLoad.o $(OBJ_DIR)/unzip.o $(OBJ_DIR)/ioapi.o $(OBJ_DIR)/Error.o $(OBJ_DIR)/glew.o $(OBJ_DIR)/Shader.o \
+   $(OBJ_DIR)/ROMLoad.o $(OBJ_DIR)/Error.o $(OBJ_DIR)/Shader.o \
    $(OBJ_DIR)/Real3D.o $(OBJ_DIR)/Legacy3D.o $(OBJ_DIR)/Models.o $(OBJ_DIR)/TextureRefs.o \
-   $(OBJ_DIR)/New3D.o $(OBJ_DIR)/Mat4.o $(OBJ_DIR)/Model.o $(OBJ_DIR)/PolyHeader.o $(OBJ_DIR)/Texture.o $(OBJ_DIR)/TextureSheet.o $(OBJ_DIR)/VBO.o $(OBJ_DIR)/Vec.o $(OBJ_DIR)/R3DShader.o $(OBJ_DIR)/R3DFloat.o \
+   $(OBJ_DIR)/New3D.o $(OBJ_DIR)/Mat4.o $(OBJ_DIR)/Model.o $(OBJ_DIR)/PolyHeader.o $(OBJ_DIR)/Texture.o $(OBJ_DIR)/TextureSheet.o $(OBJ_DIR)/VBO.o $(OBJ_DIR)/Vec.o $(OBJ_DIR)/R3DShader.o $(OBJ_DIR)/R3DFloat.o $(OBJ_DIR)/R3DScrollFog.o \
    $(OBJ_DIR)/Render2D.o $(OBJ_DIR)/TileGen.o \
    $(OBJ_DIR)/Model3.o $(OBJ_DIR)/ppc.o $(OBJ_DIR)/Main.o $(OBJ_DIR)/Audio.o $(OBJ_DIR)/Thread.o $(OBJ_DIR)/SoundBoard.o \
    $(OBJ_DIR)/SCSP.o $(OBJ_DIR)/SCSPDSP.o $(OBJ_DIR)/68K.o $(OBJ_DIR)/m68kcpu.o $(OBJ_DIR)/m68kopnz.o $(OBJ_DIR)/m68kopdm.o \
@@ -114,6 +129,14 @@
    $(OBJ_DIR)/Logger.o \
    $(OBJ_DIR)/Format.o
 
+ifeq ($(USE_GLEW_STATIC), 1)
+   OBJ += $(OBJ_DIR)/glew.o
+endif
+
+ifeq ($(USE_MINIZIP_STATIC), 1)
+   OBJ += $(OBJ_DIR)/unzip.o $(OBJ_DIR)/ioapi.o
+endif
+
 # If built-in debugger enabled, include all debugging classes
 ifeq ($(strip $(ENABLE_DEBUGGER)),yes)
    OBJ += $(OBJ_DIR)/Debugger.o $(OBJ_DIR)/ConsoleDebugger.o $(OBJ_DIR)/SupermodelDebugger.o $(OBJ_DIR)/CPUDebug.o \
Index: trunk/Makefiles/Makefile.SDL.Win32.GCC
===================================================================
--- trunk.orig/Makefiles/Makefile.SDL.Win32.GCC   2016-12-10 23:53:49.917313984 -0200
+++ trunk/Makefiles/Makefile.SDL.Win32.GCC   2016-12-10 23:53:49.913313919 -0200
@@ -97,7 +97,7 @@
 CC = gcc
 CXX = g++
 LD = g++
-COMPILER_FLAGS = -I$(SDL_INCLUDEPATH) -ISrc/ -ISrc/OSD/ -ISrc/OSD/SDL/ -ISrc/OSD/Windows/ -c -Wall -DSUPERMODEL_WIN32 -DGLEW_STATIC -O3
+COMPILER_FLAGS = -I$(SDL_INCLUDEPATH) -ISrc/ -ISrc/OSD/ -ISrc/OSD/SDL/ -ISrc/OSD/Windows/ -c -Wall -DSUPERMODEL_WIN32 -DGLEW_STATIC -DMINIZIP_STATIC -O3
 CFLAGS = $(COMPILER_FLAGS)
 CPPFLAGS = $(COMPILER_FLAGS) -I$(BOOST_INCLUDEPATH) -std=c++11
 LFLAGS = -o $(OUTFILE) $(OBJ) -L$(SDL_LIBPATH) -lmingw32 -lSDLmain -lSDL -lopengl32 -lglu32 -ldinput8 -ldxguid -lole32 -loleaut32 -lwbemuuid -lz -s #-l:$(WINSDK_LIBPATH)/WbemUuid.lib -s
Index: trunk/Src/Graphics/Legacy3D/Legacy3D.h
===================================================================
--- trunk.orig/Src/Graphics/Legacy3D/Legacy3D.h   2016-12-10 23:53:49.917313984 -0200
+++ trunk/Src/Graphics/Legacy3D/Legacy3D.h   2016-12-10 23:53:49.913313919 -0200
@@ -30,7 +30,11 @@
 #define INCLUDED_LEGACY3D_H
 
 #include "Graphics/IRender3D.h"
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 
 namespace Legacy3D {
 
Index: trunk/Src/Graphics/New3D/Model.h
===================================================================
--- trunk.orig/Src/Graphics/New3D/Model.h   2016-12-10 23:53:49.917313984 -0200
+++ trunk/Src/Graphics/New3D/Model.h   2016-12-10 23:53:49.913313919 -0200
@@ -1,7 +1,11 @@
 #ifndef _MODEL_H_
 #define _MODEL_H_
 
+#ifdef SUPERMODEL_WIN32
 #include "Types.h"
+#else
+#include <sys/types.h>
+#endif
 #include <vector>
 #include <unordered_map>
 #include <map>
@@ -144,4 +148,4 @@
 } // New3D
 
 
-#endif
\ No newline at end of file
+#endif
Index: trunk/Src/Graphics/New3D/New3D.h
===================================================================
--- trunk.orig/Src/Graphics/New3D/New3D.h   2016-12-10 23:53:49.917313984 -0200
+++ trunk/Src/Graphics/New3D/New3D.h   2016-12-10 23:53:49.913313919 -0200
@@ -28,7 +28,11 @@
 #ifndef INCLUDED_NEW3D_H
 #define INCLUDED_NEW3D_H
 
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 #include "Types.h"
 #include "TextureSheet.h"
 #include "Graphics/IRender3D.h"
Index: trunk/Src/Graphics/New3D/R3DShader.h
===================================================================
--- trunk.orig/Src/Graphics/New3D/R3DShader.h   2016-12-10 23:53:49.917313984 -0200
+++ trunk/Src/Graphics/New3D/R3DShader.h   2016-12-10 23:53:49.913313919 -0200
@@ -1,7 +1,11 @@
 #ifndef _R3DSHADER_H_
 #define _R3DSHADER_H_
 
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 #include "Model.h"
 
 namespace New3D {
@@ -73,4 +77,4 @@
 
 } // New3D
 
-#endif
\ No newline at end of file
+#endif
Index: trunk/Src/Graphics/New3D/Texture.h
===================================================================
--- trunk.orig/Src/Graphics/New3D/Texture.h   2016-12-10 23:53:49.917313984 -0200
+++ trunk/Src/Graphics/New3D/Texture.h   2016-12-10 23:53:49.913313919 -0200
@@ -2,7 +2,11 @@
 #define _TEXTURE_H_
 
 #include "Types.h"
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"   //arg
+#else
+#include <GL/glew.h>   //arg
+#endif
 
 namespace New3D {
   
Index: trunk/Src/Graphics/New3D/VBO.h
===================================================================
--- trunk.orig/Src/Graphics/New3D/VBO.h   2016-12-10 23:53:49.917313984 -0200
+++ trunk/Src/Graphics/New3D/VBO.h   2016-12-10 23:53:49.913313919 -0200
@@ -1,7 +1,11 @@
 #ifndef _VBO_H_
 #define _VBO_H_
 
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 
 namespace New3D {
 
Index: trunk/Src/Graphics/Render2D.cpp
===================================================================
--- trunk.orig/Src/Graphics/Render2D.cpp   2016-12-10 23:53:49.917313984 -0200
+++ trunk/Src/Graphics/Render2D.cpp   2016-12-10 23:53:49.913313919 -0200
@@ -275,7 +275,11 @@
  */
 
 #include <cstring>
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 #include "Supermodel.h"
 #include "Graphics/Shaders2D.h" // fragment and vertex shaders
 
Index: trunk/Src/Graphics/Render2D.h
===================================================================
--- trunk.orig/Src/Graphics/Render2D.h   2016-12-10 23:53:49.917313984 -0200
+++ trunk/Src/Graphics/Render2D.h   2016-12-10 23:53:49.913313919 -0200
@@ -28,7 +28,11 @@
 #ifndef INCLUDED_RENDER2D_H
 #define INCLUDED_RENDER2D_H
 
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 
 
 /*
Index: trunk/Src/Graphics/Shader.cpp
===================================================================
--- trunk.orig/Src/Graphics/Shader.cpp   2016-12-10 23:53:49.917313984 -0200
+++ trunk/Src/Graphics/Shader.cpp   2016-12-10 23:53:49.913313919 -0200
@@ -44,7 +44,11 @@
 
 #include <new>
 #include <cstdio>
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 #include "Supermodel.h"
 
 
Index: trunk/Src/Graphics/Shader.h
===================================================================
--- trunk.orig/Src/Graphics/Shader.h   2016-12-10 23:53:49.917313984 -0200
+++ trunk/Src/Graphics/Shader.h   2016-12-10 23:53:49.917313984 -0200
@@ -28,7 +28,11 @@
 #ifndef INCLUDED_SHADER_H
 #define INCLUDED_SHADER_H
 
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 
 /*
  * LoadShaderProgram(shaderProgramPtr, vertexShaderPtr, fragmentShaderPtr,
Index: trunk/Src/OSD/SDL/Main.cpp
===================================================================
--- trunk.orig/Src/OSD/SDL/Main.cpp   2016-12-10 23:53:49.917313984 -0200
+++ trunk/Src/OSD/SDL/Main.cpp   2016-12-10 23:53:49.917313984 -0200
@@ -48,7 +48,11 @@
 #include <cstdarg>
 #include <memory>
 #include <vector>
+#ifdef GLEW_STATIC
 #include "Pkgs/glew.h"
+#else
+#include <GL/glew.h>
+#endif
 #ifdef SUPERMODEL_OSX
 #include <SDL/SDL.h>
 #else
Index: trunk/Src/ROMLoad.cpp
===================================================================
--- trunk.orig/Src/ROMLoad.cpp   2016-12-10 23:53:49.917313984 -0200
+++ trunk/Src/ROMLoad.cpp   2016-12-10 23:53:49.917313984 -0200
@@ -28,7 +28,11 @@
 #include <new>
 #include <cstring>
 #include "Supermodel.h"
+#ifdef MINIZIP_STATIC
 #include "Pkgs/unzip.h"
+#else
+#include <minizip/unzip.h>
+#endif
 
 static bool IsPowerOfTwo(long x)
 {

sergio-br2
 
Posts: 22
Joined: Wed May 27, 2015 7:14 pm

Re: Linux fix patch

Postby sergio-br2 » Sat Apr 01, 2017 6:49 pm

Missing $(OBJ_DIR)/NewConfig.o in unix makefile, as well this:

$(OBJ_DIR)/ByteSwap.o $(OBJ_DIR)/ConfigBuilders.o $(OBJ_DIR)/GameLoader.o

Also, error in memcpy:

Code: Select all
In file included from Src/GameLoader.h:7:0,
                 from Src/GameLoader.cpp:1:
Src/ROMSet.h: In member function ‘void ROM::CopyTo(uint8_t*, size_t) const’:
Src/ROMSet.h:21:36: error: ‘memcpy’ was not declared in this scope
     memcpy(dest, src, bytes_to_copy);
                                    ^


Edit: Missing $(OBJ_DIR)/tinyxml2.o too
sergio-br2
 
Posts: 22
Joined: Wed May 27, 2015 7:14 pm

PreviousNext

Return to Alternative Fashion

Who is online

Users browsing this forum: No registered users and 1 guest