From e5fc3a9ef386aeee5cadf3beeaee286d76aef3da Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 3 May 2009 17:45:10 +0000 Subject: [PATCH] AmigaOS 68k build fixes by Artur Jarosik. Thanks! git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@770 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- Makefile | 50 +++++++++++++++++++------------------------------- filesel.c | 8 ++++---- helpfile.h | 4 ++++ init.c | 4 ++-- misc.c | 4 ++-- mountlist.c | 3 ++- realpath.c | 4 ++-- setup.c | 6 +++--- text.c | 2 +- 9 files changed, 39 insertions(+), 46 deletions(-) diff --git a/Makefile b/Makefile index 7732ea29..507706a9 100644 --- a/Makefile +++ b/Makefile @@ -70,8 +70,8 @@ else OBJDIR = obj/amiga ZIP = lha ZIPOPT = a - else ifeq ($(PLATFORM),AROS) + else ifeq ($(PLATFORM),AROS) #AROS specific DELCOMMAND = rm -rf MKDIR = mkdir -p @@ -84,8 +84,8 @@ else OBJDIR = obj/aros ZIP = lha ZIPOPT = a - else ifeq ($(PLATFORM),MorphOS) + else ifeq ($(PLATFORM),MorphOS) #MorphOS specific DELCOMMAND = rm -rf MKDIR = mkdir -p @@ -98,8 +98,22 @@ else OBJDIR = obj/morphos ZIP = lha ZIPOPT = a - else ifeq ($(PLATFORM),BeOS) + else ifeq ($(PLATFORM),AMIGA) + # AmigaOS 3.x specific (building with gcc) + DELCOMMAND = rm -rf + MKDIR = mkdir -p + RMDIR = rmdir + CP = cp + 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 ifeq ($(PLATFORM),BeOS) #BeOS specific DELCOMMAND = rm -rf MKDIR = mkdir -p @@ -111,8 +125,8 @@ else CC = gcc OBJDIR = obj/beos ZIP = zip - else ifeq ($(PLATFORM),Haiku) + else ifeq ($(PLATFORM),Haiku) #Haiku specific DELCOMMAND = rm -rf MKDIR = mkdir -p @@ -124,8 +138,8 @@ else CC = gcc OBJDIR = obj/haiku ZIP = zip - else ifeq ($(PLATFORM),skyos) + else ifeq ($(PLATFORM),skyos) #SkyOS specific DELCOMMAND = rm -rf MKDIR = mkdir -p @@ -139,33 +153,8 @@ else ZIP = zip else -# If we got here, we haven't found any specific system for uname. There is a little problem : Amiga 68k does not have uname ! - - # The trick here is to use the "version" command and see if the answer starts with Kickstart. This is the typical footprint of an amiga system. - # Te problem is these commands are also launched for other platforms where the "version" command is not available, so sh gives an error under linux/freebsd... - $(shell version >PIPE:gfx2ver) - AMIGA=$(shell sed -e s/\(Kickstart\).*/\1/g #include -#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) +#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) #include #include #define isHidden(x) (0) @@ -254,7 +254,7 @@ void Read_list_of_files(byte selected_format) } } -#if defined(__MORPHOS__) || defined (__amigaos4__) || defined(__amigaos__) +#if defined(__MORPHOS__) || defined(__AROS__) || defined (__amigaos4__) || defined(__amigaos__) Add_element_to_list("/",1); // on amiga systems, / means parent. And there is no .. Filelist_nb_directories ++; #endif @@ -265,7 +265,7 @@ void Read_list_of_files(byte selected_format) Filelist_nb_elements=Filelist_nb_directories+Filelist_nb_files; } -#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) +#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) void bstrtostr( BSTR in, STRPTR out, TEXT max ) { STRPTR iptr; @@ -290,7 +290,7 @@ void Read_list_of_drives(void) Filelist_nb_files=0; Filelist_nb_directories=0; - #if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) + #if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) { struct DosList *dl; char tmp[256]; diff --git a/helpfile.h b/helpfile.h index 1675325c..95b44ca0 100644 --- a/helpfile.h +++ b/helpfile.h @@ -292,6 +292,10 @@ static const T_Help_table helptable_credits[] = HELP_TEXT ("") HELP_TITLE(" OTHER MACHINES PORTS") HELP_TEXT ("") + HELP_BOLD (" AMIGA OS 3 PORT") + HELP_TEXT ("") + HELP_TEXT (" Artur Jarosik (arturjarosik\100gmail.com)") + HELP_TEXT ("") HELP_BOLD (" AMIGA OS 4 PORT") HELP_TEXT ("") HELP_TEXT (" Peter Gordon (pete\100petergordon.org.uk)") diff --git a/init.c b/init.c index d630498e..1c3cd28d 100644 --- a/init.c +++ b/init.c @@ -39,7 +39,7 @@ #if defined(__WIN32__) #include // GetLogicalDrives(), GetDriveType(), DRIVE_* #endif -#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) +#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) #include #include #endif @@ -71,7 +71,7 @@ // Rechercher la liste et le type des lecteurs de la machine -#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) +#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) void bstrtostr( BSTR in, STRPTR out, TEXT max ); #endif diff --git a/misc.c b/misc.c index fb3678d9..82bcac1f 100644 --- a/misc.c +++ b/misc.c @@ -710,7 +710,7 @@ void Zoom_a_line(byte* original_line, byte* zoomed_line, #include #elif defined(__BEOS__) || defined(__HAIKU__) // sysinfo not implemented -#elif defined(__AROS__) || defined(__amigaos4__) || defined(__MORPHOS__) +#elif defined(__AROS__) || defined(__amigaos4__) || defined(__MORPHOS__) || defined(__amigaos__) #include #elif defined(__SKYOS__) #include @@ -744,7 +744,7 @@ unsigned long Memory_free(void) len = sizeof(maxmem); sysctl(mib,2,&maxmem,&len,NULL,0); return maxmem; - #elif defined(__BEOS__) || defined(__HAIKU__) || defined(__SKYOS__) || defined(__amigaos4__) + #elif defined(__BEOS__) || defined(__HAIKU__) || defined(__SKYOS__) || defined(__amigaos4__) || defined(__amigaos__) // No on BeOS or Haiku // AvailMem is misleading on os4 (os4 caches stuff in memory that you can still allocate) #warning "There is missing code there for your platform ! please check and correct :)" diff --git a/mountlist.c b/mountlist.c index 66dad4a0..bd33256d 100644 --- a/mountlist.c +++ b/mountlist.c @@ -17,7 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#if(!defined(__WIN32__))&&(!defined(__amigaos4__))&&(!defined(__AROS__))&&(!defined(__MORPHOS__)) +// This file is not used on some platforms, so don't do anything for them +#if(!defined(__WIN32__))&&(!defined(__amigaos4__))&&(!defined(__AROS__))&&(!defined(__MORPHOS__))&&(!defined(__amigaos__)) // We don't use autoconf and all that in grafx2, so let's do the config here ... #if defined(__macosx__) || defined(__FreeBSD__) // MacOS X is POSIX compliant diff --git a/realpath.c b/realpath.c index 5f9cb1ed..fa74307e 100644 --- a/realpath.c +++ b/realpath.c @@ -5,7 +5,7 @@ #include #include -#if defined(__AROS__) || defined(__BEOS__) || defined(__MORPHOS__) || defined(__GP2X__) +#if defined(__AROS__) || defined(__BEOS__) || defined(__MORPHOS__) || defined(__GP2X__) || defined(__amigaos__) // These platforms don't have realpath(). // We use the following implementation, found in: // http://amiga.sourceforge.net/amigadevhelp/FUNCTIONS/GeekGadgets/realpath/ex02_realpath.c @@ -52,7 +52,7 @@ if (chdir(path)) { if (errno == ENOTDIR) { - #if defined(__WIN32__) || defined(__MORPHOS__) + #if defined(__WIN32__) || defined(__MORPHOS__) || defined(__amigaos__) // No symbolic links and no readlink() l = -1; #else diff --git a/setup.c b/setup.c index ce3719c7..4ac4b3ec 100644 --- a/setup.c +++ b/setup.c @@ -51,7 +51,7 @@ int Create_ConfigDirectory(char * config_dir) #endif } -#if defined(__macosx__) || defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) +#if defined(__macosx__) || defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) #define ARG_UNUSED __attribute__((unused)) #else #define ARG_UNUSED @@ -72,8 +72,8 @@ void Set_program_directory(ARG_UNUSED const char * argv0,char * program_dir) // Append trailing slash strcat(program_dir ,"/"); - // AmigaOS4: hard-coded volume name. - #elif defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) + // AmigaOS and alike: hard-coded volume name. + #elif defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) strcpy(program_dir,"PROGDIR:"); // Others: The part of argv[0] before the executable name. diff --git a/text.c b/text.c index 8a750b72..0f49d2a7 100644 --- a/text.c +++ b/text.c @@ -339,7 +339,7 @@ void Init_text(void) } #endif #endif - #elif defined(__amigaos4__) + #elif defined(__amigaos4__) || defined(__amigaos__) #ifndef NOTTF For_each_file( "FONTS:_TrueType", Add_font ); #endif