AmigaOS 68k build fixes by Artur Jarosik. Thanks!

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@770 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues 2009-05-03 17:45:10 +00:00
parent 6f37000cd5
commit e5fc3a9ef3
9 changed files with 39 additions and 46 deletions

View File

@ -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 <PIPE:gfx2ver)
# Amiga classic
ifeq ($(AMIGA),Kickstart)
DELCOMMAND = Delete -r
MKDIR = Makedir
RMDIR = Delete
CP = copy
ZIP = zip
PLATFORMFILS = gfx2.png
BIN = grafx2
COPT = -c99
LOPT =
CC = Logiciels:vbcc/bin/vc
OBJDIR = obj/Amiga68k
# No strip command with vbcc, do some dummy thing to make Make happy
STRIP = echo
else
# Finally, the default rules that work fine for most unix/gcc systems, linux and freebsd are tested.
# Linux and FreeBSD specific (default rules)
$(shell rm PIPE:gfx2ver)
DELCOMMAND = rm -rf
MKDIR = mkdir -p
RMDIR = rmdir
@ -203,7 +192,6 @@ else
OBJDIR = obj/unix
X11LOPT = -lX11
endif
endif
endif
endif

View File

@ -29,7 +29,7 @@
#include <sys/stat.h>
#include <unistd.h>
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__)
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
#include <proto/dos.h>
#include <dirent.h>
#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];

View File

@ -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)")

4
init.c
View File

@ -39,7 +39,7 @@
#if defined(__WIN32__)
#include <windows.h> // GetLogicalDrives(), GetDriveType(), DRIVE_*
#endif
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__)
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
#include <proto/exec.h>
#include <proto/dos.h>
#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

4
misc.c
View File

@ -710,7 +710,7 @@ void Zoom_a_line(byte* original_line, byte* zoomed_line,
#include <sys/sysctl.h>
#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 <proto/exec.h>
#elif defined(__SKYOS__)
#include <skyos/sysinfo.h>
@ -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 <sys/sysctl.h> 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 :)"

View File

@ -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

View File

@ -5,7 +5,7 @@
#include <string.h>
#include <unistd.h>
#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

View File

@ -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.

2
text.c
View File

@ -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