diff options
author | Yang Tse <yangsita@gmail.com> | 2012-04-06 23:35:15 +0200 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2012-04-06 23:37:05 +0200 |
commit | 919c97fa65a5c00f7044e849eeb0095408413505 (patch) | |
tree | 12b5005946b744b178cf1fecd310941074cffa45 /lib | |
parent | 376b4d48feea9da98eda15ddf05c86729d9dc3f1 (diff) |
curl tool: use configuration files from lib directory
Configuration files such as curl_config.h and all config-*.h no longer exist
nor are generated/copied into 'src' directory, now these only exist in 'lib'
directory from where curl tool sources uses them.
Additionally old src/setup.h has been refactored into src/tool_setup.h which
now pulls lib/setup.h
The possibility of a makefile needing an include path adjustment exists.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/amigaos.c | 25 | ||||
-rw-r--r-- | lib/amigaos.h | 40 | ||||
-rw-r--r-- | lib/config-amigaos.h | 30 | ||||
-rw-r--r-- | lib/config-mac.h | 23 | ||||
-rw-r--r-- | lib/config-riscos.h | 30 | ||||
-rw-r--r-- | lib/easy.c | 11 | ||||
-rw-r--r-- | lib/setup.h | 22 |
7 files changed, 102 insertions, 79 deletions
diff --git a/lib/amigaos.c b/lib/amigaos.c index 2055126fe..71ea704e1 100644 --- a/lib/amigaos.c +++ b/lib/amigaos.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -20,11 +20,14 @@ * ***************************************************************************/ -#ifdef __AMIGA__ /* Any AmigaOS flavour */ +#include "setup.h" + +#if defined(__AMIGA__) && !defined(__ixemul__) -#include "amigaos.h" #include <amitcp/socketbasetags.h> +#include "amigaos.h" + struct Library *SocketBase = NULL; extern int errno, h_errno; @@ -35,7 +38,7 @@ void __request(const char *msg); # define __request( msg ) Printf( msg "\n\a") #endif -void amiga_cleanup() +void Curl_amiga_cleanup() { if(SocketBase) { CloseLibrary(SocketBase); @@ -43,7 +46,7 @@ void amiga_cleanup() } } -BOOL amiga_init() +bool Curl_amiga_init() { if(!SocketBase) SocketBase = OpenLibrary("bsdsocket.library", 4); @@ -61,20 +64,14 @@ BOOL amiga_init() } #ifndef __libnix__ - atexit(amiga_cleanup); + atexit(Curl_amiga_cleanup); #endif return TRUE; } #ifdef __libnix__ -ADD2EXIT(amiga_cleanup,-50); -#endif - -#else /* __AMIGA__ */ - -#ifdef __POCC__ -# pragma warn(disable:2024) /* Disable warning #2024: Empty input file */ +ADD2EXIT(Curl_amiga_cleanup,-50); #endif -#endif /* __AMIGA__ */ +#endif /* __AMIGA__ && ! __ixemul__ */ diff --git a/lib/amigaos.h b/lib/amigaos.h index d6ff0646a..7476a13d8 100644 --- a/lib/amigaos.h +++ b/lib/amigaos.h @@ -1,5 +1,5 @@ -#ifndef LIBCURL_AMIGAOS_H -#define LIBCURL_AMIGAOS_H +#ifndef HEADER_CURL_AMIGAOS_H +#define HEADER_CURL_AMIGAOS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -21,37 +21,19 @@ * KIND, either express or implied. * ***************************************************************************/ +#include "setup.h" -#ifdef __AMIGA__ /* Any AmigaOS flavour */ +#if defined(__AMIGA__) && !defined(__ixemul__) -#ifndef __ixemul__ +bool Curl_amiga_init(); +void Curl_amiga_cleanup(); -#include <exec/types.h> -#include <exec/execbase.h> +#else -#include <proto/exec.h> -#include <proto/dos.h> +#define Curl_amiga_init() 1 +#define Curl_amiga_cleanup() Curl_nop_stmt -#include <sys/socket.h> - -#include "config-amigaos.h" - -#ifndef select -# define select(args...) WaitSelect( args, NULL) -#endif -#ifndef ioctl -# define ioctl(a,b,c,d) IoctlSocket( (LONG)a, (ULONG)b, (char*)c) #endif -#define _AMIGASF 1 - -extern void amiga_cleanup(); -extern BOOL amiga_init(); - -#else /* __ixemul__ */ - -#warning compiling with ixemul... -#endif /* __ixemul__ */ -#endif /* __AMIGA__ */ -#endif /* LIBCURL_AMIGAOS_H */ +#endif /* HEADER_CURL_AMIGAOS_H */ diff --git a/lib/config-amigaos.h b/lib/config-amigaos.h index 1474ba915..76d887755 100644 --- a/lib/config-amigaos.h +++ b/lib/config-amigaos.h @@ -1,5 +1,5 @@ -#ifndef LIBCURL_CONFIG_AMIGAOS_H -#define LIBCURL_CONFIG_AMIGAOS_H +#ifndef HEADER_CURL_CONFIG_AMIGAOS_H +#define HEADER_CURL_CONFIG_AMIGAOS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -22,6 +22,10 @@ * ***************************************************************************/ +/* ================================================================ */ +/* Hand crafted config file for AmigaOS */ +/* ================================================================ */ + #ifdef __AMIGA__ /* Any AmigaOS flavour */ #define HAVE_ARPA_INET_H 1 @@ -72,8 +76,6 @@ #define HAVE_SYS_STAT_H 1 #define HAVE_SYS_TIME_H 1 #define HAVE_SYS_TYPES_H 1 -#define HAVE_TERMIOS_H 1 -#define HAVE_TERMIO_H 1 #define HAVE_TIME_H 1 #define HAVE_UNAME 1 #define HAVE_UNISTD_H 1 @@ -89,11 +91,11 @@ #define SIZEOF_SHORT 2 #define SIZEOF_SIZE_T 4 +#define USE_MANUAL 1 #define USE_OPENSSL 1 #define USE_SSLEAY 1 #define CURL_DISABLE_LDAP 1 - #define OS "AmigaOS" #define PACKAGE "curl" @@ -114,8 +116,20 @@ #define in_addr_t int +#ifndef F_OK +# define F_OK 0 +#endif + #ifndef O_RDONLY -# define O_RDONLY 0x0000 +# define O_RDONLY 0x0000 +#endif + +#ifndef LONG_MAX +# define LONG_MAX 0x7fffffffL +#endif + +#ifndef LONG_MIN +# define LONG_MIN (-0x7fffffffL-1) #endif #define HAVE_GETNAMEINFO 1 @@ -150,4 +164,4 @@ #define SEND_TYPE_RETV int #endif /* __AMIGA__ */ -#endif /* LIBCURL_CONFIG_AMIGAOS_H */ +#endif /* HEADER_CURL_CONFIG_AMIGAOS_H */ diff --git a/lib/config-mac.h b/lib/config-mac.h index 72e8260d1..d89c38515 100644 --- a/lib/config-mac.h +++ b/lib/config-mac.h @@ -1,5 +1,5 @@ -#ifndef __LIB_CONFIG_MAC_H -#define __LIB_CONFIG_MAC_H +#ifndef HEADER_CURL_CONFIG_MAC_H +#define HEADER_CURL_CONFIG_MAC_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -23,13 +23,16 @@ ***************************************************************************/ /* =================================================================== */ -/* lib/config-mac.h - Hand crafted config file for Mac OS 9 */ +/* Hand crafted config file for Mac OS 9 */ /* =================================================================== */ /* On Mac OS X you must run configure to generate curl_config.h file */ /* =================================================================== */ #define OS "mac" +/* Define if you want the built-in manual */ +#define USE_MANUAL 1 + #define HAVE_ERRNO_H 1 #define HAVE_NETINET_IN_H 1 #define HAVE_SYS_SOCKET_H 1 @@ -43,15 +46,16 @@ #define HAVE_FCNTL_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_ALLOCA_H 1 -#define HAVE_TIME_H 1 #define HAVE_STDLIB_H 1 +#define HAVE_TIME_H 1 #define HAVE_UTIME_H 1 #define HAVE_SYS_TIME_H 1 +#define HAVE_SYS_UTIME_H 1 #define TIME_WITH_SYS_TIME 1 #define HAVE_ALARM 1 -#define HAVE_STRDUP 1 +#define HAVE_FTRUNCATE 1 #define HAVE_UTIME 1 #define HAVE_SETVBUF 1 #define HAVE_STRFTIME 1 @@ -61,14 +65,13 @@ #define HAVE_SOCKET 1 #define HAVE_STRUCT_TIMEVAL 1 -//#define HAVE_STRICMP 1 #define HAVE_SIGACTION 1 #define HAVE_SIGNAL_H 1 #define HAVE_SIG_ATOMIC_T 1 #ifdef MACOS_SSL_SUPPORT -# define USE_SSLEAY 1 -# define USE_OPENSSL 1 +# define USE_SSLEAY 1 +# define USE_OPENSSL 1 #endif #define CURL_DISABLE_LDAP 1 @@ -120,4 +123,4 @@ #define HAVE_EXTRA_STRICMP_H 1 #define HAVE_EXTRA_STRDUP_H 1 -#endif /* __LIB_CONFIG_MAC_H */ +#endif /* HEADER_CURL_CONFIG_MAC_H */ diff --git a/lib/config-riscos.h b/lib/config-riscos.h index 127dbdb0a..e2af9af6c 100644 --- a/lib/config-riscos.h +++ b/lib/config-riscos.h @@ -1,11 +1,13 @@ -/* curl_config.h.in. Generated automatically from configure.in by autoheader. /*************************************************************************** +#ifndef HEADER_CURL_CONFIG_RISCOS_H +#define HEADER_CURL_CONFIG_RISCOS_H +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -19,7 +21,11 @@ * KIND, either express or implied. * ***************************************************************************/ - */ + +/* ================================================================ */ +/* Hand crafted config file for RISC OS */ +/* ================================================================ */ + /* Name of this package! */ #undef PACKAGE @@ -32,6 +38,9 @@ /* Define cpu-machine-OS */ #define OS "ARM-RISC OS" +/* Define if you want the built-in manual */ +#define USE_MANUAL + /* Define if you have the gethostbyaddr_r() function with 5 arguments */ #undef HAVE_GETHOSTBYADDR_R_5 @@ -74,8 +83,8 @@ /* Define if you want to enable IPv6 support */ #undef ENABLE_IPV6 -/* Define to 1 if you have the alarm function. */ -#define HAVE_ALARM 1 +/* Define if you have the alarm function. */ +#define HAVE_ALARM /* Define if you have the <alloca.h> header file. */ #define HAVE_ALLOCA_H @@ -101,6 +110,9 @@ /* Define if you have the <fcntl.h> header file. */ #define HAVE_FCNTL_H +/* Define if you have the `ftruncate' function. */ +#define HAVE_FTRUNCATE + /* Define if getaddrinfo exists and works */ #define HAVE_GETADDRINFO @@ -144,7 +156,7 @@ #define HAVE_INTTYPES_H /* Define if you have the <io.h> header file. */ -#define HAVE_IO_H +#undef HAVE_IO_H /* Define if you have the `krb_get_our_ip_for_realm' function. */ #undef HAVE_KRB_GET_OUR_IP_FOR_REALM @@ -462,8 +474,8 @@ /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 void -/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ -#define RECVFROM_TYPE_ARG2_IS_VOID 1 +/* Define if the type pointed by arg 2 for recvfrom is void. */ +#define RECVFROM_TYPE_ARG2_IS_VOID /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 size_t @@ -500,3 +512,5 @@ /* Define to the function return type for send. */ #define SEND_TYPE_RETV ssize_t + +#endif /* HEADER_CURL_CONFIG_RISCOS_H */ diff --git a/lib/easy.c b/lib/easy.c index 60a55edf8..6e8ff770a 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -66,6 +66,7 @@ #include "curl_ntlm.h" #include "connect.h" /* for Curl_getconnectinfo */ #include "slist.h" +#include "amigaos.h" #include "curl_rand.h" #include "non-ascii.h" #include "warnless.h" @@ -238,8 +239,8 @@ CURLcode curl_global_init(long flags) } #ifdef __AMIGA__ - if(!amiga_init()) { - DEBUGF(fprintf(stderr, "Error: amiga_init failed\n")); + if(!Curl_amiga_init()) { + DEBUGF(fprintf(stderr, "Error: Curl_amiga_init failed\n")); return CURLE_FAILED_INIT; } #endif @@ -328,9 +329,7 @@ void curl_global_cleanup(void) if(init_flags & CURL_GLOBAL_WIN32) win32_cleanup(); -#ifdef __AMIGA__ - amiga_cleanup(); -#endif + Curl_amiga_cleanup(); #if defined(USE_LIBSSH2) && defined(HAVE_LIBSSH2_EXIT) (void)libssh2_exit(); diff --git a/lib/setup.h b/lib/setup.h index 121943758..6ce93db4d 100644 --- a/lib/setup.h +++ b/lib/setup.h @@ -1,5 +1,5 @@ -#ifndef HEADER_CURL_LIB_SETUP_H -#define HEADER_CURL_LIB_SETUP_H +#ifndef HEADER_CURL_SETUP_H +#define HEADER_CURL_SETUP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -54,8 +54,12 @@ # include "config-mac.h" #endif +#ifdef __riscos__ +# include "config-riscos.h" +#endif + #ifdef __AMIGA__ -# include "amigaos.h" +# include "config-amigaos.h" #endif #ifdef __SYMBIAN32__ @@ -281,6 +285,16 @@ # include <ioLib.h> /* for basic I/O interface functions */ #endif +#ifdef __AMIGA__ +# ifndef __ixemul__ +# include <exec/types.h> +# include <exec/execbase.h> +# include <proto/exec.h> +# include <proto/dos.h> +# define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0) +# endif +#endif + #include <stdio.h> #ifdef HAVE_ASSERT_H #include <assert.h> @@ -640,4 +654,4 @@ int netware_init(void); # define SHUT_RDWR 0x02 #endif -#endif /* HEADER_CURL_LIB_SETUP_H */ +#endif /* HEADER_CURL_SETUP_H */ |