[31240] trunk/dports/lang/ocaml

bfulgham at macports.org bfulgham at macports.org
Sun Nov 18 15:33:18 PST 2007


Revision: 31240
          http://trac.macosforge.org/projects/macports/changeset/31240
Author:   bfulgham at macports.org
Date:     2007-11-18 15:33:17 -0800 (Sun, 18 Nov 2007)

Log Message:
-----------
Correct Ocaml building under Leopard (and others).  
Closes #13236
Closes #13308

Modified Paths:
--------------
    trunk/dports/lang/ocaml/Portfile

Added Paths:
-----------
    trunk/dports/lang/ocaml/files/
    trunk/dports/lang/ocaml/files/patch-ocaml-asmrun-signals_asm.c
    trunk/dports/lang/ocaml/files/patch-ocaml-asmrun-signals_osdep.h

Modified: trunk/dports/lang/ocaml/Portfile
===================================================================
--- trunk/dports/lang/ocaml/Portfile	2007-11-18 23:03:31 UTC (rev 31239)
+++ trunk/dports/lang/ocaml/Portfile	2007-11-18 23:33:17 UTC (rev 31240)
@@ -20,6 +20,8 @@
 
 use_bzip2			yes
 
+patchfiles		patch-ocaml-asmrun-signals_asm.c patch-ocaml-asmrun-signals_osdep.h
+
 # Configure.
 configure.pre_args	-prefix ${prefix} 
 configure.args		-no-tk 
@@ -45,10 +47,6 @@
 	configure.args-delete 	-no-tk
 }
 
-platform darwin 9 {
-    macosx_deployment_target 10.4
-}
-
 livecheck.check	regex
 livecheck.url	http://caml.inria.fr/news.en.rss
 livecheck.regex	"<title>Objective Caml (.*) released"

