[m-rev.] diff: fix Mac OS X PowerPC build problems (bug #255)

Julien Fischer juliensf at csse.unimelb.edu.au
Sat May 19 23:25:21 AEST 2012


Branches: main, 11.07

Fix problems that prevent Mercury from building on Mac OS X
PowerPC machines.
(This should fix bug #255, although I don't have a machine
running Mac OS 10.4 so I can't check that.)

browser/Mmakefile:
mdbcomp/Mmakefile:
ssdb/Mmakefile:
 	Older versions of make (such as that shipped with
 	Mac OS X 10.3) only support conditionals with at
 	most one else branch: avoid using conditionals with
 	multiple else branches.

configure.in:
runtime/mercury_conf.h.in:
 	Define a macro if the header file sys/resource.h.

mdbcomp/shared_utilities.m:
 	Conditionally include sys/resource.h.  It contains
 	declarations required by setrlimit on older versions
 	of Mac OS X.

Julien.

Index: configure.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/configure.in,v
retrieving revision 1.613
diff -u -r1.613 configure.in
--- configure.in	3 Apr 2012 05:33:11 -0000	1.613
+++ configure.in	19 May 2012 12:24:40 -0000
@@ -1290,7 +1290,7 @@
          unistd.h sys/wait.h sys/siginfo.h sys/signal.h ucontext.h \
          asm/sigcontext.h sys/param.h sys/time.h sys/times.h \
          sys/types.h sys/stat.h fcntl.h termios.h sys/ioctl.h \
-        sys/stropts.h windows.h dirent.h getopt.h malloc.h \
+        sys/resource.h sys/stropts.h windows.h dirent.h getopt.h malloc.h \
          semaphore.h pthread.h time.h spawn.h fenv.h sys/mman.h sys/sem.h \
          sched.h utmpx.h)

Index: browser/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/Mmakefile,v
retrieving revision 1.62
diff -u -r1.62 Mmakefile
--- browser/Mmakefile	19 Jan 2011 01:47:59 -0000	1.62
+++ browser/Mmakefile	19 May 2012 12:23:32 -0000
@@ -257,7 +257,8 @@
  .PHONY: install_library
  install_library:

-else ifeq ($(MMAKE_USE_MMC_MAKE),yes)
+else
+ifeq ($(MMAKE_USE_MMC_MAKE),yes)

  .PHONY: install_library
  install_library: lib$(BROWSER_LIB_NAME).install
@@ -271,3 +272,4 @@
  	lib$(BROWSER_LIB_NAME).install_hdrs

  endif
+endif
Index: mdbcomp/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/mdbcomp/Mmakefile,v
retrieving revision 1.19
diff -u -r1.19 Mmakefile
--- mdbcomp/Mmakefile	26 Oct 2010 04:59:10 -0000	1.19
+++ mdbcomp/Mmakefile	19 May 2012 12:23:16 -0000
@@ -220,7 +220,8 @@
  .PHONY: install_library
  install_library:

-else ifeq ($(MMAKE_USE_MMC_MAKE),yes)
+else
+ifeq ($(MMAKE_USE_MMC_MAKE),yes)

  .PHONY: install_library
  install_library: lib$(MDBCOMP_LIB_NAME).install
@@ -234,3 +235,4 @@
  	lib$(MDBCOMP_LIB_NAME).install_hdrs

  endif
+endif
Index: mdbcomp/shared_utilities.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/mdbcomp/shared_utilities.m,v
retrieving revision 1.2
diff -u -r1.2 shared_utilities.m
--- mdbcomp/shared_utilities.m	28 Mar 2012 02:18:02 -0000	1.2
+++ mdbcomp/shared_utilities.m	19 May 2012 12:31:47 -0000
@@ -28,8 +28,23 @@
      %
  :- pred unlimit_stack(io::di, io::uo) is det.

+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
  :- implementation.

+:- pragma foreign_decl("C", "
+
+/*
+** On some systems (e.g. Mac OS X 10.3) RLIMIT_STACK is defined in the
+** header sys/resource.h.
+*/
+#if defined(MR_HAVE_SYS_RESOURCE_H)
+    #include <sys/resource.h>
+#endif
+
+").
+
  :- pragma foreign_proc("C",
      unlimit_stack(_S0::di, _S::uo),
      [will_not_call_mercury, promise_pure],
Index: runtime/mercury_conf.h.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_conf.h.in,v
retrieving revision 1.75
diff -u -r1.75 mercury_conf.h.in
--- runtime/mercury_conf.h.in	28 Mar 2012 02:18:02 -0000	1.75
+++ runtime/mercury_conf.h.in	19 May 2012 12:31:31 -0000
@@ -149,6 +149,7 @@
  **	MR_HAVE_SYS_SEM_H 	we have <sys/sem.h>
  **	MR_HAVE_SCHED_H		we have <sched.h>
  **	MR_HAVE_UTMPX_H		we have <utmpx.h>
+** 	MR_HAVE_SYS_RESOURCE_H  we have <sys/resource.h>
  */
  #undef	MR_HAVE_SYS_SIGINFO_H
  #undef	MR_HAVE_SYS_SIGNAL_H
@@ -180,6 +181,7 @@
  #undef	MR_HAVE_SYS_SEM_H
  #undef	MR_HAVE_SCHED_H
  #undef  MR_HAVE_UTMPX_H
+#undef  MR_HAVE_SYS_RESOURCE_H

  /*
  ** MR_HAVE_POSIX_TIMES is defined if we have the POSIX
Index: ssdb/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/ssdb/Mmakefile,v
retrieving revision 1.10
diff -u -r1.10 Mmakefile
--- ssdb/Mmakefile	26 Oct 2010 04:59:10 -0000	1.10
+++ ssdb/Mmakefile	19 May 2012 12:23:54 -0000
@@ -250,12 +250,13 @@

  ifneq ("$(filter il% erlang%,$(GRADE))","")

-# there is no ssdb in the .NET or Erlang backends
+# There is no ssdb in the .NET or Erlang backends.

  .PHONY: install_library
  install_library:

-else ifeq ($(MMAKE_USE_MMC_MAKE),yes)
+else
+ifeq ($(MMAKE_USE_MMC_MAKE),yes)

  .PHONY: install_library
  install_library: lib$(SSDB_LIB_NAME).install
@@ -269,3 +270,4 @@
  	lib$(SSDB_LIB_NAME).install_hdrs

  endif
+endif

--------------------------------------------------------------------------
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