[pkg-opensc-commit] [libp11] 115/239: libp11 MSVC fixups

Eric Dorland eric at moszumanska.debian.org
Sat Oct 17 06:21:15 UTC 2015


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository libp11.

commit a97b362b058a5f4db11acf917a0130f7906cdf7e
Author: Alon Bar-Lev <alon.barlev at gmail.com>
Date:   Tue Apr 8 17:42:44 2008 +0000

    libp11 MSVC fixups
    
    Here they are. This email has libp11 changes.  The next email will have
     the engine_pkcs11.
    
     The changes are inline as you asked. Watch out for wrapped lines and
     spacing. (I attached the changes too, just in case.)
    
    
      added top Makefile.mak to handle winconfig.h
    
      updated src/Makefile.mak to include config.h and use libp11.exports
            take care of manifest.
    
      remove makedef.pl
    
      added winconfig.h  with nothing in it for now.
    
    By Douglas E. Engert
---
 Makefile.mak     | 39 +++++++++++++++++++++++++++++++++++++++
 src/Makefile.mak |  8 ++++++--
 src/makedef.pl   | 35 -----------------------------------
 winconfig.h      |  1 +
 4 files changed, 46 insertions(+), 37 deletions(-)

diff --git a/Makefile.mak b/Makefile.mak
new file mode 100644
index 0000000..3fe0279
--- /dev/null
+++ b/Makefile.mak
@@ -0,0 +1,39 @@
+
+SUBDIRS = src
+
+all::
+
+all:: config.h
+
+config.h: winconfig.h
+	@copy /y winconfig.h config.h
+	
+all depend install clean::
+	 @for %i in ( $(SUBDIRS) ) do \
+		@cmd /c "cd %i && $(MAKE) /nologo /f Makefile.mak $@"
+
+SUBDIRS = src
+
+all::
+
+all:: config.h
+
+config.h: winconfig.h
+       @copy /y winconfig.h config.h
+
+all depend install clean::
+        @for %i in ( $(SUBDIRS) ) do \
+               @cmd /c "cd %i && $(MAKE) /nologo /f Makefile.mak $@"
+
+SUBDIRS = src
+
+all::
+
+all:: config.h
+
+config.h: winconfig.h
+       @copy /y winconfig.h config.h
+
+all depend install clean::
+        @for %i in ( $(SUBDIRS) ) do \
+               @cmd /c "cd %i && $(MAKE) /nologo /f Makefile.mak $@"
diff --git a/src/Makefile.mak b/src/Makefile.mak
index 074f008..05430f4 100644
--- a/src/Makefile.mak
+++ b/src/Makefile.mak
@@ -4,7 +4,7 @@ LIBLTDL_LIB =     # E.g. C:\libtool-1.5.8-lib\lib\libltdl.lib
 OPENSSL_INC = /IC:\openssl\include
 OPENSSL_LIB = C:\openssl\out32dll\libeay32.lib
 
-COPTS = /Zi /MD /nologo /I. $(OPENSSL_INC) $(LIBLTDL_INC) /D_WIN32_WINNT=0x0400 /DWIN32
+COPTS = /Zi /MD /nologo /I..\ /I. $(OPENSSL_INC) $(LIBLTDL_INC) /D_WIN32_WINNT=0x0400 /DWIN32 /DWIN32_LEAN_AND_MEAN
 LINKFLAGS = /DEBUG /NOLOGO /INCREMENTAL:NO /MACHINE:IX86
 
 TARGET                  = libp11.dll
@@ -18,6 +18,10 @@ all: $(TARGET)
 	cl $(COPTS) /c $<
 
 $(TARGET): $(OBJECTS) 
-	perl makedef.pl $*.def $* $(OBJECTS)
+	echo LIBRARY $* > $*.def
+	echo EXPORTS >> $*.def
+	type $*.exports >> $*.def
 	link $(LINKFLAGS) /dll /def:$*.def /implib:$*.lib /out:$(TARGET) \
 		$(OBJECTS) $(OPENSSL_LIB) $(LIBLTDL_LIB)
+	if EXIST $*.dll.manifest mt -manifest $*.dll.manifest -outputresource:$*.dll;2
+
diff --git a/src/makedef.pl b/src/makedef.pl
deleted file mode 100644
index 430efe8..0000000
--- a/src/makedef.pl
+++ /dev/null
@@ -1,35 +0,0 @@
-$def = $ARGV[0];
-shift @ARGV;
-$lib = $ARGV[0];
-shift @ARGV;
-$dumpbin = "dumpbin /symbols @ARGV";
-
-open(DUMP, "$dumpbin |")
-    || die "Can't run `$dumpbin': $!.\n";
-
-open(DEF, "> $def")
-    || die "Can't open `$def': $!.\n";
-
-print DEF "LIBRARY $lib\n";
-print DEF "EXPORTS\n";
-
-while(<DUMP>)
-{
-    if(!/\bUNDEF\b/ && /\bExternal\b/)
-    {
-	s/^.*\|\s+//;
-	split;
-	$_ = $_[0];
-
-	next unless ($_ =~ /PKCS11/);
-
-	if(!/^\?\?_G/ && !/^\?\?_E/ && !/DllMain/)
-        {
-            # Stupid windows linker needs to have
-            # preceding underscore for ANSI C programs
-            s/^_//;
-            
-            print DEF "    $_\n";
-	}
-    }
-}
diff --git a/winconfig.h b/winconfig.h
new file mode 100644
index 0000000..013255c
--- /dev/null
+++ b/winconfig.h
@@ -0,0 +1 @@
+/* nothing for now */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/libp11.git



More information about the pkg-opensc-commit mailing list