Added: trunk/dports/lang/ocaml/files/patch-ocaml-asmrun-signals_asm.c
===================================================================
--- trunk/dports/lang/ocaml/files/patch-ocaml-asmrun-signals_asm.c	                        (rev 0)
+++ trunk/dports/lang/ocaml/files/patch-ocaml-asmrun-signals_asm.c	2007-11-18 23:33:17 UTC (rev 31240)
@@ -0,0 +1,12 @@
+diff -u -r1.2 signals_asm.c
+--- asmrun/signals_asm.c	1 Mar 2007 10:27:26 -0000	1.2
++++ asmrun/signals_asm.c	6 Nov 2007 16:17:00 -0000
+@@ -238,7 +238,7 @@
+   /* Stack overflow handling */
+ #ifdef HAS_STACK_OVERFLOW_DETECTION
+   {
+-    struct sigaltstack stk;
++    stack_t stk;
+     struct sigaction act;
+     stk.ss_sp = sig_alt_stack;
+     stk.ss_size = SIGSTKSZ;

Added: trunk/dports/lang/ocaml/files/patch-ocaml-asmrun-signals_osdep.h
===================================================================
--- trunk/dports/lang/ocaml/files/patch-ocaml-asmrun-signals_osdep.h	                        (rev 0)
+++ trunk/dports/lang/ocaml/files/patch-ocaml-asmrun-signals_osdep.h	2007-11-18 23:33:17 UTC (rev 31240)
@@ -0,0 +1,160 @@
+diff -u -r1.8 signals_osdep.h
+--- asmrun/signals_osdep.h	29 Jan 2007 12:10:52 -0000	1.8
++++ asmrun/signals_osdep.h	6 Nov 2007 16:17:00 -0000
+@@ -88,8 +88,13 @@
+ 
+   #include <sys/ucontext.h>
+ 
+-  #define CONTEXT_STATE (((struct ucontext *)context)->uc_mcontext->ss)
+-  #define CONTEXT_PC (CONTEXT_STATE.eip)
++  #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
++    #define CONTEXT_STATE (((ucontext_t *)context)->uc_mcontext->ss)
++    #define CONTEXT_PC (CONTEXT_STATE.eip)
++  #else
++    #define CONTEXT_STATE (((ucontext_t *)context)->uc_mcontext->__ss)
++    #define CONTEXT_PC (CONTEXT_STATE.__eip)
++  #endif
+   #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
+ 
+ /****************** MIPS, all OS */
+@@ -113,106 +118,46 @@
+ 
+ #elif defined(TARGET_power) && defined(SYS_rhapsody)
+ 
+-#ifdef __ppc64__
+-
+   #define DECLARE_SIGNAL_HANDLER(name) \
+      static void name(int sig, siginfo_t * info, void * context)
+ 
+-  #define SET_SIGACT(sigact,name) \
+-     sigact.sa_sigaction = (name); \
+-     sigact.sa_flags = SA_SIGINFO | SA_64REGSET
+-
+-  typedef unsigned long long context_reg;
+-
+   #include <sys/ucontext.h>
+-
+-  #define CONTEXT_STATE (((struct ucontext64 *)context)->uc_mcontext64->ss)
+-
+-  #define CONTEXT_PC (CONTEXT_STATE.srr0)
+-  #define CONTEXT_EXCEPTION_POINTER (CONTEXT_STATE.r29)
+-  #define CONTEXT_YOUNG_LIMIT (CONTEXT_STATE.r30)
+-  #define CONTEXT_YOUNG_PTR (CONTEXT_STATE.r31)
+-  #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
+-  #define CONTEXT_SP (CONTEXT_STATE.r1)
+-
+-#else
+-
+-  #include <sys/utsname.h>
+-
+-  #define DECLARE_SIGNAL_HANDLER(name) \
+-     static void name(int sig, siginfo_t * info, void * context)
+-
+-  #define SET_SIGACT(sigact,name) \
+-     sigact.sa_handler = (void (*)(int)) (name); \
+-     sigact.sa_flags = SA_SIGINFO
+-
+-  typedef unsigned long context_reg;
+-
+-  #define CONTEXT_PC (*context_gpr_p(context, -2))
+-  #define CONTEXT_EXCEPTION_POINTER (*context_gpr_p(context, 29))
+-  #define CONTEXT_YOUNG_LIMIT (*context_gpr_p(context, 30))
+-  #define CONTEXT_YOUNG_PTR (*context_gpr_p(context, 31))
+-  #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
+-  #define CONTEXT_SP (*context_gpr_p(context, 1))
+-
+-  static int ctx_version = 0;
+-  static void init_ctx (void)
+-  {
+-    struct utsname name;
+-    if (uname (&name) == 0){
+-      if (name.release[1] == '.' && name.release[0] <= '5'){
+-        ctx_version = 1;
+-      }else{
+-        ctx_version = 2;
+-      }
+-    }else{
+-      caml_fatal_error ("cannot determine SIGCONTEXT format");
+-    }
+-  }
+-
+-  #ifdef DARWIN_VERSION_6
+-    #include <sys/ucontext.h>
+-    static unsigned long *context_gpr_p (void *ctx, int regno)
+-    {
+-      unsigned long *regs;
+-      if (ctx_version == 0) init_ctx ();
+-      if (ctx_version == 1){
+-        /* old-style context (10.0 and 10.1) */
+-        regs = (unsigned long *)(((struct sigcontext *)ctx)->sc_regs);
+-      }else{
+-        Assert (ctx_version == 2);
+-        /* new-style context (10.2) */
+-        regs = (unsigned long *)&(((struct ucontext *)ctx)->uc_mcontext->ss);
+-      }
+-      return &(regs[2 + regno]);
+-    }
++  
++  #ifdef __LP64__
++    #define SET_SIGACT(sigact,name) \
++       sigact.sa_sigaction = (name); \
++       sigact.sa_flags = SA_SIGINFO | SA_64REGSET
++    
++    typedef unsigned long long context_reg;
++    
++    #define CONTEXT_MCONTEXT (((ucontext64_t *)context)->uc_mcontext64)
+   #else
+-    #define SA_SIGINFO 0x0040
+-    struct ucontext {
+-      int       uc_onstack;
+-      sigset_t  uc_sigmask;
+-      struct sigaltstack uc_stack;
+-      struct ucontext   *uc_link;
+-      size_t    uc_mcsize;
+-      unsigned long     *uc_mcontext;
+-    };
+-    static unsigned long *context_gpr_p (void *ctx, int regno)
+-    {
+-      unsigned long *regs;
+-      if (ctx_version == 0) init_ctx ();
+-      if (ctx_version == 1){
+-        /* old-style context (10.0 and 10.1) */
+-        regs = (unsigned long *)(((struct sigcontext *)ctx)->sc_regs);
+-      }else{
+-        Assert (ctx_version == 2);
+-        /* new-style context (10.2) */
+-        regs = (unsigned long *)((struct ucontext *)ctx)->uc_mcontext + 8;
+-      }
+-      return &(regs[2 + regno]);
+-    }
++    #define SET_SIGACT(sigact,name) \
++       sigact.sa_sigaction = (name); \
++       sigact.sa_flags = SA_SIGINFO
++    
++    typedef unsigned long context_reg;
++    
++    #define CONTEXT_MCONTEXT (((ucontext_t *)context)->uc_mcontext)
+   #endif
+-
+-#endif
++  
++  #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
++    #define CONTEXT_STATE (CONTEXT_MCONTEXT->ss)
++    #define CONTEXT_PC (CONTEXT_STATE.srr0)
++    #define CONTEXT_EXCEPTION_POINTER (CONTEXT_STATE.r29)
++    #define CONTEXT_YOUNG_LIMIT (CONTEXT_STATE.r30)
++    #define CONTEXT_YOUNG_PTR (CONTEXT_STATE.r31)
++    #define CONTEXT_SP (CONTEXT_STATE.r1)
++  #else
++    #define CONTEXT_STATE (CONTEXT_MCONTEXT->__ss)
++    #define CONTEXT_PC (CONTEXT_STATE.__srr0)
++    #define CONTEXT_EXCEPTION_POINTER (CONTEXT_STATE.__r29)
++    #define CONTEXT_YOUNG_LIMIT (CONTEXT_STATE.__r30)
++    #define CONTEXT_YOUNG_PTR (CONTEXT_STATE.__r31)
++    #define CONTEXT_SP (CONTEXT_STATE.__r1)
++  #endif
++  
++  #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
+ 
+ /****************** PowerPC, ELF (Linux) */
+ 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071118/ae343c41/attachment.html


More information about the macports-changes mailing list