automake: add WITH_NATIVE_GNU_BARCODE and WITH_JAVASCRIPT build options

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/3/head
Slávek Banko 6 years ago
parent dabe93bad2
commit 6248169007
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -5,3 +5,37 @@ AM_INIT_AUTOMAKE(kbarcode, 2.0.7)
AC_C_BIGENDIAN AC_C_BIGENDIAN
AC_CHECK_KDEMAXPATHLEN 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

@ -18,6 +18,10 @@
#ifndef GNU_BARCODE_H #ifndef GNU_BARCODE_H
#define GNU_BARCODE_H #define GNU_BARCODE_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
// #define _ENABLE_NATIVE_GNU_BARCODE // #define _ENABLE_NATIVE_GNU_BARCODE
#ifdef _ENABLE_NATIVE_GNU_BARCODE #ifdef _ENABLE_NATIVE_GNU_BARCODE

@ -18,10 +18,14 @@
#ifndef TOKENPROVIDER_H #ifndef TOKENPROVIDER_H
#define TOKENPROVIDER_H #define TOKENPROVIDER_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#else
// enable JAVASCRIPT interpreter // enable JAVASCRIPT interpreter
#define USE_JAVASCRIPT #define USE_JAVASCRIPT
// use KJS instead of // use KJS instead of
#define NO_KJS_EMBED #define NO_KJS_EMBED
#endif
#include <tqstring.h> #include <tqstring.h>
#include <tqregexp.h> #include <tqregexp.h>

Loading…
Cancel
Save