[m-rev.] for post-commit review: mingw cross compiler on Mac OS X

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Jan 10 01:48:15 AEDT 2012


For post-commit review by Peter Wang.

(I will update the README file once this works.  At the moment there
appear to be other issues involving pthreads that prevent it working.)

Branches: main

A step towards getting compilation with the MacPorts version of the MinGW cross
compiler working on Mac OS X.  It's not clear that this is terribly useful as
the version of mingw-gcc in MacPorts is ancient (3.4.5).  (I will also try 
using the nognu port, maybe that is more recent.)

configure.in:
 	When checking whether the Mercury compiler is up-to-date, pass options
 	appropriate to the build compiler, not the host one.  This avoids
 	problems where the build Mercury compiler doesn't support --linkage
 	static but the host one does.

 	Use AC_CHECK_TOOL to check for ar in the non-MSVC case.  This means
 	the correct host type prefix will get attached when cross compiling.
         (The prefix is for MacPorts mingw-gcc is not a standard host triplet,
         it's simply i386-mingw.)

Julien.

Index: configure.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/configure.in,v
retrieving revision 1.608
diff -u -r1.608 configure.in
--- configure.in	9 Jan 2012 00:35:40 -0000	1.608
+++ configure.in	9 Jan 2012 14:40:18 -0000
@@ -326,7 +326,7 @@
  AC_SUBST(CONFIG_LIBDIR)
  #-----------------------------------------------------------------------------#

-case "$host" in
+case "$build" in
      i*86-*-solaris2.*)  link_static_opt= ;;
      *solaris2.10)       link_static_opt= ;;
      *apple*darwin*)     link_static_opt= ;;
@@ -1081,7 +1081,7 @@

      OBJFILE_OPT="-o "
      EXEFILE_OPT="-o "
-    AR="${HOST_TOOL_PREFIX}ar"
+    AC_CHECK_TOOL([AR], [ar], [ar])
      ARFLAGS="cr"
      AR_LIBFILE_OPT=""


--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list