[sane-devel] make errors with 1.07

abel deuring a.deuring@satzbau-gmbh.de
Sat, 09 Mar 2002 21:35:33 +0100


Henning Meier-Geinitz wrote:

> Have a look at AC_TRY_COMPILE. There are some examples in
> configure.in. The first argument are the includes, the second is the
> code that's inside the main function, the third is executed when
> compilation wa successful and the fourth when it wasn't successful.
> 
> Maybe something like this (untested):
> 
> AC_MSG_CHECKING([for sg_header.target_status in <scsi/sg.h>])
> AC_TRY_COMPILE([
> #include <sys/types.h>
> #include <scsi/sg.h>
> ],[
> struct sg_header hdr;
> hdr.target_status = 1;
> return 0;
> ],[AC_MSG_RESULT(yes);
> AC_DEFINE(HAVE_SG_TARGET_STATUS,1,[Define if sg_header.target_status is available.])],
> AC_MSG_RESULT(no))
> 
> Also, HAVE_SG_TARGET_STATUS must be added to include/sane/config.h.in.

Thanks, I'll try that. Is there a way to restrict this test to Linux? We
should not bother users of other OSes with stuff that is not relevant to
them, if possible.

Abel