From 1e1c5047f278418c0553fd14d3bcd33620684324 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sat, 30 Jul 2005 19:43:56 +0000 Subject: [PATCH] Eliminate dependency on 3rd party wcedefs.mak. --- util/mk1mf.pl | 8 -------- util/pl/VC-32.pl | 29 ++++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/util/mk1mf.pl b/util/mk1mf.pl index ca130b5d06..ebd34835b7 100755 --- a/util/mk1mf.pl +++ b/util/mk1mf.pl @@ -314,14 +314,6 @@ EOF $defs .= $preamble if defined $preamble; -if ($platform eq "VC-CE") - { - $defs.= <<"EOF"; -!INCLUDE <\$(WCECOMPAT)/wcedefs.mak> - -EOF - } - $defs.= <<"EOF"; INSTALLTOP=$INSTALLTOP diff --git a/util/pl/VC-32.pl b/util/pl/VC-32.pl index d2ec04eac1..7aedfceedc 100644 --- a/util/pl/VC-32.pl +++ b/util/pl/VC-32.pl @@ -32,10 +32,30 @@ if ($FLAVOR =~ /WIN64/) } elsif ($FLAVOR =~ /CE/) { - $base_cflags=' /W3 /WX /Gs0 /GF /Gy /nologo $(WCETARGETDEFS) -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -I$(WCECOMPAT)/include'; + # sanity check + die '%OSVERSION% is not defined' if (!defined($ENV{'OSVERSION'})); + die '%PLATFORM% is not defined' if (!defined($ENV{'PLATFORM'})); + die '%TARGETCPU% is not defined' if (!defined($ENV{'TARGETCPU'})); + + # pull CE version from OSVERSION environment variable + $wcevers = $ENV{'OSVERSION'}; # WCENNN + die '%OSVERSION% value is insane' if ($wcevers !~ /^WCE([1-9])([0-9]{2})$/); + $wcecdefs = "-D_WIN32_WCE=$1$2"; # -D_WIN32_WCE=NNN + $wcelflag = "/subsystem:windowsce,$1.$2"; # ...,N.NN + if ($ENV{'TARGETCPU'} =~ /^X86/) + { $wcelflag .= " /machine:X86"; } + else + { $wcelflag .= " /machine:$ENV{'TARGETCPU'}"; } + $wceplatf = $ENV{'PLATFORM'}; + $wceplatf =~ tr/a-z0-9 /A-Z0-9_/d; + $wcecdefs .= " -DWCEPLATFORM=$wceplatf"; + + $cc='$(CC)'; + $base_cflags=' /W3 /WX /Gs0 /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -I$(WCECOMPAT)/include'; + $base_cflags.=" $wcecdefs"; $opt_cflags=' /MD /Ox /O2 /Ob2'; $dbg_clfags=' /MDd /Od -DDEBUG -D_DEBUG'; - $lflags='/nologo /subsystem:windowsce,$(WCELDVERSION) /machine:$(WCELDMACHINE) /opt:ref'; + $lflags="/nologo /opt:ref $wcelflag"; } else # Win32 { @@ -74,7 +94,10 @@ elsif ($FLAVOR =~ /CE/) { $ex_libs='winsock.lib'; } else { $ex_libs='wsock32.lib'; } if ($FLAVOR =~ /CE/) - { $ex_libs.=' $(WCECOMPAT)/lib/wcecompatex.lib $(WCELDFLAGS)'; } + { + $ex_libs.=' $(WCECOMPAT)/lib/wcecompatex.lib'; + $ex_libs.=' /nodefaultlib:oldnames.lib coredll.lib corelibc.lib' if ($ENV{'TARGETCPU'} eq "X86"); + } else { $ex_libs.=' gdi32.lib advapi32.lib user32.lib'; -- 2.25.1