Ticket #55: gfx2_sdl2_osx.diff

File gfx2_sdl2_osx.diff, 30.8 KB (added by frarees@…, 7 years ago)
  • branches/sdl2/doc/COMPILING.txt

     
    55
    66* gcc C compiler (other compilers may work, but are not officially supported)
    77* GNU make (other similar "make" tools may work, but are not supported)
    8 * SDL library v1.2
    9 * SDL_image library
     8* SDL library v2.0
     9* SDL2_image library
    1010* libpng (not on MacOSX)
    1111* FreeType library (optional, for truetype fonts)
    12 * SDL_ttf library (optional, for truetype fonts)
     12* SDL2_ttf library (optional, for truetype fonts)
    1313* Lua library v5.1 or v5.2 (optional, for Lua scripting)
    1414
    1515Extra requirements for Windows:
     
    3333If all goes well, it should build grafx2 (the main program) in the "bin"
    3434directory. Voilà.
    3535
    36 If you don't have FreeType and SDL_ttf, type make NOTTF=1 instead. It will
     36If you don't have FreeType and SDL2_ttf, type make NOTTF=1 instead. It will
    3737build a version without TrueType support : the Text tool will be limited to
    3838bitmap fonts, proportional fonts with .ttf extension won't be available.
    3939
     
    9393        make GP2XCROSS=1
    9494This will only work on an UNIXsystem (Linux or FreeBSD).
    9595
     96== macOS ==
     97
     98By default SDL2 (+image +ttf) will be searched through pkg-config, so if you use
     99homebrew, macports or similar you will be fine. If, however, you want to link
     100against its framework versions, use NOFW=0
     101
     102macOS provides libpng already. However, if you want to link against a custom
     103libpng use SYSPNG=0. It will be searched through pkg-config.
     104
    96105== Windows ==
    97106
    98107It is also possible to compile from linux, with this command :
     
    111120  installed in C:\MSYS\mingw
    112121
    113122SDL:
    114   SDL-devel-1.2.13-mingw32.tar.gz
     123  SDL2-devel-2.0.5-mingw.tar.gz
    115124  Uncompress in temporary directory
    116125  make
    117126  make install (no effect?)
    118   Headers are in /usr/mingw/include/SDL, copy them to /usr/include/SDL
     127  Headers are in /usr/mingw/include/SDL2, copy them to /usr/include/SDL2
    119128
    120129Zlib:
    121130  http://gnuwin32.sourceforge.net/downlinks/zlib.php
     
    148157  make
    149158  Don't use 'make install', copy tiff.h libtiff.a manually instead.
    150159 
    151 SDL_image:
     160SDL2_image:
    152161  Requires: Libpng
    153162  Requires optionally: libtiff
    154163  Requires optionally: libjpeg
    155   http://www.mirrorservice.org/sites/download.sourceforge.net/pub/sourceforge/l/li/libsdl/
    156   SDL_image-1.2.8.zip
     164  https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.1-VC.zip
     165  SDL2_image-devel-2.0.1-VC.zip
    157166  Uncompress in temporary directory
    158167  ./configure
    159168  Check in the messages that png worked
     
    167176  mingw-freetype-2.3.7-2
    168177  Uncompress in c:/mwsys/mingw
    169178 
    170 SDL_ttf:
     179SDL2_ttf:
    171180  No mingw package
    172   http://www.mirrorservice.org/sites/download.sourceforge.net/pub/sourceforge/l/li/libsdl/
    173   SDL_ttf-2.0.9-win32.zip for DLLs: libfreetype-6.dll, SDL_ttf.dll, zlib1.dll
    174   SDL_ttf-2.0.9.tar.gz
     181  https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-2.0.14-VC.zip
     182  SDL2_ttf-devel-2.0.14-VC.zip for DLLs: libfreetype-6.dll, SDL2_ttf.dll, zlib1.dll
    175183
    176184Lua:
    177185  (optional)
     
    182190  (make install doesn't work, even with prefix)
    183191  Copy luaconf.h, lualib.h, lua.h, lauxlib.h to c:\msys\mingw\include
    184192  Copy liblua.a to c:\msys\mingw\lib
    185   Copy lua51.dll to c:\msys\mingw\bin
     193  Copy lua52.dll to c:\msys\mingw\bin
    186194
    187195== Atari TOS machines ==
    188196The Atari build is very similar to the Linux one. The build might work on native machine with gcc 4.3> compiler,
  • branches/sdl2/src/Makefile

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
     
    3232# Compile with OPTIM=0 to disable gcc optimizations, to enable debug.
    3333  STRIP = strip
    3434
    35 ### Specific to build MAC OS X universal binaries on Tiger or Lion ###
    36 ### (may need to be changed or removed depending on the OSX version) ###
    37 
    38 #MACOSX_LION = 1
    39 
    40 ifdef MACOSX_LION
    41 MACOSX_SYSROOT = /Developer/SDKs/MacOSX10.6.sdk
    42 MACOSX_ARCH = -arch x86_64 -arch i386
    43 else
    44 MACOSX_SYSROOT = /Developer/SDKs/MacOSX10.4u.sdk
    45 MACOSX_ARCH = -arch ppc -arch i386
    46 endif
    47 
    4835### PLATFORM DETECTION AND CONFIGURATION ###
    4936
    5037PLATFORMOBJ =
     
    9178
    9279  else
    9380  ifeq ($(PLATFORM),Darwin) # 2
     81    MACOSX_ARCH = -arch x86_64 -arch i386
    9482    #Mac OS X specific
    9583    DELCOMMAND = rm -rf
    9684    MKDIR = mkdir -p
    97     RMDIR = rmdir --ignore-fail-on-non-empty
     85    RMDIR = rm -rf
    9886    # Force it
    9987    OPTIM = 3
    10088    CP = cp
     
    10593    BIN = ../bin/grafx2
    10694    SVN_REVISION = $(shell svnversion | cut -f2 -d ":" - | tr -d "M")
    10795
    108     # these are for use with macports
    109     #SDLCOPT = $(shell sdl2-config --cflags)
    110     #SDLLOPT = $(shell sdl2-config --libs) $(shell pkg-config --libs SDL2_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)
     96    # frameworks OFF by default
     97    ifndef NOFW
     98        NOFW = 1
     99    endif
     100    ifeq ($(NOFW),0)
     101        SDLCOPT = -F$(FWDIR) -D_THREAD_SAFE -DPREFIX_SDL
     102        # @rpath is introduced in 10.5 Leopard
     103        SDLLOPT = -framework Cocoa -framework SDL2 -framework SDL2_image -rpath @executable_path/../Frameworks
     104    else
     105        SDLCOPT = $(shell sdl2-config --cflags) $(shell pkg-config SDL2_image --cflags --silence-errors)
     106        SDLLOPT = $(shell sdl2-config --libs) $(shell pkg-config SDL2_image --libs --silence-errors)
     107    endif
    113108
    114     # these are for use with Mac OS X native frameworks
    115     #-framework SDL_ttf
    116     SDLLOPT = -isysroot $(MACOSX_SYSROOT) $(MACOSX_ARCH) -L/usr/lib -framework SDL -framework SDL2_image -framework Cocoa -framework Carbon -framework OpenGL
    117     SDLCOPT = $(MACOSX_ARCH) -I$(FWDIR)/SDL.framework/Headers -I$(FWDIR)/SDL2_image.framework/Headers -I$(FWDIR)/SDL_ttf.framework/Headers -D_THREAD_SAFE
    118     LUACOPT = -I$(FWDIR)/Lua.framework/Headers
    119 ifdef MACOSX_LION
    120     LUALOPT = -framework lua
    121 else
    122     LUALOPT = -llua
    123 endif
     109    ifndef SYSPNG
     110        SYSPNG = 1
     111    endif
     112    ifeq ($(SYSPNG),1)
     113        PNGCOPT =
     114        PNGLOPT = -lpng
     115    else
     116        PNGCOPT = $(shell pkg-config libpng --cflags --silence-errors)
     117        PNGLOPT = $(pkg-config libpng --libs --silence-errors)
     118    endif
    124119
     120    # lua ON by default
     121    ifndef NOLUA
     122        NOLUA = 0
     123    endif
     124    ifeq ($(NOLUA),0)
     125        LUACOPT = $(shell pkg-config lua --cflags --silence-errors)
     126        LUALOPT = $(shell pkg-config lua --libs --silence-errors)
     127    endif
     128
     129    # ttf OFF by default
     130    ifndef NOTTF
     131        NOTTF = 1
     132    endif
     133    ifeq ($(NOTTF),0)
     134        ifeq ($(NOFW),0)
     135            TTFCOPT = $(shell pkg-config SDL2_ttf --cflags --silence-errors)
     136            TTFLOPT = $(shell pkg-config SDL2_ttf --libs --silence-errors)
     137        else
     138            TTFCOPT =
     139            TTFLOPT = -framework SDL2_ttf
     140        endif
     141    endif       
     142
    125143    # these are for everyone
    126     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 ifdef MACOSX_LION
    128     LOPT = $(SDLLOPT) $(LUALOPT) -framework libpng14 -lz
    129 else
    130     LOPT = $(SDLLOPT) $(LUALOPT) -lpng -lz
    131 endif
    132     # Use gcc for compiling. Use ncc to build a callgraph and analyze the code.
    133     CC = gcc
    134     #CC = nccgen -ncgcc -ncld -ncfabs
     144    COPT = $(MACOSX_ARCH) -D_DARWIN_C_SOURCE -D__macosx__ -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -std=c99 -c -g $(PNGCOPT) $(LUACOPT) $(SDLCOPT) $(TTFCOPT) -I/usr/include
     145    LOPT = -F$(FWDIR) $(PNGLOPT) $(LUALOPT) $(SDLLOPT) $(TTFLOPT)
     146    CC = clang
    135147    OBJDIR = ../obj/macosx
    136     PLATFORMOBJ = $(OBJDIR)/SDLMain.o
    137148    FCLOPT =
    138149    MACAPPEXE = Grafx2.app/Contents/MacOS/Grafx2
    139     NOTTF = 1
    140150  else
    141151  ifeq ($(PLATFORM),AROS) # 3
    142152    #AROS specific
     
    433443
    434444FONT_FILES = ../share/grafx2/fonts/8pxfont.png ../share/grafx2/fonts/Tuffy.ttf ../share/grafx2/fonts/PF_Arma_5__.png ../share/grafx2/fonts/PF_Easta_7_.png ../share/grafx2/fonts/PF_Easta_7__.png ../share/grafx2/fonts/PF_Ronda_7__.png ../share/grafx2/fonts/PF_Tempesta_5.png ../share/grafx2/fonts/PF_Tempesta_5_.png ../share/grafx2/fonts/PF_Tempesta_5__.png ../share/grafx2/fonts/PF_Tempesta_5___.png ../share/grafx2/fonts/PF_Tempesta_7.png ../share/grafx2/fonts/PF_Tempesta_7_.png ../share/grafx2/fonts/PF_Tempesta_7__.png ../share/grafx2/fonts/PF_Tempesta_7___.png ../share/grafx2/fonts/PF_Westa_7_.png ../share/grafx2/fonts/PF_Westa_7__.png
    435445
    436 
    437446ifeq ($(PLATFORM),Darwin)
    438447all : $(MACAPPEXE)
    439448$(MACAPPEXE) : $(BIN)
    440         rm -rf Grafx2.app
    441         mkdir -p Grafx2.app Grafx2.app/Contents Grafx2.app/Contents/Frameworks Grafx2.app/Contents/MacOS Grafx2.app/Contents/Resources Grafx2.app/Contents/Resources/scripts
    442         mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4
    443         mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4/brush
    444         mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4/demo
    445         mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4/libs
    446         mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4/palette
    447         mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4/picture
     449        $(RMDIR) Grafx2.app
     450        $(MKDIR) Grafx2.app Grafx2.app/Contents Grafx2.app/Contents/Frameworks Grafx2.app/Contents/MacOS Grafx2.app/Contents/Resources Grafx2.app/Contents/Resources/scripts
     451        $(MKDIR) Grafx2.app/Contents/Resources/scripts/samples_2.4
     452        $(MKDIR) Grafx2.app/Contents/Resources/scripts/samples_2.4/brush
     453        $(MKDIR) Grafx2.app/Contents/Resources/scripts/samples_2.4/demo
     454        $(MKDIR) Grafx2.app/Contents/Resources/scripts/samples_2.4/libs
     455        $(MKDIR) Grafx2.app/Contents/Resources/scripts/samples_2.4/palette
     456        $(MKDIR) Grafx2.app/Contents/Resources/scripts/samples_2.4/picture
    448457        echo 'APPL????' > Grafx2.app/Contents/PkgInfo
    449         cp ../Info.plist Grafx2.app/Contents
    450         cp -r Grafx2.icns Grafx2.app/Contents/Resources
    451         cp -r English.lproj Grafx2.app/Contents/Resources
    452         cp -r ../share/grafx2/fonts Grafx2.app/Contents/Resources
    453         cp -r ../share/grafx2/skins Grafx2.app/Contents/Resources
    454         cp -r ../share/grafx2/gfx2def.ini Grafx2.app/Contents/Resources
    455         cp -r ../share/grafx2/scripts/samples_2.4/brush Grafx2.app/Contents/Resources/scripts/samples_2.4
    456         cp -r ../share/grafx2/scripts/samples_2.4/demo Grafx2.app/Contents/Resources/scripts/samples_2.4
    457         cp -r ../share/grafx2/scripts/samples_2.4/libs Grafx2.app/Contents/Resources/scripts/samples_2.4
    458         cp -r ../share/grafx2/scripts/samples_2.4/palette Grafx2.app/Contents/Resources/scripts/samples_2.4
    459         cp -r ../share/grafx2/scripts/samples_2.4/picture Grafx2.app/Contents/Resources/scripts/samples_2.4
    460 ifdef MACOSX_LION
    461         mkdir -p Grafx2.app/Contents/Frameworks/Lua.framework/Versions
    462         mkdir -p Grafx2.app/Contents/Frameworks/libpng14.framework/Versions
    463 endif
    464         mkdir -p Grafx2.app/Contents/Frameworks/SDL.framework/Versions
    465         mkdir -p Grafx2.app/Contents/Frameworks/SDL2_image.framework/Versions
    466 #       mkdir -p Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions
    467 ifdef MACOSX_LION
    468         cp -Rp $(FWDIR)/Lua.framework/Versions/A Grafx2.app/Contents/Frameworks/Lua.framework/Versions
    469         cp -Rp $(FWDIR)/libpng14.framework/Versions/1.4.8 Grafx2.app/Contents/Frameworks/libpng14.framework/Versions
    470 endif
    471         cp -Rp $(FWDIR)/SDL.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL.framework/Versions
    472         cp -Rp $(FWDIR)/SDL2_image.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL2_image.framework/Versions
    473 #       cp -Rp $(FWDIR)/SDL_ttf.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions
    474     # remove those
    475         rm -fr Grafx2.app/Contents/Frameworks/SDL.framework/Versions/A/Headers
    476         rm -fr Grafx2.app/Contents/Frameworks/SDL.framework/Versions/A/Resources
    477         rm -fr Grafx2.app/Contents/Frameworks/SDL2_image.framework/Versions/A/Headers
    478         rm -fr Grafx2.app/Contents/Frameworks/SDL2_image.framework/Versions/A/Resources
    479 ifdef MACOSX_LION
    480         rm -fr Grafx2.app/Contents/Frameworks/Lua.framework/Versions/A/Resources
    481         rm -fr Grafx2.app/Contents/Frameworks/Lua.framework/Versions/A/Headers
    482         rm -fr Grafx2.app/Contents/Frameworks/libpng14.framework/Versions/1.4.8/Resources
    483         rm -fr Grafx2.app/Contents/Frameworks/libpng14.framework/Versions/1.4.8/Headers
    484         rm -fr Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions
    485 endif
     458        $(CP) ../Info.plist Grafx2.app/Contents
     459        $(CP) -r Grafx2.icns Grafx2.app/Contents/Resources
     460        $(CP) -r English.lproj Grafx2.app/Contents/Resources
     461        $(CP) -r ../share/grafx2/fonts Grafx2.app/Contents/Resources
     462        $(CP) -r ../share/grafx2/skins Grafx2.app/Contents/Resources
     463        $(CP) -r ../share/grafx2/gfx2def.ini Grafx2.app/Contents/Resources
     464        $(CP) -r ../share/grafx2/scripts/samples_2.4/brush Grafx2.app/Contents/Resources/scripts/samples_2.4
     465        $(CP) -r ../share/grafx2/scripts/samples_2.4/demo Grafx2.app/Contents/Resources/scripts/samples_2.4
     466        $(CP) -r ../share/grafx2/scripts/samples_2.4/libs Grafx2.app/Contents/Resources/scripts/samples_2.4
     467        $(CP) -r ../share/grafx2/scripts/samples_2.4/palette Grafx2.app/Contents/Resources/scripts/samples_2.4
     468        $(CP) -r ../share/grafx2/scripts/samples_2.4/picture Grafx2.app/Contents/Resources/scripts/samples_2.4
     469
    486470        cp $(BIN) $(MACAPPEXE)
    487471        $(STRIP) -x -X -S $(MACAPPEXE)
    488472        chmod +x $(MACAPPEXE)
     473
     474ifeq ($(NOFW),0)
     475        # copy frameworks
     476        $(MKDIR) Grafx2.app/Contents/Frameworks/SDL2.framework/Versions
     477        $(MKDIR) Grafx2.app/Contents/Frameworks/SDL2_image.framework/Versions
     478        $(MKDIR) Grafx2.app/Contents/Frameworks/SDL2_ttf.framework/Versions
     479        $(CP) -Rp $(FWDIR)/SDL2.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL2.framework/Versions
     480        $(CP) -Rp $(FWDIR)/SDL2_image.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL2_image.framework/Versions
     481        $(CP) -Rp $(FWDIR)/SDL2_ttf.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL2_ttf.framework/Versions
     482
     483        # resign SDL
     484        codesign -f -s - Grafx2.app/Contents/Frameworks/SDL2.framework/Versions/A/SDL2
     485        codesign -f -s - Grafx2.app/Contents/Frameworks/SDL2_image.framework/Versions/A/SDL2_image
     486ifeq ($(NOTTF),0)
     487        codesign -f -s - Grafx2.app/Contents/Frameworks/SDL2_ttf.framework/Versions/A/SDL2_ttf
     488endif
     489
     490        # remove unneeded resources and headers
     491        $(RMDIR) Grafx2.app/Contents/Frameworks/SDL2.framework/Versions/A/Headers
     492        $(RMDIR) Grafx2.app/Contents/Frameworks/SDL2.framework/Versions/A/Resources
     493        $(RMDIR) Grafx2.app/Contents/Frameworks/SDL2_image.framework/Versions/A/Headers
     494        $(RMDIR) Grafx2.app/Contents/Frameworks/SDL2_image.framework/Versions/A/Resources
     495        $(RMDIR) Grafx2.app/Contents/Frameworks/SDL2_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Headers
     496        $(RMDIR) Grafx2.app/Contents/Frameworks/SDL2_image.framework/Versions/A/Frameworks/webp.framework/Versions/A/Resources
     497        $(RMDIR) Grafx2.app/Contents/Frameworks/SDL2_ttf.framework/Versions/A/Headers
     498        $(RMDIR) Grafx2.app/Contents/Frameworks/SDL2_ttf.framework/Versions/A/Resources
     499        $(RMDIR) Grafx2.app/Contents/Frameworks/SDL2_ttf.framework/Versions/A/Frameworks/FreeType.framework/Versions/A/Resources
     500        $(RMDIR) Grafx2.app/Contents/Frameworks/SDL2_ttf.framework/Versions/A/Frameworks/FreeType.framework/Versions/A/Headers
     501else
     502        # TODO copy dylibs
     503endif
     504        # dist files
    489505        tar cvzf grafx2-svn$(SVN_REVISION)-macosx.tgz --exclude '*svn*' --exclude '*DS_Store*' Grafx2.app/*
    490506else
    491507all : $(BIN)
     
    520536# Create a zip archive ready for upload to the website, including binaries and sourcecode
    521537ziprelease: version $(BIN) release
    522538        echo `sed "s/.*=\"\(.*\)\";/\1/" pversion.c`.`svnversion` | tr " :" "_-" | sed -e "s/\(wip\)\\./\1/I" > $(OBJDIR)/versiontag
    523         tar cvzf "../src-`cat $(OBJDIR)/versiontag`.tgz" --strip=1 ../src/*.c ../src/*.cpp ../src/*.h ../src/Makefile ../src/Makefile.dep ../src/gfx2.ico ../src/Grafx2_Prefix.pch ../src/SDLMain.m
     539        tar cvzf "../src-`cat $(OBJDIR)/versiontag`.tgz" --strip=1 ../src/*.c ../src/*.cpp ../src/*.h ../src/Makefile ../src/Makefile.dep ../src/gfx2.ico ../src/Grafx2_Prefix.pch
    524540        cd .. && $(ZIP) $(ZIPOPT) "grafx2-`cat $(OBJDIR:../%=%)/versiontag`$(TTFLABEL)-$(PLATFORM).$(ZIP)" $(BIN:../%=%) share/grafx2/gfx2def.ini $(SCRIPT_FILES:../%=%) $(SKIN_FILES:../%=%) share/grafx2/gfx2.gif share/icons/grafx2.svg doc/README.txt doc/COMPILING.txt doc/gpl-2.0.txt doc/PF_fonts.txt $(FONT_FILES:../%=%) doc/README-zlib1.txt doc/README-SDL.txt doc/README-SDL_image.txt doc/README-SDL_ttf.txt doc/README-lua.txt src-`cat $(OBJDIR:../%=%)/versiontag`.tgz $(PLATFORMFILES:../%=%)
    525541        $(DELCOMMAND) "../src-`cat $(OBJDIR)/versiontag`.tgz"
    526         tar cvzf "../grafx2-`cat $(OBJDIR)/versiontag`$(TTFLABEL)-src.tgz" --strip=1 --transform 's,^,grafx2/,g' ../src/*.c ../src/*.cpp ../src/*.h ../src/Makefile ../src/Makefile.dep ../share/grafx2/gfx2def.ini $(SCRIPT_FILES) $(SKIN_FILES) ../src/gfx2.ico ../share/grafx2/gfx2.gif ../share/icons/grafx2.svg ../doc/README.txt ../doc/COMPILING.txt ../doc/gpl-2.0.txt ../doc/PF_fonts.txt ../misc/unix/grafx2.1 ../misc/unix/grafx2.xpm ../misc/unix/grafx2.desktop ../misc/morphos/grafx2.info $(FONT_FILES) ../src/Grafx2_Prefix.pch ../src/SDLMain.m
     542        tar cvzf "../grafx2-`cat $(OBJDIR)/versiontag`$(TTFLABEL)-src.tgz" --strip=1 --transform 's,^,grafx2/,g' ../src/*.c ../src/*.cpp ../src/*.h ../src/Makefile ../src/Makefile.dep ../share/grafx2/gfx2def.ini $(SCRIPT_FILES) $(SKIN_FILES) ../src/gfx2.ico ../share/grafx2/gfx2.gif ../share/icons/grafx2.svg ../doc/README.txt ../doc/COMPILING.txt ../doc/gpl-2.0.txt ../doc/PF_fonts.txt ../misc/unix/grafx2.1 ../misc/unix/grafx2.xpm ../misc/unix/grafx2.desktop ../misc/morphos/grafx2.info $(FONT_FILES) ../src/Grafx2_Prefix.pch
    527543        $(DELCOMMAND) "$(OBJDIR)/versiontag"
    528544
    529545$(BIN) : $(OBJ)
    530546        test -d ../bin || $(MKDIR) ../bin
    531         $(CC) $(OBJ) -o $(BIN) $(LOPT) $(LFLAGS)
     547        $(CC) $(LOPT) $(LFLAGS) -o $(BIN) $(OBJ)
    532548
    533549# SVN revision number
    534550version.c :
     
    572588clean :
    573589        $(DELCOMMAND) $(OBJ)
    574590        $(DELCOMMAND) $(BIN)
     591ifeq ($(PLATFORM),Darwin)
     592        $(DELCOMMAND) Grafx2.app
     593endif
    575594
    576595ifneq ($(PLATFORM),amiga-vbcc)
    577596# Linux installation of the program
  • branches/sdl2/src/SFont.c

     
    2525    GERMANY
    2626    karlb@gmx.net                                                     
    2727*/                                                                           
     28#if defined(PREFIX_SDL)
    2829#include <SDL2/SDL.h>
     30#include <SDL2/SDL_video.h>
     31#else
     32#include <SDL.h>
    2933#include <SDL_video.h>
     34#endif
    3035
    3136#include <assert.h>
    3237#include <stdlib.h>
  • branches/sdl2/src/SFont.h

     
    4444#ifndef _SFONT_H_
    4545#define _SFONT_H_
    4646
     47#if defined(PREFIX_SDL)
    4748#include <SDL2/SDL.h>
     49#else
     50#include <SDL.h>
     51#endif
    4852
    4953#ifdef __cplusplus
    5054extern "C" {
  • branches/sdl2/src/buttons.c

     
    4646#include <unistd.h>
    4747#include <ctype.h>
    4848#include <sys/stat.h>
     49
     50#if defined(PREFIX_SDL)
    4951#include <SDL2/SDL.h>
     52#else
     53#include <SDL.h>
     54#endif
    5055
    5156#include "const.h"
    5257#include "struct.h"
  • branches/sdl2/src/buttons_effects.c

     
    2525/// Handles all the effects buttons and setup windows in the effects menu.
    2626////////////////////////////////////////////////////////////////////////////
    2727
     28#if defined(PREFIX_SDL)
     29#include <SDL2/SDL.h>
     30#else
    2831#include <SDL.h>
     32#endif
     33
    2934#include <stdlib.h>
    3035#include <string.h>
    3136
  • branches/sdl2/src/filesel.c

     
    2424    along with Grafx2; if not, see <http://www.gnu.org/licenses/>
    2525*/
    2626
    27 #include <SDL_syswm.h>
     27// There is no WM on the GP2X...
     28#if !defined(__GP2X__) && !defined(__WIZ__) && !defined(__CAANOO__)
     29    #if defined(PREFIX_SDL)
     30        #include <SDL2/SDL_syswm.h>
     31    #else
     32        #include <SDL_syswm.h>
     33    #endif
     34#endif
    2835
    2936#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
    3037    #include <proto/dos.h>
  • branches/sdl2/src/global.h

     
    3030#ifndef _GLOBAL_H_
    3131#define _GLOBAL_H_
    3232
     33#if defined(PREFIX_SDL)
    3334#include <SDL2/SDL.h>
     35#else
     36#include <SDL.h>
     37#endif
     38
    3439#include "struct.h"
    3540
    3641// MAIN declares the variables,
  • branches/sdl2/src/hotkeys.h

     
    3131#else
    3232    #define bool char
    3333#endif
     34
     35#if defined(PREFIX_SDL)
    3436#include <SDL2/SDL.h>
     37#else
     38#include <SDL.h>
     39#endif
    3540
    3641#define NB_SHORTCUTS 209   ///< Number of actions that can have a key combination associated to it.
    3742
  • branches/sdl2/src/init.c

     
    4444
    4545#include <stdlib.h>
    4646#include <errno.h>
     47
     48#if defined(PREFIX_SDL)
    4749#include <SDL2/SDL.h>
     50#include <SDL2_image/SDL_image.h>
     51#else
     52#include <SDL.h>
    4853#include <SDL_image.h>
     54#endif
     55
    4956#if defined(__WIN32__)
    5057  #include <windows.h> // GetLogicalDrives(), GetDriveType(), DRIVE_*
    5158#endif
  • branches/sdl2/src/input.c

     
    2121*/
    2222
    2323#include <stdlib.h>
     24
     25#if defined(PREFIX_SDL)
    2426#include <SDL2/SDL.h>
    25 #include <SDL_syswm.h>
     27#else
     28#include <SDL.h>
     29#endif
    2630
     31// There is no WM on the GP2X...
     32#if !defined(__GP2X__) && !defined(__WIZ__) && !defined(__CAANOO__)
     33    #if defined(PREFIX_SDL)
     34        #include <SDL2/SDL_syswm.h>
     35    #else
     36        #include <SDL_syswm.h>
     37    #endif
     38#endif
     39
    2740#include "global.h"
    2841#include "keyboard.h"
    2942#include "sdlscreen.h"
  • branches/sdl2/src/io.c

     
    2424// Fonctions de lecture/ecriture file, gèrent les systèmes big-endian et
    2525// little-endian.
    2626
     27#if defined(PREFIX_SDL)
     28#include <SDL2/SDL_endian.h>
     29#else
    2730#include <SDL_endian.h>
     31#endif
    2832#include <string.h>
    2933#include <sys/stat.h>
    3034#include <errno.h>
  • branches/sdl2/src/loadsave.c

     
    3131#include <string.h>
    3232#include <unistd.h>
    3333#include <limits.h>
     34
     35#if defined(PREFIX_SDL)
     36#include <SDL2/SDL_endian.h>
     37#include <SDL2_image/SDL_image.h>
     38#else
     39#include <SDL_endian.h>
    3440#include <SDL_image.h>
    35 #include <SDL_endian.h>
     41#endif
    3642
    3743#include "buttons.h"
    3844#include "const.h"
  • branches/sdl2/src/loadsave.h

     
    2828#define __LOADSAVE_H__
    2929
    3030#include <stdio.h>
     31
     32#if defined(PREFIX_SDL)
     33#include <SDL2_image/SDL_image.h>
     34#else
    3135#include <SDL_image.h>
     36#endif
    3237
    3338enum CONTEXT_TYPE {
    3439  CONTEXT_MAIN_IMAGE,
  • branches/sdl2/src/main.c

     
    3636#include <string.h>
    3737#include <signal.h>
    3838#include <unistd.h>
     39#if defined(PREFIX_SDL)
    3940#include <SDL2/SDL.h>
     41#include <SDL2_image/SDL_image.h>
     42#else
     43#include <SDL.h>
    4044#include <SDL_image.h>
     45#endif
    4146
    42 
    4347// There is no WM on the GP2X...
    4448#if !defined(__GP2X__) && !defined(__WIZ__) && !defined(__CAANOO__)
    45     #include <SDL_syswm.h>
     49    #if defined(PREFIX_SDL)
     50        #include <SDL2/SDL_syswm.h>
     51    #else
     52        #include <SDL_syswm.h>
     53    #endif
    4654#endif
    4755
    4856#include "const.h"
  • branches/sdl2/src/misc.c

     
    2121    You should have received a copy of the GNU General Public License
    2222    along with Grafx2; if not, see <http://www.gnu.org/licenses/>
    2323*/
     24#if defined(PREFIX_SDL)
    2425#include <SDL2/SDL.h>
     26#else
     27#include <SDL.h>
     28#endif
     29
    2530#include <string.h>
    2631#include <strings.h>
    2732#include <stdlib.h>
  • branches/sdl2/src/oldies.c

     
    2020    You should have received a copy of the GNU General Public License
    2121    along with Grafx2; if not, see <http://www.gnu.org/licenses/>
    2222*/
     23#if defined(PREFIX_SDL)
     24#include <SDL2/SDL.h>
     25#else
    2326#include <SDL.h>
     27#endif
     28
    2429#include <string.h>
    2530#include <strings.h>
    2631#include <stdlib.h>
  • branches/sdl2/src/pxsimple.c

     
    2323
    2424#include <string.h>
    2525#include <stdlib.h>
     26
     27#if defined(PREFIX_SDL)
     28#include <SDL2/SDL.h>
     29#else
    2630#include <SDL.h>
     31#endif
     32
    2733#include "global.h"
    2834#include "sdlscreen.h"
    2935#include "misc.h"
  • branches/sdl2/src/readini.c

     
    841841    conf->Skin_file = strdup(value_label);
    842842  }
    843843  else
    844     conf->Skin_file = strdup("skin_DPaint.png");
     844    conf->Skin_file = strdup("skin_modern.png");
    845845
    846846  // Optional, name of font file. (>2.0)
    847847  if(!Load_INI_get_string(file,buffer,"Font_file",value_label,1))
    848848    conf->Font_file = strdup(value_label);
    849849  else
    850     conf->Font_file = strdup("font_Dpaint.png");
     850    conf->Font_file = strdup("font_Classic.png");
    851851
    852852  // Optional, "fake hardware zoom" factor (>2.1)
    853853  if (!Load_INI_get_values (file, buffer,"Pixel_ratio",1,values))
  • branches/sdl2/src/realpath.c

     
    66#include <fcntl.h>
    77#include <string.h>
    88#include <unistd.h>
    9 #if defined(__AROS__) || defined(__linux__) || defined(__GLIBC__)|| defined(__MINT__) || defined(__FreeBSD__)
     9#if defined(__AROS__) || defined(__linux__) || defined(__GLIBC__)|| defined(__MINT__) || defined(__FreeBSD__) || defined(__macosx__)
    1010#include <limits.h>
    1111#endif
    1212
  • branches/sdl2/src/sdlscreen.c

     
    2525#include <string.h>
    2626#include <stdlib.h>
    2727#include <stdio.h>
     28
     29#if defined(PREFIX_SDL)
    2830#include <SDL2/SDL.h>
     31#include <SDL2/SDL_endian.h>
     32#include <SDL2_image/SDL_image.h>
     33#else
     34#include <SDL.h>
     35#include <SDL_endian.h>
    2936#include <SDL_image.h>
    30 #include <SDL_endian.h>
    31 #include <SDL2/SDL_syswm.h>
     37#endif
     38
     39// There is no WM on the GP2X...
     40#if !defined(__GP2X__) && !defined(__WIZ__) && !defined(__CAANOO__)
     41    #if defined(PREFIX_SDL)
     42        #include <SDL2/SDL_syswm.h>
     43    #else
     44        #include <SDL_syswm.h>
     45    #endif
     46#endif
     47
    3248#if defined(__WIN32__)
    3349    #include <windows.h>
    3450#endif
  • branches/sdl2/src/sdlscreen.h

     
    2828#ifndef SDLSCREEN_H_INCLUDED
    2929#define SDLSCREEN_H_INCLUDED
    3030
     31#if defined(PREFIX_SDL)
    3132#include <SDL2/SDL.h>
     33#else
     34#include <SDL.h>
     35#endif
     36
    3237#include "struct.h"
    3338
    3439///
  • branches/sdl2/src/setup.h

     
    139139#if defined (__MINT__)
    140140  #define DEFAULT_SKIN_FILENAME "SDPAINT.PNG"
    141141#else
    142   #define DEFAULT_SKIN_FILENAME "skin_DPaint.png"
     142  #define DEFAULT_SKIN_FILENAME "skin_modern.png"
    143143#endif
    144144
    145145/// Name of the image file for the default (and fallback) 8x8 font.
     
    146146#if defined (__MINT__)
    147147  #define DEFAULT_FONT_FILENAME "FDPAINT.PNG"
    148148#else
    149   #define DEFAULT_FONT_FILENAME "font_DPaint.png"
     149  #define DEFAULT_FONT_FILENAME "font_Dpaint.png"
    150150#endif
    151151
    152152/// File extension for safety backups
  • branches/sdl2/src/struct.h

     
    2929#ifndef _STRUCT_H_
    3030#define _STRUCT_H_
    3131
     32#if defined(PREFIX_SDL)
     33#include <SDL2/SDL.h>
     34#else
    3235#include <SDL.h>
     36#endif
    3337
    3438#if defined(__BEOS__) || defined(__TRU64__)
    3539    #include <inttypes.h>
  • branches/sdl2/src/text.c

     
    3232
    3333// TrueType
    3434#ifndef NOTTF
    35 #if defined(__macosx__)
    36   #include <SDL_ttf/SDL_ttf.h>
     35#if defined(PREFIX_SDL)
     36#include <SDL2_ttf/SDL_ttf.h>
    3737#else
    38   #include <SDL2/SDL_ttf.h>
     38#include <SDL_ttf.h>
    3939#endif
    4040
    4141#if defined(__CAANOO__) || defined(__WIZ__) || defined(__GP2X__)
     
    5050  #import <sys/param.h>
    5151#endif
    5252
     53#if defined(PREFIX_SDL)
     54#include <SDL2_image/SDL_image.h>
     55#else
    5356#include <SDL_image.h>
     57#endif
     58
    5459#include "SFont.h"
    5560
    5661#include "struct.h"
     
    316321      number = 3;
    317322      // Make sure we also search into the user's fonts directory
    318323      CFURLRef url = (CFURLRef) CFCopyHomeDirectoryURLForUser(NULL);
    319       CFURLGetFileSystemRepresentation(url, true, (UInt8 *) home_dir, MAXPATHLEN);
     324      CFURLGetFileSystemRepresentation(url, true, (UInt8 *)&home_dir, MAXPATHLEN);
    320325      strcat(home_dir, "/Library/Fonts");
    321326      font_path_list[2] = home_dir;
    322327
  • branches/sdl2/src/windows.h

     
    2828#define __WINDOWS_H_
    2929
    3030#include "struct.h"
     31
     32#if defined(PREFIX_SDL)
     33#include <SDL2/SDL.h>
     34#else
    3135#include <SDL.h>
     36#endif
    3237
    3338
    3439#ifdef MULTI_WINDOW