diff options
author | Stefan Gartner <stefang@aon.at> | 2008-11-24 17:15:05 +0300 |
---|---|---|
committer | Stefan Gartner <stefang@aon.at> | 2008-11-24 17:15:05 +0300 |
commit | f1474648d318808664ac37c77524b3171a65456a (patch) | |
tree | 36be28cf29275d0582202658d14bcd083be3f578 | |
parent | 1a28bf797e4103926bf181389bb68a8c97fccaa8 (diff) |
patch #8583: Add support for gcc on irix
to compile blender with gcc on IRIX, IRIX_USE_GCC needs to be set to true in
user-def.mk.
Other changes related to irix:
* compile solid from extern/
* don't build plugins (yet) with "make release" when using gcc (the shell
script used assumes MIPSpro is installed)
* use statvfs instead of statfs on irix, like done on solaris
* use external libs from $(LCGDIR) instead of /usr/freeware
* use glew header files from $(LCGDIR)/glew instead of the ones installed on
the system (this applies to other platforms as well)
* ffmpeg support currently is disabled on irix
-rw-r--r-- | extern/Makefile | 5 | ||||
-rw-r--r-- | intern/SoundSystem/Makefile | 3 | ||||
-rw-r--r-- | intern/elbeem/intern/utilities.h | 6 | ||||
-rw-r--r-- | release/Makefile | 6 | ||||
-rw-r--r-- | source/Makefile | 15 | ||||
-rw-r--r-- | source/blender/blenlib/intern/storage.c | 8 | ||||
-rw-r--r-- | source/creator/creator.c | 7 | ||||
-rw-r--r-- | source/gameengine/BlenderRoutines/Makefile | 1 | ||||
-rw-r--r-- | source/gameengine/GamePlayer/common/unix/Makefile | 1 | ||||
-rw-r--r-- | source/nan_compile.mk | 36 | ||||
-rw-r--r-- | source/nan_definitions.mk | 23 | ||||
-rw-r--r-- | source/nan_link.mk | 20 |
12 files changed, 92 insertions, 39 deletions
diff --git a/extern/Makefile b/extern/Makefile index 26ee25b608f..51213698ebb 100644 --- a/extern/Makefile +++ b/extern/Makefile @@ -57,10 +57,7 @@ ifeq ($(WITH_BINRELOC), true) DIRS += binreloc endif -TARGET = -ifneq ($(OS),irix) - TARGET=solid -endif +TARGET = solid all:: @[ -d $(OCGDIR)/extern ] || mkdir -p $(OCGDIR)/extern diff --git a/intern/SoundSystem/Makefile b/intern/SoundSystem/Makefile index d00339f351c..051e2643a87 100644 --- a/intern/SoundSystem/Makefile +++ b/intern/SoundSystem/Makefile @@ -47,6 +47,9 @@ ifneq ($(NAN_NO_OPENAL),true) ifeq ($(OS),$(findstring $(OS), "linux freebsd solaris")) DIRS += openal sdl endif + ifeq ($(OS), irix) + DIRS += sdl + endif else export CPPFLAGS += -DNO_SOUND endif diff --git a/intern/elbeem/intern/utilities.h b/intern/elbeem/intern/utilities.h index 825e92251fe..a5f63e696a6 100644 --- a/intern/elbeem/intern/utilities.h +++ b/intern/elbeem/intern/utilities.h @@ -154,12 +154,18 @@ int writePng(const char *fileName, unsigned char **rowsp, int w, int h); */ /* minimum */ +#ifdef MIN +#undef MIN +#endif template < class T > inline T MIN( T a, T b ) { return (a < b) ? a : b ; } /* maximum */ +#ifdef MAX +#undef MAX +#endif template < class T > inline T MAX( T a, T b ) diff --git a/release/Makefile b/release/Makefile index f440e2dface..43a369d8f77 100644 --- a/release/Makefile +++ b/release/Makefile @@ -57,6 +57,12 @@ ifeq ($(OS),$(findstring $(OS), "freebsd irix linux openbsd solaris")) NOPLUGINS?=true endif endif + # don"t build plugins on irix if using gcc + ifeq ($(OS), irix) + ifeq ($(IRIX_USE_GCC), true) + NOPLUGINS?=true + endif + endif endif ifeq ($(OS),windows) diff --git a/source/Makefile b/source/Makefile index 662cb1df0a6..e9671cdae35 100644 --- a/source/Makefile +++ b/source/Makefile @@ -194,7 +194,7 @@ ifeq ($(WITH_FREETYPE2), true) else COMLIB += $(NAN_FTGL)/lib/libftgl.a ifeq ($(OS), irix) - COMLIB += $(NAN_FREETYPE)/lib32/libfreetype.a + COMLIB += $(NAN_FREETYPE)/lib/libfreetype.a else COMLIB += $(NAN_FREETYPE)/lib/libfreetype.a endif @@ -395,9 +395,16 @@ else NAN_SND_LIBS += $(ALUT) NAN_SND_LIBS += $(SOUNDSYSTEM) else - NAN_SND_LIBS = $(SOUNDSYSTEM) - NAN_SND_LIBS += $(DUMMYSOUND) - NAN_SND_LIBS += $(SOUNDSYSTEM) + ifeq ($(OS), irix) + NAN_SND_LIBS = $(SOUNDSYSTEM) + NAN_SND_LIBS += $(DUMMYSOUND) + NAN_SND_LIBS += $(SDLSOUND) + NAN_SND_LIBS += $(SOUNDSYSTEM) + else + NAN_SND_LIBS = $(SOUNDSYSTEM) + NAN_SND_LIBS += $(DUMMYSOUND) + NAN_SND_LIBS += $(SOUNDSYSTEM) + endif endif endif endif diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index ca7a376d3a2..392c680a3b0 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -47,9 +47,9 @@ #include <time.h> #include <sys/stat.h> -#if defined (__sun__) || defined (__sun) +#if defined (__sun__) || defined (__sun) || defined (__sgi) #include <sys/statvfs.h> /* Other modern unix os's should probably use this also */ -#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sgi) || defined(__sparc) || defined(__sparc__)) +#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__)) #include <sys/statfs.h> #endif @@ -179,7 +179,7 @@ double BLI_diskfree(char *dir) return (double) (freec*bytesps*sectorspc); #else -#if defined (__sun__) || defined (__sun) +#if defined (__sun__) || defined (__sun) || defined (__sgi) struct statvfs disk; #else struct statfs disk; @@ -206,7 +206,7 @@ double BLI_diskfree(char *dir) #if defined (__sun__) || defined (__sun) if (statvfs(name, &disk)) return(-1); -#elif !defined(__FreeBSD__) && !defined(linux) && (defined (__sgi) || defined(__sparc) || defined(__sparc__)) +#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__)) /* WARNING - This may not be supported by geeneric unix os's - Campbell */ if (statfs(name, &disk, sizeof(struct statfs), 0)) return(-1); #endif diff --git a/source/creator/creator.c b/source/creator/creator.c index 872a5f4d497..745978e2bb9 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -29,6 +29,13 @@ #include <stdlib.h> #include <string.h> + +/* for setuid / getuid */ +#ifdef __sgi +#include <sys/types.h> +#include <unistd.h> +#endif + /* This little block needed for linking to Blender... */ #include "MEM_guardedalloc.h" diff --git a/source/gameengine/BlenderRoutines/Makefile b/source/gameengine/BlenderRoutines/Makefile index 4b9a2a3af17..c2f19ae1d8a 100644 --- a/source/gameengine/BlenderRoutines/Makefile +++ b/source/gameengine/BlenderRoutines/Makefile @@ -35,6 +35,7 @@ include nan_compile.mk CCFLAGS += $(LEVEL_1_CPP_WARNINGS) +CPPFLAGS += -I$(NAN_GLEW)/include CPPFLAGS += -I$(NAN_SUMO)/include -I$(NAN_SOLID)/include CPPFLAGS += -I$(NAN_SOLID) CPPFLAGS += -I$(NAN_STRING)/include diff --git a/source/gameengine/GamePlayer/common/unix/Makefile b/source/gameengine/GamePlayer/common/unix/Makefile index a2bdb7225a0..3d44a41afee 100644 --- a/source/gameengine/GamePlayer/common/unix/Makefile +++ b/source/gameengine/GamePlayer/common/unix/Makefile @@ -35,6 +35,7 @@ include nan_compile.mk CCFLAGS += $(LEVEL_1_CPP_WARNINGS) +CPPFLAGS += -I$(NAN_GLEW)/include CPPFLAGS += -I$(OPENGL_HEADERS) CPPFLAGS += -I$(NAN_STRING)/include diff --git a/source/nan_compile.mk b/source/nan_compile.mk index 4b13ef8f678..19d833b5b0d 100644 --- a/source/nan_compile.mk +++ b/source/nan_compile.mk @@ -120,22 +120,34 @@ ifeq ($(OS),freebsd) endif ifeq ($(OS),irix) - CC = cc - CCC = CC - CFLAGS += -n32 -mips3 -Xcpluscomm - CCFLAGS += -n32 -mips3 -Xcpluscomm -LANG:std -ifdef MIPS73_ISOHEADERS - CCFLAGS += -LANG:libc_in_namespace_std=off -I$(MIPS73_ISOHEADERS) -else - CCFLAGS += -LANG:libc_in_namespace_std=off -endif - REL_CFLAGS += -n32 -mips3 -O2 -OPT:Olimit=0 - REL_CCFLAGS += -n32 -mips3 -O2 -OPT:Olimit=0 + ifeq ($(IRIX_USE_GCC),true) + CC = gcc + CCC = g++ + CFLAGS += -fPIC -funsigned-char -fno-strict-aliasing -mabi=n32 -mips4 + CCFLAGS += -fPIC -fpermissive -funsigned-char -fno-strict-aliasing -mabi=n32 -mips4 + REL_CFLAGS += -O2 + REL_CCFLAGS += -O2 + CPPFLAGS += -DXP_UNIX + DBG_CFLAGS += -g3 -gdwarf-2 -ggdb + DBG_CCFLAGS += -g3 -gdwarf-2 -ggdb + else + CC = cc + CCC = CC + CFLAGS += -n32 -mips3 -Xcpluscomm + CCFLAGS += -n32 -mips3 -Xcpluscomm -LANG:std + ifdef MIPS73_ISOHEADERS + CCFLAGS += -LANG:libc_in_namespace_std=off -I$(MIPS73_ISOHEADERS) + else + CCFLAGS += -LANG:libc_in_namespace_std=off + endif + REL_CFLAGS += -n32 -mips3 -O2 -OPT:Olimit=0 + REL_CCFLAGS += -n32 -mips3 -O2 -OPT:Olimit=0 + endif OPENGL_HEADERS = /usr/include NAN_DEPEND = true AR = CC ARFLAGS = -ar -o - ARFLAGSQUIET = -ar -o + ARFLAGSQUIET = -ar -o endif ifeq ($(OS),linux) diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk index 424a7c558d7..74a23ba4a40 100644 --- a/source/nan_definitions.mk +++ b/source/nan_definitions.mk @@ -75,6 +75,7 @@ else export NAN_SOLID ?= $(LCGDIR)/solid export NAN_QHULL ?= $(LCGDIR)/qhull endif + export NAN_USE_BULLET ?= true export NAN_BULLET2 ?= $(LCGDIR)/bullet2 export NAN_SUMO ?= $(SRCHOME)/gameengine/Physics/Sumo export NAN_FUZZICS ?= $(SRCHOME)/gameengine/Physics/Sumo/Fuzzics @@ -149,8 +150,8 @@ endif export NAN_OPENEXR_LIBS ?= $(NAN_OPENEXR)/lib/libIlmImf.a $(NAN_OPENEXR)/lib/libHalf.a $(NAN_OPENEXR)/lib/libIex.a $(NAN_OPENEXR)/lib/libIlmThread.a -lrt else - export NAN_OPENEXR ?= /usr/local - export NAN_OPENEXR_LIBS ?= $(NAN_OPENEXR)/lib/libIlmImf.a $(NAN_OPENEXR)/lib/libHalf.a $(NAN_OPENEXR)/lib/libIex.a + export NAN_OPENEXR ?= $(LCGDIR)/openexr + export NAN_OPENEXR_LIBS ?= $(NAN_OPENEXR)/lib/libIlmImf.a $(NAN_OPENEXR)/lib/libHalf.a $(NAN_OPENEXR)/lib/libIex.a $(NAN_OPENEXR)/lib/libIlmThread.a endif endif endif @@ -331,23 +332,27 @@ endif export NAN_PYTHON ?= $(LCGDIR)/python export NAN_PYTHON_VERSION ?= 2.3 export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION) - export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a + export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a -lpthread export NAN_OPENAL ?= $(LCGDIR)/openal export NAN_FMOD ?= $(LCGDIR)/fmod export NAN_JPEG ?= $(LCGDIR)/jpeg export NAN_PNG ?= $(LCGDIR)/png - export NAN_TIFF ?= /usr/freeware + export NAN_TIFF ?= $(LCGDIR)/tiff export NAN_ODE ?= $(LCGDIR)/ode export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay export NAN_MESA ?= /usr/src/Mesa-3.1 - export NAN_ZLIB ?= /usr/freeware + export NAN_ZLIB ?= $(LCGDIR)/zlib export NAN_NSPR ?= $(LCGDIR)/nspr - export NAN_FREETYPE ?= /usr/freeware - export NAN_GETTEXT ?= /usr/freeware - export NAN_GETTEXT_LIB ?= $(NAN_GETTEXT)/lib32/libintl.a + export NAN_FREETYPE ?= $(LCGDIR)/freetype + export NAN_ICONV ?= $(LCGDIR)/iconv + export NAN_GETTEXT ?= $(LCGDIR)/gettext + export NAN_GETTEXT_LIB ?= $(NAN_GETTEXT)/lib/libintl.a $(NAN_ICONV)/lib/libiconv.a export NAN_SDL ?= $(LCGDIR)/sdl - export NAN_SDLLIBS ?= -L$(NAN_SDL)/lib -lSDL + export NAN_SDLLIBS ?= $(NAN_SDL)/lib/libSDL.a export NAN_SDLCFLAGS ?= -I$(NAN_SDL)/include/SDL + export NAN_FFMPEG ?= $(LCGDIR)/ffmpeg + export NAN_FFMPEGLIBS = $(NAN_FFMPEG)/lib/libavformat.a $(NAN_FFMPEG)/lib/libavcodec.a $(NAN_FFMPEG)/lib/libswscale.a $(NAN_FFMPEG)/lib/libavutil.a $(NAN_FFMPEG)/lib/libogg.a $(NAN_FFMPEG)/lib/libfaad.a $(NAN_FFMPEG)/lib/libmp3lame.a $(NAN_FFMPEG)/lib/libvorbis.a $(NAN_FFMPEG)/lib/libx264.a $(NAN_FFMPEG)/lib/libfaac.a $(NAN_ZLIB)/lib/libz.a + export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include # Uncomment the following line to use Mozilla inplace of netscape # CPPFLAGS +=-DMOZ_NOT_NET diff --git a/source/nan_link.mk b/source/nan_link.mk index 8dda3b8c2df..186fe07e09a 100644 --- a/source/nan_link.mk +++ b/source/nan_link.mk @@ -72,11 +72,19 @@ ifeq ($(OS),freebsd) endif ifeq ($(OS),irix) - LDFLAGS += -mips3 - LLIBS = -lmovieGL -lGLU -lGL -lXmu -lXext -lX11 -lc -lm -ldmedia - LLIBS += -lcl -laudio -ldb -lCio -lz - LLIBS += -lpthread - LLIBS += -woff 84,171 + ifeq ($(IRIX_USE_GCC), true) + LDFLAGS += -mabi=n32 -mips4 + DBG_LDFLAGS += -LD_LAYOUT:lgot_buffer=40 + else + LDFLAGS += -n32 -mips3 + LDFLAGS += -woff 84,171 + endif + LLIBS = -lmovieGL -lGLU -lGL -lXmu -lXext -lXi -lX11 -lc -lm -ldmedia + LLIBS += -lcl -laudio + ifneq ($(IRIX_USE_GCC), true) + LLIBS += -lCio -ldb + endif + LLIBS += -lz -lpthread DYNLDFLAGS = -shared $(LDFLAGS) endif @@ -90,7 +98,7 @@ ifeq ($(OS),linux) ifeq ($(CPU),$(findstring $(CPU), "i386 x86_64 ia64 parisc64 powerpc sparc64")) COMMENT = "MESA 3.1" LLIBS = -L$(NAN_MESA)/lib -L/usr/X11R6/lib -lXmu -lXext -lX11 -lXi - LLIBS += -lutil -lc -lm -ldl -lpthread + LLIBS += -lutil -lc -lm -ldl -lpthread # LLIBS += -L$(NAN_ODE)/lib -lode LOPTS = -export-dynamic DADD = -lGL -lGLU |