1141cc406Sopenharmony_ciHow to configure, build, and install SANE. 2141cc406Sopenharmony_ci 3141cc406Sopenharmony_ci 4141cc406Sopenharmony_ciIntroduction: 5141cc406Sopenharmony_ci============= 6141cc406Sopenharmony_ciSANE stands for Scanner Access Now Easy. 7141cc406Sopenharmony_ciThis package contains the SANE libraries (this means backends and 8141cc406Sopenharmony_cinetwork scanning parts) and the command line frontend scanimage. 9141cc406Sopenharmony_ciYou always find the most recent version of SANE on: 10141cc406Sopenharmony_ci 11141cc406Sopenharmony_ci http://www.sane-project.org/ 12141cc406Sopenharmony_ci 13141cc406Sopenharmony_ciAt the same location there are also links to snapshots of the Git server and 14141cc406Sopenharmony_cisometimes beta releases of sane-backends. These are unstable development 15141cc406Sopenharmony_civersions, so be careful when using them. Please report any problems to us. See 16141cc406Sopenharmony_cicontact section for details. 17141cc406Sopenharmony_ci 18141cc406Sopenharmony_ciThere are several graphical frontends available for SANE, see the list at 19141cc406Sopenharmony_cihttp://www.sane-project.org/sane-frontends.html. 20141cc406Sopenharmony_ci 21141cc406Sopenharmony_ci 22141cc406Sopenharmony_ciQuick install: 23141cc406Sopenharmony_ci============== 24141cc406Sopenharmony_ci 25141cc406Sopenharmony_ci./autogen.sh # only if you just cloned the git repository 26141cc406Sopenharmony_ci./configure 27141cc406Sopenharmony_cimake 28141cc406Sopenharmony_cimake install 29141cc406Sopenharmony_ci 30141cc406Sopenharmony_ciman sane 31141cc406Sopenharmony_ci 32141cc406Sopenharmony_ciPre-built binaries: 33141cc406Sopenharmony_ci=================== 34141cc406Sopenharmony_ci 35141cc406Sopenharmony_ciIn addition to versions included in releases, some platforms have more current versions available. 36141cc406Sopenharmony_ci 37141cc406Sopenharmony_ciUbuntu PPA https://launchpad.net/~sane-project/+archive/ubuntu/sane-release 38141cc406Sopenharmony_ci 39141cc406Sopenharmony_cisudo add-apt-repository ppa:sane-project/sane-release 40141cc406Sopenharmony_cisudo apt update 41141cc406Sopenharmony_ciapt install libsane libsane-common sane-utils 42141cc406Sopenharmony_ci 43141cc406Sopenharmony_ci 44141cc406Sopenharmony_ciPrerequisites 45141cc406Sopenharmony_ci============= 46141cc406Sopenharmony_ci 47141cc406Sopenharmony_ciIn order to build SANE, the following tools and libraries are required: 48141cc406Sopenharmony_ci 49141cc406Sopenharmony_ci - GNU make: version 3.70 or newer 50141cc406Sopenharmony_ci 51141cc406Sopenharmony_ci - ISO C99 compiler: GNU C (gcc) is recommended for best results, 52141cc406Sopenharmony_ci but any ISO C99 compliant compiler should do 53141cc406Sopenharmony_ci 54141cc406Sopenharmony_ci 55141cc406Sopenharmony_ciSome more libraries are not strictly necessary to compile SANE, but some 56141cc406Sopenharmony_cifunctionality may be lost if they are not available. Make sure that these 57141cc406Sopenharmony_cilibraries and their respective header files are available before running 58141cc406Sopenharmony_ciconfigure. On some Linux distributions the header files are part of separate 59141cc406Sopenharmony_cipackages (e.g. usb.h in libusb-devel or libusb-dev). These must also be 60141cc406Sopenharmony_ciinstalled. 61141cc406Sopenharmony_ci 62141cc406Sopenharmony_ci - libusb: Strongly recommended if you use a USB scanner. 63141cc406Sopenharmony_ci Some backends won't work without libusb at all. 64141cc406Sopenharmony_ci 65141cc406Sopenharmony_ci - libjpeg (>=6B): For the dc210, dc240, and gphoto2 backends. 66141cc406Sopenharmony_ci 67141cc406Sopenharmony_ci - libieee1284 (>=0.1.5): For some parallel port backends. 68141cc406Sopenharmony_ci 69141cc406Sopenharmony_ci - libgphoto2 (>=2.0): For the gphoto2 backend. 70141cc406Sopenharmony_ci 71141cc406Sopenharmony_ci - a C++11 compliant C++ compiler for the genesys backend. 72141cc406Sopenharmony_ci 73141cc406Sopenharmony_ciIf you got the source straight from the git repository, as opposed to 74141cc406Sopenharmony_cia source tarball, you will need a few more utilities. These utilities 75141cc406Sopenharmony_cishould normally *not* be needed for source archives downloaded from 76141cc406Sopenharmony_cithe project's website at http://www.sane-project.org/. 77141cc406Sopenharmony_ci 78141cc406Sopenharmony_ci - autoconf (>= 2.69) as well as the autoconf-archive (for the 79141cc406Sopenharmony_ci AX_CXX_COMPILE_STDCXX and AX_CXX_COMPILE_STDCXX_11 macros) 80141cc406Sopenharmony_ci 81141cc406Sopenharmony_ci - automake (>=1.15) 82141cc406Sopenharmony_ci 83141cc406Sopenharmony_ci - libtool (>=2.4.6) 84141cc406Sopenharmony_ci 85141cc406Sopenharmony_ci - gettext (>=0.19.8) 86141cc406Sopenharmony_ci 87141cc406Sopenharmony_ci - git (>= 2.1.4) 88141cc406Sopenharmony_ci 89141cc406Sopenharmony_ciSANE should build on most Unix-like systems. Support for OS/2, MacOS X, BeOS, 90141cc406Sopenharmony_ciand Microsoft Windows is also available. For more details look at the 91141cc406Sopenharmony_cioperating system specific README.* files. For a detailed support matrix, see: 92141cc406Sopenharmony_ci 93141cc406Sopenharmony_ci http://www.sane-project.org/sane-support.html 94141cc406Sopenharmony_ci 95141cc406Sopenharmony_ciThis table may be out of date. Please tell us about any corrections or 96141cc406Sopenharmony_ciadditions. Please mention your operating system and platform and all the other 97141cc406Sopenharmony_cidetails mentioned in the table. See also the contact section. 98141cc406Sopenharmony_ci 99141cc406Sopenharmony_ciPlease check that there aren't any older versions of SANE installed on your 100141cc406Sopenharmony_cisystem. Especially if SANE libraries are installed in a different prefix 101141cc406Sopenharmony_cidirectory (e.g. /usr/lib/) this may cause problems with external 102141cc406Sopenharmony_cifrontends. Please remove these libraries (libsane.*, sane/libsane-*) by using 103141cc406Sopenharmony_ciyour package manager or manually before installing this version of SANE. 104141cc406Sopenharmony_ci 105141cc406Sopenharmony_ci 106141cc406Sopenharmony_ciConfiguration 107141cc406Sopenharmony_ci============= 108141cc406Sopenharmony_ci 109141cc406Sopenharmony_ciSimply invoke configure in the top-level directory. Besides the usual GNU 110141cc406Sopenharmony_ciconfigure options, there are the following SANE specific options: 111141cc406Sopenharmony_ci 112141cc406Sopenharmony_ci --disable-shared 113141cc406Sopenharmony_ci Don't use shared libraries. Useful for debugging or when there 114141cc406Sopenharmony_ci is a problem building shared libraries. This implicitly turns 115141cc406Sopenharmony_ci on --disable-dynamic --enable-static as well. 116141cc406Sopenharmony_ci 117141cc406Sopenharmony_ci --disable-dynamic 118141cc406Sopenharmony_ci Disable dynamic loading of backends (in the dll backend). 119141cc406Sopenharmony_ci configure normally turns on dynamic loading when it 120141cc406Sopenharmony_ci can find the appropriate header files and libraries 121141cc406Sopenharmony_ci (<dlfcn.h> and -ldl). 122141cc406Sopenharmony_ci 123141cc406Sopenharmony_ci --enable-static 124141cc406Sopenharmony_ci Use static libraries (turned off by default). 125141cc406Sopenharmony_ci 126141cc406Sopenharmony_ci --enable-preload 127141cc406Sopenharmony_ci Preload backends into DLL backend. This is useful for debugging, 128141cc406Sopenharmony_ci when dynamic loading is unavailable, to reduce runtime linking 129141cc406Sopenharmony_ci overheads, or when you only want to distribute a single DLL with 130141cc406Sopenharmony_ci all backends available. If dynamic loading or shared libraries are 131141cc406Sopenharmony_ci unavailable or disabled, this option is turned on automatically. 132141cc406Sopenharmony_ci 133141cc406Sopenharmony_ci --enable-scsibuffersize=N 134141cc406Sopenharmony_ci Specify the buffer size of the buffer for SCSI commands. The default 135141cc406Sopenharmony_ci value is 131072 bytes (128 kb). This may be changed at runtime by 136141cc406Sopenharmony_ci setting the environment variable SANE_SG_BUFFERSIZE to the desired 137141cc406Sopenharmony_ci value. The option is Linux-only at this time. 138141cc406Sopenharmony_ci --enable-scsibuffersize and SANE_SG_BUFFERSIZE have no effect for 139141cc406Sopenharmony_ci the Mustek, Umax and Sharp backends. For these backends, the buffer 140141cc406Sopenharmony_ci size is set automatically and/or can be specified in the backend's 141141cc406Sopenharmony_ci configuration file. Please refer to the backend's man pages for 142141cc406Sopenharmony_ci details. 143141cc406Sopenharmony_ci 144141cc406Sopenharmony_ci--enable-locking 145141cc406Sopenharmony_ci Means, that some backends will use a lockfile for allowing multiple 146141cc406Sopenharmony_ci access to one scanner. This is useful, i.e. one frontend is scanning 147141cc406Sopenharmony_ci the button status and another one will scan. The path to the lock 148141cc406Sopenharmony_ci files is defined by --localstatedir at the configure step and is 149141cc406Sopenharmony_ci $localstatedir/lock. The default group is uucp and can be changed 150141cc406Sopenharmony_ci by using --with-group=newgroup. If you do not want any backend to 151141cc406Sopenharmony_ci use a lockfile, simply use --disable-locking. 152141cc406Sopenharmony_ci Note: The Plustek backend is currently the only backend that makes 153141cc406Sopenharmony_ci use of this feature. 154141cc406Sopenharmony_ci 155141cc406Sopenharmony_ciTo limit the backends that are compiled, set the variable BACKENDS to 156141cc406Sopenharmony_cithe list of backends to compile. The following will limit compiling 157141cc406Sopenharmony_cito the epson2 and fujitsu backends: 158141cc406Sopenharmony_ci 159141cc406Sopenharmony_ci ./configure BACKENDS="epson2 fujitsu" 160141cc406Sopenharmony_ci 161141cc406Sopenharmony_ciTo limit the backends that are preloaded into the DLL, set the variable 162141cc406Sopenharmony_ciPRELOADABLE_BACKENDS. The following will limit compiling to the epson2 163141cc406Sopenharmony_ciand fujitsu backends but only preloads the epson2 backend: 164141cc406Sopenharmony_ci 165141cc406Sopenharmony_ci ./configure BACKENDS="epson2 fujitsu" PRELOADABLE_BACKENDS="epson2" 166141cc406Sopenharmony_ci 167141cc406Sopenharmony_ciIn addition to these configuration options, there are some more SANE-specific 168141cc406Sopenharmony_cioptions and many standard-options. To get a description of available options, 169141cc406Sopenharmony_ciinvoke configure with option --help. 170141cc406Sopenharmony_ci 171141cc406Sopenharmony_ciIf you plan on debugging one of the SANE programs, we recommend to run 172141cc406Sopenharmony_ciconfigure like this: 173141cc406Sopenharmony_ci 174141cc406Sopenharmony_ci CFLAGS="-g -O -Wall" ./configure --disable-shared 175141cc406Sopenharmony_ci 176141cc406Sopenharmony_ciFor operating system specific information, look at the README.* files. 177141cc406Sopenharmony_ci 178141cc406Sopenharmony_ci 179141cc406Sopenharmony_ciBuild 180141cc406Sopenharmony_ci===== 181141cc406Sopenharmony_ci 182141cc406Sopenharmony_ciTo build SANE, simply type "make" in the top-level directory. 183141cc406Sopenharmony_ci 184141cc406Sopenharmony_ciTo clean up the executables and libraries in the source directory, type "make 185141cc406Sopenharmony_ciclean". To restore everything to the status after unpacking the package, type 186141cc406Sopenharmony_ci"make distclean". 187141cc406Sopenharmony_ci 188141cc406Sopenharmony_ci 189141cc406Sopenharmony_ciInstallation and Configuration 190141cc406Sopenharmony_ci============================== 191141cc406Sopenharmony_ci 192141cc406Sopenharmony_ciOnce the build has finished, install SANE with "make install". By 193141cc406Sopenharmony_cidefault, this will place the SANE libraries in /usr/local/lib/, the 194141cc406Sopenharmony_ciconfiguration files in /usr/local/etc/sane.d/, and the manual pages in 195141cc406Sopenharmony_ci/usr/local/man/. The location of these directories can be overridden 196141cc406Sopenharmony_ciwith configure options; see "configure --help" for details. 197141cc406Sopenharmony_ci 198141cc406Sopenharmony_ciBefore running any SANE program, read the PROBLEMS file in this directory. 199141cc406Sopenharmony_ci 200141cc406Sopenharmony_ciFor information on configuring and trouble-shooting the various SANE 201141cc406Sopenharmony_cicomponents, please refer to the manual page sane(7). 202141cc406Sopenharmony_ci 203141cc406Sopenharmony_ciThe tools/ directory contains some small programs that may be helpful. They 204141cc406Sopenharmony_ciare described in tools/README. 205141cc406Sopenharmony_ci 206141cc406Sopenharmony_ci 207141cc406Sopenharmony_ciRemoving 208141cc406Sopenharmony_ci======== 209141cc406Sopenharmony_ci 210141cc406Sopenharmony_ciType "make uninstall" to remove SANE from your system. This will also remove 211141cc406Sopenharmony_ciolder versions of SANE if they have been installed at the same prefix. 212141cc406Sopenharmony_ciWarning: Your configuration files will be deleted also so make sure you have a 213141cc406Sopenharmony_cibackup. By default the configuration files are located in the directory 214141cc406Sopenharmony_ci/usr/local/etc/sane.d/. 215141cc406Sopenharmony_ci 216141cc406Sopenharmony_ci 217141cc406Sopenharmony_ciContact 218141cc406Sopenharmony_ci======= 219141cc406Sopenharmony_ci 220141cc406Sopenharmony_ciFor questions and general discussion about SANE contact the sane-devel mailing 221141cc406Sopenharmony_cilist. You must be subscribed to the list to send mail. See 222141cc406Sopenharmony_cihttp://www.sane-project.org/mailing-lists.html for details. 223141cc406Sopenharmony_ci 224141cc406Sopenharmony_ciIf you want to submit a bug report or feature request please use our bug 225141cc406Sopenharmony_citracking system. See http://www.sane-project.org/bugs.html for details. You 226141cc406Sopenharmony_cimay also contact the author of a specific backend directly. See the AUTHORS 227141cc406Sopenharmony_cifile for a list of addresses. 228