Some fixes to make the amiga build work better. I finally installed gcc on my amiga, so there is a

hope of getting a working build.
Everything compiles but fails when linking, because I've not figured out how to install SDL.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1464 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues 2010-04-24 21:38:39 +00:00
parent f06dbc1389
commit f36f4c9ddb
7 changed files with 51 additions and 65 deletions

View File

@ -59,19 +59,20 @@ else
#For all other platforms, we can rely on uname #For all other platforms, we can rely on uname
PLATFORM = $(shell uname) PLATFORM = $(shell uname)
#AmigaOS4 specific #AmigaOS (3 or 4) specific
ifeq ($(PLATFORM),AmigaOS) # 1 ifeq ($(PLATFORM),AmigaOS) # 1
DELCOMMAND = rm -rf DELCOMMAND = rm -rf
MKDIR = mkdir -p MKDIR = mkdir -p
RMDIR = rmdir RMDIR = rmdir
CP = cp CP = cp
BIN = ../bin/grafx2 BIN = ../bin/grafx2
COPT = -Wall -c -gstabs -mcrt=newlib `sdl-config --cflags` -I/SDK/Local/common/include/SDL -D__USE_INLINE__ $(TTFCOPT) COPT = -Wall -c -gstabs `sdl-config --cflags` $(TTFCOPT)
LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lft2 LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lft2
CC = gcc CC = gcc
OBJDIR = ../obj/amiga OBJDIR = ../obj/amiga
ZIP = lha ZIP = lha
ZIPOPT = a ZIPOPT = a
NOTTF = 1
else else
ifeq ($(PLATFORM),Darwin) # 2 ifeq ($(PLATFORM),Darwin) # 2
@ -129,21 +130,6 @@ else
ZIPOPT = a ZIPOPT = a
PLATFORMFILES = ../misc/grafx2.info PLATFORMFILES = ../misc/grafx2.info
else
ifeq ($(PLATFORM),AMIGA) # 5
# AmigaOS 3.x specific (building with gcc)
DELCOMMAND = rm -rf
MKDIR = mkdir -p
RMDIR = rmdir
CP = cp
BIN = ../bin/grafx2
COPT = -Wall -gstabs -c `sdl-config --cflags` $(TTFCOPT)
LOPT = -lSDL_image `sdl-config --libs` -lpng -ljpeg -lz $(TTFLOPT) -lfreetype
CC = gcc
OBJDIR = ../obj/amiga
ZIP = lha
ZIPOPT = a
else else
ifeq ($(PLATFORM),BeOS) # 6 ifeq ($(PLATFORM),BeOS) # 6
#BeOS specific #BeOS specific
@ -201,24 +187,6 @@ else
OBJDIR = ../obj/unix OBJDIR = ../obj/unix
X11LOPT = -lX11 X11LOPT = -lX11
CC = gcc CC = gcc
else
ifeq ($(findstring Kickstart,$(shell version)),Kickstart) # 9
# Classic amiga without gcc. Use vbcc.
PLATFORM = amiga-vbcc
DELCOMMAND = delete
MKDIR = makedir
RMDIR= delete
CP = copy
BIN = ../bin/grafx2
COPT = -c99 -Ivbcc:PosixLib/include -D__amigaos__ $(TTFCOPT)
CC = vc
OBJDIR = ../obj/amiga-vbcc
ZIP = lha
ZIPOPT = a
NOTTF = 1
else else
# Finally, the default rules that work fine for most unix/gcc systems, linux and freebsd are tested. # Finally, the default rules that work fine for most unix/gcc systems, linux and freebsd are tested.
@ -280,8 +248,6 @@ else
endif endif
endif endif
endif endif
endif
endif
endif endif
### BUILD SETTINGS are set according to vars set in the platform selection, the "overridable defaults", and environment variables set before launching make ### BUILD SETTINGS are set according to vars set in the platform selection, the "overridable defaults", and environment variables set before launching make
@ -335,7 +301,9 @@ OBJ = $(OBJDIR)/main.o $(OBJDIR)/init.o $(OBJDIR)/graph.o $(OBJDIR)/sdlscreen.o
SKIN_FILES = ../share/grafx2/skins/skin_classic.png ../share/grafx2/skins/skin_modern.png ../share/grafx2/skins/skin_DPaint.png ../share/grafx2/skins/font_Classic.png ../share/grafx2/skins/font_Fun.png ../share/grafx2/skins/font_Fairlight.png ../share/grafx2/skins/font_Melon.png ../share/grafx2/skins/font_DPaint.png ../share/grafx2/skins/skin_scenish.png ../share/grafx2/skins/font_Seen.png SKIN_FILES = ../share/grafx2/skins/skin_classic.png ../share/grafx2/skins/skin_modern.png ../share/grafx2/skins/skin_DPaint.png ../share/grafx2/skins/font_Classic.png ../share/grafx2/skins/font_Fun.png ../share/grafx2/skins/font_Fairlight.png ../share/grafx2/skins/font_Melon.png ../share/grafx2/skins/font_DPaint.png ../share/grafx2/skins/skin_scenish.png ../share/grafx2/skins/font_Seen.png
SCRIPT_FILES = ../share/grafx2/scripts/bru_db_Amigaball.lua ../share/grafx2/scripts/bru_db_ColorSphere.lua ../share/grafx2/scripts/bru_db_FindAA.lua ../share/grafx2/scripts/bru_db_Fisheye.lua ../share/grafx2/scripts/bru_db_GrayscaleAvg.lua ../share/grafx2/scripts/bru_db_GrayscaleDesat.lua ../share/grafx2/scripts/bru_db_Halfsmooth.lua ../share/grafx2/scripts/bru_db_Mandelbrot.lua ../share/grafx2/scripts/bru_db_Waves.lua ../share/grafx2/scripts/pal_db_Desaturate.lua ../share/grafx2/scripts/pal_db_ExpandColors.lua ../share/grafx2/scripts/pal_db_FillColorCube.lua ../share/grafx2/scripts/pal_db_InvertedRGB.lua ../share/grafx2/scripts/pal_db_Set3bit.lua ../share/grafx2/scripts/pal_db_Set6bit.lua ../share/grafx2/scripts/pal_db_SetC64Palette.lua ../share/grafx2/scripts/pal_db_ShiftHue.lua ../share/grafx2/scripts/pic_db_Pic2isometric.lua ../share/grafx2/scripts/pic_db_Rainbow-Dark2Bright.lua ../share/grafx2/scripts/pic_db_SierpinskyCarpet.lua ../share/grafx2/scripts/pic_db_SierpinskyTriangle.lua ../share/grafx2/scripts/pic_ni_Colorspace12bit.lua ../share/grafx2/scripts/pic_ni_Colorspace15bit.lua ../share/grafx2/scripts/pic_ni_Colorspace18bit.lua ../share/grafx2/scripts/pic_ni_GlassGridFilter.lua ../share/grafx2/scripts/pic_ni_Grid8.lua ../share/grafx2/scripts/pic_ni_Grid8red.lua ../share/grafx2/scripts/pic_ni_GridIso.lua ../share/grafx2/scripts/pic_ni_PaletteX1.lua ../share/grafx2/scripts/pic_ni_PaletteX8.lua ../share/grafx2/scripts/scn_db_RemapImage2RGB.lua ../share/grafx2/scripts/scn_db_RemapImage2RGB_ed.lua ../share/grafx2/scripts/scn_db_RemapImageTo3bitPal.lua SCRIPT_FILES1 = ../share/grafx2/scripts/bru_db_Amigaball.lua ../share/grafx2/scripts/bru_db_ColorSphere.lua ../share/grafx2/scripts/bru_db_FindAA.lua ../share/grafx2/scripts/bru_db_Fisheye.lua ../share/grafx2/scripts/bru_db_GrayscaleAvg.lua ../share/grafx2/scripts/bru_db_GrayscaleDesat.lua ../share/grafx2/scripts/bru_db_Halfsmooth.lua ../share/grafx2/scripts/bru_db_Mandelbrot.lua ../share/grafx2/scripts/bru_db_Waves.lua ../share/grafx2/scripts/pal_db_Desaturate.lua ../share/grafx2/scripts/pal_db_ExpandColors.lua ../share/grafx2/scripts/pal_db_FillColorCube.lua ../share/grafx2/scripts/pal_db_InvertedRGB.lua ../share/grafx2/scripts/pal_db_Set3bit.lua ../share/grafx2/scripts/pal_db_Set6bit.lua ../share/grafx2/scripts/pal_db_SetC64Palette.lua ../share/grafx2/scripts/pal_db_ShiftHue.lua ../share/grafx2/scripts/pic_db_Pic2isometric.lua ../share/grafx2/scripts/pic_db_Rainbow-Dark2Bright.lua ../share/grafx2/scripts/pic_db_SierpinskyCarpet.lua
SCRIPT_FILES2 = ../share/grafx2/scripts/pic_db_SierpinskyTriangle.lua ../share/grafx2/scripts/pic_ni_Colorspace12bit.lua ../share/grafx2/scripts/pic_ni_Colorspace15bit.lua ../share/grafx2/scripts/pic_ni_Colorspace18bit.lua ../share/grafx2/scripts/pic_ni_GlassGridFilter.lua ../share/grafx2/scripts/pic_ni_Grid8.lua ../share/grafx2/scripts/pic_ni_Grid8red.lua ../share/grafx2/scripts/pic_ni_GridIso.lua ../share/grafx2/scripts/pic_ni_PaletteX1.lua ../share/grafx2/scripts/pic_ni_PaletteX8.lua ../share/grafx2/scripts/scn_db_RemapImage2RGB.lua ../share/grafx2/scripts/scn_db_RemapImage2RGB_ed.lua ../share/grafx2/scripts/scn_db_RemapImageTo3bitPal.lua
SCRIPT_FILES1= SCRIPT_FILES1 SCRIPT_FILES2
ifeq ($(PLATFORM),Darwin) ifeq ($(PLATFORM),Darwin)
all : $(MACAPPEXE) all : $(MACAPPEXE)

