summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2005-05-18 08:17:29 +0000
committerAndy Polyakov <appro@openssl.org>2005-05-18 08:17:29 +0000
commit38a17571687d65d4ec10ef201125a8ddee681ec5 (patch)
treee46e9dcf2999054d67f90318fb7e31007a6d95fb
parent4104a57107cb55bc7e99a832875f9fd93168eacc (diff)
Engage Applink in mingw. [from HEAD]
-rwxr-xr-xConfigure3
-rw-r--r--TABLE2
-rw-r--r--crypto/Makefile6
-rw-r--r--crypto/bio/bss_file.c7
-rw-r--r--crypto/cryptlib.h2
-rwxr-xr-xms/uplink.pl2
-rw-r--r--util/pl/VC-32.pl9
7 files changed, 19 insertions, 12 deletions
diff --git a/Configure b/Configure
index 7234d01e1c..999ec20309 100755
--- a/Configure
+++ b/Configure
@@ -472,7 +472,7 @@ my %table=(
"BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32",
# MinGW
-"mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -D_WIN32_WINNT=0x333:::MINGW32:-lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_coff_asm}:win32:cygwin-shared:-D_WINDLL:-mno-cygwin -shared:.dll.a",
+"mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -D_WIN32_WINNT=0x333:::MINGW32:-lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_coff_asm}:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin -shared:.dll.a",
# UWIN
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
@@ -1133,6 +1133,7 @@ else
$openssl_other_defines.="#define OPENSSL_NO_STATIC_ENGINE\n";
}
+$cpuid_obj.=" uplink.o uplink-cof.o" if ($cflags =~ /\-DOPENSSL_USE_APPLINK/);
# Compiler fix-ups
if ($target =~ /icc$/)
{
diff --git a/TABLE b/TABLE
index 70ccd7e73e..35b06f8d7a 100644
--- a/TABLE
+++ b/TABLE
@@ -2991,7 +2991,7 @@ $rmd160_obj = rm86-cof.o
$rc5_obj = r586-cof.o
$dso_scheme = win32
$shared_target= cygwin-shared
-$shared_cflag = -D_WINDLL
+$shared_cflag = -D_WINDLL -DOPENSSL_USE_APPLINK
$shared_ldflag = -mno-cygwin -shared
$shared_extension = .dll.a
$ranlib =
diff --git a/crypto/Makefile b/crypto/Makefile
index 9f309e0256..c6c76c26ac 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -67,6 +67,12 @@ x86cpuid-cof.s: x86cpuid.pl perlasm/x86asm.pl
x86cpuid-out.s: x86cpuid.pl perlasm/x86asm.pl
$(PERL) x86cpuid.pl a.out $(CFLAGS) $(PROCESSOR) > $@
+uplink.o: ../ms/uplink.c
+ $(CC) $(CFLAGS) -c -o $@ ../ms/uplink.c
+
+uplink-cof.s: ../ms/uplink.pl
+ $(PERL) ../ms/uplink.pl coff > $@
+
x86_64cpuid.s: x86_64cpuid.pl
$(PERL) x86_64cpuid.pl $@
ia64cpuid.s: ia64cpuid.S
diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c
index c97ac14651..dd17802f8f 100644
--- a/crypto/bio/bss_file.c
+++ b/crypto/bio/bss_file.c
@@ -236,12 +236,17 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
b->shutdown=(int)num&BIO_CLOSE;
b->ptr=ptr;
b->init=1;
-#if BIO_FLAGS_UPLINK!=0 && defined(_IOB_ENTRIES)
+#if BIO_FLAGS_UPLINK!=0
+#if defined(__MINGW32__) && defined(__MSVCRT__) && !defined(_IOB_ENTRIES)
+#define _IOB_ENTRIES 20
+#endif
+#if defined(_IOB_ENTRIES)
/* Safety net to catch purely internal BIO_set_fp calls */
if ((size_t)ptr >= (size_t)stdin &&
(size_t)ptr < (size_t)(stdin+_IOB_ENTRIES))
BIO_clear_flags(b,BIO_FLAGS_UPLINK);
#endif
+#endif
#ifdef UP_fsetmode
if (b->flags&BIO_FLAGS_UPLINK)
UP_fsetmode(b->ptr,num&BIO_FP_TEXT?'t':'b');
diff --git a/crypto/cryptlib.h b/crypto/cryptlib.h
index 9711f42e22..fc249c57f3 100644
--- a/crypto/cryptlib.h
+++ b/crypto/cryptlib.h
@@ -66,7 +66,7 @@
#ifdef OPENSSL_USE_APPLINK
#define BIO_FLAGS_UPLINK 0x8000
-#include "uplink.h"
+#include "ms/uplink.h"
#endif
#include <openssl/crypto.h>
diff --git a/ms/uplink.pl b/ms/uplink.pl
index cd9d37f56f..5dacc4f1a1 100755
--- a/ms/uplink.pl
+++ b/ms/uplink.pl
@@ -44,7 +44,7 @@ print <<___;
.align 4
.Lazy$i:
pushl \$$i
- pushl _OPENSSL_UplinkTable
+ pushl \$_OPENSSL_UplinkTable
call _OPENSSL_Uplink
addl \$8,%esp
jmp *(_OPENSSL_UplinkTable+4*$i)
diff --git a/util/pl/VC-32.pl b/util/pl/VC-32.pl
index 6334317cd7..5888dcbfef 100644
--- a/util/pl/VC-32.pl
+++ b/util/pl/VC-32.pl
@@ -99,23 +99,18 @@ if ($shlib)
# Engage Applink...
#
$app_ex_obj.=" \$(OBJ_D)\\applink.obj /implib:\$(TMP_D)\\junk.lib";
- $cflags.=" -DOPENSSL_USE_APPLINK";
+ $cflags.=" -DOPENSSL_USE_APPLINK -I.";
# I'm open for better suggestions than overriding $banner...
$banner=<<'___';
@echo Building OpenSSL
$(OBJ_D)\applink.obj: ms\applink.c
$(CC) /Fo$(OBJ_D)\applink.obj $(APP_CFLAGS) -c ms\applink.c
-$(OBJ_D)\uplink.obj: ms\uplink.c $(OBJ_D)\applink.c
+$(OBJ_D)\uplink.obj: ms\uplink.c ms\applink.c
$(CC) /Fo$(OBJ_D)\uplink.obj $(SHLIB_CFLAGS) -c ms\uplink.c
-$(INCL_D)\uplink.h: ms\uplink.h
- $(CP) ms\uplink.h $(INCL_D)\uplink.h
$(INCO_D)\applink.c: ms\applink.c
$(CP) ms\applink.c $(INCO_D)\applink.c
-$(OBJ_D)\applink.c: ms\applink.c
- $(CP) ms\applink.c $(OBJ_D)\applink.c
-HEADER=$(HEADER) $(INCL_D)\uplink.h
EXHEADER= $(EXHEADER) $(INCO_D)\applink.c
LIBS_DEP=$(LIBS_DEP) $(OBJ_D)\applink.obj