1999-08-09 18:05:39 +00:00
|
|
|
dnl Process this file with autoconf to produce a configure script. -*-sh-*-
|
|
|
|
AC_INIT(include/sane/sane.h)
|
|
|
|
AC_CONFIG_HEADER(include/sane/config.h)
|
|
|
|
AC_PREREQ(2.10)dnl dnl Minimum Autoconf version required.
|
|
|
|
AC_ARG_PROGRAM
|
|
|
|
|
|
|
|
# version code:
|
|
|
|
V_MAJOR=1
|
|
|
|
V_MINOR=0
|
2000-12-22 16:49:54 +00:00
|
|
|
V_REV=4
|
1999-08-09 18:05:39 +00:00
|
|
|
|
2000-12-22 16:49:54 +00:00
|
|
|
PACKAGE=sane-backends
|
1999-08-09 18:05:39 +00:00
|
|
|
VERSION=${V_MAJOR}.${V_MINOR}.${V_REV}
|
|
|
|
PACKAGE_VERSION="$PACKAGE-$VERSION"
|
|
|
|
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
|
|
|
|
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
|
|
|
|
AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION")
|
|
|
|
AC_SUBST(PACKAGE)
|
|
|
|
AC_SUBST(VERSION)
|
|
|
|
AC_SUBST(PACKAGE_VERSION)
|
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_CC
|
2000-03-05 13:54:44 +00:00
|
|
|
AC_PROG_LD
|
1999-08-09 18:05:39 +00:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_GCC_TRADITIONAL
|
|
|
|
AC_AIX
|
|
|
|
AC_MINIX
|
|
|
|
AC_ISC_POSIX
|
2000-03-05 13:54:44 +00:00
|
|
|
AM_PROG_CC_STDC
|
1999-08-09 18:05:39 +00:00
|
|
|
|
|
|
|
INCLUDES="${INCLUDES} -I/usr/local/include"
|
|
|
|
CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
|
2000-03-05 13:54:44 +00:00
|
|
|
|
1999-08-09 18:05:39 +00:00
|
|
|
if test "${ac_cv_prog_gcc}" = "yes"; then
|
2000-12-23 16:06:12 +00:00
|
|
|
NORMAL_CFLAGS="${CFLAGS} -W -Wall"
|
|
|
|
WARN_CFLAGS="${CFLAGS} -W -Wall -Wstrict-prototypes -Wreturn-type \
|
|
|
|
-Wcast-align -Wpointer-arith -Wcast-qual -pedantic"
|
|
|
|
|
|
|
|
dnl OS/2 doesn't include some headers with -ansi enabled
|
|
|
|
AC_CHECK_HEADER(os2.h,,[WARN_CFLAGS="${WARN_CFLAGS} -ansi"])
|
|
|
|
|
|
|
|
# Warnings enabled by default (development)
|
|
|
|
AC_ARG_ENABLE(warnings,
|
|
|
|
[ --enable-warnings turn on tons of compiler warnings (GCC only)
|
|
|
|
[default=yes]],
|
|
|
|
[
|
|
|
|
if eval "test x$enable_warnings = xyes"; then
|
|
|
|
CFLAGS="${WARN_CFLAGS}"
|
|
|
|
else
|
|
|
|
CFLAGS="${NORMAL_CFLAGS}"
|
|
|
|
fi
|
|
|
|
],
|
|
|
|
[CFLAGS="${WARN_CFLAGS}"])
|
|
|
|
|
|
|
|
dnl # Warnings disabled by default (release)
|
|
|
|
dnl AC_ARG_ENABLE(warnings,
|
|
|
|
dnl [ --enable-warnings turn on tons of compiler warnings (GCC only)
|
|
|
|
dnl [default=no]],
|
|
|
|
dnl [
|
|
|
|
dnl if eval "test x$enable_warnings = xyes"; then
|
|
|
|
dnl CFLAGS="${WARN_CFLAGS}"
|
|
|
|
dnl else
|
|
|
|
dnl CFLAGS="${NORMAL_CFLAGS}"
|
|
|
|
dnl fi
|
|
|
|
dnl ],
|
|
|
|
dnl [CFLAGS="${NORMAL_CFLAGS}"])
|
2000-08-12 15:08:49 +00:00
|
|
|
|
2000-03-05 13:54:44 +00:00
|
|
|
fi
|
2000-12-23 16:06:12 +00:00
|
|
|
|
1999-08-09 18:05:39 +00:00
|
|
|
dnl Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
2000-12-04 20:58:29 +00:00
|
|
|
AC_CHECK_HEADERS(fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \
|
2000-12-23 16:06:12 +00:00
|
|
|
sys/time.h sys/shm.h \
|
1999-08-09 18:05:39 +00:00
|
|
|
sys/scanio.h scsi.h sys/scsi.h sys/scsicmd.h sys/scsiio.h \
|
|
|
|
bsd/dev/scsireg.h scsi/sg.h /usr/src/linux/include/scsi/sg.h io/cam/cam.h \
|
|
|
|
camlib.h os2.h sys/socket.h sys/io.h asm/io.h gscdds.h sys/hw.h \
|
2000-03-05 13:54:44 +00:00
|
|
|
sys/types.h sys/scsi/sgdefs.h sys/scsi/targets/scgio.h apollo/scsi.h \
|
|
|
|
sys/sdi_comm.h sys/passthrudef.h)
|
1999-08-09 18:05:39 +00:00
|
|
|
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_TYPE_SIGNAL
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_TYPE_PID_T
|
|
|
|
AC_CHECK_TYPE(ssize_t, long)
|
|
|
|
AC_CHECK_TYPE(u_char, unsigned char)
|
|
|
|
AC_CHECK_TYPE(u_int, unsigned int)
|
|
|
|
AC_CHECK_TYPE(u_long, unsigned long)
|
2000-08-12 15:08:49 +00:00
|
|
|
AC_CHECK_TYPE(u_int8_t, unsigned char)
|
|
|
|
AC_CHECK_TYPE(u_int16_t, unsigned short)
|
|
|
|
AC_CHECK_TYPE(u_int32_t, unsigned int)
|
1999-08-09 18:05:39 +00:00
|
|
|
|
|
|
|
if test "$ac_cv_header_sys_scsiio_h" = "yes" \
|
|
|
|
-a "$ac_cv_header_scsi_h" = "yes";
|
|
|
|
then
|
|
|
|
AC_TRY_COMPILE([
|
|
|
|
#include <sys/scsiio.h>
|
|
|
|
#include <scsi.h>
|
|
|
|
],[scsireq_t req],,
|
2001-01-14 23:45:27 +00:00
|
|
|
AC_DEFINE(scsireq_t, struct scsireq_t,
|
|
|
|
[Define scsireq_t as `struct scsireq' if necessary.]))
|
1999-08-09 18:05:39 +00:00
|
|
|
fi
|
|
|
|
|
2000-08-12 15:08:49 +00:00
|
|
|
SANE_V4L_VERSION
|
|
|
|
|
2000-11-24 15:24:55 +00:00
|
|
|
dnl Checks for dll libraries: dl
|
|
|
|
if test "${enable_dynamic}" != "no"; then
|
|
|
|
AC_CHECK_HEADERS(dlfcn.h,
|
|
|
|
[AC_CHECK_LIB(dl,dlopen, DL_LIB=-ldl)
|
2000-11-24 22:34:22 +00:00
|
|
|
saved_LIBS="${LIBS}"
|
|
|
|
LIBS="${LIBS} ${DL_LIB}"
|
|
|
|
AC_CHECK_FUNCS(dlopen, enable_dynamic=yes,)
|
|
|
|
LIBS="${saved_LIBS}"
|
|
|
|
],)
|
1999-08-09 18:05:39 +00:00
|
|
|
|
2000-11-24 15:24:55 +00:00
|
|
|
# HP/UX DLL handling
|
|
|
|
AC_CHECK_HEADERS(dl.h,
|
|
|
|
[AC_CHECK_LIB(dld,shl_load, DL_LIB=-ldld)
|
2000-11-24 22:34:22 +00:00
|
|
|
saved_LIBS="${LIBS}"
|
|
|
|
LIBS="${LIBS} ${DL_LIB}"
|
|
|
|
AC_CHECK_FUNCS(shl_load, enable_dynamic=yes,)
|
|
|
|
LIBS="${saved_LIBS}"
|
|
|
|
],)
|
2000-11-24 15:24:55 +00:00
|
|
|
fi
|
|
|
|
AC_SUBST(DL_LIB)
|
|
|
|
|
|
|
|
dnl Checks for Backend libraries.
|
|
|
|
AC_CHECK_LIB(m,sqrt)
|
1999-08-09 18:05:39 +00:00
|
|
|
AC_CHECK_LIB(scsi, scsireq_enter) # FreeBSD needs this
|
2000-03-05 13:54:44 +00:00
|
|
|
AC_CHECK_LIB(cam, cam_open_device) # FreeBSD 3+ needs this
|
2000-11-23 22:57:22 +00:00
|
|
|
AC_CHECK_LIB(syslog, syslog) # OS/2 needs this
|
2000-11-28 20:29:32 +00:00
|
|
|
|
|
|
|
SANE_CHECK_JPEG
|
1999-08-09 18:05:39 +00:00
|
|
|
|
|
|
|
dnl IRIX sometimes has SYSVR3/4 network DSOs, but we do not need or want
|
|
|
|
dnl to use them!
|
|
|
|
if test "`uname`" != "IRIX" -a "`uname`" != "IRIX64"; then
|
|
|
|
AC_CHECK_LIB(nsl,gethostbyaddr)
|
|
|
|
AC_CHECK_LIB(socket,socket)
|
|
|
|
fi
|
|
|
|
|
2000-11-25 17:51:16 +00:00
|
|
|
dnl check for PTAL library (used in hp backend)
|
|
|
|
SANE_CHECK_PTAL
|
|
|
|
|
2000-11-20 18:49:12 +00:00
|
|
|
dnl look for /dev/urandom
|
|
|
|
if test -c /dev/urandom ; then
|
2001-01-14 23:45:27 +00:00
|
|
|
AC_DEFINE(HAVE_DEV_URANDOM, 1, [Is /dev/urandom available?])
|
2000-11-20 18:49:12 +00:00
|
|
|
fi
|
|
|
|
|
1999-08-09 18:05:39 +00:00
|
|
|
dnl Checks for library functions.
|
2000-03-05 13:54:44 +00:00
|
|
|
AC_FUNC_ALLOCA
|
1999-08-09 18:05:39 +00:00
|
|
|
AC_FUNC_MMAP
|
|
|
|
AC_CHECK_FUNCS(atexit ioperm mkdir scsireq_enter sigprocmask \
|
|
|
|
strdup strndup strftime strstr strsep strtod snprintf \
|
2000-08-12 15:08:49 +00:00
|
|
|
cfmakeraw tcsendbreak usleep strcasecmp strncasecmp _portaccess \
|
|
|
|
getenv isfdtype vsyslog)
|
1999-08-09 18:05:39 +00:00
|
|
|
|
|
|
|
dnl initialize libtool
|
2000-03-05 13:54:44 +00:00
|
|
|
AC_LIBTOOL_WIN32_DLL
|
1999-08-09 18:05:39 +00:00
|
|
|
AM_PROG_LIBTOOL
|
|
|
|
|
|
|
|
|
|
|
|
AC_SUBST(INCLUDES)
|
|
|
|
CPPFLAGS="${CPPFLAGS} -DPATH_SANE_CONFIG_DIR=\$(configdir) \
|
|
|
|
-DPATH_SANE_DATA_DIR=\$(datadir) \
|
|
|
|
-DV_MAJOR=${V_MAJOR} -DV_MINOR=${V_MINOR}"
|
|
|
|
|
2000-11-28 20:29:32 +00:00
|
|
|
if test "${sane_cv_use_libjpeg}" != "yes"; then
|
1999-08-09 18:05:39 +00:00
|
|
|
echo "disabling DC210 backend (failed to find JPEG library)"
|
|
|
|
DC210=
|
|
|
|
else
|
|
|
|
echo "enabling DC210 backend"
|
|
|
|
DC210=dc210
|
|
|
|
fi
|
|
|
|
AC_SUBST(DC210)
|
|
|
|
if test "${ac_cv_header_sys_scanio_h}" = "no"; then
|
|
|
|
echo "disabling PINT backend"
|
|
|
|
PINT=
|
|
|
|
else
|
|
|
|
echo "enabling PINT backend"
|
|
|
|
PINT=pint
|
|
|
|
fi
|
|
|
|
AC_SUBST(PINT)
|
|
|
|
if test "${ac_cv_func_ioperm}" = "no" \
|
|
|
|
&& test "${ac_cv_func__portaccess}" = "no"
|
|
|
|
then
|
|
|
|
echo "disabling QuickCam backend"
|
|
|
|
QCAM=
|
|
|
|
else
|
|
|
|
echo "enabling QuickCam backend"
|
|
|
|
QCAM=qcam
|
|
|
|
fi
|
|
|
|
AC_SUBST(QCAM)
|
2000-08-12 15:08:49 +00:00
|
|
|
if test "${sane_v4l_version}" = "v4l"
|
|
|
|
then
|
|
|
|
echo "enabling Video4Linux backend"
|
|
|
|
V4L=v4l
|
|
|
|
else
|
|
|
|
echo "disabling Video4Linux backend"
|
|
|
|
V4L=
|
|
|
|
fi
|
|
|
|
AC_SUBST(V4L)
|
1999-08-09 18:05:39 +00:00
|
|
|
if test "${ac_cv_header_sys_socket_h}" = "no"; then
|
|
|
|
echo "disabling NET backend"
|
|
|
|
NET=
|
|
|
|
SANED=
|
|
|
|
else
|
|
|
|
echo "enabling NET backend"
|
|
|
|
NET=net
|
|
|
|
SANED=saned
|
|
|
|
fi
|
|
|
|
AC_SUBST(NET)
|
|
|
|
AC_SUBST(SANED)
|
|
|
|
if test "${enable_shared}" = "no"; then
|
|
|
|
enable_preload=yes
|
|
|
|
fi
|
|
|
|
if test "${enable_dynamic}" != yes || test "${enable_preload}" = "yes"; then
|
|
|
|
echo "preloading backends into DLL"
|
|
|
|
DLL_PRELOAD="\$(PRELOADABLE_BACKENDS)"
|
|
|
|
else
|
|
|
|
DLL_PRELOAD=""
|
|
|
|
fi
|
2000-03-05 13:54:44 +00:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(scsibuffersize,
|
2000-11-25 17:51:16 +00:00
|
|
|
[ --enable-scsibuffersize=N specify the default size (in bytes) of the buffer
|
|
|
|
for SCSI commands [default=131072]],
|
2000-03-05 13:54:44 +00:00
|
|
|
[set_scsibuffersize="$enableval"], [set_scsibuffersize=131072])
|
2001-02-22 09:58:04 +00:00
|
|
|
AC_DEFINE_UNQUOTED(SCSIBUFFERSIZE, $set_scsibuffersize,
|
|
|
|
[SCSI command buffer size])
|
2000-03-05 13:54:44 +00:00
|
|
|
echo "scsi buffersize: $set_scsibuffersize"
|
|
|
|
|
1999-08-09 18:05:39 +00:00
|
|
|
AC_SUBST(V_MAJOR)
|
|
|
|
AC_SUBST(V_MINOR)
|
|
|
|
AC_SUBST(V_REV)
|
|
|
|
AC_SUBST(DLL_PRELOAD)
|
|
|
|
|
|
|
|
AC_OUTPUT([Makefile lib/Makefile sanei/Makefile frontend/Makefile
|
|
|
|
japi/Makefile backend/Makefile include/Makefile doc/Makefile
|
2001-02-22 09:53:05 +00:00
|
|
|
testsuite/Makefile
|
2000-03-05 13:54:44 +00:00
|
|
|
tools/Makefile tools/sane-config],)
|
1999-08-09 18:05:39 +00:00
|
|
|
|
|
|
|
echo "****************************************************************"
|
|
|
|
echo "* Please be sure to read file PROBLEMS in this directory *"
|
|
|
|
echo "* BEFORE running any of the SANE applications. Some devices *"
|
|
|
|
echo "* may be damaged by inproper operation, so please do heed this *"
|
|
|
|
echo "* advice. *"
|
|
|
|
echo "****************************************************************"
|