summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2009-04-19 22:28:35 +0200
committerBruno Haible <bruno@clisp.org>2009-04-19 22:28:35 +0200
commitac7526fb13c91cef4fe569ddf7e6ee189fa74180 (patch)
treeffdb6d2a181bc079f97286f598507de20419f5cb /lib
parent9c3f20cc1cae69edbb237cb07dbc9e3a8cf93528 (diff)
downloadlibunistring-ac7526fb13c91cef4fe569ddf7e6ee189fa74180.tar.gz
Support for building as shared library on Cygwin and mingw.
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am15
-rw-r--r--lib/unistring/woe32dll.in.h30
2 files changed, 39 insertions, 6 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 6eaed43..463d272 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -39,7 +39,8 @@ nobase_include_HEADERS = \
unilbrk.h \
uninorm.h \
unicase.h \
- unistring/inline.h
+ unistring/inline.h \
+ unistring/woe32dll.h
noinst_HEADERS = \
unistring-notinline.h
@@ -169,21 +170,23 @@ MOSTLYCLEANFILES += libunistring.sym-t
MAINTAINERCLEANFILES += libunistring.sym
EXTRA_DIST += libunistring.sym
+# Tell the mingw or Cygwin linker which symbols to export.
+if WOE32DLL
+libunistring_la_SOURCES += ../woe32dll/unistring-exports.c
+libunistring_la_LDFLAGS += -Wl,--export-all-symbols
+endif
+
# Hide undesired symbols that are defined by libunistring_la_SOURCES or
# libunistring_la_LIBADD from the global namespace, by prefixing them with
# "libunistring_".
all check install: config.h
config.h: $(BUILT_SOURCES) libunistring.sym
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- : "Avoid double inclusion, to avoid a warning about redefinition of DLL_VARIABLE."; \
+ : "Avoid double inclusion, to avoid a warning about redefinitions."; \
echo '#ifndef UNISTRING_CONFIG_H'; \
echo '#define UNISTRING_CONFIG_H'; \
echo; \
echo '#include "../config.h"'; \
- : "All code is collected in a single library,"; \
- : "No references to variables in other libraries exist."; \
- echo '#undef DLL_VARIABLE'; \
- echo '#define DLL_VARIABLE'; \
echo; \
echo '#endif /* UNISTRING_CONFIG_H */'; \
} > config.h && \
diff --git a/lib/unistring/woe32dll.in.h b/lib/unistring/woe32dll.in.h
new file mode 100644
index 0000000..7764c86
--- /dev/null
+++ b/lib/unistring/woe32dll.in.h
@@ -0,0 +1,30 @@
+/* Support for variables in shared libraries on Windows platforms.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2009. */
+
+#ifndef _UNISTRING_WOE32DLL_H
+#define _UNISTRING_WOE32DLL_H
+
+#ifdef IN_LIBUNISTRING
+/* All code is collected in a single library, */
+# define LIBUNISTRING_DLL_VARIABLE
+#else
+/* References from outside of libunistring. */
+# define LIBUNISTRING_DLL_VARIABLE @DLL_VARIABLE@
+#endif
+
+#endif /* _UNISTRING_WOE32DLL_H */