summaryrefslogtreecommitdiff
path: root/win32/config_sh.PL
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2012-10-13 19:37:33 -0400
committerSteve Hay <steve.m.hay@googlemail.com>2012-10-31 13:31:45 +0000
commit19253ae62cd130797cb3e42f196ac26a6417e08c (patch)
tree84be33f7f26ce913616ca62c47e66abacdba0665 /win32/config_sh.PL
parent5c26a17602c4585ca111bd154f6c65c681cd0572 (diff)
downloadperl-19253ae62cd130797cb3e42f196ac26a6417e08c.tar.gz
Win32 miniperl: delay loading for Winsock, and then remove it
Slim down the image and speed up start up time for Win32 miniperl by removing Winsock. Also if the build process on Win32 in the future requires sockets, commenting one line in win32.h will turn sockets back on for miniperl, but this time with delay loading on VC Perl. The only casulty of no sockets for Win32 miniperl was figuring out the computer's name in win32/config_sh.PL. A workaround by using an ENV var was implemented. The purpose of this commit is to speed up the build process of Perl. As said in the comment in win32.h, the WIN32_NO_SOCKETS macro is incomplete in implementation. It is only removed winsock from being linked in in miniperl, not full Perl. PERL_IMPLICIT_SYS (specifically PerlSock in win32/perlhost.h) and makedef.pl's hard coded list of win32_* function exports cause winsock to still be linked in with even with WIN32_NO_SOCKETS on full perl. Both PERL_IMPLICIT_SYS (win32/perlhost.h) and makedef.pl would require changes to remove winsock from being linked in on full perl in the future.
Diffstat (limited to 'win32/config_sh.PL')
-rw-r--r--win32/config_sh.PL8
1 files changed, 6 insertions, 2 deletions
diff --git a/win32/config_sh.PL b/win32/config_sh.PL
index 3733c47bec..d866f7624e 100644
--- a/win32/config_sh.PL
+++ b/win32/config_sh.PL
@@ -103,8 +103,12 @@ if (exists $opt{cc}) {
}
$opt{cf_by} = $ENV{USERNAME} unless $opt{cf_by};
-$opt{cf_email} = $opt{cf_by} . '@' . (gethostbyname('localhost'))[0]
- unless $opt{cf_email};
+if (!$opt{cf_email}) {
+ my $computername = eval{(gethostbyname('localhost'))[0]};
+# gethostbyname might not be implemented in miniperl
+ $computername = $ENV{COMPUTERNAME} if $@;
+ $opt{cf_email} = $opt{cf_by} . '@' . $computername;
+}
$opt{usemymalloc} = 'y' if $opt{d_mymalloc} eq 'define';
$opt{libpth} = mungepath($opt{libpth}) if exists $opt{libpth};