Bug 728178 - js.exe fails to link on on mingw (missing MOZ_Crash) r=glandium
authorJacek Caban <jacek@codeweavers.com>
Fri, 02 Mar 2012 11:27:29 +0100
changeset 91025 1a6d1d4e8bfca1739ab5c5ab3747449705332b09
parent 91024 85e59a087b76f98421c3fb5e3c1781c1ffd998a3
child 91026 512d60d499969e06f6c35b2923e7fdb71618d67d
push idunknown
push userunknown
push dateunknown
reviewersglandium
bugs728178
milestone13.0a1
Bug 728178 - js.exe fails to link on on mingw (missing MOZ_Crash) r=glandium
configure.in
mfbt/Types.h
--- a/configure.in
+++ b/configure.in
@@ -7303,17 +7303,21 @@ if test "$MOZ_DMD"; then
     MOZ_MEMORY=
 fi
 
 if test "${OS_TARGET}" = "Android"; then
   dnl On Android, we use WRAP_LDFLAGS to link everything to mozglue
   :
 elif test "${OS_TARGET}" = "WINNT" -o "${OS_TARGET}" = "Darwin" -o "${OS_TARGET}" = "OS2"; then
   dnl On Windows, OSX and OS2, we want to link all our binaries against mozglue
-  MOZ_GLUE_LDFLAGS='$(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
+  if test -z "$GNU_CC"; then
+    MOZ_GLUE_LDFLAGS='$(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
+  else
+    MOZ_GLUE_LDFLAGS='-L$(LIBXUL_DIST)/lib $(call EXPAND_LIBNAME,mozglue)'
+  fi
 else
   dnl On other Unix systems, we only want to link executables against mozglue
   MOZ_GLUE_PROGRAM_LDFLAGS='$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib) $(MKSHLIB_UNFORCE_ALL)'
   if test -n "$GNU_CC"; then
     dnl And we need mozglue symbols to be exported.
     MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS -rdynamic"
   fi
   if test "$MOZ_LINKER" = 1; then
--- a/mfbt/Types.h
+++ b/mfbt/Types.h
@@ -96,17 +96,17 @@
 /*
  * Whereas implementers use MOZ_EXPORT_API and MOZ_EXPORT_DATA to declare and
  * define library symbols, users use MOZ_IMPORT_API and MOZ_IMPORT_DATA to
  * access them.  Most often the implementer of the library will expose an API
  * macro which expands to either the export or import version of the macro,
  * depending upon the compilation mode.
  */
 #ifdef _WIN32
-#  if defined(__MWERKS__) || defined(__GNUC__)
+#  if defined(__MWERKS__)
 #    define MOZ_IMPORT_API(x)    x
 #  else
 #    define MOZ_IMPORT_API(x)    __declspec(dllimport) x
 #  endif
 #elif defined(XP_OS2)
 #  define MOZ_IMPORT_API(x)     __declspec(dllimport) x
 #else
 #  define MOZ_IMPORT_API(x)     MOZ_EXPORT_API(x)