summaryrefslogtreecommitdiff
path: root/infrastructure
diff options
context:
space:
mode:
authorMartin Ebourne <martin@ebourne.me.uk>2005-12-07 16:34:47 +0000
committerMartin Ebourne <martin@ebourne.me.uk>2005-12-07 16:34:47 +0000
commit81d8eda2419e7a23088a98cdfc52a305c9ceac0d (patch)
tree27143d7b539a8bf2e23cc18e2f598804fa8d784d /infrastructure
parent065dc6f8cd168e3ee6e71ddfb06f42a92abfabbd (diff)
Merged martin/autoconf at r35 to trunk
Diffstat (limited to 'infrastructure')
-rw-r--r--infrastructure/BoxPlatform.pm.in (renamed from infrastructure/BoxPlatform.pm)28
-rw-r--r--infrastructure/m4/ac_cxx_exceptions.m424
-rw-r--r--infrastructure/m4/ac_cxx_namespaces.m425
-rw-r--r--infrastructure/m4/ax_check_bdb_v1.m443
-rw-r--r--infrastructure/m4/ax_check_define_pragma.m425
-rw-r--r--infrastructure/m4/ax_check_dirent_d_type.m441
-rw-r--r--infrastructure/m4/ax_check_llong_minmax.m476
-rw-r--r--infrastructure/m4/ax_check_malloc_workaround.m438
-rw-r--r--infrastructure/m4/ax_check_mount_point.m441
-rw-r--r--infrastructure/m4/ax_check_nonaligned_access.m457
-rw-r--r--infrastructure/m4/ax_check_ssl.m437
-rw-r--r--infrastructure/m4/ax_check_syscall_lseek.m454
-rw-r--r--infrastructure/m4/ax_func_syscall.m439
-rw-r--r--infrastructure/m4/ax_random_device.m431
-rw-r--r--infrastructure/m4/vl_lib_readline.m4106
-rwxr-xr-xinfrastructure/makebuildenv.pl364
16 files changed, 646 insertions, 383 deletions
diff --git a/infrastructure/BoxPlatform.pm b/infrastructure/BoxPlatform.pm.in
index 0549b39a..257b298b 100644
--- a/infrastructure/BoxPlatform.pm
+++ b/infrastructure/BoxPlatform.pm.in
@@ -1,7 +1,7 @@
package BoxPlatform;
use Exporter;
@ISA = qw/Exporter/;
-@EXPORT = qw/$build_os $build_cpu $make_command $bsd_make $platform_define $platform_cpu $gcc_v3 $gcc_v4 $product_version $product_name $install_into_dir $sub_make_options $platform_compile_line_extra $platform_link_line_extra/;
+@EXPORT = qw/$build_os $build_cpu $make_command $bsd_make $platform_define $platform_cpu $gcc_v3 $product_version $product_name $install_into_dir $sub_make_options $platform_compile_line_extra $platform_link_line_extra $platform_lib_files/;
BEGIN
{
@@ -18,24 +18,11 @@ BEGIN
$make_command = ($build_os eq 'Darwin') ? 'bsdmake' : ($build_os eq 'SunOS') ? 'gmake' : 'make';
$bsd_make = ($build_os ne 'Linux' && $build_os ne 'CYGWIN' && $build_os ne "SunOS");
- $platform_define = 'PLATFORM_'.uc($build_os);
- $platform_cpu = 'PLATFORM_'.uc($build_cpu);
# blank extra flags by default
- $platform_compile_line_extra = '';
- $platform_link_line_extra = '';
-
- # compiler version?
- $gcc_v3 = 0;
- $gcc_v4 = 0;
- open COMPILER,"gcc -v 2>&1 |" or die "Can't open gcc -v";
- while(<COMPILER>)
- {
- $gcc_v3 = 1 if (m/version gcc 3/ || m/gcc version 3/ || m/gcc \(GCC\) 3/i || m/gcc.Version\s+3/i);
- $gcc_v4 = 1 if (m/version gcc 4/ || m/gcc version 4/ || m/gcc \(GCC\) 4/i || m/gcc.Version\s+4/i);
- }
- close COMPILER;
- $gcc_v3 = 1 if $gcc_v4; # hacks are about the same
+ $platform_compile_line_extra = '@CPPFLAGS@ @CXXFLAGS@ @CXXFLAGS_STRICT@';
+ $platform_link_line_extra = '@LDFLAGS@';
+ $platform_lib_files = '@LIBS@';
# get version
open VERSION,"VERSION.txt";
@@ -46,7 +33,7 @@ BEGIN
close VERSION;
# where to put the files
- $install_into_dir = '/usr/local/bin';
+ $install_into_dir = '@bindir@';
# if it's Darwin,
if($build_os eq 'Darwin')
@@ -67,11 +54,6 @@ BEGIN
$platform_link_line_extra = '-L/sw/lib ';
}
}
-
- if($build_os eq 'SunOS')
- {
- $platform_link_line_extra = '-lrt ';
- }
}
sub make_flag
diff --git a/infrastructure/m4/ac_cxx_exceptions.m4 b/infrastructure/m4/ac_cxx_exceptions.m4
new file mode 100644
index 00000000..4c3013dc
--- /dev/null
+++ b/infrastructure/m4/ac_cxx_exceptions.m4
@@ -0,0 +1,24 @@
+dnl @synopsis AC_CXX_EXCEPTIONS
+dnl
+dnl If the C++ compiler supports exceptions handling (try, throw and
+dnl catch), define HAVE_EXCEPTIONS.
+dnl
+dnl @category Cxx
+dnl @author Todd Veldhuizen
+dnl @author Luc Maisonobe <luc@spaceroots.org>
+dnl @version 2004-02-04
+dnl @license AllPermissive
+
+AC_DEFUN([AC_CXX_EXCEPTIONS],
+[AC_CACHE_CHECK(whether the compiler supports exceptions,
+ac_cv_cxx_exceptions,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE(,[try { throw 1; } catch (int i) { return i; }],
+ ac_cv_cxx_exceptions=yes, ac_cv_cxx_exceptions=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_exceptions" = yes; then
+ AC_DEFINE(HAVE_EXCEPTIONS,,[define if the compiler supports exceptions])
+fi
+])
diff --git a/infrastructure/m4/ac_cxx_namespaces.m4 b/infrastructure/m4/ac_cxx_namespaces.m4
new file mode 100644
index 00000000..2f18477b
--- /dev/null
+++ b/infrastructure/m4/ac_cxx_namespaces.m4
@@ -0,0 +1,25 @@
+dnl @synopsis AC_CXX_NAMESPACES
+dnl
+dnl If the compiler can prevent names clashes using namespaces, define
+dnl HAVE_NAMESPACES.
+dnl
+dnl @category Cxx
+dnl @author Todd Veldhuizen
+dnl @author Luc Maisonobe <luc@spaceroots.org>
+dnl @version 2004-02-04
+dnl @license AllPermissive
+
+AC_DEFUN([AC_CXX_NAMESPACES],
+[AC_CACHE_CHECK(whether the compiler implements namespaces,
+ac_cv_cxx_namespaces,
+[AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
+ [using namespace Outer::Inner; return i;],
+ ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
+ AC_LANG_RESTORE
+])
+if test "$ac_cv_cxx_namespaces" = yes; then
+ AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
+fi
+])
diff --git a/infrastructure/m4/ax_check_bdb_v1.m4 b/infrastructure/m4/ax_check_bdb_v1.m4
new file mode 100644
index 00000000..de36ca07
--- /dev/null
+++ b/infrastructure/m4/ax_check_bdb_v1.m4
@@ -0,0 +1,43 @@
+dnl @synopsis AX_CHECK_BDB_V1
+dnl
+dnl This macro find an installation of Berkeley DB version 1, or compatible.
+dnl It will define the following macros on success:
+dnl
+dnl HAVE_DB - If Berkeley DB version 1 or compatible is available
+dnl DB_HEADER - The relative path and filename of the header file
+dnl LIBS - Updated for correct library
+dnl
+dnl @category C
+dnl @author Martin Ebourne
+dnl @version 2005/07/12
+dnl @license AllPermissive
+
+AC_DEFUN([AX_CHECK_BDB_V1], [
+ ac_have_bdb=no
+ AC_CHECK_HEADERS([db_185.h db4/db_185.h db3/db_185.h db1/db.h db.h],
+ [ac_bdb_header=$ac_header; break], [ac_bdb_header=""])
+ if test "x$ac_bdb_header" != x; then
+ AC_SEARCH_LIBS([__db185_open],
+ [db db-4.3 db-4.2 db-4.1 db-4.0 db-3],
+ [ac_have_bdb=yes],
+ [AC_SEARCH_LIBS([dbopen], [db-1 db], [ac_have_bdb=yes])])
+ fi
+ if test "x$ac_have_bdb" = "xyes"; then
+ AC_MSG_CHECKING([whether found db libraries work])
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+ $ac_includes_default
+ #include "$ac_bdb_header"]], [[
+ DB *dbp = dbopen(0, 0, 0, DB_HASH, 0);
+ if(dbp) dbp->close(dbp);
+ return 0;
+ ]])], [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_DB], 1, [Define to 1 if Berkeley DB is available])
+ AC_DEFINE_UNQUOTED([DB_HEADER], ["$ac_bdb_header"],
+ [Define to the location of the Berkeley DB 1.85 header])
+ ], [
+ AC_MSG_RESULT([no])
+ ac_have_bdb=no
+ ])
+ fi
+ ])dnl
diff --git a/infrastructure/m4/ax_check_define_pragma.m4 b/infrastructure/m4/ax_check_define_pragma.m4
new file mode 100644
index 00000000..176faf3d
--- /dev/null
+++ b/infrastructure/m4/ax_check_define_pragma.m4
@@ -0,0 +1,25 @@
+dnl @synopsis AX_CHECK_DEFINE_PRAGMA([ACTION-IF-TRUE], [ACTION-IF-FALSE])
+dnl
+dnl This macro will find out if the compiler will accept #pragma inside a
+dnl #define. HAVE_DEFINE_PRAGMA will be defined if this is the case, and
+dnl ACTION-IF-TRUE and ACTION-IF-FALSE are run as appropriate
+dnl
+dnl @category C
+dnl @author Martin Ebourne
+dnl @version 2005/07/03
+dnl @license AllPermissive
+
+AC_DEFUN([AX_CHECK_DEFINE_PRAGMA], [
+ AC_CACHE_CHECK([for pre-processor pragma defines], [have_define_pragma],
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #define TEST_DEFINE #pragma pack(1)
+ TEST_DEFINE
+ ]])],
+ [have_define_pragma=yes], [have_define_pragma=no]
+ )])
+ if test "x$have_define_pragma" = "xyes"; then
+ AC_DEFINE([HAVE_DEFINE_PRAGMA], 1, [Define to 1 if #define of pragmas works])
+ m4_ifvaln([$1],[$1],[:])dnl
+ m4_ifvaln([$2],[else $2])dnl
+ fi
+ ])dnl
diff --git a/infrastructure/m4/ax_check_dirent_d_type.m4 b/infrastructure/m4/ax_check_dirent_d_type.m4
new file mode 100644
index 00000000..87b93185
--- /dev/null
+++ b/infrastructure/m4/ax_check_dirent_d_type.m4
@@ -0,0 +1,41 @@
+dnl @synopsis AX_CHECK_DIRENT_D_TYPE([ACTION-IF-TRUE], [ACTION-IF-FALSE])
+dnl
+dnl This macro will find out if struct dirent.d_type is present and supported.
+dnl
+dnl The following defines will be set as appropriate:
+dnl HAVE_STRUCT_DIRENT_D_TYPE
+dnl HAVE_VALID_DIRENT_D_TYPE
+dnl Also ACTION-IF-TRUE and ACTION-IF-FALSE are run as appropriate
+dnl
+dnl @category C
+dnl @author Martin Ebourne
+dnl @version 2005/07/03
+dnl @license AllPermissive
+
+AC_DEFUN([AX_CHECK_DIRENT_D_TYPE], [
+ AC_CHECK_MEMBERS([struct dirent.d_type],,, [[#include <dirent.h>]])
+ if test "x$ac_cv_member_struct_dirent_d_type" = "xyes"; then
+ AC_CACHE_CHECK([[whether struct dirent.d_type is valid]], [have_valid_dirent_d_type],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+ $ac_includes_default
+ #include <dirent.h>
+ ]], [[
+ DIR* dir = opendir(".");
+ struct dirent* res = NULL;
+ if(dir) res = readdir(dir);
+ return res ? (res->d_type==DT_UNKNOWN) : 1;
+ ]])],
+ [have_valid_dirent_d_type=yes], [have_valid_dirent_d_type=no]
+ )])
+ if test "x$have_valid_dirent_d_type" = "xyes"; then
+ AC_DEFINE([HAVE_VALID_DIRENT_D_TYPE], 1, [Define to 1 if struct dirent.d_type is valid])
+ fi
+ fi
+ if test "x$ac_cv_member_struct_dirent_d_type" = "xyes" || \
+ test "x$have_valid_dirent_d_type" = "xyes"
+ then
+ m4_ifvaln([$1],[$1],[:])dnl
+ m4_ifvaln([$2],[else $2])dnl
+ fi
+ ])dnl
diff --git a/infrastructure/m4/ax_check_llong_minmax.m4 b/infrastructure/m4/ax_check_llong_minmax.m4
new file mode 100644
index 00000000..f3f99c53
--- /dev/null
+++ b/infrastructure/m4/ax_check_llong_minmax.m4
@@ -0,0 +1,76 @@
+dnl @synopsis AX_CHECK_LLONG_MINMAX
+dnl
+dnl This macro will fix up LLONG_MIN and LLONG_MAX as appropriate. I'm finding
+dnl it quite difficult to believe that so many hoops are necessary. The world
+dnl seems to have gone quite mad.
+dnl
+dnl This gem is adapted from the OpenSSH configure script so here's
+dnl the original copyright notice:
+dnl
+dnl Copyright (c) 1999-2004 Damien Miller
+dnl
+dnl Permission to use, copy, modify, and distribute this software for any
+dnl purpose with or without fee is hereby granted, provided that the above
+dnl copyright notice and this permission notice appear in all copies.
+dnl
+dnl @category C
+dnl @author Martin Ebourne and Damien Miller
+dnl @version 2005/07/07
+
+AC_DEFUN([AX_CHECK_LLONG_MINMAX], [
+ AC_CHECK_DECL([LLONG_MAX], [have_llong_max=1], , [[#include <limits.h>]])
+ if test -z "$have_llong_max"; then
+ AC_MSG_CHECKING([[for max value of long long]])
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ #include <stdio.h>
+ /* Why is this so damn hard? */
+ #undef __GNUC__
+ #undef __USE_ISOC99
+ #define __USE_ISOC99
+ #include <limits.h>
+ #define DATA "conftest.llminmax"
+ int main(void) {
+ FILE *f;
+ long long i, llmin, llmax = 0;
+
+ if((f = fopen(DATA,"w")) == NULL)
+ exit(1);
+
+ #if defined(LLONG_MIN) && defined(LLONG_MAX)
+ fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n");
+ llmin = LLONG_MIN;
+ llmax = LLONG_MAX;
+ #else
+ fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n");
+ /* This will work on one's complement and two's complement */
+ for (i = 1; i > llmax; i <<= 1, i++)
+ llmax = i;
+ llmin = llmax + 1LL; /* wrap */
+ #endif
+
+ /* Sanity check */
+ if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax || llmax - 1 > llmax) {
+ fprintf(f, "unknown unknown\n");
+ exit(2);
+ }
+
+ if (fprintf(f ,"%lld %lld", llmin, llmax) < 0)
+ exit(3);
+
+ exit(0);
+ }
+ ]])], [
+ read llong_min llong_max < conftest.llminmax
+ AC_MSG_RESULT([$llong_max])
+ AC_DEFINE_UNQUOTED([LLONG_MAX], [${llong_max}LL],
+ [max value of long long calculated by configure])
+ AC_MSG_CHECKING([[for min value of long long]])
+ AC_MSG_RESULT([$llong_min])
+ AC_DEFINE_UNQUOTED([LLONG_MIN], [${llong_min}LL],
+ [min value of long long calculated by configure])
+ ],
+ [AC_MSG_RESULT(not found)],
+ [AC_MSG_WARN([[cross compiling: not checking]])]
+ )
+ fi
+ ])dnl
diff --git a/infrastructure/m4/ax_check_malloc_workaround.m4 b/infrastructure/m4/ax_check_malloc_workaround.m4
new file mode 100644
index 00000000..9b1c9848
--- /dev/null
+++ b/infrastructure/m4/ax_check_malloc_workaround.m4
@@ -0,0 +1,38 @@
+dnl @synopsis AX_CHECK_MALLOC_WORKAROUND
+dnl
+dnl This macro will see if there is a potential STL memory leak, and if we can
+dnl work around it will define __USE_MALLOC as the fix.
+dnl
+dnl @category C
+dnl @author Martin Ebourne
+dnl @version 2005/07/12
+dnl @license AllPermissive
+
+AC_DEFUN([AX_CHECK_MALLOC_WORKAROUND], [
+ if test "x$GXX" = "xyes"; then
+ AC_CACHE_CHECK([for gcc version 3 or later], [gcc_3_plus],
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #if __GNUC__ < 3
+ #error "Old GNU C"
+ #endif
+ ]])],
+ [gcc_3_plus=yes], [gcc_3_plus=no]
+ )])
+ if test "x$gcc_3_plus" = "xno"; then
+ AC_CACHE_CHECK([for malloc workaround], [malloc_workaround],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #define __USE_MALLOC
+ #include <string>
+ ]], [[
+ std::string s;
+ s = "test";
+ ]])],
+ [malloc_workaround=yes], [malloc_workaround=no]
+ )])
+ if test "x$malloc_workaround" = "xyes"; then
+ AC_DEFINE([__USE_MALLOC], 1,
+ [Define to 1 if __USE_MALLOC is required work around STL memory leaks])
+ fi
+ fi
+ fi
+ ])dnl
diff --git a/infrastructure/m4/ax_check_mount_point.m4 b/infrastructure/m4/ax_check_mount_point.m4
new file mode 100644
index 00000000..747888cc
--- /dev/null
+++ b/infrastructure/m4/ax_check_mount_point.m4
@@ -0,0 +1,41 @@
+dnl @synopsis AX_CHECK_MOUNT_POINT([ACTION-IF-TRUE], [ACTION-IF-FALSE])
+dnl
+dnl This macro will find out how to get mount point information if possible.
+dnl
+dnl The following defines will be set as appropriate:
+dnl HAVE_MNTENT_H
+dnl HAVE_SYS_MNTTAB_H
+dnl HAVE_SYS_MOUNT_H
+dnl HAVE_STRUCT_MNTENT_MNT_DIR
+dnl HAVE_STRUCT_MNTTAB_MNT_MOUNTP
+dnl HAVE_STRUCT_STATFS_F_MNTONNAME
+dnl Also ACTION-IF-TRUE and ACTION-IF-FALSE are run as appropriate
+dnl
+dnl @category C
+dnl @author Martin Ebourne
+dnl @version 2005/07/01
+dnl @license AllPermissive
+
+AC_DEFUN([AX_CHECK_MOUNT_POINT], [
+ AC_CHECK_FUNCS([getmntent statfs])
+ AC_CHECK_HEADERS([mntent.h sys/mnttab.h sys/mount.h],,, [[#include <stdio.h>]])
+ # BSD
+ AC_CHECK_MEMBERS([struct statfs.f_mntonname],,, [[
+ #include <sys/param.h>
+ #include <sys/mount.h>
+ ]])
+ # Linux
+ AC_CHECK_MEMBERS([struct mntent.mnt_dir],,, [[#include <mntent.h>]])
+ # Solaris
+ AC_CHECK_MEMBERS([struct mnttab.mnt_mountp],,, [[
+ #include <stdio.h>
+ #include <sys/mnttab.h>
+ ]])
+ if test "x$ac_cv_member_struct_statfs_f_mntonname" = "xyes" || \
+ test "x$ac_cv_member_struct_mntent_mnt_dir" = "xyes" || \
+ test "x$ac_cv_member_struct_mnttab_mnt_mountp" = "xyes"
+ then
+ m4_ifvaln([$1],[$1],[:])dnl
+ m4_ifvaln([$2],[else $2])dnl
+ fi
+ ])dnl
diff --git a/infrastructure/m4/ax_check_nonaligned_access.m4 b/infrastructure/m4/ax_check_nonaligned_access.m4
new file mode 100644
index 00000000..8a6cd0c6
--- /dev/null
+++ b/infrastructure/m4/ax_check_nonaligned_access.m4
@@ -0,0 +1,57 @@
+dnl @synopsis AX_CHECK_NONALIGNED_ACCESS
+dnl
+dnl This macro will see if non-aligned memory accesses will fail. The following
+dnl defines will be made as appropriate:
+dnl HAVE_ALIGNED_ONLY_INT16
+dnl HAVE_ALIGNED_ONLY_INT32
+dnl HAVE_ALIGNED_ONLY_INT64
+dnl
+dnl @category C
+dnl @author Martin Ebourne
+dnl @version 2005/07/12
+dnl @license AllPermissive
+
+AC_DEFUN([AX_CHECK_NONALIGNED_ACCESS], [
+ AC_CACHE_CHECK([if non-aligned 16 bit word accesses fail], [have_aligned_only_int16],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[$ac_includes_default]], [[
+ #ifndef HAVE_UINT16_T
+ #define uint16_t u_int16_t;
+ #endif
+ uint16_t scratch[2];
+ memset(scratch, 0, sizeof(scratch));
+ return *(uint16_t*)((char*)scratch+1);
+ ]])],
+ [have_aligned_only_int16=no], [have_aligned_only_int16=yes]
+ )])
+ if test "x$have_aligned_only_int16" = "xyes"; then
+ AC_DEFINE([HAVE_ALIGNED_ONLY_INT16], 1, [Define to 1 if non-aligned int16 access will fail])
+ fi
+ AC_CACHE_CHECK([if non-aligned 32 bit word accesses fail], [have_aligned_only_int32],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[$ac_includes_default]], [[
+ #ifndef HAVE_UINT32_T
+ #define uint32_t u_int32_t;
+ #endif
+ uint32_t scratch[2];
+ memset(scratch, 0, sizeof(scratch));
+ return *(uint32_t*)((char*)scratch+1);
+ ]])],
+ [have_aligned_only_int32=no], [have_aligned_only_int32=yes]
+ )])
+ if test "x$have_aligned_only_int32" = "xyes"; then
+ AC_DEFINE([HAVE_ALIGNED_ONLY_INT32], 1, [Define to 1 if non-aligned int32 access will fail])
+ fi
+ AC_CACHE_CHECK([if non-aligned 64 bit word accesses fail], [have_aligned_only_int64],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[$ac_includes_default]], [[
+ #ifndef HAVE_UINT64_T
+ #define uint64_t u_int64_t;
+ #endif
+ uint64_t scratch[2];
+ memset(scratch, 0, sizeof(scratch));
+ return *(uint64_t*)((char*)scratch+1);
+ ]])],
+ [have_aligned_only_int64=no], [have_aligned_only_int64=yes]
+ )])
+ if test "x$have_aligned_only_int64" = "xyes"; then
+ AC_DEFINE([HAVE_ALIGNED_ONLY_INT64], 1, [Define to 1 if non-aligned int64 access will fail])
+ fi
+ ])dnl
diff --git a/infrastructure/m4/ax_check_ssl.m4 b/infrastructure/m4/ax_check_ssl.m4
new file mode 100644
index 00000000..039c8398
--- /dev/null
+++ b/infrastructure/m4/ax_check_ssl.m4
@@ -0,0 +1,37 @@
+dnl @synopsis AX_CHECK_SSL([ACTION-IF-TRUE], [ACTION-IF-FALSE])
+dnl
+dnl This macro will check for OpenSSL in the standard path, allowing the user
+dnl to specify a directory if it is not found. The user uses
+dnl '--with-ssl-headers=/path/to/headers' or
+dnl '--with-ssl-lib=/path/to/lib' as arguments to configure.
+dnl
+dnl If OpenSSL is found the include directory gets added to CPPFLAGS,
+dnl '-lcrypto', '-lssl', and the libraries directory are added to LDFLAGS.
+dnl Also HAVE_SSL is defined to 1, and ACTION-IF-TRUE and ACTION-IF-FALSE are
+dnl run as appropriate
+dnl
+dnl @category InstalledPackages
+dnl @author Martin Ebourne
+dnl @version 2005/07/01
+dnl @license AllPermissive
+
+AC_DEFUN([AX_CHECK_SSL], [
+ AC_ARG_WITH(
+ [ssl-headers],
+ [AC_HELP_STRING([--with-ssl-headers=DIR], [SSL include files location])],
+ [CPPFLAGS="$CPPFLAGS -I$withval"])
+ AC_ARG_WITH(
+ [ssl-lib],
+ [AC_HELP_STRING([--with-ssl-lib=DIR], [SSL library location])],
+ [LDFLAGS="$LDFLAGS -L$withval"])
+
+ ax_check_ssl_found=yes
+ AC_CHECK_HEADERS([openssl/ssl.h],, [ax_check_ssl_found=no])
+ AC_CHECK_LIB([ssl], [SSL_read],, [ax_check_ssl_found=no])
+
+ if test "x$ax_check_ssl_found" = "xyes"; then
+ AC_DEFINE([HAVE_SSL], 1, [Define to 1 if SSL is available])
+ m4_ifvaln([$1],[$1],[:])dnl
+ m4_ifvaln([$2],[else $2])dnl
+ fi
+ ])dnl
diff --git a/infrastructure/m4/ax_check_syscall_lseek.m4 b/infrastructure/m4/ax_check_syscall_lseek.m4
new file mode 100644
index 00000000..6bf93c23
--- /dev/null
+++ b/infrastructure/m4/ax_check_syscall_lseek.m4
@@ -0,0 +1,54 @@
+dnl @synopsis AX_CHECK_SYSCALL_LSEEK([ACTION-IF-TRUE], [ACTION-IF-FALSE])
+dnl
+dnl This macro will find out if the lseek syscall requires a dummy middle
+dnl parameter
+dnl
+dnl The following defines will be set as appropriate:
+dnl HAVE_LSEEK_DUMMY_PARAM
+dnl Also ACTION-IF-TRUE and ACTION-IF-FALSE are run as appropriate
+dnl
+dnl @category C
+dnl @author Martin Ebourne
+dnl @version 2005/07/03
+dnl @license AllPermissive
+
+AC_DEFUN([AX_CHECK_SYSCALL_LSEEK], [
+ AC_REQUIRE([AX_FUNC_SYSCALL])dnl
+ if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then
+ AC_CACHE_CHECK([[whether syscall lseek requires dummy parameter]], [have_lseek_dummy_param],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+ $ac_includes_default
+ #include <fcntl.h>
+ #include <sys/syscall.h>
+ #ifdef HAVE___SYSCALL_NEED_DEFN
+ extern "C" off_t __syscall(quad_t number, ...);
+ #endif
+ #ifndef HAVE_SYSCALL
+ #undef syscall
+ #define syscall __syscall
+ #endif
+ ]], [[
+ int fh = creat("lseektest", 0600);
+ int res = 0;
+ if(fh>=0)
+ {
+ res = syscall(SYS_lseek, fh, 0, SEEK_SET, 99);
+ close(fh);
+ }
+ unlink("lseektest");
+ return res!=-1;
+ ]])],
+ [have_lseek_dummy_param=yes], [have_lseek_dummy_param=no]
+ )])
+ if test "x$have_lseek_dummy_param" = "xyes"; then
+ AC_DEFINE([HAVE_LSEEK_DUMMY_PARAM], 1,
+ [Define to 1 if syscall lseek requires a dummy middle parameter])
+ fi
+ fi
+ if test "x$have_lseek_dummy_param" = "xno"
+ then
+ m4_ifvaln([$1],[$1],[:])dnl
+ m4_ifvaln([$2],[else $2])dnl
+ fi
+ ])dnl
diff --git a/infrastructure/m4/ax_func_syscall.m4 b/infrastructure/m4/ax_func_syscall.m4
new file mode 100644
index 00000000..40496bf0
--- /dev/null
+++ b/infrastructure/m4/ax_func_syscall.m4
@@ -0,0 +1,39 @@
+dnl @synopsis AX_FUNC_SYSCALL
+dnl
+dnl This macro will find out how to call syscall. One or more of the following
+dnl defines will be made as appropriate:
+dnl HAVE_UNISTD_H - If unistd.h is available
+dnl HAVE_SYS_SYSCALL_H - If sys/syscall.h is available
+dnl HAVE_SYSCALL - If syscall() is available and is defined in unistd.h
+dnl HAVE___SYSCALL - If __syscall() is available and is defined in unistd.h
+dnl HAVE___SYSCALL_NEED_DEFN - If __syscall() is available but is not defined in unistd.h
+dnl
+dnl @category C
+dnl @author Martin Ebourne
+dnl @version 2005/07/01
+dnl @license AllPermissive
+
+AC_DEFUN([AX_FUNC_SYSCALL], [
+ AC_CHECK_HEADERS([sys/syscall.h unistd.h])
+ AC_CHECK_FUNCS([syscall __syscall])
+ if test "x$ac_cv_func_syscall" != "xyes" &&
+ test "x$ac_cv_func___syscall" != "xyes"; then
+ AC_CACHE_CHECK([for __syscall needing definition], [have___syscall_need_defn],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+ $ac_includes_default
+ #ifdef HAVE_SYS_SYSCALL_H
+ #include <sys/syscall.h>
+ #endif
+ extern "C" off_t __syscall(quad_t number, ...);
+ ]], [[
+ __syscall(SYS_exit, 0);
+ return 1;
+ ]])],
+ [have___syscall_need_defn=yes], [have___syscall_need_defn=no]
+ )])
+ if test "x$have___syscall_need_defn" = "xyes"; then
+ AC_DEFINE([HAVE___SYSCALL_NEED_DEFN], 1,
+ [Define to 1 if __syscall is available but needs a definition])
+ fi
+ fi
+ ])dnl
diff --git a/infrastructure/m4/ax_random_device.m4 b/infrastructure/m4/ax_random_device.m4
new file mode 100644
index 00000000..ab9b56fd
--- /dev/null
+++ b/infrastructure/m4/ax_random_device.m4
@@ -0,0 +1,31 @@
+dnl @synopsis AX_RANDOM_DEVICE
+dnl
+dnl This macro will check for a random device, allowing the user to explicitly
+dnl set the path. The user uses '--with-random=FILE' as an argument to
+dnl configure.
+dnl
+dnl If A random device is found then HAVE_RANDOM_DEVICE is set to 1 and
+dnl RANDOM_DEVICE contains the path.
+dnl
+dnl @category Miscellaneous
+dnl @author Martin Ebourne
+dnl @version 2005/07/01
+dnl @license AllPermissive
+
+AC_DEFUN([AX_RANDOM_DEVICE], [
+ AC_ARG_WITH([random],
+ [AC_HELP_STRING([--with-random=FILE], [Use FILE as random number seed [auto-detected]])],
+ [RANDOM_DEVICE="$withval"],
+ [AC_CHECK_FILE("/dev/urandom", [RANDOM_DEVICE="/dev/urandom";],
+ [AC_CHECK_FILE("/dev/arandom", [RANDOM_DEVICE="/dev/arandom";],
+ [AC_CHECK_FILE("/dev/random", [RANDOM_DEVICE="/dev/random";])]
+ )])
+ ])
+ if test "x$RANDOM_DEVICE" != "x" ; then
+ AC_DEFINE([HAVE_RANDOM_DEVICE], 1,
+ [Define to 1 (and set RANDOM_DEVICE) if a random device is available])
+ AC_SUBST([RANDOM_DEVICE])
+ AC_DEFINE_UNQUOTED([RANDOM_DEVICE], ["$RANDOM_DEVICE"],
+ [Define to the filename of the random device (and set HAVE_RANDOM_DEVICE)])
+ fi
+ ])dnl
diff --git a/infrastructure/m4/vl_lib_readline.m4 b/infrastructure/m4/vl_lib_readline.m4
new file mode 100644
index 00000000..7c9217d6
--- /dev/null
+++ b/infrastructure/m4/vl_lib_readline.m4
@@ -0,0 +1,106 @@
+dnl @synopsis VL_LIB_READLINE
+dnl
+dnl Searches for a readline compatible library. If found, defines
+dnl `HAVE_LIBREADLINE'. If the found library has the `add_history'
+dnl function, sets also `HAVE_READLINE_HISTORY'. Also checks for the
+dnl locations of the necessary include files and sets `HAVE_READLINE_H'
+dnl or `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or
+dnl 'HAVE_HISTORY_H' if the corresponding include files exists.
+dnl
+dnl The libraries that may be readline compatible are `libedit',
+dnl `libeditline' and `libreadline'. Sometimes we need to link a
+dnl termcap library for readline to work, this macro tests these cases
+dnl too by trying to link with `libtermcap', `libcurses' or
+dnl `libncurses' before giving up.
+dnl
+dnl Here is an example of how to use the information provided by this
+dnl macro to perform the necessary includes or declarations in a C
+dnl file:
+dnl
+dnl #ifdef HAVE_LIBREADLINE
+dnl # if defined(HAVE_READLINE_READLINE_H)
+dnl # include <readline/readline.h>
+dnl # elif defined(HAVE_READLINE_H)
+dnl # include <readline.h>
+dnl # else /* !defined(HAVE_READLINE_H) */
+dnl extern char *readline ();
+dnl # endif /* !defined(HAVE_READLINE_H) */
+dnl char *cmdline = NULL;
+dnl #else /* !defined(HAVE_READLINE_READLINE_H) */
+dnl /* no readline */
+dnl #endif /* HAVE_LIBREADLINE */
+dnl
+dnl #ifdef HAVE_READLINE_HISTORY
+dnl # if defined(HAVE_READLINE_HISTORY_H)
+dnl # include <readline/history.h>
+dnl # elif defined(HAVE_HISTORY_H)
+dnl # include <history.h>
+dnl # else /* !defined(HAVE_HISTORY_H) */
+dnl extern void add_history ();
+dnl extern int write_history ();
+dnl extern int read_history ();
+dnl # endif /* defined(HAVE_READLINE_HISTORY_H) */
+dnl /* no history */
+dnl #endif /* HAVE_READLINE_HISTORY */
+dnl
+dnl Modifications to add --enable-gnu-readline to work around licensing
+dnl problems between the traditional BSD licence and the GPL.
+dnl Martin Ebourne, 2005/7/11
+dnl
+dnl @category InstalledPackages
+dnl @author Ville Laurikari <vl@iki.fi>
+dnl @version 2002-04-04
+dnl @license AllPermissive
+
+AC_DEFUN([VL_LIB_READLINE], [
+ AC_ARG_ENABLE(
+ [gnu-readline],
+ AC_HELP_STRING([--enable-gnu-readline],
+ [Allow use of GNU readline (may violate GNU licence)])
+ )
+ vl_gnu_readline_lib=""
+ if test "x$enable_gnu_readline" = "xyes"; then
+ vl_gnu_readline_lib=readline
+ fi
+ AC_CACHE_CHECK([for a readline compatible library],
+ vl_cv_lib_readline, [
+ ORIG_LIBS="$LIBS"
+ for readline_lib in edit editline $vl_gnu_readline_lib; do
+ for termcap_lib in "" termcap curses ncurses; do
+ if test -z "$termcap_lib"; then
+ TRY_LIB="-l$readline_lib"
+ else
+ TRY_LIB="-l$readline_lib -l$termcap_lib"
+ fi
+ LIBS="$ORIG_LIBS $TRY_LIB"
+ AC_TRY_LINK_FUNC(readline, vl_cv_lib_readline="$TRY_LIB")
+ if test -n "$vl_cv_lib_readline"; then
+ break
+ fi
+ done
+ if test -n "$vl_cv_lib_readline"; then
+ break
+ fi
+ done
+ if test -z "$vl_cv_lib_readline"; then
+ vl_cv_lib_readline="no"
+ LIBS="$ORIG_LIBS"
+ fi
+ ])
+
+ if test "x$vl_cv_lib_readline" != "xno"; then
+ AC_DEFINE(HAVE_LIBREADLINE, 1,
+ [Define if you have a readline compatible library])
+ AC_CHECK_HEADERS(readline.h readline/readline.h)
+ AC_CACHE_CHECK([whether readline supports history],
+ vl_cv_lib_readline_history, [
+ vl_cv_lib_readline_history="no"
+ AC_TRY_LINK_FUNC(add_history, vl_cv_lib_readline_history="yes")
+ ])
+ if test "x$vl_cv_lib_readline_history" = "xyes"; then
+ AC_DEFINE(HAVE_READLINE_HISTORY, 1,
+ [Define if your readline library has \`add_history'])
+ AC_CHECK_HEADERS(history.h readline/history.h)
+ fi
+ fi
+])dnl
diff --git a/infrastructure/makebuildenv.pl b/infrastructure/makebuildenv.pl
index ecac6939..0af6d680 100755
--- a/infrastructure/makebuildenv.pl
+++ b/infrastructure/makebuildenv.pl
@@ -12,7 +12,7 @@ $|=1;
# note: Mac OS X resource forks and .DS_Store files are explicity ignored
-print "Box build environment setup.\n\nChecking environment...\n";
+print "Box build environment setup.\n\n";
my $implicit_dep = 'lib/common';
@@ -21,43 +21,12 @@ my $implicit_dep = 'lib/common';
use lib 'infrastructure';
use BoxPlatform;
-# don't allow old versions of openssl by default.
-my $old_version_of_openssl_ok = 0;
-
# keep copy of command line args
my $makebuildenv_args = join(' ',@ARGV);
# do command line arguments
my $compile_line_extra = $platform_compile_line_extra;
my $link_line_extra = $platform_link_line_extra;
-for(@ARGV)
-{
- if($_ eq 'allow-old-openssl')
- {
- $old_version_of_openssl_ok = 1;
- next;
- }
- my ($k,$v) = split /:/,$_,2;
- if($k eq 'compile')
- {
- $compile_line_extra .= $v . ' ';
- }
- elsif($k eq 'link')
- {
- $link_line_extra .= $v . ' ';
- }
- elsif($k eq 'openssl')
- {
- # assume that the bin/lib/include dirs are under the specified path
- chop $v if ($v =~ /\/$/);
- $compile_line_extra = "-I$v/include $compile_line_extra";
- $link_line_extra = "-L$v/lib $link_line_extra";
- }
- else
- {
- die "invalid option $_ specified on command line"
- }
-}
# make sure local files directory exists
unless(-d 'local')
@@ -68,262 +37,9 @@ unless(-d 'local')
# flags about the environment
my %env_flags;
-# messages on test failure
-my $test_failure_text;
-
-# run all tests
-{
- opendir DIR,'infrastructure/tests' or die "Can't read the tests directory";
- my @tests = grep {m/_tests\.pl\Z/} readdir DIR;
- closedir DIR;
- for(@tests)
- {
- require "infrastructure/tests/$_";
- }
-}
-
-
-# ---- LINUX start --------------------------------------------------------------------------
-# do configuration on Linux... find out what's available, and configure appropraitely.
-if($build_os eq 'Linux')
-{
- # setup the basic library translation flags -- these will omit those libraries from the compile line
- $env_flags{'LIBTRANS_-lreadline'} = '';
- $env_flags{'LIBTRANS_-lLINUX_DB'} = '';
-
- my $curses_lib = '-lcurses';
- if((!exists($env_flags{'curses_PRESENT'})) && exists($env_flags{'ncurses_PRESENT'}))
- {
- # got to use ncurses instead...
- $env_flags{'LIBTRANS_-lcurses'} = '-lncurses';
- $curses_lib = '-lncurses';
- }
-
- my ($linux_readline_h, $linux_db_h);
- my $db_ver = -1;
-
- open H_FILES,"find /usr/include |" or die "Can't open find";
- while(<H_FILES>)
- {
- chomp;
-
- if(m~/readline.h\Z~)
- {
- my $rlh = strip_h_name($_);
- if(check_readline_h($rlh,$curses_lib))
- {
- $linux_readline_h = $rlh;
- # allow readline library to be used
- delete $env_flags{'LIBTRANS_-lreadline'};
- }
- }
- if(m~/db(|_1\d+).h\Z~)
- {
- # version?
- my $dv = 0;
- $dv = $1 if m~(\d+)/db~;
- my $fn = $_;
-
- # check this file mentions dbopen
- open DB_H,$_ or die "Can't open $_";
- my $found = 0;
- while(<DB_H>)
- {
- if(m/dbopen/)
- {
- $found = 1;
- last;
- }
- }
- close DB_H;
- next unless $found;
-
- # see if this version works
- print("Checking db version...\n");
- my $db_h = strip_h_name($fn);
- my $db_lib = 'db';
- $db_lib .= $db_ver if $db_ver > 0;
- if(!check_db_lib($db_h, $db_lib))
- {
- # try another
- $db_lib = 'db';
- next unless check_db_lib($db_h, $db_lib)
- }
-
- # good version?
- if($dv > $db_ver)
- {
- $linux_db_h = $db_h;
- $db_ver = $dv;
- $env_flags{'LIBTRANS_-lLINUX_DB'} = '-l'.$db_lib;
- }
- }
- }
- print "Finished checking headers\n";
- close H_FILES;
-
- # write the platform file accordingly and tell the user what's happened.
- open LIN,">local/_linux_platform.h" or die "Can't open file for writing";
- if($linux_readline_h eq '')
- {
- print("---------------------\nWARNING: readline isn't installed\n---------------------\n");
- print LIN "#define PLATFORM_READLINE_NOT_SUPPORTED\n";
-
- }
- else
- {
- open RL_H,">local/_linux_readline.h" or die "Can't open file for writing";
- print RL_H "#include <$linux_readline_h>\n";
- my $hist = $linux_readline_h;
- $hist =~ s/readline\.h/history.h/;
- print RL_H "#include <$hist>\n";
- close RL_H;
- }
- if($linux_db_h eq '')
- {
- print("---------------------\nWARNING: db is not installed -- will run in reduced efficiency mode without it.\n---------------------\n");
- print LIN "#define PLATFORM_BERKELEY_DB_NOT_SUPPORTED\n";
- }
- else
- {
- open DB_H,">local/_linux_db.h" or die "Can't open file for writing";
- print DB_H "#include <$linux_db_h>\n";
- close DB_H;
- }
- close LIN;
-}
-sub strip_h_name
-{
- my $i = $_[0];
- $i =~ s~\A/usr/include/~~;
- return $i;
-}
-sub check_readline_h
-{
- my ($h,$curses_lib) = @_;
- print "Check readline from $h...\n";
- my $hist = $h;
- $hist =~ s/readline\.h/history.h/;
- open READLINEH,">readlineh.cpp" or die "Can't open readline test file for writing";
- print READLINEH <<__E;
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <$h>
-#include <$hist>
-int main(int argc, char *argv[])
-{
- using_history();
- add_history(0);
- readline(0);
- return 0;
-}
-__E
- close READLINEH;
- # attempt to compile
- my $r = system("g++ readlineh.cpp -lreadline $curses_lib -o readlineh $compile_line_extra $link_line_extra 2>/dev/null >/dev/null");
- # delete test files
- unlink 'readlineh';
- unlink 'readlineh.cpp';
- return $r == 0; # compilation succeeded
-}
-sub check_db_lib
-{
- my ($h,$db) = @_;
- open TESTDBLIB,">testdblib.cpp" or die "Can't open db test file for writing";
- print TESTDBLIB <<__E;
-#include <$h>
-int main(int argc, char *argv[])
-{
- DB *dbp = 0;
- dbp = dbopen(0, 0, 0, DB_HASH, 0);
- dbp->close(dbp);
- DBT data;
- dbp->put(dbp, &data, &data, 0);
- dbp->get(dbp, &data, &data, 0);
- return 0;
-}
-__E
- close TESTDBLIB;
- # attempt to compile
- my $r = system("g++ testdblib.cpp -l$db -o testdblib $compile_line_extra $link_line_extra 2>/dev/null >/dev/null");
- # delete test files
- unlink 'testdblib';
- unlink 'testdblib.cpp';
- return $r == 0; # compilation succeeded
-}
-# ---- LINUX end --------------------------------------------------------------------------
# print "Flag: $_\n" for(keys %env_flags);
-# check the version of openssl installed
-if(!exists $env_flags{'OPENSSL_OK'})
-{
- # failed somehow...
-
- # is an old version present?
- my $old_version = (exists $env_flags{'OLD_OPENSSL_OK'});
-
- if(!$old_version && !-e '/usr/include/openssl/evp.h')
- {
- # headers not installed?
- print "\n\nERROR: OpenSSL library and headers need to be installed.\n\nSee documentation on web site if you need to add extra search paths.\n\n";
- exit(1);
- }
- else
- {
- if($old_version)
- {
- if($old_version_of_openssl_ok)
- {
- print "\n\nWARNING: Configuring for old version of OpenSSL.\nPerformance will be lower than with version 0.9.7\n\n";
- $compile_line_extra .= '-DPLATFORM_OLD_OPENSSL ';
- }
- else
- {
- # tell user how they might try anyway with an old version of openssl
- print <<__E;
-
-===============================================================================
-
-You appear to have a version of OpenSSL installed which is less than 0.9.7.
-
-It is possible to configure to use this old version, but performance will be
-lower than if you have 0.9.7 -- the later version is recommended.
-
-If you wish to use this old version, repeat the configuration with the extra
-argument 'allow-old-openssl', like this:
-
- ./configure allow-old-openssl
-
-* Please do not distribute binary packages with this option enabled.
-
-* Please do not distribute ports which set this option by default.
-
-IMPORTANT: Support for older versions of OpenSSL should be considered
-experimental. It is not recommended for production use, but provided to allow
-easier evaluation of this software before installing the latest OpenSSL.
-
-===============================================================================
-
-__E
- exit(1);
- }
- }
- else
- {
- print "\n\nERROR: You need to install OpenSSL, preferably at least version 0.9.7.\n\n";
- print "If you believe you have installed OpenSSL, check that the headers are installed\nas well ('dev' packages?)\n\nSee documentation on web site if you need to add extra search paths.\n\n";
- exit(1);
- }
- }
-}
-
-
-# finished checking the environment
-print "done\n\n";
-
-
# seed autogen code
print "Seeding autogen code...\n";
open FINDAUTOGEN,"find . -follow -name Makefile.extra |" or die "Can't use find for locating files";
@@ -397,14 +113,6 @@ close FL;
# extra platform defines
my $extra_platform_defines = '';
-if($gcc_v3 && !$gcc_v4)
-{
- $extra_platform_defines .= ' -DPLATFORM_GCC3'
-}
-if($gcc_v4)
-{
- $extra_platform_defines .= ' -DPLATFORM_GCC4'
-}
# read in module definitions file, and any files it includes
my @modules_files;
@@ -758,13 +466,13 @@ CXX = g++
AR = ar
RANLIB = ranlib
.ifdef RELEASE
-CXXFLAGS = -DNDEBUG -O2 -Wall $include_paths -D$platform_define -D$platform_cpu$extra_platform_defines -DBOX_VERSION="\\"$product_version\\""
+CXXFLAGS = -DNDEBUG -O2 -Wall $include_paths $extra_platform_defines -DBOX_VERSION="\\"$product_version\\""
OUTBASE = ../../release
OUTDIR = ../../release/$mod
DEPENDMAKEFLAGS = -D RELEASE
VARIENT = RELEASE
.else
-CXXFLAGS = -g -Wall $include_paths -D$platform_define -D$platform_cpu$extra_platform_defines -DBOX_VERSION="\\"$product_version\\""
+CXXFLAGS = -g -Wall $include_paths $extra_platform_defines -DBOX_VERSION="\\"$product_version\\""
OUTBASE = ../../debug
OUTDIR = ../../debug/$mod
DEPENDMAKEFLAGS =
@@ -939,7 +647,7 @@ __E
}
# link line...
- print MAKE "\t\$(CXX) $link_line_extra -o $end_target $o_file_list $lib_files$lo\n";
+ print MAKE "\t\$(CXX) $link_line_extra -o $end_target $o_file_list $lib_files$lo $platform_lib_files\n";
}
# tests need to copy the test file over
if($type eq 'test')
@@ -1006,8 +714,6 @@ __E
print "\nType 'cd <module_dir>; $make_command' to build a module\n\n";
-print $test_failure_text;
-
if($modules_omitted)
{
print "\nNOTE: Some modules have been omitted on this platform\n\n"
@@ -1062,65 +768,3 @@ sub ignore_module
{
exists $env_flags{'IGNORE_'.$_[0]}
}
-
-# how to run a test
-sub do_test
-{
- my %t = @_;
-
- print $t{'Name'},':';
- open TEST_CODE,">envtest.cpp" or die "Can't open envtest.cpp for writing";
- print TEST_CODE $t{'Code'};
- close TEST_CODE;
- my $result = (system("g++ envtest.cpp ".$t{'TestCompileFlags'}." -o envtest $compile_line_extra $link_line_extra 2>/dev/null >/dev/null") == 0);
- if($result && exists $t{'RunCode'})
- {
- $result = 0 unless (system('./envtest') == 0);
- }
- unlink 'envtest.cpp';
- unlink 'envtest';
- print $result?" yes\n":" no\n";
- if($result)
- {
- # success
- if(exists $t{'SuccessFlags'})
- {
- for(@{$t{'SuccessFlags'}})
- {
- my ($k,$v) = split /=>/,$_;
- $v = 1 if $v eq '';
- $env_flags{$k} = $v
- }
- }
- $compile_line_extra .= $t{'SuccessCompileFlags'}.' ' if exists $t{'SuccessCompileFlags'};
- $link_line_extra .= $t{'SuccessLinkFlags'}.' ' if exists $t{'SuccessLinkFlags'};
- }
- else
- {
- # aborting failure?
- if(exists $t{'AbortOnFailure'})
- {
- print $t{'FailureText'};
- print "\nAborting configuration, cannot build in this environment.\n";
- exit(1);
- }
-
- # failure
- if(exists $t{'FailureFlags'})
- {
- for(@{$t{'FailureFlags'}})
- {
- my ($k,$v) = split /=>/,$_;
- $v = 1 if $v eq '';
- $env_flags{$k} = $v
- }
- }
- $compile_line_extra .= $t{'FailureCompileFlags'}.' ' if exists $t{'FailureCompileFlags'};
- $link_line_extra .= $t{'FailureLinkFlags'}.' ' if exists $t{'FailureLinkFlags'};
- $test_failure_text .= $t{'FailureText'} if exists $t{'FailureText'};
- }
- $result
-}
-
-
-