summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in114
1 files changed, 96 insertions, 18 deletions
diff --git a/configure.in b/configure.in
index e2fe1c4..7d50ab6 100644
--- a/configure.in
+++ b/configure.in
@@ -29,6 +29,10 @@ AC_SUBST(LIBRCC_CVS_DATE)
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+AC_ARG_ENABLE( force-dynamic-engines,
+ [ --enable-force-dynamic-engines force usage of dynamic engines],,
+ enable_force_dynamic_engines="no")
+
AC_PROG_CC
AC_PROG_INSTALL
AM_PROG_LIBTOOL
@@ -41,7 +45,7 @@ dnl Checks for programs.
dnl Checks for header files.
AC_CHECK_HEADERS(iconv.h,, [AC_MSG_ERROR(Missing iconv header)])
-AC_CHECK_HEADERS(mntent.h pwd.h sys/types.h unistd.h)
+AC_CHECK_HEADERS(mntent.h pwd.h sys/types.h sys/stat.h unistd.h)
AC_TRY_COMPILE([#include <langinfo.h>],
[char *codeset = nl_langinfo (CODESET);],
@@ -61,37 +65,97 @@ AC_SUBST(XML_INCLUDES)
AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
AM_CONDITIONAL(HAVE_GTK, [ test $GTK_CONFIG != no ])
-GTK_LIBS="\`gtk-config --libs\`"
-GTK_INCLUDES="\`gtk-config --cflags\`"
+if test $GTK_CONFIG = no; then
+ GTK_LIBS=""
+ GTK_INCLUDES=""
+ HAVE_GTK=no
+else
+ GTK_LIBS="\`gtk-config --libs\`"
+ GTK_INCLUDES="\`gtk-config --cflags\`"
+ HAVE_GTK=yes
+fi
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_INCLUDES)
+AC_CHECK_HEADER(dlfcn.h, [AC_CHECK_LIB(dl, dlopen, [
+ AC_DEFINE(HAVE_DLOPEN,1,[Defines if dlopen is available])
+ DLOPEN_LIBS="-ldl"
+ DLOPEN_INCLUDES=""
+ HAVE_DLOPEN=yes
+],[
+ DLOPEN_LIBS=""
+ DLOPEN_INCLUDES=""
+ HAVE_DLOPEN=no
+])])
+
+if test $enable_force_dynamic_engines = yes; then
+ RCD_LIBS=""
+ RCD_INCLUDES=""
+ HAVE_RCD=no
+ ENCA_LIBS=""
+ ENCA_INCLUDES=""
+ HAVE_ENCA=no
+else
AC_CHECK_HEADER(librcd.h, [AC_CHECK_LIB(rcd, rcdGetRussianCharset, [
+ AC_DEFINE(HAVE_RCD,1,[Defines if libRCD is available])
RCD_LIBS="-lrcd"
RCD_INCLUDES=""
-], AC_MSG_ERROR(LibRCD is required))], [AC_MSG_ERROR(LibRCD is required)])
-AC_SUBST(RCD_LIBS)
-AC_SUBST(RCD_INCLUDES)
-
-AC_CHECK_HEADER(enca.h, [AC_CHECK_LIB(enca, enca_analyse, [
- AC_DEFINE(HAVE_ENCA,1,[Defines if enca is available])
- ENCA_LIBS="-lenca"
- ENCA_INCLUDES=""
+ HAVE_RCD=yes
+],[
+ RCD_LIBS=""
+ RCD_INCLUDES=""
+ HAVE_RCD=no
])])
-
-if test "x$ENCA_LIBS" = "x"; then
- AC_CHECK_HEADER(dlfcn.h, [AC_CHECK_LIB(dl, dlopen, [
- AC_DEFINE(HAVE_DLOPEN,1,[Defines if dlopen is available])
- ENCA_LIBS="-ldl"
+AC_CHECK_HEADER(enca.h, [AC_CHECK_LIB(enca, enca_analyse, [
+ AC_DEFINE(HAVE_ENCA,1,[Defines if enca is available])
+ ENCA_LIBS="-lenca"
ENCA_INCLUDES=""
- ],[
+ HAVE_ENCA=yes
+],[
ENCA_LIBS=""
ENCA_INCLUDES=""
- ])])
+ HAVE_ENCA=no
+])])
fi
+
+AC_SUBST(RCD_LIBS)
+AC_SUBST(RCD_INCLUDES)
AC_SUBST(ENCA_LIBS)
AC_SUBST(ENCA_INCLUDES)
+USE_DLOPEN=no
+if test $HAVE_DLOPEN = yes; then
+ if test $HAVE_ENCA = no; then
+ HAVE_ENCA=dynamic
+ USE_DLOPEN=yes
+ fi
+ if test $HAVE_RCD = no; then
+ HAVE_RCD=dynamic
+ USE_DLOPEN=yes
+ fi
+
+ if test $USE_DLOPEN = no; then
+ DLOPEN_LIBS=""
+ DLOPEN_INCLUDES=""
+ fi
+fi
+AC_SUBST(DLOPEN_LIBS)
+AC_SUBST(DLOPEN_INCLUDES)
+
+
+AX_PATH_BDB([4],[
+ BDB_LIBS="$BDB_LDFLAGS $BDB_LIBS"
+ BDB_INCLUDES="$BDB_CPPFLAGS"
+ HAVE_BDB=yes
+],[
+ BDB_LIBS=""
+ BDB_INCLUDES=""
+ HAVE_BDB=no
+])
+AC_SUBST(BDB_LIBS)
+AC_SUBST(BDB_INCLUDES)
+
+
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -99,3 +163,17 @@ dnl Checks for library functions.
AC_CHECK_FUNCS(strcasecmp strncasecmp strdup)
AC_OUTPUT(src/Makefile ui/Makefile examples/Makefile Makefile librcc.spec)
+
+echo ""
+echo "Configuration:"
+echo " Dynamic Engine Loading Support: $HAVE_DLOPEN"
+echo " Enca Charset Detection Support: $HAVE_ENCA"
+echo " LibRCD Charset Detection Support: $HAVE_RCD"
+echo ""
+echo " Multilanguage support with DB4: $HAVE_BDB"
+echo ""
+echo "User Interfaces:"
+echo " GTK User Interface: $HAVE_GTK"
+echo ""
+echo ""
+echo ""