C-DynaLib

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN


    unlink ("testtest.txt");
    while ($self->{how_to_run} = shift (@candidate)) {
	print "$self->{how_to_run}\n" if $Verbose;
	system ($self->{how_to_run});
	$? == 0 && &$try and return 1;
    }
    return &$cant;
}

sub guess_cdecl_h {
    my $self = shift;
    open CONFIG, ">$cdecl_h" or die "can't write $cdecl_h";

    $do_reverse = 0;
    print "Testing stack layout...\n" if $Verbose;
    $self->{how_to_compile} =~ s/testtest/testreverse/g;
    $self->{how_to_run} =~ s/testtest/testreverse/g;
    my $defines;
    for ("-DINCLUDE_ALLOCA", "", "-DINCLUDE_MALLOC") {
        $defines = $_;

Makefile.PL  view on Meta::CPAN

		@convention = ('cdecl6');
	    } else {
		@convention = ('cdecl');
	    }
	    if ($reverse or $is_win32) {
		push @convention, 'stdcall' unless grep /^stdcall$/, @convention;
		print "Using conventions: @convention\n";
	    }
	}
    } elsif (@convention) {
	print "Can't figure out this system.  I'll have to guess.\n"
	    if $Verbose;
	guess_cdecl_h($self);
	if ($do_reverse and !grep /^stdcall$/, @convention) {
	    push @convention, 'stdcall';
	    print "Using conventions: @convention\n";
	}
	elsif ($is_win32) {
	    push @convention, 'stdcall' unless grep /^stdcall$/, @convention;
            push @convention, 'hack30' unless grep /^hack30$/, @convention;
	    print "Using conventions: @convention\n";
	}
    } else {

script/pl2exe.pl  view on Meta::CPAN

$headers .= pack ('SSLLLSS',	# the IMAGE_FILE_HEADER substructure
		  0x14c,	# for Intel I386
		  1,		# number of sections
		  874806772,	# time-date stamp (whatever)
		  0,0,		# uniteresting fields
		  224,		# size of the IMAGE_OPTIONAL_HEADER
		  0x010f	# random flags: 0xa18e(?) for a DLL
		  );
$headers .= pack ('SCCL9S6L4SSL6',	# IMAGE_OPTIONAL_HEADERS substruct
		  0x010b,	# 0x0107 would be a ROM image
		  1,0,		# linker version maj.min (I guess that's us)
		  $code_size,
		  0,0,		# size of initialized/un- data
		  0x1000,	# RVA of entry point
		  		# (the RVA is the address when loaded,
		  		# relative to the image base)
		  0x1000,	# RVA of start of code section
		  0,		# RVA of data section, if there were one
		  0x400000,	# image base
		  0x1000,	# section alignment
		  512,		# file alignment



( run in 1.208 second using v1.01-cache-2.11-cpan-748bfb374f4 )