[sane-devel] make errors with 1.07

abel deuring adeuring at gmx.net
Sat Mar 9 20:35:33 GMT 2002


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



More information about the sane-devel mailing list