[PATCH 1/5] configury: support DLLs on OS/2
KO Myung-Hun <[email protected]> Thu, 20 Nov 2014 13:55:19 +0900
| Newsgroups | gmane.comp.gnu.m4.patches |
|---|---|
| Message-ID | <[email protected]> |
Without -no-undefined, DLLs are not created on OS/2.
Without -avoid-version, M4 cannot load modules. Because on OS/2, links
without version-info to DLLs with version-info are not created, however
m4 tries to load modules without version-info.
* Makefile.am (AM_LDFLAGS): Add OS2_LDFLAGS.
(module_ldflags): Add -avoid-version on OS/2.
* configure.ac (OS2_LDFLAGS): Add -no-undefined on *-*-os2*.
(HAVE_OS2): Define it on os2*.
---
Makefile.am | 5 ++++-
configure.ac | 5 +++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index e9ec90d..72bdfab 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,7 +41,7 @@ changelog_old = $(srcdir)/ChangeLog.old
# See http://lists.gnu.org/archive/html/libtool-patches/2007-02/msg00062.html
AM_CPPFLAGS = -I$(srcdir) -I.
AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
-AM_LDFLAGS = -export-dynamic -export-symbols-regex ".*"
+AM_LDFLAGS = -export-dynamic -export-symbols-regex ".*" $(OS2_LDFLAGS)
EXTRA_DIST =
BUILT_SOURCES =
CLEANFILES =
@@ -149,6 +149,9 @@ MOSTLYCLEANFILES += src/getopt.h src/getopt.h-t
## -------- ##
module_ldflags = -module $(AM_LDFLAGS)
+if HAVE_OS2
+module_ldflags += -avoid-version
+endif
module_libadd = m4/libm4.la
noinst_HEADERS = modules/m4.h
diff --git a/configure.ac b/configure.ac
index 2fe6d9e..d05f637 100644
--- a/configure.ac
+++ b/configure.ac
@@ -275,6 +275,11 @@ AM_CONDITIONAL([USE_GMP], [test "x$USE_GMP" = xyes])
M4_SYSCMD
+AS_CASE([$host], [*-*-os2*], [OS2_LDFLAGS="-no-undefined"])
+AC_SUBST([OS2_LDFLAGS])
+AM_CONDITIONAL([HAVE_OS2], [test -z "${host_os##os2*}"])
+
+
## -------- ##
## Outputs. ##
## -------- ##
--
1.8.5.2