[Mono-dev] [PATCH v2 7/8] eglib: Fix hardcoded library dependencies for Haiku
Andreas Färber
andreas.faerber at web.de
Wed Mar 31 20:27:58 EDT 2010
Haiku neither has libm nor libdl. On Mac OS X, libm.dylib is just a symlink
to libSystem.dylib.
Introduce autoconf checks for these libraries.
v1 -> v2:
* Add checks for libm and libdl.
This commit is licensed under the MIT X11 license.
---
eglib/ChangeLog | 8 ++++++++
eglib/configure.ac | 2 ++
eglib/src/Makefile.am | 2 --
eglib/test/Makefile.am | 2 +-
4 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/eglib/ChangeLog b/eglib/ChangeLog
index 5db80e9..3a6a22e 100644
--- a/eglib/ChangeLog
+++ b/eglib/ChangeLog
@@ -1,3 +1,11 @@
+2010-03-30 Andreas Faerber <andreas.faerber at web.de>
+
+ * configure.ac: Add checks for libm and libdl.
+ * {src,test}/Makefile.am: Remove hardcoded library dependencies.
+ Fixes compilation on Haiku.
+
+ Contributed under MIT/X11 license.
+
2010-03-05 Zoltan Varga <vargaz at gmail.com>
* test/test.c (_GNU_SOURCE): Fix compilation if _GNU_SOURCE is already defined.
diff --git a/eglib/configure.ac b/eglib/configure.ac
index f075d78..6d818ee 100644
--- a/eglib/configure.ac
+++ b/eglib/configure.ac
@@ -70,6 +70,8 @@ AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(void *)
AC_CHECK_FUNCS(strndup strlcpy getpwent_r strtok_r rewinddir)
AC_CHECK_LIB(iconv, libiconv_open, LIBS="$LIBS -liconv")
+AC_SEARCH_LIBS(sqrtf, m)
+AC_SEARCH_LIBS(dlopen, dl)
old_ldflags="${LDFLAGS}"
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
AC_TRY_LINK(, [int i;], found_export_dynamic=yes, found_export_dynamic=no)
diff --git a/eglib/src/Makefile.am b/eglib/src/Makefile.am
index 337c988..8cd29dc 100644
--- a/eglib/src/Makefile.am
+++ b/eglib/src/Makefile.am
@@ -51,8 +51,6 @@ INCLUDES = -I$(srcdir)
if HOST_WIN32
libeglib_la_LIBADD = -lm -liconv -lpsapi
-else
-libeglib_la_LIBADD = -lm -ldl
endif
libeglib_static_la_LIBADD = $(libeglib_la_LIBADD)
diff --git a/eglib/test/Makefile.am b/eglib/test/Makefile.am
index 4f825b3..3411ef9 100644
--- a/eglib/test/Makefile.am
+++ b/eglib/test/Makefile.am
@@ -30,7 +30,7 @@ SOURCES = \
test_eglib_SOURCES = $(SOURCES)
test_eglib_CFLAGS = -Wall -Werror -D_FORTIFY_SOURCE=2 -I$(srcdir)/../src -I../src -DDRIVER_NAME=\"EGlib\"
-test_eglib_LDADD = ../src/libeglib.la -ldl
+test_eglib_LDADD = ../src/libeglib.la
run-eglib: all
./test-eglib
--
1.7.0.3
More information about the Mono-devel-list
mailing list