$(MINIPERL) : $(MINIDIR) $(MINI_OBJ)
$(LINK32) -subsystem:console -out:$@ @<<
- $(LINK_FLAGS) $(LIBFILES) $(MINI_OBJ)
+ $(LINK_FLAGS) $(DELAYLOAD) $(LIBFILES) $(MINI_OBJ)
<<
$(EMBED_EXE_MANI)
}
$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};
$(mktmp $(LKPRE) $(MINI_OBJ) $(LIBFILES) $(LKPOST))
.ELSE
$(LINK32) -subsystem:console -out:$@ $(BLINK_FLAGS) \
- @$(mktmp $(LIBFILES) $(MINI_OBJ))
+ @$(mktmp $(DELAYLOAD) $(LIBFILES) $(MINI_OBJ))
$(EMBED_EXE_MANI)
.ENDIF
# define _WIN32_WINNT 0x0500 /* needed for CreateHardlink() etc. */
#endif
+#ifdef PERL_IS_MINIPERL
+/* this macro will remove Winsock only on miniperl, PERL_IMPLICIT_SYS and
+ * makedef.pl create dependencies that will keep Winsock linked in even with
+ * this macro defined, even though sockets will be umimplemented from a script
+ * level in full perl
+ */
+# define WIN32_NO_SOCKETS
+#endif
+
+#ifdef WIN32_NO_SOCKETS
+# undef HAS_SOCKET
+# undef HAS_GETPROTOBYNAME
+# undef HAS_GETPROTOBYNUMBER
+# undef HAS_GETPROTOENT
+# undef HAS_GETNETBYNAME
+# undef HAS_GETNETBYADDR
+# undef HAS_GETNETENT
+# undef HAS_GETSERVBYNAME
+# undef HAS_GETSERVBYPORT
+# undef HAS_GETSERVENT
+# undef HAS_GETHOSTBYNAME
+# undef HAS_GETHOSTBYADDR
+# undef HAS_GETHOSTENT
+# undef HAS_SELECT
+# undef HAS_IOCTL
+# undef HAS_NTOHL
+# undef HAS_HTONL
+# undef HAS_HTONS
+# undef HAS_NTOHS
+# define WIN32SCK_IS_STDSCK
+#endif
+
#if defined(PERL_IMPLICIT_SYS)
# define DYNAMIC_ENV_FETCH
# define HAS_GETENV_LEN
#define OP_BINARY O_BINARY /* mistake in in pp_sys.c? */
/* read() and write() aren't transparent for socket handles */
-#define PERL_SOCK_SYSREAD_IS_RECV
-#define PERL_SOCK_SYSWRITE_IS_SEND
+#ifndef WIN32_NO_SOCKETS
+# define PERL_SOCK_SYSREAD_IS_RECV
+# define PERL_SOCK_SYSWRITE_IS_SEND
+#endif
#define PERL_NO_FORCE_LINK /* no need for PL_force_link_funcs */
wsock_started = 1;
}
+/* in no sockets Win32 builds, this fowards to replacements in util.c, dTHX
+ * is required
+ */
u_long
win32_htonl(u_long hostlong)
{
+#ifdef MYSWAP
+ dTHX;
+#else
StartSockets();
+#endif
return htonl(hostlong);
}
u_short
win32_htons(u_short hostshort)
{
+#ifdef MYSWAP
+ dTHX;
+#else
StartSockets();
+#endif
return htons(hostshort);
}
u_long
win32_ntohl(u_long netlong)
{
+#ifdef MYSWAP
+ dTHX;
+#else
StartSockets();
+#endif
return ntohl(netlong);
}
u_short
win32_ntohs(u_short netshort)
{
+#ifdef MYSWAP
+ dTHX;
+#else
StartSockets();
+#endif
return ntohs(netshort);
}