1141cc406Sopenharmony_cidnl Process this file with autoconf to produce a configure script. 2141cc406Sopenharmony_ci 3141cc406Sopenharmony_cidnl ****************************************************************** 4141cc406Sopenharmony_cidnl Set up autoconf and automake 5141cc406Sopenharmony_cidnl ****************************************************************** 6141cc406Sopenharmony_ciAC_INIT([sane-backends], 7141cc406Sopenharmony_ci m4_esyscmd_s([tools/git-version-gen --prefix '' .tarball-version]), 8141cc406Sopenharmony_ci [sane-devel@alioth-lists.debian.net]) 9141cc406Sopenharmony_ciAC_PREREQ([2.69]) dnl minimum autoconf version required 10141cc406Sopenharmony_ciAC_CONFIG_MACRO_DIR([m4]) 11141cc406Sopenharmony_ciAC_CONFIG_HEADERS([include/sane/config.h]) 12141cc406Sopenharmony_ci 13141cc406Sopenharmony_ciAM_INIT_AUTOMAKE([1.15 subdir-objects -Wall]) 14141cc406Sopenharmony_ciAM_SILENT_RULES 15141cc406Sopenharmony_ci 16141cc406Sopenharmony_cidnl ****************************************************************** 17141cc406Sopenharmony_cidnl Determine SANE version components and release status 18141cc406Sopenharmony_cidnl ****************************************************************** 19141cc406Sopenharmony_ciAS_IF([test x = "x$AWK"],[AC_PROG_AWK]) 20141cc406Sopenharmony_ciAS_IF([test x = "x`echo $VERSION | sed 's/[[.0-9]]//g'`"], 21141cc406Sopenharmony_ci [is_release=yes], 22141cc406Sopenharmony_ci [is_release=no]) 23141cc406Sopenharmony_ciV_MAJOR=`echo $VERSION | $AWK -F. '{print $1}'` 24141cc406Sopenharmony_ciV_MINOR=`echo $VERSION | $AWK -F. '{print $2}'` 25141cc406Sopenharmony_ciV_REV=`echo $VERSION | $AWK -F. '{print $3}' | sed 's/^\([[0-9]]*\).*/\1/'`; 26141cc406Sopenharmony_ci 27141cc406Sopenharmony_ciAC_DEFINE_UNQUOTED(SANE_DLL_V_MAJOR, $V_MAJOR, [SANE DLL major number]) 28141cc406Sopenharmony_ciAC_DEFINE_UNQUOTED(SANE_DLL_V_MINOR, $V_MINOR, [SANE DLL minor number]) 29141cc406Sopenharmony_ciAC_DEFINE_UNQUOTED(SANE_DLL_V_BUILD, $V_REV, [SANE DLL revision number]) 30141cc406Sopenharmony_ciAC_SUBST(V_MAJOR) 31141cc406Sopenharmony_ciAC_SUBST(V_MINOR) 32141cc406Sopenharmony_ciAC_SUBST(V_REV) 33141cc406Sopenharmony_ci 34141cc406Sopenharmony_cidnl ****************************************************************** 35141cc406Sopenharmony_cidnl Set up the compiler and linker 36141cc406Sopenharmony_cidnl ****************************************************************** 37141cc406Sopenharmony_ciAC_PROG_CC 38141cc406Sopenharmony_ciAC_PROG_CXX 39141cc406Sopenharmony_ciAM_PROG_CC_C_O 40141cc406Sopenharmony_ciAM_PATH_PYTHON(2.7) 41141cc406Sopenharmony_cisane_save_CC=$CC 42141cc406Sopenharmony_ciAC_PROG_CC_C99 dnl enables extensions to ISO C99 :-( 43141cc406Sopenharmony_ciAS_IF([test xno != "x$ac_cv_prog_cc_c99"], 44141cc406Sopenharmony_ci [AC_MSG_CHECKING([for $sane_save_CC option for ISO C99 w/o extensions]) 45141cc406Sopenharmony_ci AS_CASE([$ac_cv_prog_cc_c99], 46141cc406Sopenharmony_ci [-std=gnu99], [sane_prog_cc_c99="-std=c99"], 47141cc406Sopenharmony_ci [-qlanglvl=extc99],[sane_prog_cc_c99="-qlanglvl=stdc99"]) 48141cc406Sopenharmony_ci AS_IF([test "x$ac_cv_prog_cc_c99" = "x$sane_prog_cc_c99"], 49141cc406Sopenharmony_ci [AC_MSG_RESULT([$ac_cv_prog_cc_99])], 50141cc406Sopenharmony_ci [AC_MSG_RESULT([$sane_prog_cc_c99]) 51141cc406Sopenharmony_ci CC="$sane_save_CC $sane_prog_cc_c99"]) 52141cc406Sopenharmony_ci ]) 53141cc406Sopenharmony_ciAC_PROG_GCC_TRADITIONAL 54141cc406Sopenharmony_ciAC_USE_SYSTEM_EXTENSIONS dnl call before running the C compiler 55141cc406Sopenharmony_ci 56141cc406Sopenharmony_ciAM_PROG_AR 57141cc406Sopenharmony_ciLT_INIT([disable-static win32-dll]) 58141cc406Sopenharmony_ciLT_PREREQ([2.4.6]) 59141cc406Sopenharmony_ci 60141cc406Sopenharmony_cidnl ***************************************************************** 61141cc406Sopenharmony_cidnl Set up I18N/L10N support 62141cc406Sopenharmony_cidnl ***************************************************************** 63141cc406Sopenharmony_ciAM_GNU_GETTEXT([external]) 64141cc406Sopenharmony_ciAM_GNU_GETTEXT_VERSION([0.19.8]) 65141cc406Sopenharmony_ci 66141cc406Sopenharmony_cidnl *********************************************************************** 67141cc406Sopenharmony_cidnl Checks for programs. 68141cc406Sopenharmony_cidnl *********************************************************************** 69141cc406Sopenharmony_ciAC_PATH_PROG(SANE_CONFIG_PATH, sane-config, no) 70141cc406Sopenharmony_ci 71141cc406Sopenharmony_cidnl Call explicitly before using PKG_* 72141cc406Sopenharmony_ciPKG_PROG_PKG_CONFIG 73141cc406Sopenharmony_ci 74141cc406Sopenharmony_ciAM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes) 75141cc406Sopenharmony_ci 76141cc406Sopenharmony_cidnl *********************************************************************** 77141cc406Sopenharmony_cidnl set compiler/linker flags 78141cc406Sopenharmony_cidnl *********************************************************************** 79141cc406Sopenharmony_ciSANE_SET_AM_CFLAGS([$is_release]) 80141cc406Sopenharmony_ciAX_CXX_COMPILE_STDCXX_11([noext], [optional]) 81141cc406Sopenharmony_ciSANE_SET_AM_LDFLAGS 82141cc406Sopenharmony_ci 83141cc406Sopenharmony_cidnl *********************************************************************** 84141cc406Sopenharmony_cidnl Checks for unix variants 85141cc406Sopenharmony_cidnl *********************************************************************** 86141cc406Sopenharmony_ciAC_SEARCH_LIBS([strerror],[cposix]) 87141cc406Sopenharmony_ci 88141cc406Sopenharmony_ciAC_NEED_BYTEORDER_H([include/byteorder.h]) 89141cc406Sopenharmony_ciAX_CREATE_STDINT_H([include/_stdint.h]) 90141cc406Sopenharmony_ci 91141cc406Sopenharmony_cidnl *********************************************************************** 92141cc406Sopenharmony_cidnl Checks for libraries 93141cc406Sopenharmony_cidnl *********************************************************************** 94141cc406Sopenharmony_ciAC_ARG_ENABLE(dynamic, 95141cc406Sopenharmony_ci AS_HELP_STRING([--disable-dynamic], 96141cc406Sopenharmony_ci [Disable dynamic loading of backends]), 97141cc406Sopenharmony_ci [enable_dynamic=$enableval], [enable_dynamic=auto]) 98141cc406Sopenharmony_ciSANE_CHECK_DLL_LIB 99141cc406Sopenharmony_cidnl Checks for Backend libraries. 100141cc406Sopenharmony_ciAC_CHECK_LIB(m, sqrt, MATH_LIB="-lm") 101141cc406Sopenharmony_ciAC_SUBST(MATH_LIB) 102141cc406Sopenharmony_cicase ${host_os} in 103141cc406Sopenharmony_ci os2*) 104141cc406Sopenharmony_ci AC_CHECK_LIB(syslog, syslog, SYSLOG_LIBS="-lsyslog") 105141cc406Sopenharmony_ci ;; 106141cc406Sopenharmony_ci beos*) 107141cc406Sopenharmony_ci AC_CHECK_LIB(be, syslog, SYSLOG_LIBS="-lbe") 108141cc406Sopenharmony_ci ;; 109141cc406Sopenharmony_ciesac 110141cc406Sopenharmony_ciAC_SUBST(SYSLOG_LIBS) 111141cc406Sopenharmony_ci 112141cc406Sopenharmony_ciSANE_CHECK_JPEG 113141cc406Sopenharmony_ciSANE_CHECK_TIFF 114141cc406Sopenharmony_ciSANE_CHECK_PNG 115141cc406Sopenharmony_ciSANE_CHECK_IEEE1284 116141cc406Sopenharmony_ciSANE_CHECK_PTHREAD 117141cc406Sopenharmony_ciSANE_CHECK_LOCKING 118141cc406Sopenharmony_ciSANE_CHECK_GPHOTO2 119141cc406Sopenharmony_ci 120141cc406Sopenharmony_ci 121141cc406Sopenharmony_ciAC_ARG_WITH(v4l, 122141cc406Sopenharmony_ci AS_HELP_STRING([--with-v4l], 123141cc406Sopenharmony_ci [include the v4l backend @<:@default=yes@:>@]), 124141cc406Sopenharmony_ci [# If --with-v4l=no or --without-v4l, disable backend 125141cc406Sopenharmony_ci # as "$with_v4l" will be set to "no"]) 126141cc406Sopenharmony_ci 127141cc406Sopenharmony_ciif test "$with_v4l" != "no" ; then 128141cc406Sopenharmony_ci PKG_CHECK_MODULES(LIBV4L, [libv4l1 >= 0.8.3], have_libv4l1=yes, have_libv4l1=no) 129141cc406Sopenharmony_cifi 130141cc406Sopenharmony_ci 131141cc406Sopenharmony_ciAC_ARG_WITH(avahi, 132141cc406Sopenharmony_ci AS_HELP_STRING([--with-avahi], 133141cc406Sopenharmony_ci [enable Avahi support @<:@default=check@:>@]), 134141cc406Sopenharmony_ci [], 135141cc406Sopenharmony_ci [with_avahi=check]) 136141cc406Sopenharmony_ciAC_DEFINE(WITH_AVAHI, 137141cc406Sopenharmony_ci [0], [Define to 1 if Avahi support is available]) 138141cc406Sopenharmony_ciAS_IF([test xno != "x$with_avahi"], 139141cc406Sopenharmony_ci [PKG_CHECK_MODULES(AVAHI, [avahi-client >= 0.6.24], 140141cc406Sopenharmony_ci [AC_DEFINE([WITH_AVAHI], [1]) 141141cc406Sopenharmony_ci with_avahi=yes 142141cc406Sopenharmony_ci ], 143141cc406Sopenharmony_ci [AS_IF([test xcheck != "x$with_avahi"], 144141cc406Sopenharmony_ci [AC_MSG_ERROR([Avahi support requested but not found])]) 145141cc406Sopenharmony_ci with_avahi=no 146141cc406Sopenharmony_ci ]) 147141cc406Sopenharmony_ci ]) 148141cc406Sopenharmony_ciAM_CONDITIONAL([have_libavahi], [test x != "x$AVAHI_LIBS"]) 149141cc406Sopenharmony_ci 150141cc406Sopenharmony_cidnl check sane to make sure we don't have two installations 151141cc406Sopenharmony_ciAC_CHECK_LIB(sane, sane_init, LIBSANE_EXISTS="yes") 152141cc406Sopenharmony_ci 153141cc406Sopenharmony_ci 154141cc406Sopenharmony_cidnl ************************************************************** 155141cc406Sopenharmony_cidnl Check for libsnmp availability 156141cc406Sopenharmony_cidnl ************************************************************** 157141cc406Sopenharmony_ci 158141cc406Sopenharmony_ciAC_ARG_WITH(snmp, 159141cc406Sopenharmony_ci AS_HELP_STRING([--with-snmp], 160141cc406Sopenharmony_ci [enable SNMP support @<:@default=check@:>@]), 161141cc406Sopenharmony_ci [], 162141cc406Sopenharmony_ci [with_snmp=check]) 163141cc406Sopenharmony_ciAC_DEFINE(HAVE_LIBSNMP, 164141cc406Sopenharmony_ci [0], [Define to 1 if libsnmp is available]) 165141cc406Sopenharmony_ciAS_IF([test xno != "x$with_snmp"], 166141cc406Sopenharmony_ci [PKG_CHECK_MODULES(SNMP, [netsnmp >= 5.6], 167141cc406Sopenharmony_ci [AC_DEFINE([HAVE_LIBSNMP], [1]) 168141cc406Sopenharmony_ci with_snmp=yes 169141cc406Sopenharmony_ci ], 170141cc406Sopenharmony_ci [AS_IF([test xcheck != "x$with_snmp"], 171141cc406Sopenharmony_ci [AC_MSG_ERROR([libsnmp requested but not found])]) 172141cc406Sopenharmony_ci with_snmp=no 173141cc406Sopenharmony_ci ]) 174141cc406Sopenharmony_ci ]) 175141cc406Sopenharmony_ciAM_CONDITIONAL([have_snmp], [test x != "x$SNMP_LIBS"]) 176141cc406Sopenharmony_ci 177141cc406Sopenharmony_cidnl *********************************************************************** 178141cc406Sopenharmony_cidnl Checks for header files. 179141cc406Sopenharmony_cidnl *********************************************************************** 180141cc406Sopenharmony_ciAC_HEADER_STDC 181141cc406Sopenharmony_ciAC_CHECK_HEADERS(fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \ 182141cc406Sopenharmony_ci sys/time.h sys/shm.h sys/ipc.h sys/scanio.h os2.h \ 183141cc406Sopenharmony_ci sys/socket.h sys/io.h sys/hw.h sys/types.h linux/ppdev.h \ 184141cc406Sopenharmony_ci dev/ppbus/ppi.h machine/cpufunc.h sys/sem.h poll.h \ 185141cc406Sopenharmony_ci windows.h be/kernel/OS.h limits.h sys/ioctl.h asm/types.h\ 186141cc406Sopenharmony_ci netinet/in.h tiffio.h ifaddrs.h pwd.h getopt.h) 187141cc406Sopenharmony_ciAC_CHECK_HEADERS([asm/io.h],,,[#include <sys/types.h>]) 188141cc406Sopenharmony_ci 189141cc406Sopenharmony_ciSANE_CHECK_MISSING_HEADERS 190141cc406Sopenharmony_ci 191141cc406Sopenharmony_ciAC_CHECK_HEADERS(winsock2.h, SOCKET_LIB="-lws2_32") 192141cc406Sopenharmony_ci 193141cc406Sopenharmony_ciAC_CHECK_HEADER(resmgr.h,[ 194141cc406Sopenharmony_ci AC_CHECK_LIB( 195141cc406Sopenharmony_ci resmgr, 196141cc406Sopenharmony_ci rsm_open_device,[ 197141cc406Sopenharmony_ci AC_DEFINE(HAVE_RESMGR,1,[define if you have the resmgr library]) 198141cc406Sopenharmony_ci RESMGR_LIBS="-lresmgr" 199141cc406Sopenharmony_ci ] 200141cc406Sopenharmony_ci ) 201141cc406Sopenharmony_ci]) 202141cc406Sopenharmony_ciAC_SUBST(RESMGR_LIBS) 203141cc406Sopenharmony_ci 204141cc406Sopenharmony_cidnl *********************************************************************** 205141cc406Sopenharmony_cidnl Checks for types and structures 206141cc406Sopenharmony_cidnl *********************************************************************** 207141cc406Sopenharmony_ci 208141cc406Sopenharmony_ciAC_TYPE_SIZE_T 209141cc406Sopenharmony_ciAC_TYPE_PID_T 210141cc406Sopenharmony_ciAC_TYPE_SSIZE_T 211141cc406Sopenharmony_ciSANE_CHECK_U_TYPES 212141cc406Sopenharmony_ci 213141cc406Sopenharmony_ci# from Python, check for "long long" type 214141cc406Sopenharmony_ciAC_MSG_CHECKING(for long long support) 215141cc406Sopenharmony_cihave_long_long=no 216141cc406Sopenharmony_ciAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long long x; x = (long long)0;]])],[AC_DEFINE(HAVE_LONG_LONG, 1, Define if the long long type is available.) have_long_long=yes],[]) 217141cc406Sopenharmony_ciAC_MSG_RESULT($have_long_long) 218141cc406Sopenharmony_ci 219141cc406Sopenharmony_ciAC_MSG_CHECKING([for socklen_t in <sys/socket.h>]) 220141cc406Sopenharmony_ciAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 221141cc406Sopenharmony_ci#include <sys/socket.h> 222141cc406Sopenharmony_ci]], [[socklen_t len]])],AC_MSG_RESULT(yes), 223141cc406Sopenharmony_ci[AC_MSG_RESULT(no); AC_DEFINE(socklen_t,int, 224141cc406Sopenharmony_ci[Define socklen_t as \'int\' if necessary.])]) 225141cc406Sopenharmony_ci 226141cc406Sopenharmony_ciAC_MSG_CHECKING([for union semun in <sys/sem.h>]) 227141cc406Sopenharmony_ciAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 228141cc406Sopenharmony_ci#include <sys/types.h> 229141cc406Sopenharmony_ci#include <sys/ipc.h> 230141cc406Sopenharmony_ci#include <sys/sem.h> 231141cc406Sopenharmony_ci]], [[union semun test_semun]])],[AC_MSG_RESULT(yes); 232141cc406Sopenharmony_ciAC_DEFINE(HAVE_UNION_SEMUN,1,[Define if union semun is available.])], 233141cc406Sopenharmony_ci[AC_MSG_RESULT(no)]) 234141cc406Sopenharmony_ci 235141cc406Sopenharmony_ciAC_MSG_CHECKING([for struct flock in fcntl.h]) 236141cc406Sopenharmony_ciAC_EGREP_HEADER([struct flock], fcntl.h, [AC_MSG_RESULT(yes) ; 237141cc406Sopenharmony_ci AC_DEFINE(HAVE_STRUCT_FLOCK, 1, 238141cc406Sopenharmony_ci [Define if struct flock is available.])], AC_MSG_RESULT(no)) 239141cc406Sopenharmony_ci 240141cc406Sopenharmony_ciAC_MSG_CHECKING([for Linux ioctl defines]) 241141cc406Sopenharmony_ciAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 242141cc406Sopenharmony_ci#include <sys/ioctl.h> 243141cc406Sopenharmony_ci#include <asm/types.h> 244141cc406Sopenharmony_ci]],[[ 245141cc406Sopenharmony_ci__u32 houba = _IOR('v',14, unsigned long); 246141cc406Sopenharmony_ci]])],[AC_MSG_RESULT(yes); 247141cc406Sopenharmony_cihave_linux_ioctl_defines="yes";],AC_MSG_RESULT(no)) 248141cc406Sopenharmony_ci 249141cc406Sopenharmony_cidnl *********************************************************************** 250141cc406Sopenharmony_cidnl Checks for compiler characteristics 251141cc406Sopenharmony_cidnl *********************************************************************** 252141cc406Sopenharmony_ciAC_C_BIGENDIAN 253141cc406Sopenharmony_ciAC_C_CONST 254141cc406Sopenharmony_ciAC_C_INLINE 255141cc406Sopenharmony_ci 256141cc406Sopenharmony_cidnl *********************************************************************** 257141cc406Sopenharmony_cidnl Checks for library functions 258141cc406Sopenharmony_cidnl *********************************************************************** 259141cc406Sopenharmony_ci 260141cc406Sopenharmony_cidnl Functions for which we provide an implementation if missing 261141cc406Sopenharmony_ciAC_CONFIG_LIBOBJ_DIR([lib]) 262141cc406Sopenharmony_ciAC_FUNC_ALLOCA 263141cc406Sopenharmony_ciAC_REPLACE_FUNCS([getenv inet_ntop inet_pton sigprocmask \ 264141cc406Sopenharmony_ci sleep snprintf strcasestr strdup strndup strsep syslog usleep \ 265141cc406Sopenharmony_ci vsyslog]) 266141cc406Sopenharmony_ciAS_IF([test x != x$ALLOCA], 267141cc406Sopenharmony_ci [LTALLOCA=`echo "$ALLOCA" | sed 's/\.o$//; s/\.obj$//'`.lo]) 268141cc406Sopenharmony_ciAC_SUBST(LTALLOCA) 269141cc406Sopenharmony_ci 270141cc406Sopenharmony_cidnl Define SOCKET_LIB, NSL_LIB, BIND_LIB, and RESOLV_LIB when required 271141cc406Sopenharmony_cidnl for functions we use. 272141cc406Sopenharmony_ciAC_CHECK_FUNC(gethostbyaddr,, [AC_CHECK_LIB(bind, gethostbyaddr, BIND_LIB="-lbind")]) 273141cc406Sopenharmony_ciAC_CHECK_FUNC(gethostbyaddr,, [AC_CHECK_LIB(nsl, gethostbyaddr, NSL_LIB="-lnsl")]) 274141cc406Sopenharmony_ciAC_CHECK_FUNC(socket,, [AC_CHECK_LIB(socket, socket, SOCKET_LIB="-lsocket")]) 275141cc406Sopenharmony_ciAC_CHECK_FUNC(inet_aton,, [AC_CHECK_LIB(resolv, inet_aton, RESOLV_LIB="-lresolv")]) 276141cc406Sopenharmony_ci 277141cc406Sopenharmony_cidnl Group related network libraries together so they can always be linked 278141cc406Sopenharmony_cidnl in. 279141cc406Sopenharmony_ciSOCKET_LIBS="$SOCKET_LIB $NSL_LIB $BIND_LIB $RESOLV_LIB" 280141cc406Sopenharmony_ciAC_SUBST(SOCKET_LIBS) 281141cc406Sopenharmony_ci 282141cc406Sopenharmony_cidnl define HAVE_* values for network functions. This may require 283141cc406Sopenharmony_cidnl SOCKET_LIBS so set LIBS temporarily. 284141cc406Sopenharmony_cisave_LIBS="$LIBS" 285141cc406Sopenharmony_ciLIBS="$LIBS $SOCKET_LIBS" 286141cc406Sopenharmony_ciAC_CHECK_FUNCS(inet_addr inet_aton inet_ntoa) 287141cc406Sopenharmony_ciLIBS="$save_LIBS" 288141cc406Sopenharmony_ci 289141cc406Sopenharmony_ciif test "$ac_cv_header_be_kernel_OS_h" = "yes" ; then 290141cc406Sopenharmony_ci dnl those are known to be broken in BeOS (BONE) 291141cc406Sopenharmony_ci ac_cv_func_getaddrinfo=no 292141cc406Sopenharmony_ci ac_cv_func_getnameinfo=no 293141cc406Sopenharmony_cifi 294141cc406Sopenharmony_ci 295141cc406Sopenharmony_ciAC_FUNC_MMAP 296141cc406Sopenharmony_ciAC_CHECK_FUNCS(atexit ioperm i386_set_ioperm \ 297141cc406Sopenharmony_ci mkdir strftime strstr strtod \ 298141cc406Sopenharmony_ci cfmakeraw tcsendbreak strcasecmp strncasecmp _portaccess \ 299141cc406Sopenharmony_ci getaddrinfo getnameinfo poll setitimer iopl getuid getpass) 300141cc406Sopenharmony_ci 301141cc406Sopenharmony_cidnl sys/io.h might provide ioperm but not inb,outb (like for 302141cc406Sopenharmony_cidnl non i386/x32/x86_64 with musl libc) 303141cc406Sopenharmony_ciif test "${ac_cv_header_sys_io_h}" = "yes"; then 304141cc406Sopenharmony_ci AC_MSG_CHECKING([for inb,outb (provided by sys/io.h)]) 305141cc406Sopenharmony_ci AC_LINK_IFELSE( 306141cc406Sopenharmony_ci [AC_LANG_PROGRAM([[#include <sys/io.h>]], 307141cc406Sopenharmony_ci [[inb(0);outb(0,0);]])], 308141cc406Sopenharmony_ci [AC_MSG_RESULT([yes]) 309141cc406Sopenharmony_ci sane_cv_have_sys_io_h_with_inb_outb="yes"], 310141cc406Sopenharmony_ci [AC_MSG_RESULT([no]) 311141cc406Sopenharmony_ci sane_cv_have_sys_io_h_with_inb_outb="no" 312141cc406Sopenharmony_ci AC_MSG_WARN([sys/io.h does not provide inb,outb (non i386/x32/x86_64 arch?)])]) 313141cc406Sopenharmony_ci if test "$sane_cv_have_sys_io_h_with_inb_outb" = "yes"; then 314141cc406Sopenharmony_ci AC_DEFINE(SANE_HAVE_SYS_IO_H_WITH_INB_OUTB, 1, [Define to 1 if you have the <sys/io.h> providing inb,outb.]) 315141cc406Sopenharmony_ci fi 316141cc406Sopenharmony_cielse 317141cc406Sopenharmony_ci sane_cv_have_sys_io_h_with_inb_outb="no" 318141cc406Sopenharmony_cifi 319141cc406Sopenharmony_ci 320141cc406Sopenharmony_ciSANE_PROTOTYPES 321141cc406Sopenharmony_ci 322141cc406Sopenharmony_ciif test "$ac_cv_header_os2_h" = "yes" ; then 323141cc406Sopenharmony_ci AC_DEFINE(strncasecmp, strnicmp, [Define for OS/2 only]) 324141cc406Sopenharmony_ci AC_DEFINE(strcasecmp, stricmp, [Define for OS/2 only]) 325141cc406Sopenharmony_cifi 326141cc406Sopenharmony_ci 327141cc406Sopenharmony_ciif test "$ac_cv_header_getopt_h" = "yes" ; then 328141cc406Sopenharmony_ci AC_CHECK_FUNCS(getopt_long) 329141cc406Sopenharmony_cifi 330141cc406Sopenharmony_ci 331141cc406Sopenharmony_ci# Slightly abuse the AC_LIBOBJ macro to mark files as replacement code 332141cc406Sopenharmony_ciAS_IF([test x$ac_cv_header_getopt_h != xyes \ 333141cc406Sopenharmony_ci && test x$ac_cv_func_getopt_long != xyes], 334141cc406Sopenharmony_ci [AC_LIBOBJ(getopt) 335141cc406Sopenharmony_ci AC_LIBOBJ(getopt1)]) 336141cc406Sopenharmony_ci 337141cc406Sopenharmony_cidnl *********************************************************************** 338141cc406Sopenharmony_cidnl checks for system services 339141cc406Sopenharmony_cidnl *********************************************************************** 340141cc406Sopenharmony_ciif test -c /dev/urandom ; then 341141cc406Sopenharmony_ci AC_DEFINE(HAVE_DEV_URANDOM, 1, [Is /dev/urandom available?]) 342141cc406Sopenharmony_cifi 343141cc406Sopenharmony_ci 344141cc406Sopenharmony_ciAC_ARG_WITH(systemd, 345141cc406Sopenharmony_ci AS_HELP_STRING([--with-systemd], [enable systemd support @<:@default=yes@:>@])) 346141cc406Sopenharmony_ciif test "x$with_systemd" != xno ; then 347141cc406Sopenharmony_ci PKG_CHECK_MODULES(SYSTEMD, [libsystemd], have_systemd=yes, have_systemd=no) 348141cc406Sopenharmony_ci if test "x$have_systemd" = xno; then 349141cc406Sopenharmony_ci PKG_CHECK_MODULES(SYSTEMD, [libsystemd-daemon], have_systemd=yes, have_systemd=no) 350141cc406Sopenharmony_ci fi 351141cc406Sopenharmony_ci if test "x$have_systemd" = xyes; then 352141cc406Sopenharmony_ci AC_DEFINE(HAVE_SYSTEMD, 1, [Is /usr/include/systemd/sd-daemon.h available?]) 353141cc406Sopenharmony_ci else 354141cc406Sopenharmony_ci if test "x$with_systemd" = xyes; then 355141cc406Sopenharmony_ci AC_MSG_ERROR([Systemd support was requested but systemd was not found]) 356141cc406Sopenharmony_ci fi 357141cc406Sopenharmony_ci fi 358141cc406Sopenharmony_cifi 359141cc406Sopenharmony_ci 360141cc406Sopenharmony_cidnl ****************************************************************** 361141cc406Sopenharmony_cidnl Check for USB support 362141cc406Sopenharmony_cidnl ****************************************************************** 363141cc406Sopenharmony_ci 364141cc406Sopenharmony_ciAC_ARG_WITH(usb, 365141cc406Sopenharmony_ci AS_HELP_STRING([--with-usb], [enable USB support @<:@default=check@:>@]), 366141cc406Sopenharmony_ci [], 367141cc406Sopenharmony_ci [with_usb=check]) 368141cc406Sopenharmony_ciAS_IF([test xno != "x$with_usb"], 369141cc406Sopenharmony_ci [have_usb=no 370141cc406Sopenharmony_ci AS_CASE(x$host_os, dnl odd-ball operating systems first 371141cc406Sopenharmony_ci [xbeos*], 372141cc406Sopenharmony_ci [AC_CHECK_HEADER(be/drivers/USB_scanner.h, [have_usb=yes])], 373141cc406Sopenharmony_ci [xos2*], 374141cc406Sopenharmony_ci [AC_CHECK_HEADER(usbcalls.h, 375141cc406Sopenharmony_ci [AC_CHECK_LIB(usbcall, UsbQueryNumberDevices, 376141cc406Sopenharmony_ci [USB_LIBS="-lusbcall" 377141cc406Sopenharmony_ci have_usb=yes 378141cc406Sopenharmony_ci AC_DEFINE(HAVE_USBCALLS, [1], 379141cc406Sopenharmony_ci [Define to 1 if you have usbcall.dll.]) 380141cc406Sopenharmony_ci ]) 381141cc406Sopenharmony_ci ], 382141cc406Sopenharmony_ci [], 383141cc406Sopenharmony_ci [#include <usb.h> 384141cc406Sopenharmony_ci #include <os2.h> 385141cc406Sopenharmony_ci ]) 386141cc406Sopenharmony_ci ], 387141cc406Sopenharmony_ci [dnl default to libusb-1.x, fall back to libusb-0.x if missing 388141cc406Sopenharmony_ci PKG_CHECK_MODULES([USB], [libusb-1.0], 389141cc406Sopenharmony_ci [AC_DEFINE([HAVE_LIBUSB], [1], 390141cc406Sopenharmony_ci [Define to 1 if you have libusb-1.0]) 391141cc406Sopenharmony_ci have_usb=yes 392141cc406Sopenharmony_ci ], 393141cc406Sopenharmony_ci [PKG_CHECK_MODULES([USB], [libusb >= 0.1.8], 394141cc406Sopenharmony_ci [AC_DEFINE([HAVE_LIBUSB_LEGACY], [1], 395141cc406Sopenharmony_ci [Define to 1 if you have libusb-0.1]) 396141cc406Sopenharmony_ci have_usb=yes 397141cc406Sopenharmony_ci ], 398141cc406Sopenharmony_ci [dnl 10+ years old libusb or Windows version 399141cc406Sopenharmony_ci AC_CHECK_HEADER(usb.h, 400141cc406Sopenharmony_ci AC_CHECK_LIB(usb, usb_interrupt_read, 401141cc406Sopenharmony_ci [USB_LIBS="-lusb" 402141cc406Sopenharmony_ci have_usb=yes 403141cc406Sopenharmony_ci ])) 404141cc406Sopenharmony_ci AC_CHECK_HEADERS(lusb0_usb.h, 405141cc406Sopenharmony_ci AC_CHECK_LIB(usb, usb_interrupt_read, 406141cc406Sopenharmony_ci [USB_LIBS="-lusb" 407141cc406Sopenharmony_ci have_usb=yes 408141cc406Sopenharmony_ci ])) 409141cc406Sopenharmony_ci ]) 410141cc406Sopenharmony_ci ]) 411141cc406Sopenharmony_ci ]) 412141cc406Sopenharmony_ci ]) 413141cc406Sopenharmony_ciAS_IF([test xyes = "x$with_usb" && test xyes != "x$have_usb"], 414141cc406Sopenharmony_ci [AC_MSG_ERROR([USB support requested but required libraries not found.]) 415141cc406Sopenharmony_ci ]) 416141cc406Sopenharmony_ciAM_CONDITIONAL([have_usblib], [test x != "x$USB_LIBS"]) 417141cc406Sopenharmony_ci 418141cc406Sopenharmony_cidnl ****************************************************************** 419141cc406Sopenharmony_cidnl Check for libcurl availability 420141cc406Sopenharmony_cidnl ****************************************************************** 421141cc406Sopenharmony_ciAC_ARG_WITH(libcurl, 422141cc406Sopenharmony_ci AS_HELP_STRING([--with-libcurl], 423141cc406Sopenharmony_ci [enable functionality that needs libcurl @<:@default=check@:>@]), 424141cc406Sopenharmony_ci [], 425141cc406Sopenharmony_ci [with_libcurl=check]) 426141cc406Sopenharmony_ciAC_DEFINE(HAVE_LIBCURL, 427141cc406Sopenharmony_ci [0], [Define to 1 if libcurl is available]) 428141cc406Sopenharmony_ciAS_IF([test xno != "x$with_libcurl"], 429141cc406Sopenharmony_ci [PKG_CHECK_MODULES(libcurl, [libcurl], 430141cc406Sopenharmony_ci [AC_DEFINE([HAVE_LIBCURL], [1]) 431141cc406Sopenharmony_ci with_libcurl=yes 432141cc406Sopenharmony_ci ], 433141cc406Sopenharmony_ci [AS_IF([test xcheck != "x$with_libcurl"], 434141cc406Sopenharmony_ci [AC_MSG_ERROR([libcurl requested but not found])]) 435141cc406Sopenharmony_ci with_libcurl=no 436141cc406Sopenharmony_ci ]) 437141cc406Sopenharmony_ci ]) 438141cc406Sopenharmony_ciAM_CONDITIONAL([have_libcurl], [test x != "x$libcurl_LIBS"]) 439141cc406Sopenharmony_ci 440141cc406Sopenharmony_cidnl ****************************************************************** 441141cc406Sopenharmony_cidnl Check for poppler-glib availability 442141cc406Sopenharmony_cidnl ****************************************************************** 443141cc406Sopenharmony_ciAC_ARG_WITH(poppler-glib, 444141cc406Sopenharmony_ci AS_HELP_STRING([--with-poppler-glib], 445141cc406Sopenharmony_ci [enable functionality that needs poppler-glib @<:@default=check@:>@]), 446141cc406Sopenharmony_ci [], 447141cc406Sopenharmony_ci [with_poppler_glib=check]) 448141cc406Sopenharmony_ciAC_DEFINE(HAVE_POPPLER_GLIB, 449141cc406Sopenharmony_ci [0], [Define to 1 if libpoppler-glib is available]) 450141cc406Sopenharmony_ciAS_IF([test xno != "x$with_poppler_glib"], 451141cc406Sopenharmony_ci [PKG_CHECK_MODULES(POPPLER_GLIB, [poppler-glib], 452141cc406Sopenharmony_ci [AC_DEFINE([HAVE_POPPLER_GLIB], [1]) 453141cc406Sopenharmony_ci with_poppler_glib=yes 454141cc406Sopenharmony_ci ], 455141cc406Sopenharmony_ci [AS_IF([test xcheck != "x$with_poppler_glib"], 456141cc406Sopenharmony_ci [AC_MSG_ERROR([poppler-glib requested but not found])]) 457141cc406Sopenharmony_ci with_poppler_glib=no 458141cc406Sopenharmony_ci ]) 459141cc406Sopenharmony_ci ]) 460141cc406Sopenharmony_ciAM_CONDITIONAL([have_poppler_glib], [test x != "x$POPPLER_GLIB_LIBS"]) 461141cc406Sopenharmony_ci 462141cc406Sopenharmony_cidnl ****************************************************************** 463141cc406Sopenharmony_cidnl Check for USB record/replay support 464141cc406Sopenharmony_cidnl ****************************************************************** 465141cc406Sopenharmony_ciAC_ARG_WITH(usb_record_replay, 466141cc406Sopenharmony_ci AS_HELP_STRING([--with-usb-record-replay], 467141cc406Sopenharmony_ci [enable USB record and replay to XML files @<:@default=yes@:>@])) 468141cc406Sopenharmony_ci 469141cc406Sopenharmony_ciif test "x$with_usb_record_replay" != "xno"; then 470141cc406Sopenharmony_ci PKG_CHECK_MODULES([XML], [libxml-2.0], have_libxml=yes, have_libxml=no) 471141cc406Sopenharmony_ci if test "x$have_libxml" = xyes; then 472141cc406Sopenharmony_ci AC_DEFINE(HAVE_LIBXML2, 1, [Define to 1 if libxml2 is available]) 473141cc406Sopenharmony_ci AC_DEFINE(WITH_USB_RECORD_REPLAY, 1, [define if USB record replay is enabled]) 474141cc406Sopenharmony_ci else 475141cc406Sopenharmony_ci if test "x$with_usb_record_replay" = xyes; then 476141cc406Sopenharmony_ci AC_MSG_ERROR([USB record and replay support was requested but libxml-2.0 was not found]) 477141cc406Sopenharmony_ci fi 478141cc406Sopenharmony_ci fi 479141cc406Sopenharmony_cifi 480141cc406Sopenharmony_ciAM_CONDITIONAL([have_libxml2], [test x != "x$XML_LIBS"]) 481141cc406Sopenharmony_ci 482141cc406Sopenharmony_cidnl ************ 483141cc406Sopenharmony_cidnl SCSI Support 484141cc406Sopenharmony_cidnl ************ 485141cc406Sopenharmony_ci 486141cc406Sopenharmony_cidnl FIXME: These are a lot of header files to scan. We should 487141cc406Sopenharmony_cidnl scan for just one that is unique per platform and then do 488141cc406Sopenharmony_cidnl conditional scans for more specific only as needed. 489141cc406Sopenharmony_ci 490141cc406Sopenharmony_ci# Unset VERSION during the SCSI header check 491141cc406Sopenharmony_cised "s!^#define VERSION .*!/* & */!" confdefs.h > confdefs.h.tmp 492141cc406Sopenharmony_cimv confdefs.h.tmp confdefs.h 493141cc406Sopenharmony_ci 494141cc406Sopenharmony_ciAC_CHECK_HEADERS(IOKit/scsi/SCSITaskLib.h IOKit/cdb/IOSCSILib.h \ 495141cc406Sopenharmony_ci IOKit/scsi/SCSICommandOperationCodes.h \ 496141cc406Sopenharmony_ci IOKit/scsi-commands/SCSICommandOperationCodes.h scsi.h sys/scsi.h \ 497141cc406Sopenharmony_ci sys/scsicmd.h sys/scsiio.h bsd/dev/scsireg.h scsi/sg.h \ 498141cc406Sopenharmony_ci camlib.h gscdds.h sys/scsi/scsi.h sys/scsi/sgdefs.h \ 499141cc406Sopenharmony_ci sys/scsi/targets/scgio.h apollo/scsi.h sys/sdi_comm.h \ 500141cc406Sopenharmony_ci sys/passthrudef.h) 501141cc406Sopenharmony_ci 502141cc406Sopenharmony_ci# Restore VERSION 503141cc406Sopenharmony_cised "s!/\* \(#define VERSION .*\) \*/!\1!" confdefs.h > confdefs.h.tmp 504141cc406Sopenharmony_cimv confdefs.h.tmp confdefs.h 505141cc406Sopenharmony_ci 506141cc406Sopenharmony_ciAC_CHECK_HEADERS([io/cam/cam.h],,,[#include <io/common/iotypes.h>]) 507141cc406Sopenharmony_ciAC_CHECK_HEADERS([ntddscsi.h ddk/ntddscsi.h],,,[#include <windows.h>]) 508141cc406Sopenharmony_ci 509141cc406Sopenharmony_cidnl FreeBSD < 3 510141cc406Sopenharmony_ciif test "$ac_cv_header_sys_scsiio_h" = "yes" \ 511141cc406Sopenharmony_ci && test "$ac_cv_header_scsi_h" = "yes"; then 512141cc406Sopenharmony_ci AC_MSG_CHECKING([if 'scsireq_t' needs to be defined as 'struct scsireq']) 513141cc406Sopenharmony_ci AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 514141cc406Sopenharmony_ci#include <sys/scsiio.h> 515141cc406Sopenharmony_ci#include <scsi.h> 516141cc406Sopenharmony_ci]], [[scsireq_t req]])],, 517141cc406Sopenharmony_ci [AC_MSG_RESULT(yes); 518141cc406Sopenharmony_ci AC_DEFINE(scsireq_t, struct scsireq_t, 519141cc406Sopenharmony_ci [Define scsireq_t as \'struct scsireq\' if necessary.])]) 520141cc406Sopenharmony_cifi 521141cc406Sopenharmony_ciAC_CHECK_LIB(scsi, scsireq_enter, SCSI_LIBS="-lscsi") # FreeBSD needs this 522141cc406Sopenharmony_ci 523141cc406Sopenharmony_cidnl FreeBSD >= 3 524141cc406Sopenharmony_ciAC_CHECK_LIB(cam, cam_open_device, SCSI_LIBS="-lcam") # FreeBSD 3+ needs this 525141cc406Sopenharmony_ci 526141cc406Sopenharmony_ciAC_CHECK_FUNCS(scsireq_enter) 527141cc406Sopenharmony_ci 528141cc406Sopenharmony_ciif test "$ac_cv_header_scsi_sg_h" = "yes"; then 529141cc406Sopenharmony_ci AC_MSG_CHECKING([for sg_header.target_status in <scsi/sg.h>]) 530141cc406Sopenharmony_ci AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 531141cc406Sopenharmony_ci#include <sys/types.h> 532141cc406Sopenharmony_ci#include <scsi/sg.h> 533141cc406Sopenharmony_ci]],[[ 534141cc406Sopenharmony_cistruct sg_header hdr; 535141cc406Sopenharmony_cihdr.target_status = 1; 536141cc406Sopenharmony_cireturn 0; 537141cc406Sopenharmony_ci]])],[AC_MSG_RESULT(yes); 538141cc406Sopenharmony_ci AC_DEFINE(HAVE_SG_TARGET_STATUS,1, 539141cc406Sopenharmony_ci [Define if sg_header.target_status is available.])], 540141cc406Sopenharmony_ci AC_MSG_RESULT(no)) 541141cc406Sopenharmony_cifi 542141cc406Sopenharmony_ci 543141cc406Sopenharmony_ciif test "$ac_cv_header_IOKit_scsi_SCSITaskLib_h" = "yes"; then 544141cc406Sopenharmony_ci AC_MSG_CHECKING([for SCSITaskSGElement in IOKit/scsi/SCSITaskLib.h]) 545141cc406Sopenharmony_ci AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 546141cc406Sopenharmony_ci#undef VERSION 547141cc406Sopenharmony_ci#include <IOKit/scsi/SCSITaskLib.h> 548141cc406Sopenharmony_ci]],[[ 549141cc406Sopenharmony_ciSCSITaskSGElement range; 550141cc406Sopenharmony_cireturn 0; 551141cc406Sopenharmony_ci]])],[AC_MSG_RESULT(yes); 552141cc406Sopenharmony_ci AC_DEFINE(HAVE_SCSITASKSGELEMENT, 1, 553141cc406Sopenharmony_ci [Define if SCSITaskSGElement is available.])], 554141cc406Sopenharmony_ci AC_MSG_RESULT(no)) 555141cc406Sopenharmony_cifi 556141cc406Sopenharmony_ci 557141cc406Sopenharmony_ci# Multiple platforms can set SCSI_LIBS so do substitution at end. 558141cc406Sopenharmony_ciAC_SUBST(SCSI_LIBS) 559141cc406Sopenharmony_ci 560141cc406Sopenharmony_ciAC_ARG_ENABLE(scsibuffersize, 561141cc406Sopenharmony_ci AS_HELP_STRING([--enable-scsibuffersize=N], 562141cc406Sopenharmony_ci [specify the default size in bytes of the buffer for SCSI 563141cc406Sopenharmony_ci commands @<:@default=131072@:>@]), 564141cc406Sopenharmony_ci [set_scsibuffersize="$enableval"], [set_scsibuffersize=131072]) 565141cc406Sopenharmony_ciAC_DEFINE_UNQUOTED(SCSIBUFFERSIZE, $set_scsibuffersize, 566141cc406Sopenharmony_ci [SCSI command buffer size]) 567141cc406Sopenharmony_cidnl FIXME: Move this to configuration printout area but probably 568141cc406Sopenharmony_cidnl but probably needs to be wrapped by what ever uses it so its 569141cc406Sopenharmony_cidnl only printed when used. 570141cc406Sopenharmony_ciecho "scsi buffersize: $set_scsibuffersize" 571141cc406Sopenharmony_ci 572141cc406Sopenharmony_ciAC_ARG_ENABLE(scsi-directio, 573141cc406Sopenharmony_ci AS_HELP_STRING([--enable-scsi-directio], 574141cc406Sopenharmony_ci [enable SCSI direct IO (Linux only, dangerous, see 575141cc406Sopenharmony_ci README.linux)]), 576141cc406Sopenharmony_ci [ 577141cc406Sopenharmony_ci if eval "test x$enable_scsi_directio = xyes"; then 578141cc406Sopenharmony_ci AM_CFLAGS="$AM_CFLAGS -DENABLE_SCSI_DIRECTIO" 579141cc406Sopenharmony_ci fi 580141cc406Sopenharmony_ci ]) 581141cc406Sopenharmony_ci 582141cc406Sopenharmony_cidnl **** 583141cc406Sopenharmony_cidnl IPv6 584141cc406Sopenharmony_cidnl **** 585141cc406Sopenharmony_ci 586141cc406Sopenharmony_cidnl check for IPv6 (can be overridden by --enable-ipv6) 587141cc406Sopenharmony_ciif test "$ac_cv_func_getnameinfo" = "yes" \ 588141cc406Sopenharmony_ci && test "$ac_cv_func_getaddrinfo" = "yes" ; then 589141cc406Sopenharmony_ci SANE_CHECK_IPV6 590141cc406Sopenharmony_cielse 591141cc406Sopenharmony_ci ipv6="no" 592141cc406Sopenharmony_cifi 593141cc406Sopenharmony_ci 594141cc406Sopenharmony_cidnl *********************************************************************** 595141cc406Sopenharmony_cidnl initialize libtool 596141cc406Sopenharmony_cidnl *********************************************************************** 597141cc406Sopenharmony_ciAC_ARG_ENABLE(preload, 598141cc406Sopenharmony_ci AS_HELP_STRING([--disable-preload], 599141cc406Sopenharmony_ci [Disable preloading of backends]), 600141cc406Sopenharmony_ci [enable_preload=$enableval], [enable_preload=auto]) 601141cc406Sopenharmony_ci 602141cc406Sopenharmony_cidnl Windows (cygwin/mingw), BeOS, and OS/2 need this. 603141cc406Sopenharmony_cicase $host_os in 604141cc406Sopenharmony_ci cygwin* | mingw* | beos* | os2*) 605141cc406Sopenharmony_ci AM_LDFLAGS="$AM_LDFLAGS -no-undefined" 606141cc406Sopenharmony_ciesac 607141cc406Sopenharmony_ci 608141cc406Sopenharmony_cidnl Check for lock dir 609141cc406Sopenharmony_ci 610141cc406Sopenharmony_ciAC_ARG_WITH(lockdir, AS_HELP_STRING([--with-lockdir=DIR], 611141cc406Sopenharmony_ci [set SANE lockdir @<:@localstatedir/lock@:>@]), 612141cc406Sopenharmony_ci [locksanedir=$withval],[locksanedir=${localstatedir}/lock]) 613141cc406Sopenharmony_ciAC_SUBST(locksanedir) 614141cc406Sopenharmony_ci 615141cc406Sopenharmony_ciconfigdir="${sysconfdir}/sane.d" 616141cc406Sopenharmony_ciAC_SUBST(configdir) 617141cc406Sopenharmony_ci 618141cc406Sopenharmony_cidnl *********************************************************************** 619141cc406Sopenharmony_cidnl enable/disable backends and features based on previous tests and user's 620141cc406Sopenharmony_cidnl choice 621141cc406Sopenharmony_cidnl *********************************************************************** 622141cc406Sopenharmony_ci 623141cc406Sopenharmony_ciAM_CPPFLAGS="${AM_CPPFLAGS} -DPATH_SANE_CONFIG_DIR=\$(configdir) \ 624141cc406Sopenharmony_ci -DPATH_SANE_DATA_DIR=\$(datadir) \ 625141cc406Sopenharmony_ci -DPATH_SANE_LOCK_DIR=\$(locksanedir) \ 626141cc406Sopenharmony_ci -DV_MAJOR=${V_MAJOR} -DV_MINOR=${V_MINOR}" 627141cc406Sopenharmony_ci 628141cc406Sopenharmony_ciif test "${ac_cv_header_sys_socket_h}" = "no"; then 629141cc406Sopenharmony_ci echo "*** disabling saned (sys/socket.h not found)" 630141cc406Sopenharmony_ci SANED= 631141cc406Sopenharmony_cielse 632141cc406Sopenharmony_ci SANED=saned 633141cc406Sopenharmony_cifi 634141cc406Sopenharmony_ciAM_CONDITIONAL(COMPILE_SANED, test x$SANED = xsaned) 635141cc406Sopenharmony_ci 636141cc406Sopenharmony_cidnl These are the backends that are build in any case: 637141cc406Sopenharmony_ci 638141cc406Sopenharmony_ciAC_ARG_ENABLE(local-backends, 639141cc406Sopenharmony_ci AS_HELP_STRING([--disable-local-backends], 640141cc406Sopenharmony_ci [turn off compilation of all backends but net])) 641141cc406Sopenharmony_ci 642141cc406Sopenharmony_ciALL_BACKENDS="abaton agfafocus apple artec artec_eplus48u as6e \ 643141cc406Sopenharmony_ci avision bh canon canon630u canon_dr canon_lide70 canon_pp cardscan \ 644141cc406Sopenharmony_ci coolscan coolscan2 coolscan3 dc25 dc210 dc240 \ 645141cc406Sopenharmony_ci dell1600n_net dmc epjitsu epson epson2 epsonds escl fujitsu \ 646141cc406Sopenharmony_ci genesys gphoto2 gt68xx hp hp3500 hp3900 hp4200 hp5400 \ 647141cc406Sopenharmony_ci hp5590 hpsj5s hpljm1005 hs2p ibm kodak kodakaio kvs1025 kvs20xx \ 648141cc406Sopenharmony_ci kvs40xx leo lexmark ma1509 magicolor \ 649141cc406Sopenharmony_ci matsushita microtek microtek2 mustek mustek_pp \ 650141cc406Sopenharmony_ci mustek_usb mustek_usb2 nec net niash pie pieusb pint \ 651141cc406Sopenharmony_ci pixma plustek plustek_pp qcam ricoh ricoh2 rts8891 s9036 \ 652141cc406Sopenharmony_ci sceptre sharp sm3600 sm3840 snapscan sp15c st400 \ 653141cc406Sopenharmony_ci stv680 tamarack teco1 teco2 teco3 test u12 umax \ 654141cc406Sopenharmony_ci umax_pp umax1220u v4l xerox_mfp p5" 655141cc406Sopenharmony_ci 656141cc406Sopenharmony_ci# If user specifies backends manually then cause configure 657141cc406Sopenharmony_ci# to fail if its detected it can't be compiled. If we 658141cc406Sopenharmony_ci# are in automatic mode then remove backend from list instead. 659141cc406Sopenharmony_ciuser_selected_backends="yes" 660141cc406Sopenharmony_ci 661141cc406Sopenharmony_ciAC_ARG_VAR(BACKENDS, [list of backends to compile]) 662141cc406Sopenharmony_ciif eval "test x$enable_local_backends = xno"; then 663141cc406Sopenharmony_ci BACKENDS="net" 664141cc406Sopenharmony_cielse 665141cc406Sopenharmony_ci if test "${BACKENDS}" != "" ; then 666141cc406Sopenharmony_ci AC_MSG_NOTICE([Manually selected backends: ${BACKENDS}]) 667141cc406Sopenharmony_ci else 668141cc406Sopenharmony_ci BACKENDS="$ALL_BACKENDS" 669141cc406Sopenharmony_ci user_selected_backends="no" 670141cc406Sopenharmony_ci fi 671141cc406Sopenharmony_cifi 672141cc406Sopenharmony_ci 673141cc406Sopenharmony_ciif test "${sane_cv_use_libjpeg}" = "yes"; then 674141cc406Sopenharmony_ci SANEI_SANEI_JPEG_LO="../sanei/sanei_jpeg.lo" 675141cc406Sopenharmony_ci saved_LIBS="${LIBS}" 676141cc406Sopenharmony_ci LIBS="${JPEG_LIBS}" 677141cc406Sopenharmony_ci AC_CHECK_FUNCS(jpeg_crop_scanline jpeg_skip_scanlines) 678141cc406Sopenharmony_ci LIBS="${saved_LIBS}" 679141cc406Sopenharmony_cifi 680141cc406Sopenharmony_ciAM_CONDITIONAL(HAVE_JPEG, test x$sane_cv_use_libjpeg = xyes) 681141cc406Sopenharmony_ciAC_SUBST(SANEI_SANEI_JPEG_LO) 682141cc406Sopenharmony_ci 683141cc406Sopenharmony_ciSANE_CHECK_BACKENDS 684141cc406Sopenharmony_ci 685141cc406Sopenharmony_ciAC_ARG_ENABLE(pnm-backend, 686141cc406Sopenharmony_ci AS_HELP_STRING([--enable-pnm-backend], 687141cc406Sopenharmony_ci [enable the pnm backend for testing frontends (possible security risk, see PROBLEMS file)]), 688141cc406Sopenharmony_ci [FILTERED_BACKENDS="${FILTERED_BACKENDS} pnm"], 689141cc406Sopenharmony_ci [echo "*** pnm backend not manually selected - disabling"]) 690141cc406Sopenharmony_ci 691141cc406Sopenharmony_ciBACKENDS="$FILTERED_BACKENDS" 692141cc406Sopenharmony_ciBACKEND_LIBS_ENABLED="" 693141cc406Sopenharmony_ciBACKEND_CONFS_ENABLED="" 694141cc406Sopenharmony_ciBACKEND_MANS_ENABLED="" 695141cc406Sopenharmony_cifor backend in ${BACKENDS} ; do 696141cc406Sopenharmony_ci BACKEND_LIBS_ENABLED="${BACKEND_LIBS_ENABLED} libsane-${backend}.la" 697141cc406Sopenharmony_ci BACKEND_CONFS_ENABLED="${BACKEND_CONFS_ENABLED} ${backend}.conf" 698141cc406Sopenharmony_ci BACKEND_MANS_ENABLED="${BACKEND_MANS_ENABLED} sane-${backend}.5" 699141cc406Sopenharmony_ci if test x$backend = xgenesys; then 700141cc406Sopenharmony_ci with_genesys_tests=yes 701141cc406Sopenharmony_ci fi 702141cc406Sopenharmony_ci if test x$backend = xumax_pp; then 703141cc406Sopenharmony_ci install_umax_pp_tools=yes 704141cc406Sopenharmony_ci fi 705141cc406Sopenharmony_cidone 706141cc406Sopenharmony_ciAC_SUBST(BACKEND_LIBS_ENABLED) 707141cc406Sopenharmony_ciAM_CONDITIONAL(WITH_GENESYS_TESTS, test xyes = x$with_genesys_tests) 708141cc406Sopenharmony_ciAM_CONDITIONAL(INSTALL_UMAX_PP_TOOLS, test xyes = x$install_umax_pp_tools) 709141cc406Sopenharmony_ci 710141cc406Sopenharmony_ciAC_ARG_VAR(PRELOADABLE_BACKENDS, [list of backends to preload into single DLL]) 711141cc406Sopenharmony_ciif test "${enable_preload}" = "auto"; then 712141cc406Sopenharmony_ci if test "${enable_shared}" = "no" || test "${enable_dynamic}" != "yes"; then 713141cc406Sopenharmony_ci enable_preload=yes 714141cc406Sopenharmony_ci fi 715141cc406Sopenharmony_cifi 716141cc406Sopenharmony_ciif test "${enable_preload}" = "yes"; then 717141cc406Sopenharmony_ci echo "preloading backends into DLL" 718141cc406Sopenharmony_ci 719141cc406Sopenharmony_ci # If user specifies backends manually then cause configure 720141cc406Sopenharmony_ci # to fail if its detected it can't be compiled. If we 721141cc406Sopenharmony_ci # are in automatic mode then remove backend from list instead. 722141cc406Sopenharmony_ci user_selected_backends="yes" 723141cc406Sopenharmony_ci 724141cc406Sopenharmony_ci if eval "test x$enable_local_backends = xno"; then 725141cc406Sopenharmony_ci PRELOADABLE_BACKENDS="net" 726141cc406Sopenharmony_ci else 727141cc406Sopenharmony_ci if test "${PRELOADABLE_BACKENDS}" != "" ; then 728141cc406Sopenharmony_ci AC_MSG_NOTICE([Manually selected preloadable backends: ${PRELOADABLE_BACKENDS}]) 729141cc406Sopenharmony_ci else 730141cc406Sopenharmony_ci PRELOADABLE_BACKENDS="$BACKENDS" 731141cc406Sopenharmony_ci user_selected_backends="no" 732141cc406Sopenharmony_ci fi 733141cc406Sopenharmony_ci fi 734141cc406Sopenharmony_ci 735141cc406Sopenharmony_ci saved_BACKENDS="$BACKENDS" 736141cc406Sopenharmony_ci BACKENDS="${PRELOADABLE_BACKENDS}" 737141cc406Sopenharmony_ci 738141cc406Sopenharmony_ci SANE_CHECK_BACKENDS 739141cc406Sopenharmony_ci 740141cc406Sopenharmony_ci PRELOADABLE_BACKENDS="$FILTERED_BACKENDS" 741141cc406Sopenharmony_ci BACKENDS="$saved_BACKENDS" 742141cc406Sopenharmony_cielse 743141cc406Sopenharmony_ci PRELOADABLE_BACKENDS="" 744141cc406Sopenharmony_cifi 745141cc406Sopenharmony_ciPRELOADABLE_BACKENDS_ENABLED="" 746141cc406Sopenharmony_ci# Do not initialize BACKEND_CONFS_ENABLED so that its a combination 747141cc406Sopenharmony_ci# of all backends. 748141cc406Sopenharmony_cifor backend in ${PRELOADABLE_BACKENDS} ; do 749141cc406Sopenharmony_ci BACKEND_CONFS_ENABLED="${BACKEND_CONFS_ENABLED} ${backend}.conf" 750141cc406Sopenharmony_ci BACKEND_MANS_ENABLED="${BACKEND_MANS_ENABLED} sane-${backend}.5" 751141cc406Sopenharmony_ci # Special hacks. Normally, we create a convenience library that 752141cc406Sopenharmony_ci # matches the backend's name but in some cases that will conflict 753141cc406Sopenharmony_ci # with an external library name that also matches backend name. 754141cc406Sopenharmony_ci # Work around that here by renaming internal library. 755141cc406Sopenharmony_ci if test "${backend}" = "gphoto2"; then 756141cc406Sopenharmony_ci backend=gphoto2_i 757141cc406Sopenharmony_ci fi 758141cc406Sopenharmony_ci PRELOADABLE_BACKENDS_ENABLED="${PRELOADABLE_BACKENDS_ENABLED} lib${backend}.la" 759141cc406Sopenharmony_cidone 760141cc406Sopenharmony_ciAM_CONDITIONAL([preloadable_backends_enabled], 761141cc406Sopenharmony_ci [test x != "x$PRELOADABLE_BACKENDS_ENABLED"]) 762141cc406Sopenharmony_ci 763141cc406Sopenharmony_ciAC_SUBST(PRELOADABLE_BACKENDS) 764141cc406Sopenharmony_ciAC_SUBST(PRELOADABLE_BACKENDS_ENABLED) 765141cc406Sopenharmony_ciAC_SUBST(BACKEND_CONFS_ENABLED) 766141cc406Sopenharmony_ciAC_SUBST(BACKEND_MANS_ENABLED) 767141cc406Sopenharmony_ci 768141cc406Sopenharmony_cidnl in BeOS, backends are not installed in lib/sane, but add-ons/sane/ 769141cc406Sopenharmony_cidnl we account for both installing in /boot/beos and ~/config 770141cc406Sopenharmony_cicase $host_os in 771141cc406Sopenharmony_ci beos*) 772141cc406Sopenharmony_ci libdir='${exec_prefix}/add-ons' 773141cc406Sopenharmony_ci ;; 774141cc406Sopenharmony_ciesac 775141cc406Sopenharmony_ci 776141cc406Sopenharmony_ciAC_ARG_ENABLE(parport-directio, 777141cc406Sopenharmony_ci AS_HELP_STRING([--enable-parport-directio], 778141cc406Sopenharmony_ci [enable direct hardware access to the parallel port, so 779141cc406Sopenharmony_ci frontends will require special permission level]), 780141cc406Sopenharmony_ci [ 781141cc406Sopenharmony_ci if eval "test x$enable_parport_directio = xyes"; then 782141cc406Sopenharmony_ci AM_CFLAGS="$AM_CFLAGS -DENABLE_PARPORT_DIRECTIO" 783141cc406Sopenharmony_ci fi 784141cc406Sopenharmony_ci ]) 785141cc406Sopenharmony_ci 786141cc406Sopenharmony_cidnl *********************************************************************** 787141cc406Sopenharmony_cidnl Write output files 788141cc406Sopenharmony_cidnl *********************************************************************** 789141cc406Sopenharmony_ci 790141cc406Sopenharmony_ciAC_SUBST(AM_CPPFLAGS) 791141cc406Sopenharmony_ciAC_SUBST(AM_CFLAGS) 792141cc406Sopenharmony_ciAC_SUBST(AM_CXXFLAGS) 793141cc406Sopenharmony_ciAC_SUBST(AM_LDFLAGS) 794141cc406Sopenharmony_ci 795141cc406Sopenharmony_ciAC_CONFIG_FILES([Makefile lib/Makefile sanei/Makefile frontend/Makefile \ 796141cc406Sopenharmony_ci japi/Makefile backend/Makefile include/Makefile doc/Makefile \ 797141cc406Sopenharmony_ci po/Makefile.in testsuite/Makefile \ 798141cc406Sopenharmony_ci testsuite/backend/Makefile \ 799141cc406Sopenharmony_ci testsuite/backend/genesys/Makefile \ 800141cc406Sopenharmony_ci testsuite/sanei/Makefile testsuite/tools/Makefile \ 801141cc406Sopenharmony_ci tools/Makefile doc/doxygen-sanei.conf doc/doxygen-genesys.conf]) 802141cc406Sopenharmony_ciAC_CONFIG_FILES([tools/sane-config], [chmod a+x tools/sane-config]) 803141cc406Sopenharmony_ciAC_CONFIG_FILES([tools/sane-backends.pc]) 804141cc406Sopenharmony_ciAC_OUTPUT 805141cc406Sopenharmony_ci 806141cc406Sopenharmony_cidnl *********************************************************************** 807141cc406Sopenharmony_cidnl print configuration information 808141cc406Sopenharmony_cidnl *********************************************************************** 809141cc406Sopenharmony_ci 810141cc406Sopenharmony_ciecho "-> Variables used for compilation/linking:" 811141cc406Sopenharmony_ciecho AM_CPPFLAGS=\"${AM_CPPFLAGS}\" 812141cc406Sopenharmony_ciecho AM_CFLAGS=\"${AM_CFLAGS}\" 813141cc406Sopenharmony_ciecho AM_CXXFLAGS=\"${AM_CXXFLAGS}\" 814141cc406Sopenharmony_ciecho AM_LDFLAGS=\"${AM_LDFLAGS}\" 815141cc406Sopenharmony_ciecho LIBS=\"${LIBS}\" 816141cc406Sopenharmony_ciecho "-> Installation directories:" 817141cc406Sopenharmony_ciecho "Configuration: `eval eval echo ${sysconfdir}`" 818141cc406Sopenharmony_ciecho "Libraries: `eval eval echo ${libdir}`" 819141cc406Sopenharmony_ciecho "Binaries: `eval eval echo ${bindir}` and `eval eval echo ${sbindir}`" 820141cc406Sopenharmony_ciecho "Manpages: `eval eval echo ${mandir}`" 821141cc406Sopenharmony_ciecho "Documentation: `eval eval echo ${docdir}`" 822141cc406Sopenharmony_ciif eval "test x$INSTALL_LOCKPATH = xinstall-lockpath" ; then 823141cc406Sopenharmony_ci echo "Lockfiles: `eval eval echo ${locksanedir}`" 824141cc406Sopenharmony_cielse 825141cc406Sopenharmony_ci echo "Lockfiles: Feature is disabled!" 826141cc406Sopenharmony_cifi 827141cc406Sopenharmony_ciecho "-> Network parameters:" 828141cc406Sopenharmony_ciif test "${SANED}" = "saned" ; then 829141cc406Sopenharmony_ci echo "Build saned: yes" 830141cc406Sopenharmony_cielse 831141cc406Sopenharmony_ci echo "Build saned: no" 832141cc406Sopenharmony_cifi 833141cc406Sopenharmony_ciecho "IPv6 support: `eval eval echo ${ipv6}`" 834141cc406Sopenharmony_ciecho "Avahi support: `eval eval echo ${with_avahi}`" 835141cc406Sopenharmony_ciecho "cURL support: `eval eval echo ${with_libcurl}`" 836141cc406Sopenharmony_ciecho "POPPLER_GLIB support: `eval eval echo ${with_poppler_glib}`" 837141cc406Sopenharmony_ciecho "SNMP support: `eval eval echo ${with_snmp}`" 838141cc406Sopenharmony_ciecho "-> The following backends will be built:" 839141cc406Sopenharmony_cifor backend in ${BACKENDS} ; do 840141cc406Sopenharmony_ci echo $ECHO_N "${backend} " 841141cc406Sopenharmony_cidone 842141cc406Sopenharmony_ciecho 843141cc406Sopenharmony_ciecho 844141cc406Sopenharmony_ciecho "-> The following preload backends will be built:" 845141cc406Sopenharmony_cifor backend in ${PRELOADABLE_BACKENDS} ; do 846141cc406Sopenharmony_ci echo $ECHO_N "${backend} " 847141cc406Sopenharmony_cidone 848141cc406Sopenharmony_ciecho 849141cc406Sopenharmony_ci 850141cc406Sopenharmony_ciif test "$SANE_CONFIG_PATH" != "no" ; then 851141cc406Sopenharmony_ci SANE_INSTALLED_VERSION=`$SANE_CONFIG_PATH --version` 852141cc406Sopenharmony_ci SANE_INSTALLED_PREFIX=`$SANE_CONFIG_PATH --prefix` 853141cc406Sopenharmony_ci if test "$SANE_INSTALLED_PREFIX" != "$prefix" ; then 854141cc406Sopenharmony_ci echo "*** WARNING: SANE is already installed (version $SANE_INSTALLED_VERSION). The old" 855141cc406Sopenharmony_ci echo "*** installation is at $SANE_INSTALLED_PREFIX while SANE will now be installed" 856141cc406Sopenharmony_ci echo "*** at $prefix. It is recommended to uninstall the old SANE version" 857141cc406Sopenharmony_ci echo "*** before installing the new one to avoid problems." 858141cc406Sopenharmony_ci fi 859141cc406Sopenharmony_cielse 860141cc406Sopenharmony_ci if test "$LIBSANE_EXISTS" = "yes" ; then 861141cc406Sopenharmony_ci echo "*** Warning: An old version of SANE was detected but the sane-config program" 862141cc406Sopenharmony_ci echo "*** couldn't be found. If you encounter any problems with SANE remove the old" 863141cc406Sopenharmony_ci echo "*** SANE files and reinstall this version." 864141cc406Sopenharmony_ci fi 865141cc406Sopenharmony_cifi 866141cc406Sopenharmony_ciif eval "test x${sysconfdir} = x/usr/etc" ; then 867141cc406Sopenharmony_ci echo "*** WARNING: Configuration files are stored in /usr/etc. If this is not" 868141cc406Sopenharmony_ci echo "*** intended, use --sysconfdir to set another path (e.g. "/etc")." 869141cc406Sopenharmony_cifi 870141cc406Sopenharmony_ciif test "$SELECTED_BACKENDS" != "" ; then 871141cc406Sopenharmony_ci echo "*** Warning: Local backends have been disabled. This means that scanners" 872141cc406Sopenharmony_ci echo "*** connected to your local computer won't be supported. Only a network" 873141cc406Sopenharmony_ci echo "*** connection to a remote host is possible." 874141cc406Sopenharmony_cifi 875141cc406Sopenharmony_ciif test "$with_usb" != "no" && test "$have_usb" != "yes" ; then 876141cc406Sopenharmony_ci echo "*** Warning: sane-backends will be built without USB support. There may" 877141cc406Sopenharmony_ci echo "*** be valid reasons to do so, e.g. if you don't use USB scanners or on" 878141cc406Sopenharmony_ci echo "*** platforms without USB support but generally this means that you" 879141cc406Sopenharmony_ci echo "*** can't use USB devices with SANE. The most probable cause is that" 880141cc406Sopenharmony_ci if test "${ac_cv_header_usb_h}" != "yes"; then 881141cc406Sopenharmony_ci echo "*** the libusb header file usb.h is not installed. If you use Linux" 882141cc406Sopenharmony_ci echo "*** you may need a package called 'libusb-dev', 'libusb-devel' or similar." 883141cc406Sopenharmony_ci else 884141cc406Sopenharmony_ci echo "*** libusb is not installed at all or is too old. See README." 885141cc406Sopenharmony_ci fi 886141cc406Sopenharmony_cifi 887141cc406Sopenharmony_ci 888141cc406Sopenharmony_ciecho "****************************************************************" 889141cc406Sopenharmony_ciecho "* Please be sure to read file PROBLEMS in this directory *" 890141cc406Sopenharmony_ciecho "* BEFORE running any of the SANE applications. Some devices *" 891141cc406Sopenharmony_ciecho "* may be damaged by improper operation, so please do heed this *" 892141cc406Sopenharmony_ciecho "* advice. *" 893141cc406Sopenharmony_ciecho "****************************************************************" 894