diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2014-10-03 14:05:01 +0000 |
---|---|---|
committer | Mattia Rizzolo <mattia@mapreri.org> | 2014-10-03 14:05:01 +0000 |
commit | e7e90b72fd3161c5d55fed49e100781dfa3e9408 (patch) | |
tree | 67cfcfae6b9a9e15701a332dfacbe0ca6440f16c /configure.in | |
parent | 2d113e8792747151bf5d830f1a1485f2f951f940 (diff) |
Imported Upstream version 0.84upstream/0.84
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 124 |
1 files changed, 36 insertions, 88 deletions
diff --git a/configure.in b/configure.in index c06eb0a..34ff577 100644 --- a/configure.in +++ b/configure.in @@ -1,19 +1,19 @@ 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_INIT(include/config.h.in) +AC_CONFIG_HEADER(include/config.h) # AC_PREREQ(2.10)dnl dnl Minimum Autoconf version required. # AC_ARG_PROGRAM # version code: V_MAJOR=0 -V_MINOR=50 +V_MINOR=84 PACKAGE=xsane BINPROGS="xsane" # languages -ALL_LINGUAS="de fr cs" +ALL_LINGUAS="cs de es fr nl ru sl sr sv it ja tr" SANE_V_MAJOR=1 VERSION=${V_MAJOR}.${V_MINOR} @@ -26,13 +26,8 @@ AC_SUBST(VERSION) AC_SUBST(PACKAGE_VERSION) AC_SUBST(SANE_MAJOR) -dnl Check args -dnl Check for intl patch selection -AC_MSG_CHECKING([whether libintl patch is requested]) -dnl Default is disabled libintl patch -AC_ARG_ENABLE(intl-patch, [ --enable-intl-patch add -lintl to check for sane], ADD_LIBINTL=$enableval, ADD_LIBINTL=no) -AC_MSG_RESULT($ADD_LIBINTL) +dnl Check args dnl Check for gimp plugin support AC_MSG_CHECKING([whether GIMP plugin is requested]) @@ -78,9 +73,7 @@ fi dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \ - sys/time.h sys/scanio.h sys/socket.h sys/io.h asm/io.h gscdds.h sys/hw.h \ - bsd/dev/scsireg.h io/cam/cam.h camlib.h sys/types.h zlib.h) +AC_CHECK_HEADERS(os2.h fcntl.h unistd.h libc.h sys/time.h sys/types.h zlib.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -93,11 +86,6 @@ AC_CHECK_TYPE(u_char, unsigned char) AC_CHECK_TYPE(u_int, unsigned int) AC_CHECK_TYPE(u_long, unsigned long) -dnl The following libs have to be included because they are forgotten in the sane libs -AC_CHECK_LIB(scsi, scsireq_enter) # FreeBSD needs this -AC_CHECK_LIB(cam, cam_open_device) # FreeBSD 3+ needs this -dnl AC_CHECK_LIB(intl,gettext) - dnl Checks for libraries. AC_CHECK_LIB(m, sqrt) AC_CHECK_LIB(z, deflateInit_) @@ -114,13 +102,7 @@ fi dnl Checks for library functions. AM_FUNC_ALLOCA AC_FUNC_MMAP -AC_CHECK_FUNCS(atexit mkdir sigprocmask strdup strndup strftime strstr strsep strtod snprintf usleep strcasecmp strncasecmp) - -dnl standard dll handling -AC_CHECK_HEADERS(dlfcn.h, [AC_CHECK_LIB(dl,dlopen) AC_CHECK_FUNCS(dlopen, enable_dynamic=yes,)],) - -dnl HP/UX DLL handling -AC_CHECK_HEADERS(dl.h, [AC_CHECK_LIB(dld,shl_load) AC_CHECK_FUNCS(shl_load, enable_dynamic=yes,)],) +AC_CHECK_FUNCS(atexit mkdir sigprocmask strdup strndup strftime strstr strsep strtod snprintf usleep strcasecmp strncasecmp lstat) dnl Check for NLS/gettext AM_GNU_GETTEXT @@ -135,68 +117,34 @@ fi AC_SUBST(INTLSUB) -#### Choose a window system. - -AC_PATH_X -if test "$no_x" = yes; then - window_system=none -else - window_system=x11 -fi +AM_PATH_SANE(1.0.0, HAVE_SANE=yes, ) +dnl *** if xsane is compiled as gimp plugin it is possible that we do not +dnl *** need the test for gtk, but when we have gimp-1.0.x installed +dnl *** (gimp-1.0.x does not have gimp-config) or we compile xsane without +dnl *** gimp support we need the test for gtk AM_PATH_GTK(1.2.0, HAVE_GTK=yes, ) -# 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... -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) + AM_PATH_GIMP(1.0.0, HAVE_GIMP=yes) fi - -LIBS="${saved_LIBS}" -CPPFLAGS="${saved_CPPFLAGS}" - + # png test must stand after test for zlib -# png test must stand behind X11-check because it is located in -# the X11 directory on some systems -# so we have to use x_includes and x_libraries to test for png -# and all following checks (=sane) -# saved_CPPFLAGS is still up to date -CPPFLAGS="${CPPFLAGS} -I${x_includes}" +# png test must stand behind GTK-check (X-Window-check) +# because png.h is located in the X11 directory on some systems +# so we have to use GTK_CFLAGS and GTK_LIBS to test for png if test "${USE_PNG}" = "yes"; then - AC_CHECK_HEADERS(png.h, [AC_CHECK_LIB(png, png_create_info_struct,,, -L${x_libraries})]) - if test "${ac_cv_lib_png_png_create_info_struct}" = "yes"; then -# remove libpng because if we do not remove it all following -# checks could need x_libraries and x_includes - LIBS=`echo $LIBS | sed -e 's/-lpng//'` - PNG_LIB="-lpng" + saved_CPPFLAGS="${CPPFLAGS}" + + if test "x${HAVE_GTK}" != "x"; then + CPPFLAGS="${CPPFLAGS} ${GTK_CFLAGS}" fi -fi -CPPFLAGS="${saved_CPPFLAGS}" - -# check for sane must stand after check for dl -# check must stand at end of list because of the missing libintl in libsane.so -# check needs x_libraries and x_includes because they may be needed by png -dnl Check for sane lib -if test "${ADD_LIBINTL}" = "no"; then - AC_CHECK_HEADERS(sane/sane.h, AC_CHECK_LIB(sane,sane_init)) -else - AC_CHECK_HEADERS(sane/sane.h, AC_CHECK_LIB(sane,sane_init,,, -lintl)) -fi + AC_CHECK_HEADERS(png.h, [AC_CHECK_LIB(png, png_create_info_struct,,, ${GTK_LIBS})]) + CPPFLAGS="${saved_CPPFLAGS}" +fi -# this should be after all checks -# add libpng again -LIBS="${PNG_LIB} ${LIBS}" AC_SUBST(INCLUDES) AC_SUBST(BINPROGS) @@ -204,29 +152,31 @@ AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) AC_SUBST(GIMP_LIBS) CPPFLAGS="${CPPFLAGS} \ - -DPATH_SANE_DATA_DIR=\$(sanedatadir) \ -DV_MAJOR=${V_MAJOR} -DV_MINOR=${V_MINOR} -DSANE_V_MAJOR=${SANE_V_MAJOR}" dnl Print error message if sane or gtk is missing -if test "${ac_cv_lib_sane_sane_init}" != "yes"; then +if test "x${HAVE_SANE}" = "x"; then echo "****************************************************************" - echo "ERROR: SANE is needed for compiling xsane" + echo "ERROR: SANE-1.0.0 or newer is needed for compiling xsane" echo " - if you installed SANE as rpm make sure you also included" echo " sane-devel" - echo " - if SANE is installed, try ./configure -enable-intl-patch" echo "****************************************************************" - rm -f $cache_file - exit -1 + echo "" + echo "you may need to remove $cache_file before you run configure again" + echo "" + exit fi -if test "${HAVE_GTK}" = "no"; then +if test "x${HAVE_GTK}" = "x"; then echo "****************************************************************" echo "ERROR: GTK-1.2.0 or newer is needed for compiling xsane" echo " if you installed gtk as rpm make sure you also included" echo " gtk-devel" echo "****************************************************************" - rm -f $cache_file - exit -1 + echo "" + echo "you may need to remove $cache_file before you run configure again" + echo "" + exit fi @@ -243,7 +193,7 @@ To add include or library paths call: [env] CPPFLAGS=\"-I/path/to/foo/include\" LDFLAGS=\"-L/path/to/foo/libs\" ./configure]) AC_OUTPUT([Makefile intl/Makefile po/Makefile lib/Makefile - frontend/Makefile include/Makefile doc/Makefile],) + src/Makefile include/Makefile doc/Makefile xsane.spec],) echo "****************************************************************" echo "* *" @@ -289,9 +239,7 @@ echo "****************************************************************" echo "* *" echo "* To compile XSANE: *" echo "* ----------------- *" -echo "* enter as normal user: *" echo "* make *" -echo "* and as root: *" echo "* make install *" echo "* *" echo "* ------------------------------------------------------------ *" |