2000-11-10 06:18:59 +00:00
|
|
|
dnl Process this file with autoconf to produce a configure script. -*-sh-*-
|
|
|
|
AC_INIT(include/sane/config.h.in)
|
|
|
|
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
|
2002-10-23 14:07:41 +00:00
|
|
|
V_BUILD=9
|
2002-10-24 17:47:13 +00:00
|
|
|
V_EXTRA=-cvs
|
2000-11-10 06:18:59 +00:00
|
|
|
|
|
|
|
PACKAGE=sane-frontends
|
|
|
|
|
2000-11-26 01:11:51 +00:00
|
|
|
GUIPROGS="xscanimage xcam"
|
2002-01-12 00:45:20 +00:00
|
|
|
BINPROGS="scanadf"
|
2000-11-10 06:18:59 +00:00
|
|
|
|
|
|
|
# languages
|
|
|
|
# ALL_LINGUAS="cs de fr sv it tr"
|
|
|
|
|
|
|
|
SANE_V_MAJOR=1
|
2002-01-08 18:27:50 +00:00
|
|
|
VERSION=${V_MAJOR}.${V_MINOR}.${V_BUILD}${V_EXTRA}
|
2000-11-10 06:18:59 +00:00
|
|
|
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)
|
|
|
|
AC_SUBST(SANE_MAJOR)
|
|
|
|
|
2000-11-26 01:11:51 +00:00
|
|
|
dnl Check if GUIs shall be compiled
|
|
|
|
AC_ARG_ENABLE(guis, [ --disable-guis do not compile graphical user interfaces (GUIs)], USE_GUI=$enableval, USE_GUI=yes)
|
2000-11-10 06:18:59 +00:00
|
|
|
|
|
|
|
dnl Check for gimp plugin support
|
|
|
|
AC_MSG_CHECKING([whether GIMP plugin is requested])
|
|
|
|
dnl Default is enabled GIMP plugin
|
|
|
|
AC_ARG_ENABLE(gimp, [ --disable-gimp do not include GIMP plugin mode], USE_GIMP=$enableval, USE_GIMP=yes)
|
|
|
|
AC_MSG_RESULT($USE_GIMP)
|
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_AIX
|
|
|
|
AC_MINIX
|
|
|
|
AC_ISC_POSIX
|
|
|
|
AM_PROG_CC_STDC
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_GCC_TRADITIONAL
|
|
|
|
|
|
|
|
INCLUDES="${INCLUDES} -I/usr/local/include"
|
|
|
|
CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
|
|
|
|
if test "${ac_cv_prog_gcc}" = "yes"; then
|
|
|
|
CFLAGS="${CFLAGS} -Wall"
|
|
|
|
fi
|
|
|
|
|
2002-04-13 18:53:27 +00:00
|
|
|
AC_CANONICAL_HOST
|
|
|
|
dnl special LDFLAGS
|
|
|
|
case "$host_os" in
|
|
|
|
aix*) #enable .so libraries, disable archives
|
|
|
|
LDFLAGS="$LDFLAGS -Wl,-brtl"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2000-11-10 06:18:59 +00:00
|
|
|
dnl Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
2001-07-02 23:08:49 +00:00
|
|
|
AC_CHECK_HEADERS(os2.h fcntl.h unistd.h libc.h sys/time.h sys/types.h)
|
2000-11-10 06:18:59 +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)
|
|
|
|
|
|
|
|
dnl Checks for libraries.
|
|
|
|
AC_CHECK_LIB(m, sqrt)
|
|
|
|
|
2002-05-03 07:24:44 +00:00
|
|
|
if test "`uname`" != "IRIX" -a "`uname`" != "IRIX64"; then
|
|
|
|
AC_CHECK_LIB(socket, socket)
|
|
|
|
AC_CHECK_LIB(syslog, syslog) # OS/2 needs this
|
|
|
|
fi
|
|
|
|
|
2000-11-10 06:18:59 +00:00
|
|
|
dnl Checks for library functions.
|
|
|
|
AM_FUNC_ALLOCA
|
|
|
|
AC_FUNC_MMAP
|
2001-08-03 21:32:46 +00:00
|
|
|
AC_CHECK_FUNCS(atexit mkdir sigprocmask strdup strndup strftime strstr \
|
|
|
|
strsep strtod snprintf usleep strcasecmp strncasecmp getenv isfdtype vsyslog)
|
2000-11-10 06:18:59 +00:00
|
|
|
|
2002-04-13 18:53:27 +00:00
|
|
|
AC_CHECK_TOOL(RANLIB, ranlib, :)
|
2000-11-10 06:18:59 +00:00
|
|
|
|
|
|
|
AM_PATH_SANE(1.0.0, HAVE_SANE=yes, )
|
2000-11-26 01:11:51 +00:00
|
|
|
dnl Print error message if sane is missing
|
|
|
|
if test "x${HAVE_SANE}" = "x"; then
|
2001-07-10 22:11:13 +00:00
|
|
|
echo "**********************************************************************"
|
|
|
|
echo "ERROR: Couldn't find SANE libraries (sane-backends). Possible reasons:"
|
|
|
|
echo " - sane-backends isn't installed (install sane-backends before"
|
|
|
|
echo " sane-frontends"
|
|
|
|
echo " - the SANE header files aren't installed (if you installed"
|
|
|
|
echo " SANE as RPM make sure you also included the sane-devel RPM)"
|
|
|
|
echo " - the SANE libraries can't be found because /usr/local/lib/ isn't"
|
|
|
|
echo " searched by the dynamic linker (see INSTALL for details)"
|
|
|
|
echo "**********************************************************************"
|
2002-01-08 17:19:23 +00:00
|
|
|
echo ""
|
2002-04-13 18:53:27 +00:00
|
|
|
echo "You may need to remove $cache_file before you run configure again."
|
2002-01-08 17:19:23 +00:00
|
|
|
echo ""
|
2000-11-26 01:11:51 +00:00
|
|
|
exit
|
|
|
|
fi
|
2000-11-10 06:18:59 +00:00
|
|
|
|
2000-11-26 01:11:51 +00:00
|
|
|
if test "${USE_GUI}" = "yes"; then
|
|
|
|
AM_PATH_GTK(0.99.13, HAVE_GTK=yes, )
|
2000-11-10 06:18:59 +00:00
|
|
|
|
|
|
|
# Change CFLAGS temporarily so that C_SWITCH_X_SITE gets used
|
|
|
|
# for the tests that follow. We set it back to REAL_CFLAGS later on.
|
|
|
|
|
|
|
|
# According to Owen Taylor, GTK_CFLAGS is _guaranteed_ to contain
|
|
|
|
# -D and -I flags only, i.e., it really is GTK_CPPFLAGS...
|
2000-11-26 01:11:51 +00:00
|
|
|
saved_CPPFLAGS="${CPPFLAGS}"
|
|
|
|
saved_LIBS="${LIBS}"
|
|
|
|
CPPFLAGS="${CPPFLAGS} ${GTK_CFLAGS}"
|
|
|
|
LIBS="${LIBS} ${GTK_LIBS}"
|
|
|
|
|
|
|
|
if test "${USE_GIMP}" = "yes"; then
|
|
|
|
AC_CHECK_HEADERS(libgimp/gimp.h, GIMP_LIBS="-lgimp")
|
|
|
|
AC_CHECK_HEADERS(libgimp/gimpfeatures.h)
|
|
|
|
fi
|
|
|
|
|
|
|
|
LIBS="${saved_LIBS}"
|
|
|
|
CPPFLAGS="${saved_CPPFLAGS}"
|
|
|
|
|
|
|
|
if test "x${HAVE_GTK}" = "x"; then
|
|
|
|
echo "****************************************************************"
|
2002-04-13 18:53:27 +00:00
|
|
|
echo "WARNING: GTK-0.99.13 or newer is needed for compiling the GUI"
|
|
|
|
echo " frontends. If you installed gtk as rpm make sure"
|
|
|
|
echo " you also installed gtk-devel."
|
2000-11-26 01:11:51 +00:00
|
|
|
echo " ===> GUIs will be deactivated"
|
|
|
|
echo "****************************************************************"
|
2002-01-08 17:19:23 +00:00
|
|
|
echo ""
|
2002-04-13 18:53:27 +00:00
|
|
|
echo "You may need to remove $cache_file before you run configure again."
|
2002-01-08 17:19:23 +00:00
|
|
|
echo ""
|
2000-11-26 01:11:51 +00:00
|
|
|
else
|
|
|
|
BINPROGS=${BINPROGS}" "${GUIPROGS}
|
|
|
|
fi
|
2000-11-10 06:18:59 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(INCLUDES)
|
|
|
|
AC_SUBST(BINPROGS)
|
|
|
|
AC_SUBST(GTK_CFLAGS)
|
|
|
|
AC_SUBST(GTK_LIBS)
|
|
|
|
AC_SUBST(GIMP_LIBS)
|
|
|
|
CPPFLAGS="${CPPFLAGS} \
|
|
|
|
-DPATH_SANE_DATA_DIR=\$(sanedatadir) \
|
2000-11-11 22:07:44 +00:00
|
|
|
-DV_MAJOR=${V_MAJOR} -DV_MINOR=${V_MINOR} -DV_BUILD=${V_BUILD} -DSANE_V_MAJOR=${SANE_V_MAJOR}"
|
2000-11-10 06:18:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AC_SUBST(V_MAJOR)
|
|
|
|
AC_SUBST(V_MINOR)
|
2000-11-11 20:22:38 +00:00
|
|
|
AC_SUBST(V_BUILD)
|
2000-11-10 06:18:59 +00:00
|
|
|
AC_SUBST(DLL_PRELOAD)
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(foo1, [
|
|
|
|
Used environment variables that can be set by user:
|
|
|
|
CFLAGS, CPPFLAGS, LDFLAGS, LIBS])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(foo2, [
|
|
|
|
To add include or library paths call:
|
|
|
|
[env] CPPFLAGS=\"-I/path/to/foo/include\" LDFLAGS=\"-L/path/to/foo/libs\" ./configure])
|
|
|
|
|
2002-01-08 18:27:50 +00:00
|
|
|
AC_OUTPUT([Makefile lib/Makefile src/Makefile sanei/Makefile doc/Makefile
|
|
|
|
include/Makefile],)
|
2000-11-10 06:18:59 +00:00
|
|
|
|
|
|
|
echo "****************************************************************"
|
|
|
|
echo "* *"
|
|
|
|
echo "* SANE-FRONTENDS configure status: *"
|
|
|
|
echo "* -------------------------------- *"
|
|
|
|
|
2000-11-26 01:11:51 +00:00
|
|
|
if test "x${HAVE_GTK}" != "x"; then
|
|
|
|
echo "* - GUIs activated (xcam + xscanimage) *"
|
|
|
|
if test "${GIMP_LIBS}set" != "set"; then
|
|
|
|
echo "* - GIMP plugin activated for xscanimage *"
|
|
|
|
else
|
|
|
|
echo "* - GIMP plugin deactivated for xscanimage *"
|
|
|
|
fi
|
2000-11-10 06:18:59 +00:00
|
|
|
else
|
2000-11-26 01:11:51 +00:00
|
|
|
if test "${USE_GUI}" = "yes"; then
|
|
|
|
echo "* * GTK not found: GUIs deactivated *"
|
|
|
|
else
|
|
|
|
echo "* - GUIs deactivated (xcam + xscanimage) *"
|
|
|
|
fi
|
2000-11-10 06:18:59 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "* *"
|
|
|
|
echo "****************************************************************"
|
|
|
|
echo "* *"
|
|
|
|
echo "* To compile SANE-FRONTENDS: *"
|
|
|
|
echo "* -------------------------- *"
|
|
|
|
echo "* make *"
|
|
|
|
echo "* make install *"
|
|
|
|
echo "* *"
|
|
|
|
echo "* ------------------------------------------------------------ *"
|
|
|
|
echo "* ... PLEASE READ SANE DOCUMENTATION BEFORE STARTING SANE ... *"
|
|
|
|
echo "* ------------------------------------------------------------ *"
|
2002-01-26 16:55:09 +00:00
|
|
|
echo "* *"
|
|
|
|
echo "* If you experience any problems with sane-frontends please *"
|
|
|
|
echo "* write to the sane mailing list or contact: *"
|
|
|
|
echo "* Oliver Rauch <Oliver.Rauch@Rauch-domain.de> *"
|
|
|
|
echo "* *"
|
2000-11-10 06:18:59 +00:00
|
|
|
echo "****************************************************************"
|