Permalink
Browse files

Fix to be able to enable modules and a build issue with modules enabl…

…ed. sigh
  • Loading branch information...
1 parent eb8036f commit ae81a0a326fe9a8bb0fce8c1e63a6884ab9e2518 @tagoh committed Dec 12, 2012
Showing with 9 additions and 10 deletions.
  1. +5 −7 configure.ac
  2. +1 −0 liblangtag/Makefile.am
  3. +3 −3 liblangtag/lt-ext-module.c
View
@@ -203,12 +203,9 @@ dnl functions testing
dnl ======================================================================
AX_CREATE_STDINT_H([liblangtag/lt-stdint.h])
AC_CHECK_HEADERS([dirent.h execinfo.h libgen.h sys/param.h])
-AC_CHECK_FUNCS([backtrace dlopen strndup vasprintf vsnprintf])
+AC_CHECK_FUNCS([backtrace strndup vasprintf vsnprintf])
AC_CHECK_VA_COPY
-if test "x$ac_cv_func_dlopen" != xyes; then
- enable_modules=no
-fi
if test "x$ac_cv_func_vsnprintf" = xyes; then
AC_CACHE_CHECK([Whether vsnprintf is C99-compliant], [lt_cv_c99_vsnprintf],
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
@@ -322,11 +319,12 @@ if test "x$enable_modules" != "xno"; then
if test "x$lt_module_suffix" = x; then
AC_MSG_ERROR(Unable to determine shared libreary suffix from libtool)
fi
- AC_CHECK_LIB(dl, dlopen,
- [AC_CHECK_LIB(dl, dlsym, [MODULE_LIBS=-ldl])])
+ use_modules=0
+ AC_CHECK_LIB([dl], [dlopen],
+ [AC_CHECK_LIB([dl], [dlsym], [MODULE_LIBS=-ldl; use_modules=1])])
AC_SUBST(MODULE_LIBS)
- AC_DEFINE(ENABLE_MODULE, 1, [Use modules])
+ AC_DEFINE_UNQUOTED(ENABLE_MODULE, $use_modules, [Use modules])
AC_DEFINE_UNQUOTED(LT_MODULE_SUFFIX, "$lt_module_suffix", [Shared library suffix])
fi
AM_CONDITIONAL(ENABLE_MODULE, test x$MODULE_LIBS != x)
@@ -140,6 +140,7 @@ liblangtag_sources = \
stamp_files = \
$(NULL)
included_modules = $(NULL)
+
if !ENABLE_MODULE
included_modules += \
$(top_builddir)/extensions/liblangtag-ext-ldml-t.la \
@@ -74,7 +74,7 @@ static lt_bool_t _lt_ext_eaw_parse_tag (lt_ext_module_data_t
static char *_lt_ext_eaw_get_tag (lt_ext_module_data_t *data);
static lt_bool_t _lt_ext_eaw_validate_tag (lt_ext_module_data_t *data);
-#ifndef ENABLE_MODULE
+#if !ENABLE_MODULE
extern const lt_ext_module_funcs_t *LT_MODULE_SYMBOL_ (lt_module_ext_t, get_funcs) (void);
extern const lt_ext_module_funcs_t *LT_MODULE_SYMBOL_ (lt_module_ext_u, get_funcs) (void);
#endif
@@ -383,7 +383,7 @@ lt_ext_module_new(const char *name)
lt_return_val_if_fail (name != NULL, NULL);
-#ifdef ENABLE_MODULE
+#if ENABLE_MODULE
retval = lt_mem_alloc_object(sizeof (lt_ext_module_t));
if (retval) {
@@ -568,7 +568,7 @@ lt_ext_module_precheck_tag(lt_ext_module_t *module,
void
lt_ext_modules_load(void)
{
-#ifdef ENABLE_MODULE
+#if ENABLE_MODULE
const char *env = getenv("LANGTAG_EXT_MODULE_PATH");
char *path_list, *s, *p, *path;
size_t suffix_len = strlen(LT_MODULE_SUFFIX) + 1;

0 comments on commit ae81a0a

Please sign in to comment.