View File

@ -19,6 +19,21 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Grafx2; if not, see <http://www.gnu.org/licenses/> along with Grafx2; if not, see <http://www.gnu.org/licenses/>
*/ */
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
#include <proto/dos.h>
#include <sys/types.h>
#include <dirent.h>
#define isHidden(x) (0)
#elif defined(__WIN32__)
#include <dirent.h>
#include <windows.h>
#define isHidden(x) (GetFileAttributesA((x)->d_name)&FILE_ATTRIBUTE_HIDDEN)
#else
#include <dirent.h>
#define isHidden(x) ((x)->d_name[0]=='.')
#endif
#define _XOPEN_SOURCE 500 #define _XOPEN_SOURCE 500
#include <fcntl.h> #include <fcntl.h>
@ -62,18 +77,6 @@
#define __attribute__(x) #define __attribute__(x)
#endif #endif
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
#include <proto/dos.h>
#include <dirent.h>
#define isHidden(x) (0)
#elif defined(__WIN32__)
#include <dirent.h>
#include <windows.h>
#define isHidden(x) (GetFileAttributesA((x)->d_name)&FILE_ATTRIBUTE_HIDDEN)
#else
#include <dirent.h>
#define isHidden(x) ((x)->d_name[0]=='.')
#endif
extern char Program_version[]; // generated in pversion.c extern char Program_version[]; // generated in pversion.c

