Loading ...
Sorry, an error occurred while loading the content.

Re: Patch to fix compilation on intel macs

Expand Messages
  • Bram Moolenaar
    ... Thanks, I ll include it. I also spot use of __POWERPC__ in src/vim.h. I think that s a place where checking for MACOS_X is appropriate (I think OS X
    Message 1 of 6 , Feb 20, 2006
    • 0 Attachment
      Jussi Hagman wrote:

      > Here's a small patch that should fix the compilation error when
      > building for intel macs. It would be great if Bernhard could try it,
      > but it works on my PPC and is very trivial.

      Thanks, I'll include it. I also spot use of __POWERPC__ in src/vim.h.
      I think that's a place where checking for MACOS_X is appropriate (I
      think OS X always uses 32 or 64 bit ints).

      > This does nothing to fix configure.
      >
      > I do not know how we should proceed with supporting the intel
      > machines. I guess vim should be built universal as default (or
      > perhaps with a switch to configure). It should not be more than a few
      > switches to CFLAGS and LDFLAGS, but it comes with additional catch,
      > the universal binaries are not easily made to work on other than OS X
      > 10.4. I have no idea how the autoconf system works. Can you recommend
      > me any tutorials?

      I wonder how Apple does this themselves. They include a minimal Vim as
      vi, thus they must compile it for Intel too.

      --
      BRIDGEKEEPER: What is your favorite colour?
      GAWAIN: Blue ... No yelloooooww!
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://www.ICCF.nl ///
    • Jussi Hagman
      ... I saw that too, but I actually misred it and thought that it s working ok on intel too. But that was probably a false assumption. I d propose the
      Message 2 of 6 , Feb 20, 2006
      • 0 Attachment
        On 20.2.2006, at 13:14, Bram Moolenaar wrote:

        > Jussi Hagman wrote:
        >
        >> Here's a small patch that should fix the compilation error when
        >> building for intel macs. It would be great if Bernhard could try it,
        >> but it works on my PPC and is very trivial.
        >
        > Thanks, I'll include it. I also spot use of __POWERPC__ in src/vim.h.
        > I think that's a place where checking for MACOS_X is appropriate (I
        > think OS X always uses 32 or 64 bit ints).

        I saw that too, but I actually misred it and thought that it's
        working ok on intel too. But that was probably a false assumption.
        I'd propose the following:

        Index: vim.h
        ===================================================================
        RCS file: /cvsroot/vim/vim/src/vim.h,v
        retrieving revision 1.87
        diff -c -r1.87 vim.h
        *** vim.h 10 Oct 2005 17:39:59 -0000 1.87
        --- vim.h 20 Feb 2006 18:30:29 -0000
        ***************
        *** 138,144 ****
        # endif
        # endif
        #endif
        ! #ifdef MACOS
        # if defined(__POWERPC__) || defined(__fourbyteints__) \
        || defined(__MRC__) || defined(__SC__) || defined(__APPLE_CC__)/
        * MPW Compilers */
        # define SIZEOF_INT 4
        --- 138,144 ----
        # endif
        # endif
        #endif
        ! #ifdef MACOS_CLASSIC
        # if defined(__POWERPC__) || defined(__fourbyteints__) \
        || defined(__MRC__) || defined(__SC__) || defined(__APPLE_CC__)/
        * MPW Compilers */
        # define SIZEOF_INT 4
        ***************
        *** 146,151 ****
        --- 146,154 ----
        # define SIZEOF_INT 2
        # endif
        #endif
        + #ifdef MACOS_X
        + # define SIZEOF_INT 4
        + #endif
        #ifdef RISCOS
        # define SIZEOF_INT 4
        #endif


        >> This does nothing to fix configure.
        >>
        >> I do not know how we should proceed with supporting the intel
        >> machines. I guess vim should be built universal as default (or
        >> perhaps with a switch to configure). It should not be more than a few
        >> switches to CFLAGS and LDFLAGS, but it comes with additional catch,
        >> the universal binaries are not easily made to work on other than OS X
        >> 10.4. I have no idea how the autoconf system works. Can you recommend
        >> me any tutorials?
        >
        > I wonder how Apple does this themselves. They include a minimal
        > Vim as
        > vi, thus they must compile it for Intel too.

        I probably did not explain this well enough, let's make a matrix. +
        means that it is possible to do and - that it is less than trivial
        and -- that it is not possible (AFAIK)

        10.2 10.3 10.4
        intel -- -- +
        PPC + + +
        universal - - +

        So, it is no problem compiling either PPC for whatever OS X, it is
        not possible to compile intel for <10.4, but that's not a problem as
        those machines do not exist. But it is a bit harder to compile an
        universal binary that would work on PPC <10.4 and intel 10.4. I've
        understood though that is possible via some trickery but it's not
        what Apple is recommending us to do.

        I doubt Apple is guaranteeing that you can move a binary from 10.4 to
        10.3 and it would work. And it probably does compile the different
        builds of it's operating system separately.

        This is my understanding how it goes, but as I was writing this mail
        I found some quite interesting articles in the internet so the
        "trickery" could be much less than I assumed but I must dig deeper.

        Greetings,
        Jussi

        --
        Jussi Hagman, jhagman@..., iChat/AIM: jussihagman, ICQ: 54004113
        Studentbyn 4 D 33, 20540 Åbo, Finland +358 50 56 51 170
      • Bram Moolenaar
        ... That s almost the same as what I have. ... So far we always made different Vim binaries for each dot version of the OS. Things like shared libraries
        Message 3 of 6 , Feb 20, 2006
        • 0 Attachment
          Jussi Hagman wrote:

          > I saw that too, but I actually misred it and thought that it's
          > working ok on intel too. But that was probably a false assumption.
          > I'd propose the following:

          That's almost the same as what I have.

          > I probably did not explain this well enough, let's make a matrix. +
          > means that it is possible to do and - that it is less than trivial
          > and -- that it is not possible (AFAIK)
          >
          > 10.2 10.3 10.4
          > intel -- -- +
          > PPC + + +
          > universal - - +
          >
          > So, it is no problem compiling either PPC for whatever OS X, it is
          > not possible to compile intel for <10.4, but that's not a problem as
          > those machines do not exist. But it is a bit harder to compile an
          > universal binary that would work on PPC <10.4 and intel 10.4. I've
          > understood though that is possible via some trickery but it's not
          > what Apple is recommending us to do.
          >
          > I doubt Apple is guaranteeing that you can move a binary from 10.4 to
          > 10.3 and it would work. And it probably does compile the different
          > builds of it's operating system separately.
          >
          > This is my understanding how it goes, but as I was writing this mail
          > I found some quite interesting articles in the internet so the
          > "trickery" could be much less than I assumed but I must dig deeper.

          So far we always made different Vim binaries for each dot version of the
          OS. Things like shared libraries change, I don't know how to make a
          binary that works on several OS versions (with Python, GUI, etc.).
          Would probably require some special tricks to load shared libraries,
          looking for several versions and handling the incompatibilities...

          --
          Close your shells, or I'll kill -9 you
          Tomorrow I'll quota you
          Remember the disks'll always be full
          And then while I'm away
          I'll write ~ everyday
          And I'll send-pr all my buggings to you.
          [ CVS log "Beatles style" for FreeBSD ports/INDEX, Satoshi Asami ]

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ download, build and distribute -- http://www.A-A-P.org ///
          \\\ help me help AIDS victims -- http://www.ICCF.nl ///
        • Jussi Hagman
          ... OK, good. Then we don t have to think more about that. :) -- Jussi Hagman, jhagman@infa.abo.fi, iChat/AIM: jussihagman, ICQ: 54004113 Studentbyn 4 D 33,
          Message 4 of 6 , Feb 20, 2006
          • 0 Attachment
            On 21.2.2006, at 0:24, Bram Moolenaar wrote:
            > Jussi Hagman wrote:
            >> This is my understanding how it goes, but as I was writing this mail
            >> I found some quite interesting articles in the internet so the
            >> "trickery" could be much less than I assumed but I must dig deeper.
            >
            > So far we always made different Vim binaries for each dot version
            > of the
            > OS.

            OK, good. Then we don't have to think more about that. :)

            --
            Jussi Hagman, jhagman@..., iChat/AIM: jussihagman, ICQ: 54004113
            Studentbyn 4 D 33, 20540 Åbo, Finland +358 50 56 51 170
          Your message has been successfully submitted and would be delivered to recipients shortly.