[y2038 commit] r174 - in trunk/perl/Time-y2038: . inc/Local/Module

2 views
Skip to first unread message

codesite...@google.com

unread,
Nov 17, 2008, 5:24:29 PM11/17/08
to y2038-...@googlegroups.com
Author: schwern
Date: Mon Nov 17 14:24:02 2008
New Revision: 174

Modified:
trunk/perl/Time-y2038/Changes
trunk/perl/Time-y2038/inc/Local/Module/Build.pm

Log:
Fix Cygwin so the check_max program is not always run.


Modified: trunk/perl/Time-y2038/Changes
==============================================================================
--- trunk/perl/Time-y2038/Changes (original)
+++ trunk/perl/Time-y2038/Changes Mon Nov 17 14:24:02 2008
@@ -1,6 +1,7 @@
Next
Build Improvements
* The limit check program was ignoring a limit of 0. Duh.
+ * Fix so the check_max program is not always re-run on Cygwin.


20081111 Tue Nov 11 15:36:27 PST 2008

Modified: trunk/perl/Time-y2038/inc/Local/Module/Build.pm
==============================================================================
--- trunk/perl/Time-y2038/inc/Local/Module/Build.pm (original)
+++ trunk/perl/Time-y2038/inc/Local/Module/Build.pm Mon Nov 17 14:24:02 2008
@@ -7,16 +7,17 @@
my $self = shift;

my $source = "check_max.c";
- my $exe = "check_max";
+ my $exe = $self->notes("check_max") || "check_max";
unless( $self->up_to_date($source => $exe) ) {
warn "Building a program to test the range of your system time
functions...\n";
my $cb = $self->cbuilder;
my $obj = $cb->compile(source => "check_max.c", include_dirs =>
['y2038']);
$exe = $cb->link_executable(objects => $obj, exe_file => $exe);
+ $exe = $self->find_real_exe($exe);
+ $self->notes(check_max => $exe);
+ $self->add_to_cleanup($exe);
}

- $self->add_to_cleanup($exe);
-
return if $self->up_to_date(["munge_config", $exe]
=> "y2038/time64_config.h");
warn " and running it...\n";

@@ -48,6 +49,24 @@
}

return;
+}
+
+
+# This is necessary because Cygwin nerotically puts a .exe on
+# every executable. This appears to be built into gcc.
+sub find_real_exe {
+ my $self = shift;
+ my $exe = shift;
+
+ my $real_exe;
+ for ($exe, "$exe.exe") {
+ $real_exe = $_ if -e;
+ }
+
+ warn "Can't find the executable, thought it was $exe"
+ unless defined $real_exe;
+
+ return $real_exe;
}


Reply all
Reply to author
Forward
0 new messages