Building libsane.dll on OS/2

From: Franz Bakan (fbakan@gmx.net)
Date: Fri Jun 08 2001 - 17:16:00 PDT

  • Next message: Petter Reinholdtsen: "Re: autoconf macro SANE_CHECK_U_TYPES fails on Tru64 with cc"

    Hi,
    meanwhile I have had success building
    the 'shared library-version' of sane 1.05 on OS/2
    (scanimage.exe, xcam.exe, xscanimage.exe and libsane.dll)

    The trick in priciple was to use libtool from the patched
    1.01-OS/2 version from Yuri Dario
    and adding some libs (../sanei/libsanei.a -lshm -ljpeg -lsyslog) to the
    'archive_cmds='... line in libtool
    so that this line ends with:
    ... \$objdir/\$libname.def ../sanei/libsanei.a -lshm -ljpeg -lsyslog -lsocket -s

    I had two problems when building libsane.dll
    which might be caused by the actual sources:

    1.
    I got the following error:
    emxbind: export multiply defined: sanei_umax_pp_lamp

    There are two functions used in umax_pp_mid.c
    sanei_umax_pp_lamp() and
    sanei_umax_pp_Lamp()
    which names differ just in the case of one character

    The two names go both to the sane-umax_pp.def file
    I assume that OS/2 cannot deal with functions in shared
    libraries who's names just differ in 'case'

    As a workaround I renamed all 'sanei_umax_pp_lamp'
    in the sources to 'sanei_umax_pp_lampp'
    That solved the problem.

    Perhaps one of these two functions could be renamed in
    the official sources to make things compatible with OS/2

    2.
    From the build process: (shortened commands)
    emxexp dll.o dll-s.o sane_strstatus.o ../sanei/sanei_init_debug.o .........
     ../sanei/sanei_pa4s2.o .....
     djpeg.o djpeg.o ......
     umax_pp_mid.o >> .libs/libsane.def

    gcc -Zmt -Zdll -Zcrtdll -o .libs/libsane.dll dll.o dll-s.o sane_strstatus.o
     ../sanei/sanei_init_debug.o .............. coolscan.o dc25.o dc210.o dc240.o
    ............. umax_pp_mid.o .libs/libsane.def ../sanei/libsanei.a
     -lshm -ljpeg -lsyslog -lsocket -s
    djpeg.o: Definition of symbol _sanei_jpeg_jinit_write_ppm (multiply defined)
    djpeg.o: Definition of symbol _sanei_jpeg_jinit_write_ppm (multiply defined)
    gmake[1]: *** [libsane.la] Error 1

    There are the following two lines in the backend/Makefile
    EXTRA_dc210 =djpeg
    EXTRA_dc240 =djpeg

    which are probably the reason why 'djpeg.o' appears two times
    in the 'emxexp' command.

    I commented out the first and then the the build process finished
    successfully.

    Bye,
    Franz

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



    This archive was generated by hypermail 2b29 : Fri Jun 08 2001 - 17:12:32 PDT