Diego Casorran's fixes to allow native AmigaOS builds
This commit is contained in:
		| @@ -21,8 +21,8 @@ | |||||||
|  * $Id$ |  * $Id$ | ||||||
|  ***************************************************************************/ |  ***************************************************************************/ | ||||||
|  |  | ||||||
| #ifndef CURL_AMIGAOS_H | #ifndef LIBCURL_AMIGAOS_H | ||||||
| #define CURL_AMIGAOS_H | #define LIBCURL_AMIGAOS_H | ||||||
|  |  | ||||||
| #ifndef __ixemul__ | #ifndef __ixemul__ | ||||||
|  |  | ||||||
| @@ -34,12 +34,19 @@ | |||||||
|  |  | ||||||
| #include <bsdsocket.h> | #include <bsdsocket.h> | ||||||
|  |  | ||||||
| #define select(args...) WaitSelect( args, NULL) | #include "config-amigaos.h" | ||||||
|  |  | ||||||
|  | #define select(args...)	WaitSelect( args, NULL) | ||||||
| #define inet_ntoa(x)	Inet_NtoA( x ## .s_addr) | #define inet_ntoa(x)	Inet_NtoA( x ## .s_addr) | ||||||
|  | #define ioctl(a,b,c,d)	IoctlSocket( (LONG)a, (ULONG)b, (char*)c) | ||||||
|  | #define _AMIGASF	1 | ||||||
|  |  | ||||||
|  | extern void amiga_cleanup(); | ||||||
|  | extern BOOL amiga_init(); | ||||||
|  |  | ||||||
| #else /* __ixemul__ */ | #else /* __ixemul__ */ | ||||||
|  |  | ||||||
| #warning compiling with ixemul... | #warning compiling with ixemul... | ||||||
|  |  | ||||||
| #endif /* __ixemul__ */ | #endif /* __ixemul__ */ | ||||||
| #endif /* CURL_AMIGAOS_H */ | #endif /* LIBCURL_AMIGAOS_H */ | ||||||
|   | |||||||
| @@ -1,4 +1,7 @@ | |||||||
|  |  | ||||||
|  | #ifndef LIBCURL_CONFIG_AMIGAOS_H | ||||||
|  | #define LIBCURL_CONFIG_AMIGAOS_H | ||||||
|  |  | ||||||
| #define HAVE_ARPA_INET_H 1 | #define HAVE_ARPA_INET_H 1 | ||||||
| #define HAVE_GETHOSTBYADDR 1 | #define HAVE_GETHOSTBYADDR 1 | ||||||
| #define HAVE_INET_ADDR 1 | #define HAVE_INET_ADDR 1 | ||||||
| @@ -60,6 +63,7 @@ | |||||||
| #define PACKAGE_STRING "curl -" | #define PACKAGE_STRING "curl -" | ||||||
| #define PACKAGE_TARNAME "curl" | #define PACKAGE_TARNAME "curl" | ||||||
| #define PACKAGE_VERSION "-" | #define PACKAGE_VERSION "-" | ||||||
|  | #define CURL_CA_BUNDLE "s:curl-ca-bundle.crt" | ||||||
|  |  | ||||||
| #define RETSIGTYPE void | #define RETSIGTYPE void | ||||||
| #define SELECT_TYPE_ARG1 int | #define SELECT_TYPE_ARG1 int | ||||||
| @@ -77,3 +81,4 @@ | |||||||
| # define O_RDONLY 0x0000 | # define O_RDONLY 0x0000 | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | #endif /* LIBCURL_CONFIG_AMIGAOS_H */ | ||||||
|   | |||||||
| @@ -151,6 +151,11 @@ CURLcode curl_global_init(long flags) | |||||||
|     if (win32_init() != CURLE_OK) |     if (win32_init() != CURLE_OK) | ||||||
|       return CURLE_FAILED_INIT; |       return CURLE_FAILED_INIT; | ||||||
|  |  | ||||||
|  | #ifdef _AMIGASF | ||||||
|  |   if(!amiga_init()) | ||||||
|  |     return CURLE_FAILED_INIT; | ||||||
|  | #endif | ||||||
|  |  | ||||||
|   initialized = 1; |   initialized = 1; | ||||||
|   init_flags  = flags; |   init_flags  = flags; | ||||||
|    |    | ||||||
| @@ -174,6 +179,10 @@ void curl_global_cleanup(void) | |||||||
|   if (init_flags & CURL_GLOBAL_WIN32) |   if (init_flags & CURL_GLOBAL_WIN32) | ||||||
|     win32_cleanup(); |     win32_cleanup(); | ||||||
|  |  | ||||||
|  | #ifdef _AMIGASF | ||||||
|  |   amiga_cleanup(); | ||||||
|  | #endif | ||||||
|  |  | ||||||
|   initialized = 0; |   initialized = 0; | ||||||
|   init_flags  = 0; |   init_flags  = 0; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -54,6 +54,9 @@ | |||||||
| /* hand-modified MacOS config.h! */ | /* hand-modified MacOS config.h! */ | ||||||
| #include "config-mac.h" | #include "config-mac.h" | ||||||
| #endif | #endif | ||||||
|  | #ifdef AMIGA | ||||||
|  | #include "amigaos.h" | ||||||
|  | #endif | ||||||
|  |  | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| @@ -204,6 +207,12 @@ defined(HAVE_LIBSSL) && defined(HAVE_LIBCRYPTO) | |||||||
|  |  | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | #ifdef _AMIGASF | ||||||
|  | #undef HAVE_ALARM | ||||||
|  | #undef sclose | ||||||
|  | #define sclose(x) CloseSocket(x) | ||||||
|  | #endif | ||||||
|  |  | ||||||
| #define DIR_CHAR      "/" | #define DIR_CHAR      "/" | ||||||
| #define DOT_CHAR      "." | #define DOT_CHAR      "." | ||||||
|  |  | ||||||
|   | |||||||
| @@ -32,7 +32,7 @@ | |||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #ifndef HAVE_GETTIMEOFDAY | #ifndef HAVE_GETTIMEOFDAY | ||||||
| #if !defined(_WINSOCKAPI_) && !defined(__MINGW32__) | #if !defined(_WINSOCKAPI_) && !defined(__MINGW32__) && !defined(_AMIGASF) | ||||||
| struct timeval { | struct timeval { | ||||||
|  long tv_sec; |  long tv_sec; | ||||||
|  long tv_usec; |  long tv_usec; | ||||||
|   | |||||||
| @@ -1,4 +1,7 @@ | |||||||
|  |  | ||||||
|  | #ifndef CURL_CONFIG_AMIGAOS_H | ||||||
|  | #define CURL_CONFIG_AMIGAOS_H | ||||||
|  |  | ||||||
| #define OS "AmigaOS" | #define OS "AmigaOS" | ||||||
|  |  | ||||||
| #define HAVE_UNISTD_H		1 | #define HAVE_UNISTD_H		1 | ||||||
| @@ -27,4 +30,11 @@ | |||||||
| #ifndef F_OK | #ifndef F_OK | ||||||
| # define F_OK 0 | # define F_OK 0 | ||||||
| #endif | #endif | ||||||
|  | #ifndef LONG_MAX | ||||||
|  | # define	LONG_MAX	0x7fffffffL		/* max value for a long */ | ||||||
|  | #endif | ||||||
|  | #ifndef LONG_MIN | ||||||
|  | # define	LONG_MIN	(-0x7fffffffL-1)	/* min value for a long */ | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #endif /* CURL_CONFIG_AMIGAOS_H */ | ||||||
|   | |||||||
							
								
								
									
										16
									
								
								src/main.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								src/main.c
									
									
									
									
									
								
							| @@ -1995,6 +1995,7 @@ static int parseconfig(const char *filename, | |||||||
|  |  | ||||||
| #define CURLRC DOT_CHAR "curlrc" | #define CURLRC DOT_CHAR "curlrc" | ||||||
|  |  | ||||||
|  | #ifndef AMIGA | ||||||
|     filename = CURLRC;   /* sensible default */ |     filename = CURLRC;   /* sensible default */ | ||||||
|     home = homedir();    /* portable homedir finder */ |     home = homedir();    /* portable homedir finder */ | ||||||
|     if(home) { |     if(home) { | ||||||
| @@ -2006,6 +2007,13 @@ static int parseconfig(const char *filename, | |||||||
|       } |       } | ||||||
|       free(home); /* we've used it, now free it */ |       free(home); /* we've used it, now free it */ | ||||||
|     } |     } | ||||||
|  |      | ||||||
|  | # else /* AmigaOS */ | ||||||
|  |   /* On AmigaOS all the config files are into env: | ||||||
|  |    */ | ||||||
|  |   filename = "ENV:" CURLRC; | ||||||
|  |  | ||||||
|  | #endif | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   if(strcmp(filename,"-")) |   if(strcmp(filename,"-")) | ||||||
| @@ -3300,6 +3308,14 @@ operate(struct Configurable *config, int argc, char *argv[]) | |||||||
|           } |           } | ||||||
|         } |         } | ||||||
| #endif | #endif | ||||||
|  | #ifdef AMIGA | ||||||
|  |         /* Set the url as comment for the file. (up to 80 chars are allowed) | ||||||
|  |          */ | ||||||
|  |         if( strlen(url) > 78 ) | ||||||
|  |           url[79] = '\0'; | ||||||
|  |          | ||||||
|  |         SetComment( outs.filename, url); | ||||||
|  | #endif | ||||||
|  |  | ||||||
|         if(headerfilep) |         if(headerfilep) | ||||||
|           fclose(headerfilep); |           fclose(headerfilep); | ||||||
|   | |||||||
| @@ -10,13 +10,20 @@ ATCPSDKI=	/GG/netinclude | |||||||
| CC	=	gcc | CC	=	gcc | ||||||
| CFLAGS	=	-I$(ATCPSDKI) -m68020-60 -noixemul -I. -I../include -W -Wall | CFLAGS	=	-I$(ATCPSDKI) -m68020-60 -noixemul -I. -I../include -W -Wall | ||||||
| LIBS	=	../lib/libcurl.a -lsslnix -lcryptonix -lz | LIBS	=	../lib/libcurl.a -lsslnix -lcryptonix -lz | ||||||
|  | MANPAGE =	../docs/curl.1 | ||||||
|  | README	=	../docs/MANUAL | ||||||
|  | MKHELP	=	../src/mkhelp.pl | ||||||
|  |  | ||||||
| OBJS	=	getpass.c homedir.c hugehelp.c main.c urlglob.c writeenv.c writeout.c  | OBJS	=	getpass.c hugehelp.c main.c urlglob.c writeenv.c writeout.c  | ||||||
|  |  | ||||||
|  |  | ||||||
| all:	$(OBJS:.c=.o) | all:	hugehelp.c $(OBJS:.c=.o) | ||||||
| 	$(CC) $(CFLAGS) -s -o cURL $(OBJS:.c=.o) $(LIBS) | 	$(CC) $(CFLAGS) -s -o cURL $(OBJS:.c=.o) $(LIBS) | ||||||
|  |  | ||||||
|  | hugehelp.c: $(README) $(MANPAGE)  mkhelp.pl | ||||||
|  | 	rm -f hugehelp.c | ||||||
|  | 	/bin/nroff -man $(MANPAGE) | /bin/perl $(MKHELP) -c $(README) > hugehelp.c | ||||||
|  |  | ||||||
| install: | install: | ||||||
| 	$(INSTALL) -c cURL /c/cURL | 	$(INSTALL) -c cURL /c/cURL | ||||||
|  |  | ||||||
|   | |||||||
| @@ -46,6 +46,9 @@ | |||||||
| #ifdef __riscos__ | #ifdef __riscos__ | ||||||
| #include "config-riscos.h" | #include "config-riscos.h" | ||||||
| #endif | #endif | ||||||
|  | #ifdef __amigaos__ | ||||||
|  | #include "config-amigaos.h" | ||||||
|  | #endif | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #ifdef CURLDEBUG | #ifdef CURLDEBUG | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Daniel Stenberg
					Daniel Stenberg