summaryrefslogtreecommitdiff
path: root/infrastructure
diff options
context:
space:
mode:
Diffstat (limited to 'infrastructure')
-rw-r--r--infrastructure/BoxPlatform.pm.in6
-rw-r--r--infrastructure/m4/ax_check_mount_point.m42
-rw-r--r--infrastructure/m4/ax_check_ssl.m42
-rwxr-xr-xinfrastructure/makebuildenv.pl54
-rwxr-xr-xinfrastructure/makeparcels.pl19
5 files changed, 64 insertions, 19 deletions
diff --git a/infrastructure/BoxPlatform.pm.in b/infrastructure/BoxPlatform.pm.in
index 257b298b..e3a1a26a 100644
--- a/infrastructure/BoxPlatform.pm.in
+++ 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 $product_version $product_name $install_into_dir $sub_make_options $platform_compile_line_extra $platform_link_line_extra $platform_lib_files/;
+@EXPORT = qw/$build_os $build_cpu $target_os $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 $platform_exe_ext/;
BEGIN
{
@@ -23,9 +23,11 @@ BEGIN
$platform_compile_line_extra = '@CPPFLAGS@ @CXXFLAGS@ @CXXFLAGS_STRICT@';
$platform_link_line_extra = '@LDFLAGS@';
$platform_lib_files = '@LIBS@';
+ $target_os = '@target_os@';
+ $platform_exe_ext = '@EXEEXT@';
# get version
- open VERSION,"VERSION.txt";
+ open VERSION,"VERSION.txt" or die "VERSION.txt: $!";
$product_version = <VERSION>;
chomp $product_version;
$product_name = <VERSION>;
diff --git a/infrastructure/m4/ax_check_mount_point.m4 b/infrastructure/m4/ax_check_mount_point.m4
index 747888cc..3ed3f85d 100644
--- a/infrastructure/m4/ax_check_mount_point.m4
+++ b/infrastructure/m4/ax_check_mount_point.m4
@@ -3,6 +3,7 @@ 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_MOUNTS
dnl HAVE_MNTENT_H
dnl HAVE_SYS_MNTTAB_H
dnl HAVE_SYS_MOUNT_H
@@ -35,6 +36,7 @@ AC_DEFUN([AX_CHECK_MOUNT_POINT], [
test "x$ac_cv_member_struct_mntent_mnt_dir" = "xyes" || \
test "x$ac_cv_member_struct_mnttab_mnt_mountp" = "xyes"
then
+ AC_DEFINE([HAVE_MOUNTS], [1], [Define to 1 if this platform supports mounts])
m4_ifvaln([$1],[$1],[:])dnl
m4_ifvaln([$2],[else $2])dnl
fi
diff --git a/infrastructure/m4/ax_check_ssl.m4 b/infrastructure/m4/ax_check_ssl.m4
index 039c8398..03362bb6 100644
--- a/infrastructure/m4/ax_check_ssl.m4
+++ b/infrastructure/m4/ax_check_ssl.m4
@@ -27,7 +27,7 @@ AC_DEFUN([AX_CHECK_SSL], [
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])
+ AC_CHECK_LIB([ssl], [SSL_read],, [ax_check_ssl_found=no], [-lcrypto])
if test "x$ax_check_ssl_found" = "xyes"; then
AC_DEFINE([HAVE_SSL], 1, [Define to 1 if SSL is available])
diff --git a/infrastructure/makebuildenv.pl b/infrastructure/makebuildenv.pl
index 0af6d680..64c73eb0 100755
--- a/infrastructure/makebuildenv.pl
+++ b/infrastructure/makebuildenv.pl
@@ -182,6 +182,7 @@ sub make_obj_symlink
print "Scanning code...\n";
my $modules_omitted = 0;
+my $modules_omitting = 0;
# process lines in flattened modules files
for(@modules_files)
@@ -191,16 +192,20 @@ for(@modules_files)
next unless m/\S/;
# omit bits on some platforms?
- next if m/\AEND-OMIT/;
+ if(m/\AEND-OMIT/)
+ {
+ $modules_omitting = 0;
+ next;
+ }
+
+ next if $modules_omitting;
+
if(m/\AOMIT:(.+)/)
{
- if($1 eq $build_os)
+ if($1 eq $build_os or $1 eq $target_os)
{
$modules_omitted = 1;
- while(<MODULES>)
- {
- last if m/\AEND-OMIT/;
- }
+ $modules_omitting = 1;
}
next;
}
@@ -402,8 +407,10 @@ __E
close TESTFILE;
}
- writetestfile("$mod/_t", './test $1 $2 $3 $4 $5', $mod);
- writetestfile("$mod/_t-gdb", 'gdb ./test', $mod);
+ writetestfile("$mod/_t",
+ './test${platform_exe_ext} $1 $2 $3 $4 $5', $mod);
+ writetestfile("$mod/_t-gdb",
+ 'gdb ./test${platform_exe_ext}', $mod);
}
@@ -440,15 +447,26 @@ __E
# make include path
- my $include_paths = join(' ',map {'-I../../'.$_} @all_deps_for_module);
+ my $include_paths = "-I../../lib/win32 " .
+ join(' ',map {'-I../../'.$_} @all_deps_for_module);
# is target a library?
my $target_is_library = ($type ne 'bin' && $type ne 'test');
# make target name
my $end_target = $name;
- $end_target .= '.a' if $target_is_library;
- $end_target = 'test' if $type eq 'test';
+
+ if ($target_is_library)
+ {
+ $end_target .= '.a';
+ }
+ else
+ {
+ $end_target .= $platform_exe_ext;
+ }
+
+ $end_target = 'test'.$platform_exe_ext if $type eq 'test';
+
# adjust for outdir
$end_target = '$(OUTDIR)/' . $end_target;
@@ -456,6 +474,13 @@ __E
my $mk_name_extra = ($bsd_make)?'':'X';
open MAKE,">$mod/Makefile".$mk_name_extra or die "Can't open Makefile for $mod\n";
my $debug_link_extra = ($target_is_library)?'':'../../debug/lib/debug/debug.a';
+
+ my $release_flags = "-O2";
+ if ($target_os eq "mingw32")
+ {
+ $release_flags = "-O0 -g";
+ }
+
print MAKE <<__E;
#
# AUTOMATICALLY GENERATED FILE
@@ -466,7 +491,7 @@ CXX = g++
AR = ar
RANLIB = ranlib
.ifdef RELEASE
-CXXFLAGS = -DNDEBUG -O2 -Wall $include_paths $extra_platform_defines -DBOX_VERSION="\\"$product_version\\""
+CXXFLAGS = -DNDEBUG $release_flags -Wall $include_paths $extra_platform_defines -DBOX_VERSION="\\"$product_version\\""
OUTBASE = ../../release
OUTDIR = ../../release/$mod
DEPENDMAKEFLAGS = -D RELEASE
@@ -567,6 +592,7 @@ __E
my $has_deps = ($#{$module_dependency{$mod}} >= 0);
# ----- # always has dependencies with debug library
$has_deps = 1;
+ $has_deps = 0 if $target_is_library;
# Depenency stuff
my $deps_makeinfo;
@@ -613,7 +639,7 @@ __E
my $o_file_list = join(' ',map {'$(OUTDIR)/'.$_.'.o'} @objs);
print MAKE $end_target,': ',$o_file_list;
- print MAKE ' dep_modules' if !$bsd_make;
+ print MAKE ' dep_modules' if $has_deps and not $bsd_make;
print MAKE " ",$lib_files unless $target_is_library;
print MAKE "\n";
@@ -658,7 +684,7 @@ __E
# dependency line?
print MAKE "\n";
- # module dependcies for GNU make?
+ # module dependencies for GNU make?
print MAKE $deps_makeinfo if !$bsd_make;
# print the rest of the file
diff --git a/infrastructure/makeparcels.pl b/infrastructure/makeparcels.pl
index 1c0b0ead..55e64976 100755
--- a/infrastructure/makeparcels.pl
+++ b/infrastructure/makeparcels.pl
@@ -26,7 +26,7 @@ open PARCELS,"parcels.txt" or die "Can't open parcels file";
next if m/\AEND-OMIT/;
if(m/\AOMIT:(.+)/)
{
- if($1 eq $build_os)
+ if($1 eq $build_os or $1 eq $target_os)
{
while(<PARCELS>)
{
@@ -35,6 +35,21 @@ open PARCELS,"parcels.txt" or die "Can't open parcels file";
}
next;
}
+
+ if (m'\AONLY:(.+)')
+ {
+ my @only_targets = split m'\,', $1;
+
+ if (not grep {$_ eq $build_os or $_ eq $target_os}
+ @only_targets)
+ {
+ while (<PARCELS>)
+ {
+ last if m'\AEND-ONLY';
+ }
+ next;
+ }
+ }
# new parcel, or a new parcel definition?
if(m/\A\s+(.+)\Z/)
@@ -100,7 +115,7 @@ for my $parcel (@parcels)
if($type eq 'bin')
{
- my $exeext = ($build_os eq 'CYGWIN')?'.exe':'';
+ my $exeext = $platform_exe_ext;
print MAKE "\t(cd bin/$name; \$(MAKE) $release_flag)\n";
print MAKE "\tcp release/bin/$name/$name$exeext $dir\n";
}