This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

any gotchas with import-lib ?



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@esem.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@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]