Commit 8434ea91 authored by Luiz Angelo Daros de Luca's avatar Luiz Angelo Daros de Luca Committed by m. allan noah

Define IO_SUPPORT_MISSING when inb() and outb() aren't in <sys/io.h>

Fixes link issues on OpenWRT w/ musl on MIPS.
parent a1a04f74
......@@ -640,9 +640,9 @@ for be in ${BACKENDS}; do
;;
qcam)
if test "${ac_cv_func_ioperm}" = "no" \
if ( test "${ac_cv_func_ioperm}" = "no" || test "${sane_cv_have_sys_io_h_with_inb_outb}" = "no" )\
&& test "${ac_cv_func__portaccess}" = "no"; then
echo "*** $be backend requires ioperm and portaccess functions - $DISABLE_MSG"
echo "*** $be backend requires (ioperm, inb and outb) or portaccess functions - $DISABLE_MSG"
backend_supported="no"
fi
;;
......
......@@ -2817,8 +2817,8 @@ test "$program_suffix" != NONE &&
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
......@@ -3224,6 +3224,7 @@ END
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
......@@ -9599,6 +9600,42 @@ fi
if test "${ac_cv_header_sys_io_h}" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inb,outb (provided by sys/io.h)" >&5
$as_echo_n "checking for inb,outb (provided by sys/io.h)... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/io.h>
int
main ()
{
inb(0);outb(0,0);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
sane_cv_have_sys_io_h_with_inb_outb="yes"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
sane_cv_have_sys_io_h_with_inb_outb="no"
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: sys/io.h does not provide inb,outb (non i386/x32/x86_64 arch?)" >&5
$as_echo "$as_me: WARNING: sys/io.h does not provide inb,outb (non i386/x32/x86_64 arch?)" >&2;}
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test "$sane_cv_have_sys_io_h_with_inb_outb" = "yes"; then
$as_echo "#define SANE_HAVE_SYS_IO_H_WITH_INB_OUTB 1" >>confdefs.h
fi
else
sane_cv_have_sys_io_h_with_inb_outb="no"
fi
......@@ -18077,9 +18114,9 @@ for be in ${BACKENDS}; do
;;
qcam)
if test "${ac_cv_func_ioperm}" = "no" \
if ( test "${ac_cv_func_ioperm}" = "no" || test "${sane_cv_have_sys_io_h_with_inb_outb}" = "no" )\
&& test "${ac_cv_func__portaccess}" = "no"; then
echo "*** $be backend requires ioperm and portaccess functions - $DISABLE_MSG"
echo "*** $be backend requires (ioperm, inb and outb) or portaccess functions - $DISABLE_MSG"
backend_supported="no"
fi
;;
......@@ -18251,9 +18288,9 @@ for be in ${BACKENDS}; do
;;
qcam)
if test "${ac_cv_func_ioperm}" = "no" \
if ( test "${ac_cv_func_ioperm}" = "no" || test "${sane_cv_have_sys_io_h_with_inb_outb}" = "no" )\
&& test "${ac_cv_func__portaccess}" = "no"; then
echo "*** $be backend requires ioperm and portaccess functions - $DISABLE_MSG"
echo "*** $be backend requires (ioperm, inb and outb) or portaccess functions - $DISABLE_MSG"
backend_supported="no"
fi
;;
......
......@@ -484,6 +484,9 @@
/* SANE DLL minor number */
#undef SANE_DLL_V_MINOR
/* Define to 1 if you have the <sys/io.h> providing inb,outb. */
#undef SANE_HAVE_SYS_IO_H_WITH_INB_OUTB
/* SCSI command buffer size */
#undef SCSIBUFFERSIZE
......
......@@ -51,6 +51,9 @@
#ifdef HAVE_SYS_IO_H
# include <sys/io.h> /* use where available (glibc 2.x, for example) */
# ifndef SANE_HAVE_SYS_IO_H_WITH_INB_OUTB
# define IO_SUPPORT_MISSING
# endif
#elif HAVE_ASM_IO_H
# include <asm/io.h> /* ugly, but backwards compatible */
#elif defined (__i386__) && defined (__GNUC__)
......
......@@ -72,7 +72,10 @@
# if defined (__ICC) && __ICC >= 700
# define __GNUC__ 2
# endif
# include <sys/io.h>
# include <sys/io.h>
# ifndef SANE_HAVE_SYS_IO_H_WITH_INB_OUTB
# define IO_SUPPORT_MISSING
# endif
# if defined (__ICC) && __ICC >= 700
# undef __GNUC__
# elif defined(__ICC) && defined(HAVE_ASM_IO_H)
......
......@@ -61,6 +61,9 @@
#ifdef HAVE_SYS_IO_H
# include <sys/io.h> /* use where available (glibc 2.x, for example) */
# ifndef SANE_HAVE_SYS_IO_H_WITH_INB_OUTB
# define IO_SUPPORT_MISSING
# endif
#elif HAVE_ASM_IO_H
# include <asm/io.h> /* ugly, but backwards compatible */
#elif HAVE_SYS_HW_H
......
......@@ -94,6 +94,9 @@
# define __GNUC__ 2
# endif
# include <sys/io.h>
# ifndef SANE_HAVE_SYS_IO_H_WITH_INB_OUTB
# define IO_SUPPORT_MISSING
# endif
# if defined (__ICC) && __ICC >= 700
# undef __GNUC__
# elif defined(__ICC) && defined(HAVE_ASM_IO_H)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment