public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch,build] Build libgfortran and libgomp as DLL on win32
@ 2007-08-28 13:56 François-Xavier Coudert
  2007-08-28 21:49 ` Danny Smith
  0 siblings, 1 reply; 7+ messages in thread
From: François-Xavier Coudert @ 2007-08-28 13:56 UTC (permalink / raw)
  To: fortran, gcc-patches; +Cc: Danny Smith, cgf

[-- Attachment #1: Type: text/plain, Size: 809 bytes --]

The attached patch allows libgfortran and libgomp to be built as
shared libraries (DLL) on i386-pc-mingw32. It simply adds
-no-undefined to the linker flags, and checks for support in the
configure.ac: LT_INIT([shared static win32-dll dlopen]).

This was bootstrapped and manually tested on i386-pc-mingw32.
(Building libgomp requires using pthreads-win32 and explicitly
configuring with --enable-libgomp.) I think I need the approval of
build maintainers for this patch, but other opinions are welcome
(especially the windows maintainers).

FX


PS: I intend to do the same for libobjc and libstdc++-v3, but I can't
make it work for libobjc (I'm investigating) and libstdc++-v3 is
currently broken on mingw32. For libssp, I think I'd need some advice:
who maintains it? (there's no listed maintainer AFAICT)

[-- Attachment #2: win32-dll.ChangeLog --]
[-- Type: application/octet-stream, Size: 562 bytes --]

libgfortran/
2007-08-28  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	* configure.ac: Add win32 DLL support.
	* Makefile.am: Add -no-undefined linker flag.
	* Makefile.in: Regenerate.
	* configure: Regenerate.


libgomp/
2007-08-28  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	* libgomp/configure.ac: Add win32 DLL support.
	* libgomp/Makefile.am: Add -no-undefined linker flag.
	* libgomp/Makefile.in: Regenerate.
	* libgomp/testsuite/Makefile.in: Regenerate.
	* libgomp/config.h.in: Regenerate.
	* libgomp/configure: Regenerate.

[-- Attachment #3: win32-dll.diff --]
[-- Type: application/octet-stream, Size: 2136 bytes --]

Index: libgfortran/configure.ac
===================================================================
--- libgfortran/configure.ac	(revision 127831)
+++ libgfortran/configure.ac	(working copy)
@@ -146,8 +146,7 @@
 
 # Configure libtool
 #AC_MSG_NOTICE([====== Starting libtool configuration])
-AC_LIBTOOL_DLOPEN
-AM_PROG_LIBTOOL
+LT_INIT([shared static win32-dll dlopen])
 AC_SUBST(enable_shared)
 AC_SUBST(enable_static)
 #AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10
Index: libgfortran/Makefile.am
===================================================================
--- libgfortran/Makefile.am	(revision 127831)
+++ libgfortran/Makefile.am	(working copy)
@@ -15,7 +15,7 @@
 
 toolexeclib_LTLIBRARIES = libgfortran.la
 libgfortran_la_LINK = $(LINK)
-libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lm $(extra_ldflags_libgfortran) $(version_arg)
+libgfortran_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lm $(extra_ldflags_libgfortran) $(version_arg)
 
 myexeclib_LTLIBRARIES = libgfortranbegin.la
 myexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
Index: libgomp/configure.ac
===================================================================
--- libgomp/configure.ac	(revision 127831)
+++ libgomp/configure.ac	(working copy)
@@ -139,7 +139,7 @@
 
 
 # Configure libtool
-AM_PROG_LIBTOOL
+LT_INIT([shared static win32-dll dlopen])
 AC_SUBST(enable_shared)
 AC_SUBST(enable_static)
 
Index: libgomp/Makefile.am
===================================================================
--- libgomp/Makefile.am	(revision 127831)
+++ libgomp/Makefile.am	(working copy)
@@ -29,7 +29,7 @@
 libgomp_version_script =
 endif
 libgomp_version_info = -version-info $(libtool_VERSION)
-libgomp_la_LDFLAGS = $(libgomp_version_info) $(libgomp_version_script)
+libgomp_la_LDFLAGS = -no-undefined $(libgomp_version_info) $(libgomp_version_script)
 
 libgomp_la_SOURCES = alloc.c barrier.c critical.c env.c error.c iter.c \
 	loop.c ordered.c parallel.c sections.c single.c team.c work.c \

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-08-29 20:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-28 13:56 [patch,build] Build libgfortran and libgomp as DLL on win32 François-Xavier Coudert
2007-08-28 21:49 ` Danny Smith
2007-08-29 11:59   ` François-Xavier Coudert
2007-08-29 12:46     ` Brian Dessent
2007-08-29 13:02       ` François-Xavier Coudert
2007-08-29 20:31       ` Danny Smith
2007-08-29 20:07     ` Danny Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).