Skip to content

Commit

Permalink
curl tool: use configuration files from lib directory
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yangtse committed Apr 6, 2012
1 parent 376b4d4 commit 919c97f
Show file tree
Hide file tree
Showing 97 changed files with 324 additions and 1,296 deletions.
5 changes: 1 addition & 4 deletions buildconf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,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
Expand Down Expand Up @@ -384,9 +384,6 @@ $PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4
echo "buildconf: running autoheader"
${AUTOHEADER:-autoheader} || die "autoheader command failed"

echo "buildconf: cp lib/curl_config.h.in src/curl_config.h.in"
cp lib/curl_config.h.in src/curl_config.h.in

echo "buildconf: running autoconf"
${AUTOCONF:-autoconf} || die "autoconf command failed"

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This configure script may be copied, distributed and modified under the
terms of the curl license; see COPYING for more details])

AC_CONFIG_SRCDIR([lib/urldata.h])
AM_CONFIG_HEADER(lib/curl_config.h src/curl_config.h include/curl/curlbuild.h)
AM_CONFIG_HEADER(lib/curl_config.h include/curl/curlbuild.h)
AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE

Expand Down
6 changes: 3 additions & 3 deletions docs/INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ Windows vs Unix
Inside the source code, We make an effort to avoid '#ifdef [Your OS]'. All
conditionals that deal with features *should* instead be in the format
'#ifdef HAVE_THAT_WEIRD_FUNCTION'. Since Windows can't run configure scripts,
we maintain two curl_config-win32.h files (one in lib/ and one in src/) that
are supposed to look exactly as a curl_config.h file would have looked like on
a Windows machine!
we maintain a curl_config-win32.h file in lib directory that is supposed to
look exactly as a curl_config.h file would have looked like on a Windows
machine!

Generally speaking: always remember that this will be compiled on dozens of
operating systems. Don't walk on the edge.
Expand Down
1 change: 1 addition & 0 deletions include/curl/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
curlbuild.h
stamp-h2
stamp-h3
curlver.h.dist
25 changes: 11 additions & 14 deletions lib/amigaos.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;

Expand All @@ -35,15 +38,15 @@ void __request(const char *msg);
# define __request( msg ) Printf( msg "\n\a")
#endif

void amiga_cleanup()
void Curl_amiga_cleanup()
{
if(SocketBase) {
CloseLibrary(SocketBase);
SocketBase = NULL;
}
}

BOOL amiga_init()
bool Curl_amiga_init()
{
if(!SocketBase)
SocketBase = OpenLibrary("bsdsocket.library", 4);
Expand All @@ -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__ */
40 changes: 11 additions & 29 deletions lib/amigaos.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#ifndef LIBCURL_AMIGAOS_H
#define LIBCURL_AMIGAOS_H
#ifndef HEADER_CURL_AMIGAOS_H
#define HEADER_CURL_AMIGAOS_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* 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
Expand All @@ -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 */

30 changes: 22 additions & 8 deletions lib/config-amigaos.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#ifndef LIBCURL_CONFIG_AMIGAOS_H
#define LIBCURL_CONFIG_AMIGAOS_H
#ifndef HEADER_CURL_CONFIG_AMIGAOS_H
#define HEADER_CURL_CONFIG_AMIGAOS_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
Expand All @@ -22,6 +22,10 @@
*
***************************************************************************/

/* ================================================================ */
/* Hand crafted config file for AmigaOS */
/* ================================================================ */

#ifdef __AMIGA__ /* Any AmigaOS flavour */

#define HAVE_ARPA_INET_H 1
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -150,4 +164,4 @@
#define SEND_TYPE_RETV int

#endif /* __AMIGA__ */
#endif /* LIBCURL_CONFIG_AMIGAOS_H */
#endif /* HEADER_CURL_CONFIG_AMIGAOS_H */
23 changes: 13 additions & 10 deletions lib/config-mac.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#ifndef __LIB_CONFIG_MAC_H
#define __LIB_CONFIG_MAC_H
#ifndef HEADER_CURL_CONFIG_MAC_H
#define HEADER_CURL_CONFIG_MAC_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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 */
Loading

0 comments on commit 919c97f

Please sign in to comment.