View File

@ -21,18 +21,10 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Grafx2; if not, see <http://www.gnu.org/licenses/> along with Grafx2; if not, see <http://www.gnu.org/licenses/>
*/ */
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) #if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
#include <proto/dos.h> #include <proto/dos.h>
#include <sys/types.h>
#include <dirent.h> #include <dirent.h>
#define isHidden(x) (0) #define isHidden(x) (0)
#elif defined(__WIN32__) #elif defined(__WIN32__)
@ -44,6 +36,16 @@
#define isHidden(x) ((x)->d_name[0]=='.') #define isHidden(x) ((x)->d_name[0]=='.')
#endif #endif
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "const.h" #include "const.h"
#include "struct.h" #include "struct.h"
#include "global.h" #include "global.h"

View File

@ -29,6 +29,12 @@
#if defined(__WIN32__) || defined(__linux__) #if defined(__WIN32__) || defined(__linux__)
#define GRAFX2_CATCHES_SIGNALS #define GRAFX2_CATCHES_SIGNALS
#endif #endif
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
#include <proto/exec.h>
#include <proto/dos.h>
#endif
#include <stdio.h> #include <stdio.h>
//#include <fcntl.h> //#include <fcntl.h>
#include <string.h> #include <string.h>
@ -44,10 +50,6 @@
#if defined(__WIN32__) #if defined(__WIN32__)
#include <windows.h> // GetLogicalDrives(), GetDriveType(), DRIVE_* #include <windows.h> // GetLogicalDrives(), GetDriveType(), DRIVE_*
#endif #endif
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
#include <proto/exec.h>
#include <proto/dos.h>
#endif
#ifdef GRAFX2_CATCHES_SIGNALS #ifdef GRAFX2_CATCHES_SIGNALS
#include <signal.h> #include <signal.h>
#endif #endif

View File

@ -299,6 +299,9 @@ int Lock_file_handle = -1;
byte Create_lock_file(const char *file_directory) byte Create_lock_file(const char *file_directory)
{ {
#ifdef __amigaos__
#warning "Missing code for your platform, please check and correct!"
#else
char lock_filename[MAX_PATH_CHARACTERS]; char lock_filename[MAX_PATH_CHARACTERS];
strcpy(lock_filename,file_directory); strcpy(lock_filename,file_directory);
@ -333,6 +336,7 @@ byte Create_lock_file(const char *file_directory)
return -1; return -1;
} }
#endif #endif
#endif // __amigaos__
return 0; return 0;
} }

View File

@ -23,15 +23,22 @@
*/ */
#define GLOBAL_VARIABLES #define GLOBAL_VARIABLES
// time.h defines timeval which conflicts with the one in amiga SDK
#ifdef __amigaos__
#include <devices/timer.h>
#else
#include <time.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <time.h>
#include <unistd.h> #include <unistd.h>
#include <SDL.h> #include <SDL.h>
#include <SDL_image.h> #include <SDL_image.h>
// There is no WM on the GP2X... // There is no WM on the GP2X...
#ifndef __GP2X__ #ifndef __GP2X__
#include <SDL_syswm.h> #include <SDL_syswm.h>

View File

@ -17,7 +17,7 @@
// the path. So this implementation is limited, it's really better to // the path. So this implementation is limited, it's really better to
// use realpath() if your platform has it. // use realpath() if your platform has it.
#if defined(__GP2X__) #if defined(__GP2X__) || defined(__amigaos__)
// This is a random default value ... // This is a random default value ...
#define PATH_MAX 32768 #define PATH_MAX 32768
#endif #endif