emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiling Emacs on Mac OS X 10.6 Snow Leopard


From: YAMAMOTO Mitsuharu
Subject: Compiling Emacs on Mac OS X 10.6 Snow Leopard
Date: Mon, 31 Aug 2009 19:36:31 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

This is a summary of the current status of compilation on the newly
released Mac OS X 10.6 Snow Leopard.

  * For Emacs 22.3 and 23.1, you need to apply the patch below.  It
    has already been applied to the CVS trunk.

  * Now gcc seems to make a 64-bit binary by default (the situation
    might be different on Core Solo/Duo machines).  Emacs 22.3 Carbon
    port can't make it because the GUI portion of Carbon doesn't have
    64-bit support.  Currently, the Cocoa port (23.1 or the CVS trunk)
    can't do that either because the code doesn't take account of it.
    In either case, you need to specify the 32-bit option CC='gcc
    -arch i386' when running configure.  This restriction does not
    apply to tty-only or X11 builds.

  * If you want to use a 64-bit binary with native GUI support, you
    can try Emacs 22.3 Carbon+AppKit port or 23.1 Mac port (the latter
    is currently experimental/hackers-only).
    http://lists.gnu.org/archive/html/emacs-devel/2009-08/msg01309.html

                                     YAMAMOTO Mitsuharu
                                address@hidden

Index: src/unexmacosx.c
===================================================================
RCS file: /sources/emacs/emacs/src/unexmacosx.c,v
retrieving revision 1.22.2.5
diff -c -p -r1.22.2.5 unexmacosx.c
*** src/unexmacosx.c    8 Jan 2008 04:29:48 -0000       1.22.2.5
--- src/unexmacosx.c    30 Aug 2009 09:01:00 -0000
*************** print_load_command_name (int lc)
*** 584,589 ****
--- 584,597 ----
        printf ("LC_UUID          ");
        break;
  #endif
+ #ifdef LC_DYLD_INFO
+     case LC_DYLD_INFO:
+       printf ("LC_DYLD_INFO     ");
+       break;
+     case LC_DYLD_INFO_ONLY:
+       printf ("LC_DYLD_INFO_ONLY");
+       break;
+ #endif
      default:
        printf ("unknown          ");
      }
*************** copy_data_segment (struct load_command *
*** 821,826 ****
--- 829,835 ----
               || strncmp (sectp->sectname, "__const", 16) == 0
               || strncmp (sectp->sectname, "__cfstring", 16) == 0
               || strncmp (sectp->sectname, "__gcc_except_tab", 16) == 0
+              || strncmp (sectp->sectname, "__program_vars", 16) == 0
               || strncmp (sectp->sectname, "__objc_", 7) == 0)
        {
          if (!unexec_copy (sectp->offset, old_file_offset, sectp->size))
*************** copy_twolevelhints (struct load_command 
*** 1088,1093 ****
--- 1097,1132 ----
    curr_header_offset += lc->cmdsize;
  }
  
+ #ifdef LC_DYLD_INFO
+ /* Copy a LC_DYLD_INFO(_ONLY) load command from the input file to the output
+    file, adjusting the file offset fields.  */
+ static void
+ copy_dyld_info (struct load_command *lc, long delta)
+ {
+   struct dyld_info_command *dip = (struct dyld_info_command *) lc;
+ 
+   if (dip->rebase_off > 0)
+     dip->rebase_off += delta;
+   if (dip->bind_off > 0)
+     dip->bind_off += delta;
+   if (dip->weak_bind_off > 0)
+     dip->weak_bind_off += delta;
+   if (dip->lazy_bind_off > 0)
+     dip->lazy_bind_off += delta;
+   if (dip->export_off > 0)
+     dip->export_off += delta;
+ 
+   printf ("Writing ");
+   print_load_command_name (lc->cmd);
+   printf (" command\n");
+ 
+   if (!unexec_write (curr_header_offset, lc, lc->cmdsize))
+     unexec_error ("cannot write dyld info command to header");
+ 
+   curr_header_offset += lc->cmdsize;
+ }
+ #endif
+ 
  /* Copy other kinds of load commands from the input file to the output
     file, ones that do not require adjustments of file offsets.  */
  static void
*************** dump_it ()
*** 1154,1159 ****
--- 1193,1204 ----
        case LC_TWOLEVEL_HINTS:
        copy_twolevelhints (lca[i], linkedit_delta);
        break;
+ #ifdef LC_DYLD_INFO
+       case LC_DYLD_INFO:
+       case LC_DYLD_INFO_ONLY:
+       copy_dyld_info (lca[i], linkedit_delta);
+       break;
+ #endif
        default:
        copy_other (lca[i]);
        break;
Index: src/s/darwin.h
===================================================================
RCS file: /sources/emacs/emacs/src/s/darwin.h,v
retrieving revision 1.28.2.4
diff -c -p -r1.28.2.4 darwin.h
*** src/s/darwin.h      17 Jul 2008 09:07:06 -0000      1.28.2.4
--- src/s/darwin.h      30 Aug 2009 09:01:01 -0000
*************** Boston, MA 02110-1301, USA.  */
*** 351,356 ****
--- 351,359 ----
  #define malloc unexec_malloc
  #define realloc unexec_realloc
  #define free unexec_free
+ /* Don't use posix_memalign because it is not compatible with
+    unexmacosx.c.  */
+ #undef HAVE_POSIX_MEMALIGN
  #endif
  
  /* This makes create_process in process.c save and restore signal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]