summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2014-10-03 14:05:03 +0000
committerMattia Rizzolo <mattia@mapreri.org>2014-10-03 14:05:03 +0000
commit817e6294b42b3e4435f1b99728afc1dca84a6445 (patch)
tree75bc563b5fe4149fe7e5cbf7a5c2cbcee5ea0fb3 /configure.in
parente7e90b72fd3161c5d55fed49e100781dfa3e9408 (diff)
Imported Upstream version 0.97upstream/0.97
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in94
1 files changed, 72 insertions, 22 deletions
diff --git a/configure.in b/configure.in
index 34ff577..bb31cb9 100644
--- a/configure.in
+++ b/configure.in
@@ -6,35 +6,50 @@ AC_CONFIG_HEADER(include/config.h)
# version code:
V_MAJOR=0
-V_MINOR=84
+V_MINOR=97
PACKAGE=xsane
BINPROGS="xsane"
# languages
-ALL_LINGUAS="cs de es fr nl ru sl sr sv it ja tr"
+ALL_LINGUAS="cs da de es fr it ja nl pl pt pt_BR ro ru sk sl sr sv vi tr zh"
SANE_V_MAJOR=1
VERSION=${V_MAJOR}.${V_MINOR}
-PACKAGE_VERSION="$PACKAGE-$VERSION"
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
-AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION")
+XSANE_PACKAGE_VERSION="$PACKAGE-$VERSION"
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define to the name of the distribution])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define to the version of the distribution])
+AC_DEFINE_UNQUOTED(XSANE_PACKAGE_VERSION, "$XSANE_PACKAGE_VERSION", [Define to name and version of distribution])
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
-AC_SUBST(PACKAGE_VERSION)
+AC_SUBST(XSANE_PACKAGE_VERSION)
AC_SUBST(SANE_MAJOR)
dnl Check args
-dnl Check for gimp plugin support
+echo ""
+echo "**************************************************************************"
+echo ""
+
+dnl Check for gtk-2
+AC_MSG_CHECKING([whether GTK+-2.0 is requested])
+AC_ARG_ENABLE(gtk2, [ --disable-gtk2 do not use GTK+-2.0, if available use GTK+-1.2], USE_GTK2=$enableval, USE_GTK2=yes)
+AC_MSG_RESULT($USE_GTK2)
+
+dnl Check for gimp plugin support, default is enabled
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)
+if test "${USE_GIMP}" = "yes"; then
+ dnl Check for gimp-2 plugin support, default is enabled
+ AC_MSG_CHECKING([whether GIMP-2.0 is requested])
+ AC_ARG_ENABLE(gimp2, [ --disable-gimp2 do not use GIMP-2.0, use GIMP-1.x if available], TRY_GIMP_2=$enableval, TRY_GIMP_2=yes)
+ AC_MSG_RESULT($TRY_GIMP_2)
+fi
+
dnl Check for jpeg support
AC_MSG_CHECKING([whether JPEG support is requested])
dnl Default is enabled JPEG
@@ -53,6 +68,9 @@ dnl Default is enabled TIFF
AC_ARG_ENABLE(tiff, [ --disable-tiff do not include TIFF support], USE_TIFF=$enableval, USE_TIFF=yes)
AC_MSG_RESULT($USE_TIFF)
+echo ""
+echo "**************************************************************************"
+echo ""
dnl Checks for programs.
AC_PROG_CC
@@ -71,9 +89,15 @@ if test "${ac_cv_prog_gcc}" = "yes"; then
CFLAGS="${CFLAGS} -Wall"
fi
+AC_GCC_MSNATIVE_STRUCT
+if test "${ac_cv_header_windows_h}" = "yes"; then
+ LDFLAGS="${LDFLAGS} -mwindows"
+ XSANE_ICON="xsane-icon.opc"
+fi
+
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS(os2.h fcntl.h unistd.h libc.h sys/time.h sys/types.h zlib.h)
+AC_CHECK_HEADERS(windows.h 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
@@ -100,7 +124,7 @@ if test "${USE_TIFF}" = "yes"; then
fi
dnl Checks for library functions.
-AM_FUNC_ALLOCA
+AC_FUNC_ALLOCA
AC_FUNC_MMAP
AC_CHECK_FUNCS(atexit mkdir sigprocmask strdup strndup strftime strstr strsep strtod snprintf usleep strcasecmp strncasecmp lstat)
@@ -119,14 +143,42 @@ AC_SUBST(INTLSUB)
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, )
-
if test "${USE_GIMP}" = "yes"; then
- AM_PATH_GIMP(1.0.0, HAVE_GIMP=yes)
+ if test "${TRY_GIMP_2}" = "yes"; then
+ AM_PATH_GIMP_2_0(1.3.23, HAVE_GIMP=yes, )
+ fi
+fi
+
+if test "${HAVE_GIMP}" = "yes"; then
+ HAVE_GTK=yes
+ AC_DEFINE([HAVE_GIMP_2], 1, [Define to 1 if you have gimp-2.0.])
+else
+ dnl *** We do not have gimp-2.0 ***
+ 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.
+ dnl *** we start with the test for GTK+-2.0, if this fails or is diabled
+ dnl *** then we test for gtk+-1.2
+
+ if test "${USE_GTK2}" = "yes"; then
+ AM_PATH_GTK_2_0(2.0.0, HAVE_GTK=yes, )
+ fi
+
+ if test "x${HAVE_GTK}" = "x"; then
+ AM_PATH_GTK(1.2.0, HAVE_GTK=yes, )
+ fi
+
+ if test "${USE_GIMP}" = "yes"; then
+ dnl *** now we can test for gimp-1.x.x, for gimp-1.0.x we need GTK_* settings ***
+ AM_PATH_GIMP_ORAUCH(1.0.0, HAVE_GIMP=yes)
+ fi
+fi
+
+if test "${HAVE_GIMP}" = "yes"; then
+ dnl *** we have gimp ***
+ dnl *** define macro HAVE_ANY_GIMP for sourcecode tests for gimp ***
+ AC_DEFINE([HAVE_ANY_GIMP], 1, [Define to 1 if you have gimp - no matter what version.])
fi
@@ -162,8 +214,6 @@ if test "x${HAVE_SANE}" = "x"; then
echo " sane-devel"
echo "****************************************************************"
echo ""
- echo "you may need to remove $cache_file before you run configure again"
- echo ""
exit
fi
@@ -174,8 +224,6 @@ if test "x${HAVE_GTK}" = "x"; then
echo " gtk-devel"
echo "****************************************************************"
echo ""
- echo "you may need to remove $cache_file before you run configure again"
- echo ""
exit
fi
@@ -184,6 +232,8 @@ AC_SUBST(V_MAJOR)
AC_SUBST(V_MINOR)
AC_SUBST(DLL_PRELOAD)
+AC_SUBST(XSANE_ICON)
+
AC_ARG_ENABLE(foo1, [
Used environment variables that can be set by user:
CFLAGS, CPPFLAGS, LDFLAGS, LIBS])