Ticket #52: macosx_build.patch
File macosx_build.patch, 4.8 KB (added by , 6 years ago) |
---|
-
src/Makefile
105 105 BIN = ../bin/grafx2 106 106 SVN_REVISION = $(shell svnversion | cut -f2 -d ":" - | tr -d "M") 107 107 108 SDLCONFIG := $(shell which sdl-config) 109 ifneq ($(SDLCONFIG), ) 108 110 # these are for use with macports 109 #SDLCOPT = $(shell sdl-config --cflags) 110 #SDLLOPT = $(shell sdl-config --libs) $(shell pkg-config --libs SDL_image) 111 #LUACOPT = $(shell pkg-config lua --cflags --silence-errors ||pkg-config lua5.1 --cflags --silence-errors ||pkg-config lua-5.1 --cflags) 112 #LUALOPT = $(shell pkg-config lua --libs --silence-errors ||pkg-config lua5.1 --libs --silence-errors ||pkg-config lua-5.1 --libs) 113 111 SDLCOPT = $(shell sdl-config --cflags) 112 SDLLOPT = $(shell sdl-config --libs) $(shell pkg-config --libs SDL_image) 113 else 114 114 # these are for use with Mac OS X native frameworks 115 115 #-framework SDL_ttf 116 116 SDLLOPT = -isysroot $(MACOSX_SYSROOT) $(MACOSX_ARCH) -L/usr/lib -framework SDL -framework SDL_image -framework Cocoa -framework Carbon -framework OpenGL 117 117 SDLCOPT = $(MACOSX_ARCH) -I$(FWDIR)/SDL.framework/Headers -I$(FWDIR)/SDL_image.framework/Headers -I$(FWDIR)/SDL_ttf.framework/Headers -D_THREAD_SAFE 118 endif 119 120 # these are for use with macports 121 LUAPKG := $(shell for p in lua5.1 lua-5.1 lua51 lua ; do pkg-config --exists $$p && echo $$p && break ; done) 122 ifneq ($(LUAPKG), ) 123 LUACOPT = $(shell pkg-config $(LUAPKG) --cflags) 124 LUALOPT = $(shell pkg-config $(LUAPKG) --libs) 125 else 126 # these are for use with Mac OS X native frameworks 118 127 LUACOPT = -I$(FWDIR)/Lua.framework/Headers 119 128 ifdef MACOSX_LION 120 129 LUALOPT = -framework lua 121 130 else 122 131 LUALOPT = -llua 123 132 endif 133 endif 124 134 125 135 # these are for everyone 126 136 COPT = -D_DARWIN_C_SOURCE -D__macosx__ -D__linux__ -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -std=c99 -c -g $(LUACOPT) $(SDLCOPT) $(TTFCOPT) -I/usr/include 127 137 ifdef MACOSX_LION 128 138 LOPT = $(SDLLOPT) $(LUALOPT) -framework libpng14 -lz 129 139 else 130 LOPT = $(SDLLOPT) $(LUALOPT) -lpng -lz 140 LOPT = $(SDLLOPT) $(LUALOPT) 141 LIBPNGCONFIG := $(shell libpng-config) 142 ifneq ($(LIBPNGCONFIG), ) 143 COPT += $(shell libpng-config --cflags) 144 LOPT += $(shell libpng-config --ldflags) 145 else 146 LOPT += -lpng 131 147 endif 148 LOPT += -lz 149 endif 132 150 # Use gcc for compiling. Use ncc to build a callgraph and analyze the code. 133 151 CC = gcc 134 152 #CC = nccgen -ncgcc -ncld -ncfabs … … 288 306 LUACOPT = 289 307 LUALOPT = 290 308 else 291 LUACOPT = $(shell pkg-config lua --cflags --silence-errors ||pkg-config lua5.1 --cflags --silence-errors ||pkg-config lua-5.1 --cflags) 292 LUALOPT = $(shell pkg-config lua --libs --silence-errors ||pkg-config lua5.1 --libs --silence-errors ||pkg-config lua-5.1 --libs) 309 LUAPKG := $(shell for p in lua5.1 lua-5.1 lua51 lua ; do pkg-config --exists $$p && echo $$p && break ; done) 310 LUACOPT = $(shell pkg-config $(LUAPKG) --cflags) 311 LUALOPT = $(shell pkg-config $(LUAPKG) --libs) 293 312 endif 294 313 endif 295 314 … … 484 503 cp -r ../share/grafx2/scripts/samples_2.4/picture Grafx2.app/Contents/Resources/scripts/samples_2.4 485 504 ifdef MACOSX_LION 486 505 mkdir -p Grafx2.app/Contents/Frameworks/Lua.framework/Versions 506 cp -Rp $(FWDIR)/Lua.framework/Versions/A Grafx2.app/Contents/Frameworks/Lua.framework/Versions 487 507 mkdir -p Grafx2.app/Contents/Frameworks/libpng14.framework/Versions 508 cp -Rp $(FWDIR)/libpng14.framework/Versions/1.4.8 Grafx2.app/Contents/Frameworks/libpng14.framework/Versions 488 509 endif 489 mkdir -p Grafx2.app/Contents/Frameworks/SDL.framework/Versions 490 mkdir -p Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions 510 if [ -d $(FWDIR)/SDL.framework/Versions ] ; then \ 511 mkdir -p Grafx2.app/Contents/Frameworks/SDL.framework/Versions ;\ 512 cp -Rp $(FWDIR)/SDL.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL.framework/Versions ;\ 513 fi 514 if [ -d $(FWDIR)/SDL_image.framework/Versions ] ; then \ 515 mkdir -p Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions ;\ 516 cp -Rp $(FWDIR)/SDL_image.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions ;\ 517 fi 491 518 # mkdir -p Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions 492 ifdef MACOSX_LION493 cp -Rp $(FWDIR)/Lua.framework/Versions/A Grafx2.app/Contents/Frameworks/Lua.framework/Versions494 cp -Rp $(FWDIR)/libpng14.framework/Versions/1.4.8 Grafx2.app/Contents/Frameworks/libpng14.framework/Versions495 endif496 cp -Rp $(FWDIR)/SDL.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL.framework/Versions497 cp -Rp $(FWDIR)/SDL_image.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions498 519 # cp -Rp $(FWDIR)/SDL_ttf.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions 499 520 # remove those 500 521 rm -fr Grafx2.app/Contents/Frameworks/SDL.framework/Versions/A/Headers