commit a58ac1377a6146dfaef3146590e751322a9c78e7
Author: Paolo Bonzini
Date: Mon Nov 1 01:18:59 2010 +0100
do not install libc.la if it is not necessary
diff --git a/Makefile.am b/Makefile.am
index 90619dd..576b578 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -59,7 +59,10 @@ dist_noinst_SCRIPTS = build-aux/texi2dvi build-aux/texi2html \
pkgconfigdir = $(libdir)/pkgconfig
nodist_pkgconfig_DATA = gnu-smalltalk.pc
+if NEED_LIBC_LA
module_DATA = libc.la
+endif
+
noinst_DATA = gst.im
dist_noinst_DATA += smalltalk-mode-init.el.in gst-mode.el.in \
.gdbinit scripts/Finish.st gsticon.ico packages/xml/ChangeLog \
diff --git a/build-aux/libc-so-name.m4 b/build-aux/libc-so-name.m4
index 6ba110a..603fe58 100644
--- a/build-aux/libc-so-name.m4
+++ b/build-aux/libc-so-name.m4
@@ -9,7 +9,30 @@ dnl the same distribution terms as the rest of that program.
dnl Sets the variables LIBC_SO_NAME and LIBC_SO_DIR to the directory
dnl and basename for the C library.
AC_DEFUN([GST_LIBC_SO_NAME],
-[AC_CACHE_CHECK([how to dlopen the C library], gst_cv_libc_so_name, [
+[AC_CACHE_CHECK([whether lt_dlopenext("libc") works], gst_cv_libc_dlopen_works,
+[save_CFLAGS=$CFLAGS
+save_LIBS=$LIBS
+CFLAGS="$CFLAGS $INCLTDL"
+LIBS="$CFLAGS $LIBLTDL"
+AC_RUN_IFELSE(AC_LANG_PROGRAM([[
+#include
+`test $with_system_libltdl = no && echo '#include "ltdl.c"' `
+]], [[
+lt_dlinit();
+return lt_dlopenext("libc") == NULL ? 1 : 0;
+]]), [gst_cv_libc_dlopen_works=yes],
+ [gst_cv_libc_dlopen_works=no],
+ [gst_cv_libc_dlopen_works=no])
+CFLAGS=$save_CFLAGS
+LIBS=$save_LIBS
+])
+
+AM_CONDITIONAL([NEED_LIBC_LA], [test "$gst_cv_libc_dlopen_works" = no])
+if test "$gst_cv_libc_dlopen_works" = no; then
+ AC_CONFIG_FILES(libc.la)
+fi
+
+AC_CACHE_CHECK([how to dlopen the C library], gst_cv_libc_so_name, [
if test $GCC = yes; then
gst_lib_path=`$CC --print-multi-os-directory $CFLAGS $CPPFLAGS`
case $gst_lib_path in
diff --git a/configure.ac b/configure.ac
index 18d53ef..f780339 100644
--- a/configure.ac
+++ b/configure.ac
@@ -295,8 +295,6 @@ AC_CHECK_SIZEOF(wchar_t, , [[
AC_CHECK_SIZEOF(OOP, , [[
typedef void *OOP;]])
-GST_LIBC_SO_NAME
-
AC_LIBTOOL_DLOPEN
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
@@ -400,6 +398,7 @@ dnl ------------------------- OTHER LIBRARIES -------------------
{ echo; echo "${term_bold}Auxiliary libraries:${term_norm}"; } >& AS_MESSAGE_FD
+GST_LIBC_SO_NAME
GST_HAVE_GMP
GST_HAVE_READLINE
@@ -877,7 +876,6 @@ AC_CONFIG_FILES(gnu-smalltalk.pc)
AC_CONFIG_FILES(gst-config, chmod +x gst-config)
AC_CONFIG_FILES(tests/gst, chmod +x tests/gst)
AC_CONFIG_FILES(tests/atlocal)
-AC_CONFIG_FILES(libc.la)
dnl Master Makefile
AC_CONFIG_FILES(Makefile)