mirror of https://github.com/MidnightCommander/mc
Ticket #2129: fix build with static GLib.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru> Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
86fc45dd40
commit
9645d3f256
|
@ -145,7 +145,6 @@ dnl Check for main libraies
|
|||
dnl ############################################################################
|
||||
|
||||
AC_CHECK_GLIB
|
||||
AC_G_MODULE_SUPPORTED
|
||||
MC_WITH_SCREEN
|
||||
MC_CHECK_SEARCH_TYPE
|
||||
dnl X11 support. Used to read keyboard modifiers when running under X11.
|
||||
|
@ -314,7 +313,7 @@ linux*)
|
|||
[AC_DEFINE(HAVE_LIBGPM, 1,
|
||||
[Define to enable gpm mouse support on Linux])
|
||||
mouse_lib="gpm and xterm"
|
||||
MCLIBS="$MCLIBS -lgpm"],
|
||||
MCLIBS="$MCLIBS -lgpm -ltinfo"],
|
||||
if test "x$with_gpm_mouse" = "xyes"; then
|
||||
[AC_MSG_ERROR([libgpm is missing or older than 0.18])]
|
||||
else
|
||||
|
|
|
@ -63,12 +63,10 @@ libmc_la_LIBADD = \
|
|||
vfs/libmcvfs.la \
|
||||
widget/libmcwidget.la
|
||||
|
||||
libmc_la_LIBADD += $(MCLIBS) $(SLANGLIB)
|
||||
|
||||
if HAVE_GMODULE
|
||||
libmc_la_LIBADD += $(GMODULE_LIBS)
|
||||
else
|
||||
libmc_la_LIBADD += $(GLIB_LIBS)
|
||||
endif
|
||||
|
||||
libmc_la_LIBADD += $(PCRE_LIBS) $(LIBICONV) $(INTLLIBS)
|
||||
libmc_la_LIBADD += \
|
||||
$(MCLIBS) \
|
||||
$(SLANGLIB) \
|
||||
$(GLIB_LIBS) \
|
||||
$(PCRE_LIBS) \
|
||||
$(LIBICONV) \
|
||||
$(INTLLIBS)
|
||||
|
|
|
@ -25,11 +25,4 @@ endif
|
|||
|
||||
libmctty_la_SOURCES = $(TTY_SRC) $(TTY_SCREEN_SRC)
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)
|
||||
|
||||
if HAVE_GMODULE
|
||||
AM_CPPFLAGS += $(GMODULE_CFLAGS)
|
||||
else
|
||||
AM_CPPFLAGS += $(GLIB_CFLAGS)
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir) $(GLIB_CFLAGS)
|
||||
|
|
|
@ -3,48 +3,72 @@ dnl Check whether the g_module_* family of functions works
|
|||
dnl on this system. We need to know that at the compile time to
|
||||
dnl decide whether to link with X11.
|
||||
dnl
|
||||
AC_DEFUN([AC_G_MODULE_SUPPORTED], [
|
||||
AC_DEFUN([mc_GMODULE_SUPPORTED], [
|
||||
|
||||
g_module_supported=""
|
||||
|
||||
found_gmodule=no
|
||||
PKG_CHECK_MODULES(GMODULE, [gmodule-no-export-2.0 >= 2.12], [found_gmodule=yes], [:])
|
||||
if test x"$found_gmodule" = xyes; then
|
||||
g_module_supported="gmodule-no-export-2.0"
|
||||
if test x$with_glib_static = xyes; then
|
||||
AC_MSG_WARN([Static build is enabled... Cannot use GModule])
|
||||
else
|
||||
dnl try fallback to the generic gmodule
|
||||
PKG_CHECK_MODULES(GMODULE, [gmodule-2.0 >= 2.12], [found_gmodule=yes], [:])
|
||||
found_gmodule=no
|
||||
PKG_CHECK_MODULES(GMODULE, [gmodule-no-export-2.0 >= 2.12], [found_gmodule=yes], [:])
|
||||
if test x"$found_gmodule" = xyes; then
|
||||
g_module_supported="gmodule-2.0"
|
||||
g_module_supported="gmodule-no-export-2.0"
|
||||
else
|
||||
dnl try fallback to the generic gmodule
|
||||
PKG_CHECK_MODULES(GMODULE, [gmodule-2.0 >= 2.12], [found_gmodule=yes], [:])
|
||||
if test x"$found_gmodule" = xyes; then
|
||||
g_module_supported="gmodule-2.0"
|
||||
fi
|
||||
fi
|
||||
|
||||
case x"$g_module_supported" in
|
||||
xgmodule-no-export-2.0|xgmodule-2.0)
|
||||
if test x`$PKG_CONFIG --variable=gmodule_supported "$g_module_supported"` = xtrue; then
|
||||
AC_DEFINE([HAVE_GMODULE], [1], [Defined if gmodule functionality is supported])
|
||||
else
|
||||
g_module_supported=""
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
g_module_supported=""
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x"$g_module_supported" != x; then
|
||||
GLIB_LIBS="$GMODULE_LIBS"
|
||||
GLIB_CFLAGS="$GMODULE_CFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
case x"$g_module_supported" in
|
||||
xgmodule-no-export-2.0|xgmodule-2.0)
|
||||
if test x`$PKG_CONFIG --variable=gmodule_supported "$g_module_supported"` = xtrue; then
|
||||
AC_DEFINE([HAVE_GMODULE], [1], [Defined if gmodule functionality is supported])
|
||||
else
|
||||
g_module_supported=""
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
g_module_supported=""
|
||||
;;
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL([HAVE_GMODULE], [test x"$g_module_supported" != x])
|
||||
])
|
||||
|
||||
AC_DEFUN([mc_CHECK_STATIC_GLIB], [
|
||||
dnl
|
||||
dnl Try to find static libraries for glib and gmodule.
|
||||
dnl
|
||||
AC_ARG_WITH([glib_static],
|
||||
AS_HELP_STRING([--with-glib-static], [Link glib statically @<:@no@:>@]),
|
||||
[
|
||||
if test x$withval = xno; then
|
||||
with_glib_static=no
|
||||
else
|
||||
with_glib_static=yes
|
||||
fi
|
||||
],
|
||||
[with_glib_static=no])
|
||||
|
||||
if test x$with_glib_static = xyes; then
|
||||
dnl Redefine GLIB_LIBS using --static option to define linker flags for static linking
|
||||
GLIB_LIBS=`pkg-config --libs --static glib-2.0`
|
||||
|
||||
GLIB_LIBDIR=`pkg-config --variable=libdir glib-2.0`
|
||||
new_GLIB_LIBS=
|
||||
for i in $GLIB_LIBS; do
|
||||
case x$i in
|
||||
x-lglib*)
|
||||
lib=glib ;;
|
||||
x-lgmodule*)
|
||||
lib=gmodule ;;
|
||||
*)
|
||||
lib=
|
||||
add="$i" ;;
|
||||
|
@ -66,7 +90,6 @@ AC_DEFUN([AC_G_MODULE_SUPPORTED], [
|
|||
done
|
||||
GLIB_LIBS="$new_GLIB_LIBS"
|
||||
fi
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_CHECK_GLIB], [
|
||||
|
@ -76,14 +99,13 @@ AC_DEFUN([AC_CHECK_GLIB], [
|
|||
dnl without any glib won't have their time wasted by other checks.
|
||||
dnl
|
||||
|
||||
AC_ARG_WITH([glib_static],
|
||||
AS_HELP_STRING([--with-glib-static], [Link glib statically @<:@no@:>@]))
|
||||
|
||||
glib_found=no
|
||||
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.12], [glib_found=yes], [:])
|
||||
if test x"$glib_found" = xno; then
|
||||
AC_MSG_ERROR([glib-2.0 not found or version too old (must be >= 2.12)])
|
||||
fi
|
||||
|
||||
mc_CHECK_STATIC_GLIB
|
||||
mc_GMODULE_SUPPORTED
|
||||
])
|
||||
|
||||
|
|
|
@ -45,7 +45,9 @@ libinternal_la_LIBADD = \
|
|||
|
||||
mc_LDADD = \
|
||||
libinternal.la \
|
||||
$(top_builddir)/lib/libmc.la
|
||||
$(top_builddir)/lib/libmc.la \
|
||||
$(GLIB_LIBS) \
|
||||
$(PCRE_LIBS)
|
||||
|
||||
if ENABLE_VFS_SMB
|
||||
# this is a hack for linking with own samba library in simple way
|
||||
|
|
|
@ -4,7 +4,9 @@ AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) @CHECK_CFLAGS@
|
|||
|
||||
AM_LDFLAGS = @TESTS_LDFLAGS@
|
||||
|
||||
LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la
|
||||
LIBS = @CHECK_LIBS@ \
|
||||
$(top_builddir)/lib/libmc.la \
|
||||
$(GLIB_LIBS)
|
||||
|
||||
EXTRA_DIST = utilunix__my_system-common.c
|
||||
|
||||
|
|
|
@ -7,7 +7,9 @@ AM_CPPFLAGS = \
|
|||
|
||||
AM_LDFLAGS = @TESTS_LDFLAGS@
|
||||
|
||||
LIBS=@CHECK_LIBS@ $(top_builddir)/lib/libmc.la
|
||||
LIBS = @CHECK_LIBS@ \
|
||||
$(top_builddir)/lib/libmc.la \
|
||||
$(GLIB_LIBS)
|
||||
|
||||
TESTS = \
|
||||
config_string \
|
||||
|
|
|
@ -5,7 +5,9 @@ AM_CPPFLAGS = \
|
|||
-I$(top_srcdir)/lib/search \
|
||||
@CHECK_CFLAGS@
|
||||
|
||||
LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la
|
||||
LIBS = @CHECK_LIBS@ \
|
||||
$(top_builddir)/lib/libmc.la \
|
||||
$(GLIB_LIBS)
|
||||
|
||||
TESTS = \
|
||||
regex_replace_esc_seq \
|
||||
|
|
|
@ -5,7 +5,9 @@ AM_CPPFLAGS = \
|
|||
-I$(top_srcdir)/lib/search \
|
||||
@CHECK_CFLAGS@
|
||||
|
||||
LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la
|
||||
LIBS = @CHECK_LIBS@ \
|
||||
$(top_builddir)/lib/libmc.la \
|
||||
$(GLIB_LIBS)
|
||||
|
||||
TESTS = \
|
||||
replace__str_replace_all \
|
||||
|
|
|
@ -10,8 +10,9 @@ AM_LDFLAGS = @TESTS_LDFLAGS@
|
|||
|
||||
EXTRA_DIST = mc.charsets
|
||||
|
||||
LIBS=@CHECK_LIBS@ \
|
||||
$(top_builddir)/lib/libmc.la
|
||||
LIBS = @CHECK_LIBS@ \
|
||||
$(top_builddir)/lib/libmc.la \
|
||||
$(GLIB_LIBS)
|
||||
|
||||
TESTS = \
|
||||
canonicalize_pathname \
|
||||
|
|
|
@ -7,8 +7,9 @@ AM_CPPFLAGS = \
|
|||
|
||||
AM_LDFLAGS = @TESTS_LDFLAGS@
|
||||
|
||||
LIBS=@CHECK_LIBS@ \
|
||||
$(top_builddir)/lib/libmc.la
|
||||
LIBS = @CHECK_LIBS@ \
|
||||
$(top_builddir)/lib/libmc.la \
|
||||
$(GLIB_LIBS)
|
||||
|
||||
TESTS = \
|
||||
complete_engine
|
||||
|
|
|
@ -12,9 +12,10 @@ AM_CPPFLAGS = \
|
|||
|
||||
AM_LDFLAGS = @TESTS_LDFLAGS@
|
||||
|
||||
LIBS=@CHECK_LIBS@ \
|
||||
LIBS = @CHECK_LIBS@ \
|
||||
$(top_builddir)/src/libinternal.la \
|
||||
$(top_builddir)/lib/libmc.la
|
||||
$(top_builddir)/lib/libmc.la \
|
||||
$(GLIB_LIBS)
|
||||
|
||||
if ENABLE_VFS_SMB
|
||||
# this is a hack for linking with own samba library in simple way
|
||||
|
|
|
@ -6,9 +6,10 @@ AM_CPPFLAGS = \
|
|||
|
||||
AM_LDFLAGS = @TESTS_LDFLAGS@
|
||||
|
||||
LIBS=@CHECK_LIBS@ \
|
||||
LIBS = @CHECK_LIBS@ \
|
||||
$(top_builddir)/src/libinternal.la \
|
||||
$(top_builddir)/lib/libmc.la
|
||||
$(top_builddir)/lib/libmc.la \
|
||||
$(GLIB_LIBS)
|
||||
|
||||
if ENABLE_VFS_SMB
|
||||
# this is a hack for linking with own samba library in simple way
|
||||
|
|
|
@ -7,9 +7,10 @@ AM_CPPFLAGS = \
|
|||
|
||||
AM_LDFLAGS = @TESTS_LDFLAGS@
|
||||
|
||||
LIBS=@CHECK_LIBS@ \
|
||||
LIBS = @CHECK_LIBS@ \
|
||||
$(top_builddir)/src/libinternal.la \
|
||||
$(top_builddir)/lib/libmc.la
|
||||
$(top_builddir)/lib/libmc.la \
|
||||
$(GLIB_LIBS)
|
||||
|
||||
if ENABLE_VFS_SMB
|
||||
# this is a hack for linking with own samba library in simple way
|
||||
|
|
Loading…
Reference in New Issue