[sane-devel] sane-backends/lib/getopt.c compiling on OS/2

Franz Bakan Franz Bakan" <fbakan@gmx.net
Thu, 07 Jul 2005 23:55:49 +0200 (CEST)

On Wed, 06 Jul 2005 12:31:11 +0200, Mattias Ellert wrote:

>On Sun, 2005-07-03 at 15:10 +0200, Henning Meier-Geinitz wrote:
>> getopt.c is compiled and linked unconditionally on all platforms as
>> far as I can see. As this works on all the other platforms there must
>> be something different on OS/2.
>> You could try to move getopt and getopt_long to AC_REPLACE_FUNCS in
>> configure.in and modify lib/Makefile.in accordingly. But I haven't
>> checked all the implications of that. Maybe linking the getopt code
>> was done intentionally.
>You shouldn't have to do this. If the compiler finds that the glibc has
>the right getopt version all the code in getopt.c is removed by the
>#ifndef ELIDE_CODE conditional and it creates an empty getopt.o.

But on OS/2 we don't have a GLIBC system ...

The macro that decides to compile or not is defined in gnu-versions.h
which only exists on GLIBC systems.

The following 3 lines 

#ifdef __INNOTEK_LIBC__
#define ELIDE_CODE 1

which should appear after configure in

would solve the issue for OS/2

I suggest somone to add these 3 lines to config.h.in