[patch] 0.72 sane-dll.so changes...

Michael Sweet (mike@easysw.com)
Mon, 11 May 1998 17:00:46 -0400

This is a multi-part message in MIME format.
--------------3DFB8E5AA172F65C0053D2CB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

The following patch is a hack I'm using in sane-dll.so/a (backend/dll.c)
so that you don't have to parse the .la file. Basically, is just looks
in /usr/local/lib (or whatever SANE_LIB_DIR is set to) for all of the
backend library files. It assumes that the installed DSOs end with
".so" (not correct for HP-UX, which uses .sl or .[version]), so it
shouldn't be used for that platform.

I'm not sure how things are changing for the next release, but "for
the record", I recommend using a DSO directory separate from
/usr/local/lib for the back-end DSOs. dlopen() doesn't care *what*
extension is on the end of the filename, so we can use the backend
name (mustek, hp, etc) as the filename and not muck with this stuff.

-- 
________________________________________________________________________
 Mike Sweet         Software for HP, SGI,        Easy Software Products
 (301) 373-9603     and Sun Workstations       44145 Airport View Drive
 mike@easysw.com    http://www.easysw.com    Hollywood, Maryland  20636
--------------3DFB8E5AA172F65C0053D2CB
Content-Type: application/octet-stream; name="dll.diffs"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="dll.diffs"

LS0tIGRsbC5jLm9yaWcJTW9uIE1heSAxMSAxNjoxOToxNSAxOTk4CisrKyBkbGwuYwlNb24g TWF5IDExIDE2OjMxOjExIDE5OTgKQEAgLTIyOCw4ICsyMjgsOSBAQAogICBjaGFyIGxpYm5h bWVbUEFUSF9NQVhdLCBsaW5lW1BBVEhfTUFYXTsKICAgaW50IGksIGZvdW5kID0gMDsKICAg RklMRSAqZnAgPSAwOworIyBkZWZpbmUgU0FORV9MSUJfRElSICIvdXNyL2xvY2FsL2xpYi8i CiAjIGRlZmluZSBQUkVGSVggImxpYnNhbmUtIgotIyBkZWZpbmUgUE9TVEZJWCAiLmxhIgor IyBkZWZpbmUgU1VGRklYICIuc28iCiAKICAgREJHKDEsICJsb2FkaW5nIGJhY2tlbmQgJXNc biIsIGJlLT5uYW1lKTsKIApAQCAtM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YGRsbmFtZScgaW4gIlBSRUZJWCIlcyJQT1NURklYIlxuIiwgYmUtPm5hbWUpOwotICAgICAg cmV0dXJuIFNBTkVfU1RBVFVTX0lOVkFMOwotICAgIH0KKyAgc3ByaW50ZihsaWJuYW1lLCBT QU5FX0xJQl9ESVIgUFJFRklYICIlcyIgU1VGRklYLCBiZS0+bmFtZSk7CiAKICAgREJHKDIs ICJkbG9wZW4oKWluZyBgJXMnXG4iLCBsaWJuYW1lKTsKIAo= --------------3DFB8E5AA172F65C0053D2CB--

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com