summaryrefslogtreecommitdiff
blob: 1f0334b99ef9b70b0383e738708314ceb4c0edb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Index: kooka/configure.in.in
===================================================================
--- kooka/configure.in.in	(revision 428265)
+++ kooka/configure.in.in	(working copy)
@@ -2,21 +2,32 @@
 dnl AC_CHECK_LIB(Pgm2asc,pgm2asc)
 dnl should define HAVE_LIBPGM2ASC if available
 
-AC_ARG_WITH(kadmos-dir,
-AC_HELP_STRING([--with-kadmos-dir],[sets the path to the kadmos engine]),
-	[ac_kadmos_value=$withval], [ac_kadmos_value=NONE])
+AC_ARG_WITH([kadmos],
+  [AS_HELP_STRING([--with-kadmos],
+    [Enable the kadmos OCR engine @<:@default=check@:>@])],
+  [], with_kadmos=check)
 
+AC_ARG_WITH([kadmos-dir],
+  AS_HELP_STRING([--with-kadmos-dir],
+    [sets the path to the kadmos engine @<:@default=/usr/local@:>@]),
+  [ac_kadmos_value=$withval], [ac_kadmos_value=/usr/local])
+
 KADMOS_INC=
 KADMOS_LIB=
 
-if test -r "$ac_kadmos_value/kadmos.h"; then
-	KADMOS_INC="-I$ac_kadmos_value"
-	KADMOS_LIB="$ac_kadmos_value/librep.a"
-	AC_DEFINE_UNQUOTED(HAVE_KADMOS, 1, [Defines if your system has the kadmos libraries])
-elif test ! "x$ac_kadmos_value" = "xNONE"; then
-	AC_MSG_WARN([couldn't find kadmos engine header file under $ac_kadmos_value/kadmos.h])
+if test "x$with_kadmos" != xno; then
+	if test -r "$ac_kadmos_value/kadmos.h"; then
+		KADMOS_INC="-I$ac_kadmos_value"
+		KADMOS_LIB="$ac_kadmos_value/librep.a"
+		AC_DEFINE_UNQUOTED(HAVE_KADMOS, 1, [Defines if your system has the kadmos libraries])
+	else
+		AC_MSG_WARN([couldn't find kadmos engine header file under $ac_kadmos_value/kadmos.h])
+	fi
+
+	if test "x$with_kadmos" != xcheck && test -z "$KADMOS_LIB"; then
+		AC_MSG_FAILURE([--with-kadmos was given, but test for kadmos failed])
+	fi
 fi
 
 AC_SUBST(KADMOS_LIB)
 AC_SUBST(KADMOS_INC)
-