> -----Original Message-----
> From: Martin Sebor [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 12, 2007 6:29 PM
> To: [email protected]
> Subject: Re: [PATCH] RE: Cygwin cannot find -lstd12d
>
> Martin Sebor wrote:
> [...]
> > If you've successfully tested your patch with at least a few of the
> > stdcxx example programs please go ahead and commit it.
> > We can deal with the suffix later.
>
> Farid, what's the status of this patch?
Here it is.
What else can be improved: the ld on Cygwin appends .exe suffix to the
built executable name if that
name is not contain '.'. As a result we have the /examples and /bin
executables with .exe suffix, and
/tests executables without that suffix.
ChangeLog:
* gcc.config: Set SHARED_SUFFIX = .dll on Cygwin
* GNUmakefile.lib: Added statements to build the import library
instead of symbolic link on Cygwin
* makefile.common: Corrected condition to get worked on Cygwin
* makefile.rules: Added $(LIBDIR) to PATH environment variable to run
examples and tests
without copying the libstd.dll to the executable folder
* GNUmakefile: Export $(OSNAME) variable to the makefile.in
=================================
Index: etc/config/gcc.config
===================================================================
--- etc/config/gcc.config (revision 517637)
+++ etc/config/gcc.config (working copy)
@@ -184,6 +184,10 @@
SHARED_SUFFIX = .dylib
endif
+ifneq ($(findstring CYGWIN,$(OSNAME)),)
+ SHARED_SUFFIX = .dll
+endif
+
STATIC_CXXFLAGS =
STATIC_CPPFLAGS =
STATIC_LDFLAGS =
Index: etc/config/GNUmakefile.lib
===================================================================
--- etc/config/GNUmakefile.lib (revision 517637)
+++ etc/config/GNUmakefile.lib (working copy)
@@ -17,11 +17,22 @@
# the name of the library to build (and in shared builds,
# the name of the symbolic link pointing to it, for library
# versioning)
-LIBLINK := $(LIBNAME)
+# on Cygwin LIBLINK is the name of the import library
+ifeq ($(findstring CYGWIN,$(OSNAME)),)
+ LIBLINK := $(LIBNAME)
+else
+ LIBLINK := $(LIBNAME).a
+endif
+# do not use LIBLINK as TARGET on Cygwin
ifeq ($(findstring shared,$(BUILDMODE)),shared)
- LIB := $(LIBLINK).$(LIBVER)
- TARGET := $(LIB) $(LIBLINK)
+ ifeq ($(findstring CYGWIN,$(OSNAME)),)
+ LIB := $(LIBLINK).$(LIBVER)
+ TARGET := $(LIB) $(LIBLINK)
+ else
+ LIB := $(basename $(LIBNAME)).$(LIBVER)$(LIBSUFFIX)
+ TARGET := $(LIB)
+ endif
else
LIB := $(LIBLINK)
TARGET := $(LIB)
@@ -39,6 +50,11 @@
ONE_REPOSITORY = 1
include ../makefile.common
+# generate import library on Cygwin
+ifneq ($(findstring CYGWIN,$(OSNAME)),)
+ LDSOFLAGS += -Wl,--out-implib,$(LIBLINK)
+endif
+
CXXFLAGS += $(PICFLAGS)
LDFLAGS += $(LDSOFLAGS) $(MAPFLAGS) $(MAPFILE)
Index: etc/config/makefile.common
===================================================================
--- etc/config/makefile.common (revision 517637)
+++ etc/config/makefile.common (working copy)
@@ -126,7 +126,7 @@
# link with the produced library and the math library
# (take care not to try to link the library with itself)
-ifeq ($(findstring $(LIBNAME),$(TARGET)),)
+ifeq ($(findstring $(basename $(LIBNAME)),$(TARGET)),)
LDFLAGS += -L$(LIBDIR)
# set the GNU make variable LDLIBS to the names of the libraries
# to link with (make puts $(LDLIBS) last on the link line in
Index: etc/config/makefile.rules
===================================================================
--- etc/config/makefile.rules (revision 517637)
+++ etc/config/makefile.rules (working copy)
@@ -110,7 +110,7 @@
# subtests (the little tests the main test consists of)
run runall run_all: $(BINDIR)/exec
@(LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(LIBDIR);
\
- PATH=$$PATH:.;
\
+ PATH=$$PATH:$(LIBDIR):.;
\
TOPDIR=$(TOPDIR);
\
export LD_LIBRARY_PATH PATH TOPDIR;
\
./run $(RUNFLAGS) $(RUNTARGET);
\
Index: GNUmakefile
===================================================================
--- GNUmakefile (revision 517637)
+++ GNUmakefile (working copy)
@@ -612,6 +612,7 @@
&& echo "OMIT_EXM_SRCS = $(OMIT_EXM_SRCS)" >>
$(MAKEFILE_IN) \
&& echo "OMIT_TST_SRCS = $(OMIT_TST_SRCS)" >>
$(MAKEFILE_IN) \
&& echo "BUILDTAG = $(BUILDTAG)" >>
$(MAKEFILE_IN) \
+ && echo "OSNAME = $(OSNAME)" >>
$(MAKEFILE_IN) \
&& echo "PLATFORM = $(PLATFORM)" >>
$(MAKEFILE_IN) \
&& echo "DEFAULT_SHROBJ = $(DEFAULT_SHROBJ)" >>
$(MAKEFILE_IN) \
&& echo "CXX_REPOSITORY = $(CXX_REPOSITORY)" >>
$(MAKEFILE_IN));
=================================
Farid.