delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/10/27/11:22:20

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
X-Received: (from news AT localhost) by esem.com (8.7.5/8.7.3) id RAA26027 for nittka; Wed, 27 Oct 1999 17:17:46 +0200
Path: kalserv.esem.com!news
From: Oliver Nittka <nittka AT esem DOT com>
Subject: any gotchas with import-lib ?
Date: 27 Oct 1999 17:17:44 +0200
Organization: ESEM Gruenau GmbH
Lines: 58
Message-ID: <u66zsn887.fsf@esem.com>
NNTP-Posting-Host: oly.esem.com
X-Newsreader: Gnus v5.7/Emacs 20.4
To: cygwin AT sourceware DOT cygnus DOT com
ReSent-Date: Wed, 27 Oct 1999 17:19:21 +0200 (MET DST)
ReSent-From: Oliver Nittka <nittka AT esem DOT com>
ReSent-To: cygwin AT sourceware DOT cygnus DOT com
ReSent-Message-ID: <Pine DOT LNX DOT 3 DOT 96 DOT 991027171921 DOT 26097A AT kalserv DOT esem DOT com>

hi !

i'm currently using the following script to create a lib that i can
use to link my programs against some arbitrary dlls:

-------------------- implib.sh ------------------
#!/bin/sh
    
if [ "$1" == "" ]; then
  echo "usage: $0 dllfile"
  exit 1
fi
    
bname=$(basename $1)
bname=${bname%.dll}
bname=${bname%.DLL}

defname=${bname}.def
libname=lib${bname}.a
    
# create def file
echo "EXPORTS" > $defname
objdump -p $1 | \
  sed "1,/^The Export Tables/d" | \
  sed "1,/^\[Ordinal\/Name Pointer\]/d" | \
  sed "/^$/,$ d;s/^.*\[.*\] //1" >> $defname

# create import lib
dlltool -k --def $defname --output-lib $libname --dllname ${bname}.dll
-------------------------------------------------

it seems to work fine, but i'd like to know, if there are any hidden
gotchas using that method.

background:
  i am frequently building extensions for tcl, which i want to link
  against the DLLs that come from scriptics, just so everyone can use
  them without having cygwish etc.

  earlier, i used to (try to) compile the whole tcl/tk - tarballs,
  usually with the help of mumit khan's patches (hey, thanks again
  mumit !), just for the sake of those libtcl80.a etc.

  a few days ago, i found out the above, and since then i don't have
  to go through all that hassle. as i said, it all seems to work fine,
  i can build my extensions and all, but i just wanted to make sure
  :-)

  comments very wellcome.

TIA !
  -- oly
-- 
Oliver Nittka              | nittka AT esem DOT com
ESEM Gruenau GmbH & Co. KG | http://www.esem.com
Riedheimer Str.6           | phone: +49 7544 9583-25
88677 Markdorf / Germany   | fax:   +49 7544 9583-60


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019