summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2019-02-24 14:29:00 +0100
committerSlávek Banko <slavek.banko@axis.cz>2019-02-24 14:53:38 +0100
commit62481690071ce35abc780ba582a292b82b35b350 (patch)
tree9f638199c82fedd3dfe92a17af882a0e4d5fcc11
parentdabe93bad27870ad3f52ec56c02e090a9384524a (diff)
downloadkbarcode-62481690.tar.gz
kbarcode-62481690.zip
automake: add WITH_NATIVE_GNU_BARCODE and WITH_JAVASCRIPT build options
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--configure.in.in34
-rw-r--r--kbarcode/gnubarcode.h4
-rw-r--r--kbarcode/tokenprovider.h4
3 files changed, 42 insertions, 0 deletions
diff --git a/configure.in.in b/configure.in.in
index 3448a6e..70485d4 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -5,3 +5,37 @@ AM_INIT_AUTOMAKE(kbarcode, 2.0.7)
AC_C_BIGENDIAN
AC_CHECK_KDEMAXPATHLEN
+AC_ARG_WITH(native-gnu-barcode,
+ AC_HELP_STRING([--without-native-gnu-barcode],[disable build with GNU Barcode [default=auto]]),
+ [with_native_gnu_barcode=$withval],
+ [with_native_gnu_barcode=auto]
+)
+if test "$with_native_gnu_barcode" != "no"; then
+ KDE_CHECK_HEADERS([barcode.h], [have_gnu_barcode="yes"], [have_gnu_barcode=no])
+ if test "$have_gnu_barcode" = "yes"; then
+ AC_DEFINE(_ENABLE_NATIVE_GNU_BARCODE, 1, [Define to 1 if you have <barcode.h> header file.])
+ else
+ if test "$with_native_gnu_barcode" = "yes"; then
+ echo "Barcode is requested, but GNU Barcode header was not found on your system"
+ exit
+ fi
+ fi
+fi
+
+AC_ARG_WITH(javascript,
+ AC_HELP_STRING([--without-javascript],[build KBarcode without javascript interpreter [default=auto]]),
+ [with_javascript=$withval],
+ [with_javascript=auto]
+)
+if test "$with_javascript" != "no"; then
+ KDE_CHECK_HEADERS([kjs/interpreter.h], [have_javascript="yes"], [have_javascript=no])
+ if test "$have_javascript" = "yes"; then
+ AC_DEFINE(USE_JAVASCRIPT, 1, [Define to 1 if you have <kjs/interpreter.h> header file.])
+ AC_DEFINE(NO_KJS_EMBED, 1, [Define to 1 for use tdelibs javascript interpreter])
+ else
+ if test "$with_javascript" = "yes"; then
+ echo "Javascript interpreter is requested, but tdelibs Javascript header (kjs) was not found on your system"
+ exit
+ fi
+ fi
+fi
diff --git a/kbarcode/gnubarcode.h b/kbarcode/gnubarcode.h
index a70498c..1f71e79 100644
--- a/kbarcode/gnubarcode.h
+++ b/kbarcode/gnubarcode.h
@@ -18,6 +18,10 @@
#ifndef GNU_BARCODE_H
#define GNU_BARCODE_H
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
// #define _ENABLE_NATIVE_GNU_BARCODE
#ifdef _ENABLE_NATIVE_GNU_BARCODE
diff --git a/kbarcode/tokenprovider.h b/kbarcode/tokenprovider.h
index ce7d186..78e64a8 100644
--- a/kbarcode/tokenprovider.h
+++ b/kbarcode/tokenprovider.h
@@ -18,10 +18,14 @@
#ifndef TOKENPROVIDER_H
#define TOKENPROVIDER_H
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#else
// enable JAVASCRIPT interpreter
#define USE_JAVASCRIPT
// use KJS instead of
#define NO_KJS_EMBED
+#endif
#include <tqstring.h>
#include <tqregexp.h>