cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl.dll version info

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Wed, 5 Nov 2003 23:45:59 +0100

Here is a patch that adds version and description to libcurl.dll.
For MSVC6 and MingW. Doesn't MacOS have resources too?

Daniel, fill in something sensible in the "LegalCopyright " field.

------------------ lib\libcurl.rc (new file) -----------------------

#include <winver.h>
#include "../include/curl/curl.h"

LANGUAGE 0x09,0x01

VS_VERSION_INFO VERSIONINFO
  FILEVERSION RC_VERSION
  PRODUCTVERSION RC_VERSION
  FILEFLAGSMASK 0x3fL
#if CURLDEBUG
  FILEFLAGS 1
#else
  FILEFLAGS 0
#endif
  FILEOS VOS__WINDOWS32
  FILETYPE VFT_DLL
  FILESUBTYPE 0x0L

BEGIN
  BLOCK "StringFileInfo"
  BEGIN
    BLOCK "040904b0"
    BEGIN
      VALUE "CompanyName", "The cURL library, http://curl.haxx.se/\0"
      VALUE "FileDescription", "libcurl Shared Library\0"
      VALUE "FileVersion", LIBCURL_VERSION
      VALUE "InternalName", "libcurl\0"
      VALUE "OriginalFilename", "libcurl.dll\0"
      VALUE "ProductName", "The cURL library\0"
      VALUE "ProductVersion", LIBCURL_VERSION
      VALUE "LegalCopyright", "Copyright « ... fill this in\0"
    END
  END

  BLOCK "VarFileInfo"
  BEGIN
    VALUE "Translation", 0x409, 1200
  END
END

--------------------------------------------------

--- CVS-latest\lib\Makefile.m32 Tue Oct 21 15:14:25 2003
+++ lib\Makefile.m32 Wed Nov 05 23:29:45 2003
@@ -14,6 +14,7 @@
 STRIP = strip -g
 OPENSSL_PATH = ../../openssl-0.9.7a
 ZLIB_PATH = ../../zlib-1.1.4
+RC_VERSION = 7,10,9,0

 ########################################################
 ## Nothing more to do below this line!
@@ -70,13 +71,13 @@
        $(RANLIB) libcurl.a
        $(STRIP) $@

-DLLINITOBJ =
+RESOURCE = libcurl.res

 # remove the last line above to keep debug info

-libcurl.dll libcurldll.a: libcurl.a libcurl.def $(DLLINITOBJ)
+libcurl.dll libcurldll.a: libcurl.a libcurl.def $(RESOURCE)
        $(RM) $@
- dllwrap --dllname $@ --output-lib libcurldll.a --export-all --def libcurl.def $(libcurl_a_LIBRARIES) $(DLLINITOBJ)
$(DLL_LIBS) -lwsock32 -lws2_32 -lwinmm
+ dllwrap --dllname $@ --output-lib libcurldll.a --export-all --def libcurl.def $(libcurl_a_LIBRARIES) $(RESOURCE)
$(DLL_LIBS) -lwsock32 -lws2_32 -lwinmm
        $(STRIP) $@

 # remove the last line above to keep debug info
@@ -90,10 +91,12 @@
 .S.o:
        $(COMPILE) -c $<

+libcurl.res: libcurl.rc
+ windres -DCURLDEBUG=0 -DRC_VERSION=$(RC_VERSION) -O COFF -o $@ -i $^
+
 clean:
- $(RM) $(libcurl_a_OBJECTS)
+ $(RM) $(libcurl_a_OBJECTS) $(RESOURCE)

 distrib: clean
-
        $(RM) $(libcurl_a_LIBRARIES)

-------------------------------

--- CVS-latest\lib\Makefile.vc6 Tue Nov 04 07:59:26 2003
+++ lib\Makefile.vc6 Wed Nov 05 23:20:10 2003
@@ -31,6 +31,8 @@
 # linking of openssl
 ##############################################################

+RC_VERSION = 7,10,9,0
+
 LIB_NAME = libcurl
 LIB_NAME_DEBUG = libcurld
 !IFNDEF OPENSSL_PATH
@@ -73,6 +75,7 @@
 LNK = $(LNKDLL) /out:$(TARGET) /IMPLIB:"$(LIB_NAME).lib"
 CC = $(CCNODBG)
 CFGSET = TRUE
+RESOURCE = $(DIROBJ)\libcurl.res
 !ENDIF

 ######################
@@ -99,6 +102,7 @@
 LINKLIBS = $(LINKLIBS) $(SSLLIBS)
 CC = $(CCNODBG) $(CFLAGSSSL)
 CFGSET = TRUE
+RESOURCE = $(DIROBJ)\libcurl.res
 !ENDIF

 ######################
@@ -111,6 +115,7 @@
 LINKLIBS = $(LINKLIBS) $(SSLLIBS)
 CC = $(CCNODBG) $(CFLAGSSSL)
 CFGSET = TRUE
+RESOURCE = $(DIROBJ)\libcurl.res
 !ENDIF

@@ -134,6 +139,7 @@
 LNK = $(LNKDLL) /DEBUG /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib" /PDB:"$(LIB_NAME_DEBUG).pdb"
 CC = $(CCDEBUG)
 CFGSET = TRUE
+RESOURCE = $(DIROBJ)\libcurl.res
 !ENDIF

 ######################
@@ -159,6 +165,7 @@
 LINKLIBS = $(LINKLIBS) $(SSLLIBS)
 CC = $(CCDEBUG) $(CFLAGSSSL)
 CFGSET = TRUE
+RESOURCE = $(DIROBJ)\libcurl.res
 !ENDIF

 #######################
@@ -221,7 +228,8 @@
  $(DIROBJ)\http_digest.obj \
         $(DIROBJ)\http_negotiate.obj \
         $(DIROBJ)\http_ntlm.obj \
- $(DIROBJ)\md5.obj
+ $(DIROBJ)\md5.obj \
+ $(RESOURCE)

 all : $(TARGET)

@@ -234,12 +242,23 @@
 $(DIROBJ):
  @if not exist "$(DIROBJ)" mkdir $(DIROBJ)

-.SUFFIXES: .c .obj
+.SUFFIXES: .c .obj .res

 {.\}.c{$(DIROBJ)\}.obj:
  $(CC) $(CFLAGS) /Fo"$@" $<

+debug-dll\libcurl.res \
+debug-ssl-dll\libcurl.res \
+release-libcurl-ssl-dll\libcurl.res: libcurl.rc
+ rc /dCURL_DEBUG=1 /dRC_VERSION=$(RC_VERSION) /Fo $@ libcurl.rc
+
+release-dll\libcurl.res \
+release-ssl-dll\libcurl.res \
+release-libcurl-ssl-dll\libcurl.res: libcurl.rc
+ rc /dCURL_DEBUG=0 /dRC_VERSION=$(RC_VERSION) /Fo $@ libcurl.rc
+
 clean:
  -_at_erase $(DIROBJ)\*.obj
+ -_at_erase $(DIROBJ)\*.res
  -_at_erase vc60.idb
  -_at_erase vc60.pch

-------------------------------

I couldn't find a easy way to turn LIBCURL_VERSION_NUM into
7,9,10,0 (yes, it must be 4 values). Maybe there should be a
libcurl.rc.in file parsed by Perl.

Or define it in portions;
#define LIBCURL_VERSION_NUM ((LIBCURL_MAJOR << 16) + \
            (LIBCURL_MINOR << 8) + \
            LIBCURL_PATCH)

--gv

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
Received on 2003-11-05