winemaker: C++ handling
François Gouget
fgouget at codeweavers.com
Fri Mar 2 23:05:40 CST 2001
The winemaker generated Makefiles always use gcc to link the targets.
This means C++ targets using things like iostream, the STL or others
don't link because they are not linked with libstdc++.
This patch modifies the generated Makefiles so that if the target has
C++ source we use g++ to do the link, and let g++ throw in the
appropriate libraries.
Note, I don't test that the syntax for linking apps is the same with
g++ as with gcc, but I don't see any reason why it should be different.
See also bug #162:
http://wine.codeweavers.com/bugzilla/show_bug.cgi?id=162
Changelog:
François Gouget <fgouget at codeweavers.com>
* tools/winemaker
If a target has C++ sources, then use g++ to link it (fixes #162)
Removed SONAME, it's not relevant for dlls and was unused anyway
--
François Gouget
fgouget at codeweavers.com
-------------- next part --------------
Index: tools/winemaker
===================================================================
RCS file: /home/wine/wine/tools/winemaker,v
retrieving revision 1.18
diff -u -r1.18 winemaker
--- tools/winemaker 2001/03/03 00:17:11 1.18
+++ tools/winemaker 2001/03/03 04:40:53
@@ -1795,7 +1924,12 @@
$t_name.=".so";
}
print FILEO "$t_name: \$(${canon}_SPEC_SRCS:.spec=.spec.o) \$(${canon}_OBJS) \$(${canon}_DEPENDS) \n";
- print FILEO "\t\$(LDSHARED) \$(LDDLLFLAGS) -o \$\@ \$(${canon}_OBJS) \$(${canon}_SPEC_SRCS:.spec=.spec.o) \$(${canon}_LIBRARY_PATH) \$(${canon}_LIBRARIES:%=-l%) \$(DLL_LINK) \$(LIBS)\n";
+ if (@{@$target[$T_SOURCES_CXX]} > 0 or @{@$project_settings[$T_SOURCES_CXX]} > 0) {
+ print FILEO "\t\$(LDXXSHARED)";
+ } else {
+ print FILEO "\t\$(LDSHARED)";
+ }
+ print FILEO " \$(LDDLLFLAGS) -o \$\@ \$(${canon}_OBJS) \$(${canon}_SPEC_SRCS:.spec=.spec.o) \$(${canon}_LIBRARY_PATH) \$(${canon}_LIBRARIES:%=-l%) \$(DLL_LINK) \$(LIBS)\n";
if (@$target[$T_TYPE] ne $TT_DLL) {
print FILEO "\ttest -e @$target[$T_NAME] || \$(LN_S) \$(WINE) @$target[$T_NAME]\n";
}
@@ -2254,6 +2388,7 @@
dnl **** Check for working dll ****
LDSHARED=""
+LDXXSHARED=""
LDDLLFLAGS=""
AC_CACHE_CHECK("whether we can build a Linux dll",
ac_cv_c_dll_linux,
@@ -2265,6 +2400,7 @@
if test "$ac_cv_c_dll_linux" = "yes"
then
LDSHARED="\$(CC) -shared -Wl,-rpath,\$(libdir)"
+ LDXXSHARED="\$(CXX) -shared -Wl,-rpath,\$(libdir)"
LDDLLFLAGS="-Wl,-Bsymbolic"
else
AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll,
@@ -2276,7 +2412,8 @@
])
if test "$ac_cv_c_dll_unixware" = "yes"
then
- LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,h,\$(libdir)/%)"#FIXME: why SONAME here?
+ LDSHARED="\$(CC) -Wl,-G"
+ LDXXSHARED="\$(CXX) -Wl,-G"
LDDLLFLAGS="-Wl,-B,symbolic"
else
AC_CACHE_CHECK("whether we can build a NetBSD dll",
@@ -2289,6 +2426,7 @@
if test "$ac_cv_c_dll_netbsd" = "yes"
then
LDSHARED="\$(CC) -Wl,-Bshareable,-Bforcearchive"
+ LDXXSHARED="\$(CXX) -Wl,-Bshareable,-Bforcearchive"
LDDLLFLAGS="" #FIXME
fi
fi
@@ -2303,6 +2441,7 @@
AC_SUBST(DLL_LINK)
AC_SUBST(LDSHARED)
+AC_SUBST(LDXXSHARED)
AC_SUBST(LDDLLFLAGS)
dnl *** check for the need to define __i386__
@@ -2778,6 +2917,7 @@
ALLWRCFLAGS=$(WRCFLAGS) $(WRCEXTRA) $(OPTIONS) $(ALLFLAGS)
LDCOMBINE = ld -r
LDSHARED = @LDSHARED@
+LDXXSHARED = @LDXXSHARED@
LDDLLFLAGS= @LDDLLFLAGS@
STRIP = strip
STRIPFLAGS= --strip-unneeded
More information about the wine-patches
mailing list