summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2008-01-13 01:43:30 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2008-01-13 01:43:30 +0000
commit3e18aa68aa582bf16cc1ccffdd2cf3b4ca8a3dbf (patch)
treeafa2f1cace5c2a1189af2e074053e229a43998a6 /configure.in
parentea41f5b9998b3311202c52b7ce44f72cc538cbc1 (diff)
downloadlibrcc-3e18aa68aa582bf16cc1ccffdd2cf3b4ca8a3dbf.tar.gz
librcc-3e18aa68aa582bf16cc1ccffdd2cf3b4ca8a3dbf.tar.bz2
librcc-3e18aa68aa582bf16cc1ccffdd2cf3b4ca8a3dbf.tar.xz
librcc-3e18aa68aa582bf16cc1ccffdd2cf3b4ca8a3dbf.zip
Portability Fixes
- FreeBSD compability fixes of autoconf scripts by Ulrich Spoerlein - Some hard to understand parts of autoconf scripts are rewriten. Again many thanks to Ulrich Spoerlein for pointing.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in176
1 files changed, 118 insertions, 58 deletions
diff --git a/configure.in b/configure.in
index ce87ce8..4e6b9e7 100644
--- a/configure.in
+++ b/configure.in
@@ -29,21 +29,6 @@ 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_ARG_ENABLE( libtranslate,
- [ --disable-libtranslate disable usage of libtranslate],,
- disable_libtranslate="yes")
-
-AC_ARG_ENABLE( bdb,
- [ --disable-bdb disable usage of berkeleydb for recodings caching],,
- disable_bdb="yes")
-
-AC_ARG_ENABLE( force-system-iconv,
- [ --enable-force-system-iconv force usage of iconv library from glibc],,
- enable_force_system_iconv="no")
AC_PROG_CC
AM_PROG_CC_C_O
@@ -60,8 +45,8 @@ AC_SUBST(pkgdatadir)
CFLAGS="$CFLAGS -Wall -Wpointer-arith"
if test ! -f /usr/include/iconv.h -a -f /usr/local/include/iconv.h ; then
- CFLAGS+=" -I/usr/local/include"
- LIBS+=" -L/usr/local/lib"
+ CFLAGS="$CFLAGS -I/usr/local/include"
+ LIBS="$LIBS -L/usr/local/lib"
fi
dnl Checks for programs.
@@ -80,6 +65,9 @@ AC_TRY_COMPILE([#include <langinfo.h>],
dnl Checks for libraries.
+dnl ***
+dnl *** LibXML2 (Mandatory)
+dnl ***
AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
if test $XML2_CONFIG = no; then
AC_MSG_ERROR(LibXML2 is required)
@@ -89,6 +77,9 @@ XML_INCLUDES="\`xml2-config --cflags\`"
AC_SUBST(XML_LIBS)
AC_SUBST(XML_INCLUDES)
+dnl ***
+dnl *** GTK1 (Optional)
+dnl ***
AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
AM_CONDITIONAL(HAVE_GTK, [ test $GTK_CONFIG != no ])
if test $GTK_CONFIG = no; then
@@ -103,9 +94,38 @@ fi
AC_SUBST(GTK1_LIBS)
AC_SUBST(GTK1_INCLUDES)
-PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.0, HAVE_GTK2=yes, HAVE_GTK2=no)
+dnl ***
+dnl *** GLIB 2.0 (Optional)
+dnl ***
+AC_ARG_ENABLE(glib2,
+ [ --disable-glib2 disable glib2 [default=enabled]],,
+ enable_glib2="yes")
+
+if test "x$enable_glib2" = "xyes"; then
+ PKG_CHECK_MODULES(GLIB2, glib-2.0 >= 2.0.0, HAVE_GLIB2=yes, HAVE_GLIB2=no)
+else
+ HAVE_GLIB2=no
+fi
+AM_CONDITIONAL(HAVE_GLIB2, [ test $HAVE_GLIB2 = yes ])
+
+
+dnl ***
+dnl *** GTK 2.0 (Optional)
+dnl ***
+AC_ARG_ENABLE(gtk2,
+ [ --disable-gtk2 disable gtk2 [default=enabled]],,
+ enable_gtk2="yes")
+
+if test "x$enable_gtk2" = "xyes"; then
+ PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.0, HAVE_GTK2=yes, HAVE_GTK2=no)
+else
+ HAVE_GTK2=no
+fi
AM_CONDITIONAL(HAVE_GTK2, [ test $HAVE_GTK2 = yes ])
+dnl ***
+dnl *** Shared libraries support
+dnl ***
AC_CHECK_HEADER(dlfcn.h, [AC_CHECK_LIB(dl, dlopen, [
AC_DEFINE(HAVE_DLOPEN,1,[Defines if dlopen is available])
DLOPEN_LIBS="-ldl"
@@ -123,25 +143,35 @@ AC_CHECK_HEADER(dlfcn.h, [AC_CHECK_LIB(dl, dlopen, [
])])
+dnl ***
+dnl *** Find IConv library (External / GLibc embeded)
+dnl ***
EXTRA_LIBS=""
-EXTERNAL_ICONV=no
HAVE_LIBCHARSET=no
+EXTERNAL_ICONV=no
+
+AC_ARG_ENABLE( force-system-iconv,
+ [ --enable-force-system-iconv force usage of iconv library from glibc],,
+ enable_force_system_iconv="no")
if test "x$enable_force_system_iconv" != "xyes"; then
-AC_CHECK_LIB(iconv, iconv_open, [
- EXTERNAL_ICONV=yes
- EXTRA_LIBS+=" -liconv"
-])
-AC_CHECK_HEADER(libcharset.h, [AC_CHECK_LIB(charset, locale_charset, [
+ AC_CHECK_LIB(iconv, iconv_open, [
+ EXTERNAL_ICONV=yes
+ EXTRA_LIBS="$EXTRA_LIBS -liconv"
+ ])
+ AC_CHECK_HEADER(libcharset.h, [AC_CHECK_LIB(charset, locale_charset, [
AC_DEFINE(HAVE_LIBCHARSET,1,[Defines if libRCD is available])
HAVE_LIBCHARSET=yes
- EXTRA_LIBS+=" -lcharset"
-])])
+ EXTRA_LIBS="$EXTRA_LIBS -lcharset"
+ ])])
fi
AM_CONDITIONAL(HAVE_LIBCHARSET, [ test "x$HAVE_LIBCHARSET" = "xyes" ])
AC_SUBST(EXTRA_LIBS)
+dnl ***
+dnl *** Encoding detection engines: LibRCD, Enca, LibGUESS
+dnl ***
RCD_LIBS=""
RCD_INCLUDES=""
HAVE_RCD=no
@@ -152,19 +182,23 @@ LIBGUESS_LIBS=""
LIBGUESS_INCLUDES=""
HAVE_LIBGUESS=no
+AC_ARG_ENABLE( force-dynamic-engines,
+ [ --enable-force-dynamic-engines force usage of dynamic engines],,
+ enable_force_dynamic_engines="no")
+
if test "x$enable_force_dynamic_engines" != "xyes"; then
-AC_CHECK_HEADER(librcd.h, [AC_CHECK_LIB(rcd, rcdGetRussianCharset, [
+ 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=""
HAVE_RCD=yes
-])])
-AC_CHECK_HEADER(enca.h, [AC_CHECK_LIB(enca, enca_analyse, [
+ ])])
+ 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
-])])
+ ])])
fi
AC_CHECK_HEADER(libguess.h, [AC_CHECK_LIB(guess, guess_jp, [
@@ -204,12 +238,14 @@ fi
AC_SUBST(DLOPEN_LIBS)
AC_SUBST(DLOPEN_INCLUDES)
+dnl ***
+dnl *** BerkeleyDB
+dnl ***
+AC_ARG_ENABLE( bdb,
+ [ --disable-bdb disable support of recodings caching using BerkeleyDB],,
+ enable_bdb="yes")
-if test "x$disable_bdb" != "xyes"; then
- BDB_LIBS=""
- BDB_INCLUDES=""
- HAVE_BDB=no
-else
+if test "x$enable_bdb" = "xyes"; then
AX_PATH_BDB([4],[
BDB_LIBS="$BDB_LDFLAGS $BDB_LIBS"
BDB_INCLUDES="$BDB_CPPFLAGS"
@@ -219,41 +255,51 @@ else
BDB_INCLUDES=""
HAVE_BDB=no
])
+else
+ BDB_LIBS=""
+ BDB_INCLUDES=""
+ HAVE_BDB=no
fi
AC_SUBST(BDB_LIBS)
AC_SUBST(BDB_INCLUDES)
-PKG_CHECK_MODULES(GLIB2, glib-2.0 >= 2.0.0, HAVE_GLIB2=yes, HAVE_GLIB2=no)
-AM_CONDITIONAL(HAVE_GLIB2, [ test $HAVE_GLIB2 = yes ])
+dnl ***
+dnl *** LibTranslate (Optional)
+dnl ***
+AC_ARG_ENABLE( libtranslate,
+ [ --disable-libtranslate disable usage of libtranslate],,
+ enable_libtranslate="yes")
+if test "x$enable_libtranslate" = "xyes"; then
+ PKG_CHECK_MODULES(LIBTRANSLATE, [libtranslate], [
+ HAVE_LIBTRANSLATE=yes
+ ],[
+ HAVE_LIBTRANSLATE=no
+ ])
-if test "x$disable_libtranslate" != "xyes"; then
+ if test $HAVE_LIBTRANSLATE = yes; then
+ AC_DEFINE(HAVE_LIBTRANSLATE,1,[Defines if libtranslate is available])
+ AC_CHECK_LIB(translate, translate_session_timed_translate_text, [
+ HAVE_LIBTRANSLATE_TIMED_TRANSLATE=yes
+ AC_DEFINE(HAVE_LIBTRANSLATE_TIMED_TRANSLATE,1,[Defines if libtranslate has time limited translate])
+ ],[
+ HAVE_LIBTRANSLATE_TIMED_TRANSLATE=no
+ ])
+ else
+ HAVE_LIBTRANSLATE_TIMED_TRANSLATE=no
+ fi
+else
HAVE_LIBTRANSLATE=no
HAVE_LIBTRANSLATE_TIMED_TRANSLATE=no
LIBTRANSLATE_LIBS=""
LIBTRANSLATE_CFLAGS=""
AC_SUBST(LIBTRANSLATE_LIBS)
AC_SUBST(LIBTRANSLATE_CFLAGS)
-else
-PKG_CHECK_MODULES(LIBTRANSLATE, [libtranslate], [
- HAVE_LIBTRANSLATE=yes
-],[
- HAVE_LIBTRANSLATE=no
-])
-
-if test $HAVE_LIBTRANSLATE = yes; then
- AC_DEFINE(HAVE_LIBTRANSLATE,1,[Defines if libtranslate is available])
- AC_CHECK_LIB(translate, translate_session_timed_translate_text, [
- HAVE_LIBTRANSLATE_TIMED_TRANSLATE=yes
- AC_DEFINE(HAVE_LIBTRANSLATE_TIMED_TRANSLATE,1,[Defines if libtranslate has time limited translate])
- ],[
- HAVE_LIBTRANSLATE_TIMED_TRANSLATE=no
- ])
-else
- HAVE_LIBTRANSLATE_TIMED_TRANSLATE=no
-fi
fi
+dnl ***
+dnl *** Aspell (Optional)
+dnl ***
AM_PATH_ASPELL([
AC_DEFINE(HAVE_ASPELL,1,[Defines if aspell is available])
HAVE_ASPELL=yes
@@ -262,7 +308,17 @@ AM_PATH_ASPELL([
])
-PTHREAD_LIBS=error
+dnl ***
+dnl *** Threading library
+dnl ***
+AC_MSG_CHECKING([for PTHREAD_LIBS])
+if test "x$PTHREAD_LIBS" = "x"; then
+ PTHREAD_LIBS=error
+else
+ AC_MSG_RESULT([$PTHREAD_LIBS])
+fi
+
+if test "x$PTHREAD_LIBS" = "xerror"; then
AC_EGREP_CPP(yes,[
#if (defined(__FreeBSD_cc_version) && __FreeBSD_cc_version <= 500001) || defined(__OpenBSD__)
yes
@@ -271,6 +327,7 @@ AC_EGREP_CPP(yes,[
PTHREAD_CFLAGS="-D_THREAD_SAFE"
PTHREAD_LIBS="-pthread"
)
+fi
if test "x$PTHREAD_LIBS" = "xerror"; then
AC_CHECK_LIB(pthread, pthread_mutex_lock, PTHREAD_LIBS="-lpthread")
fi
@@ -308,8 +365,11 @@ AC_CHECK_FUNCS(strcasecmp strncasecmp strdup strnlen)
AC_OUTPUT(src/Makefile engines/Makefile external/Makefile ui/Makefile examples/Makefile Makefile librcc.spec)
+dnl ***
+dnl *** Data directory
+dnl ***
rccdir=${pkgdatadir}
-while expr ${rccdir:0:1} == '$' &>/dev/null; do
+while expr "${rccdir}" : "\\\$" >/dev/null; do
rccdir=`eval echo $rccdir`
done