blob: f53fb7910511a1cc5bb9dce7c91072fb71c565fb [file] [log] [blame]
Link with libm to fix unresolved symbols when linked with as-needed
and add a soname to the standalone math library
R bug: https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14953
Patch by Sebastien Fabbro
Adapted to R-3.0.0 by Denis Dupeyron
--- src/nmath/standalone/Makefile.in.orig 2013-04-04 14:39:15.777544946 -0600
+++ src/nmath/standalone/Makefile.in 2013-04-04 14:40:51.256153179 -0600
@@ -64,7 +64,8 @@
Rexeclibdir_LTLIBRARIES = $(libRmath_la)
libRmath_la_SOURCES = $(SOURCES)
libRmath_la_OBJECTS = $(OBJECTS:.o=.lo)
-libRmath_la_LDFLAGS =
+libRmath_la_LDFLAGS = -Wl,-soname=libRmath.so
+libRmath_la_LIBADD = $(LIBM)
CLEANFILES = Makedeps *.d *.o *.lo test $(SOURCES)
DISTCLEANFILES = Makefile $(Rexeclibdir_LIBRARIES) $(Rexeclibdir_LTLIBRARIES)
@@ -117,7 +118,7 @@
## under peculiar circumstances, $(LIBM) here helps.
$(libRmath_la): $(libRmath_la_OBJECTS)
- $(DYLIB_LINK) -o $@ $(libRmath_la_LDFLAGS) $(libRmath_la_OBJECTS) $(LIBM)
+ $(DYLIB_LINK) $(libRmath_la_LDFLAGS) $(libRmath_la_OBJECTS) $(libRmath_la_LIBADD) -o $@
test: $(srcdir)/test.c
$(CC) -o $@ $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(srcdir)/test.c \