Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming Businesses Operating Systems Software Unix Apple IT Technology

Porting Unix Command-Line Tools to Mac OS X 92

An anonymous reader writes "Over at Apple has posted a technote on porting Unix programs to Mac OS X. Nothing earth-shattering, but nice to see it all collected."
This discussion has been archived. No new comments can be posted.

Porting Unix Command-Line Tools to Mac OS X

Comments Filter:
  • So (Score:4, Insightful)

    by Znonymous Coward ( 615009 ) on Friday May 09, 2003 @10:02AM (#5918808) Journal
    Why don't they just do it their selves and add more value to their "distro"? They could easly take all the popular GNU tools and port them to Darwin. Then we wouldn't need to use fink.

    • Re:So (Score:4, Insightful)

      by pauljlucas ( 529435 ) on Friday May 09, 2003 @10:35AM (#5919103) Homepage Journal
      Why don't they just do it their selves and add more value to their "distro"?
      Because their target market isn't geeks. There are far more users who couldn't care less about GNU tools and never want to see a command-line.
      • Re:So (Score:2, Insightful)

        by Knife_Edge ( 582068 )
        I suppose it is true that most Apple users could care less about the command line. I am not one of them - If OS X did not support the command line as well as it did, I would be using Linux as my desktop. As it is, I have been annoyed on several occassions that the BSD command line utilities Apple provides lacked some feature that the GNU utilities have (I recall just replacing Apple's 'ls' with the GNU equivalent outright). At the same time, I don't want to mess with Fink, it introduces complexity. For
        • by Anonymous Coward on Friday May 09, 2003 @11:14AM (#5919379)
          It used BSD tools, not GNU tools.

          Deal with it.
        • Re:So (Score:5, Insightful)

          by anothy ( 83176 ) on Friday May 09, 2003 @01:30PM (#5920653) Homepage
          first:
          I have been annoyed on several occassions that the BSD command line utilities Apple provides lacked some feature that the GNU utilities have (I recall just replacing Apple's 'ls' with the GNU equivalent outright).
          then, in the very next sentance:
          At the same time, I don't want to mess with Fink, it introduces complexity.
          and, just to close it up:
          I'd much rather that Apple just installed the GNU stuff by default.
          man! i've got mod points, and i almost moderated this funny, but i wanted to make sure people got it. you don't want extra complexity, but you prefer the GNU tools to the BSD tools? y'er kiddin', right? how on earth can anyone make sense of that? the GNU tools are, on average, dramatically more complicated than the BSD tools. i used to build Linux boxes that dumped the GNU tools in favor of the BSD tools. then i got annoyed with the GNU C library and tried swapping that out. halfway through the project of rebuilding everything so that it didn't have the stupid glibc dependancies, i got fed up and went back to a BSD system - because the tools were so much simpler. Apple made a great decision in using the BSD tools rather than the GNU tools (license questions aside).

          oh, and as a parting kick:
          ...in Linux you can just assemble your system to do what you want.
          right. yup. unless you want it to be a good desktop system.
          • by kwerle ( 39371 )
            Rock on :-)
          • Yeah, I'm a laugh riot. I essentially just said every now and then I find a feature missing from the BSD tools that exists in the GNU tools. Honestly, I enjoy extra complexity if it comes from a feature I want.

            Extra complexity that I do not want would be what I described, using fink to maintain two sets of binaries for GNU and BSD versions of the same tool in order to get an additional feature or a different behavior that I desire. I think this is annoying and would prefer just to replace one with the o
          • of why BSD tools are more complex through fewer options:

            BSD:
            gunzip -c filename.tar.gz | tar -xf -
            GNU:
            tar xzf filename.tar.gz
        • by daveschroeder ( 516195 ) on Friday May 09, 2003 @02:54PM (#5921503)

          At the same time, I don't want to mess with Fink, it introduces complexity. For example, having two sets of binaries in different places doesn't mean you can run shell scripts without changing them if they were written expecting one set to be somewhere it isn't.

          DarwinPorts [opendarwin.org]

          DarwinPorts FAQ [opendarwin.org]

          Interview with Jordan Hubbard on DarwinPorts [osnews.com] (Slashdot article [slashdot.org])

      • Re:So (Score:4, Interesting)

        by Znonymous Coward ( 615009 ) on Friday May 09, 2003 @11:42AM (#5919593) Journal
        Because their target market isn't geeks.

        Then why are they selling servers?

        There are far more users who couldn't care less about GNU tools and never want to see a command-line.

        If they put the GNU tools there, non geeks would never know about it.

        • If they put the GNU tools there, non geeks would never know about it.
          Then there's no point in paying Apple employees to work on porting the stuff.
          • Re:So (Score:5, Insightful)

            by Znonymous Coward ( 615009 ) on Friday May 09, 2003 @12:07PM (#5919783) Journal
            Then there's no point in paying Apple employees to work on porting the stuff.

            Yes there is, it's called value added software. It wouldn't cost very much to do it. Then maybe more geeks would buy macs.

            And don't tell me that geeks don't like macs. If they didn't, there wouldn't be a apple.slashdot.org

            nuff said

            • Yes there is, it's called value added software. It wouldn't cost very much to do it. Then maybe more geeks would buy macs.

              Again, geeks aren't Apple's target market and are only a small percentage of sales.

              And don't tell me that geeks don't like macs. If they didn't, there wouldn't be a apple.slashdot.org

              I don't disagree; but, yet again, the geek market is insignificant to Apple's bottom line and to its shareholders' return on investment.

              • If Fink keeps building up steam (as it has been for the past 2 years), maybe that will convince Apple that it's worthwhile to support a few staffers to start porting UNIX cl tools to OS X.

                It wouldn't cost very much to do it.

                How do you define "not very much?" I'm thinking it would cost at least $75K/employee (including benefits, overhead, and indirect stuff), and take 3 employees 1-2 years to do. But IANAPM (I am not a project manager).

                • Re:So (Score:4, Insightful)

                  by pauljlucas ( 529435 ) on Friday May 09, 2003 @12:41PM (#5920141) Homepage Journal
                  If Fink keeps building up steam ..., maybe that will convince Apple that it's worthwhile to support a few staffers to start porting UNIX cl tools to OS X.
                  Why pay for the cow when you can get the milk for free? I'm sure those volunteering for Fink will continue to do so without being paid by Apple. A benefit is that Apple doesn't have to support anything done by Fink, including technical support calls.
                  • Re:So (Score:2, Insightful)

                    besides, its not like its that hard to install fink, considering the level of user that is going to miss the additional utilities. Sheesh, if Apple had included everything out of the box, people would be complaining that apple forced one set of tools on their users
                    -Claude
                • Re:So (Score:5, Informative)

                  by WatertonMan ( 550706 ) on Friday May 09, 2003 @02:31PM (#5921278)
                  A lot of porting is done by Apple employees. Just not necessary at Apple's request. This limits how much support Apple has to provide for these opensource projects and also limits their liability if something goes wrong. Quoting from the opendarwin page, "many OpenDarwin members are either Apple employees or Darwin Committers, who have an active interest in merging technologies from OpenDarwin.org into Darwin and Mac OS X releases. With OpenDarwin, project members have greater latitude in producing incremental updates or interim releases of Darwin. The mission of the OpenDarwin project is to innovate and explore new technologies while still remaining relevant, through its informal connection to www.opensource.apple.com, to the mainstream computing environments that Apple provides. It complements Apple's infrastructure by allowing increased participation by the community."

                  As to the choice of BSD or GNU standard tools, that's a bit of a personal preference. However since Darwin is based on BSD (with a lot of FreeBSD of late) rather than Linux it shouldn't be surprising that it retains its tools. That is more in keeping with its BSD roots.

                  As I mentioned elsewhere if you are savvy enough to recognize the difference in the tools you ought to be savvy enough to build the GNU versions of the tools.

              • I couln't agree more with the bottom line argument.

                Think about how much more money apple makes on Software like:
                Final Cut Pro/Express
                Logic Platinum
                Shake
                Keynote

                but then think about how much money Apple makes on their X11. Maybe indirectly. For example, the matlab package is a lot faster with the Apple's X11 graphics engine and the quartz-wm. And then people buy more Macs because of this, but it is much easier to convience Stockholders about direct income.
            • People already scream at the price for the upgrades within Jaguar. If Apple spends more on development, they'll have to price it higher. I suspect the number of people who'll spend $4000 on a laptop would change very little.
        • Re:So (Score:4, Insightful)

          by Lars T. ( 470328 ) <Lars...Traeger@@@googlemail...com> on Friday May 09, 2003 @12:37PM (#5920092) Journal
          Only geeks buy servers?
          • obviously only geeks buy servers, or I wouldn't be seeing this in error_log (or am I getting geeks mixed up with morons?).

            68.158.145.171 - - [13/May/2003:14:26:46 -0400] "GET /scripts/..%c1%1c../winnt/s ystem32/cmd.exe?/c+dir HTTP/1.0" 404 309

            68.158.145.171 - - [13/May/2003:14:26:47 -0400] "GET /scripts/..%c0%2f../winnt/s ystem32/cmd.exe?/c+dir HTTP/1.0" 404 309
            68.158.145.171 - - [13/May/2003:14:26:47 -0400] "GET /scripts/..%c0%af../winnt/s ystem32/cmd.exe?/c+dir HTTP/1.0" 404 309
            68.158.145.171 - - [1

      • Re:So (Score:2, Interesting)

        by HSpirit ( 519997 )

        I'm the Graphic Designer/IT Guy in a small advertising agency. MacOSX has allowed me to create - entirely for free - our own mail server (fetchmail-sendmail-qpopper), internal job versioning and approval system (Apache-WebDAV), internal messaging application (Apache-perl), firewall (ipfw), remote login (OpenSSH) and probably a myriad of smaller applications that I use without thinking about everyday, all from ported GNU/BSD command-line apps...

        ...all on the same machine that runs our core-business GUI app

    • Re:So (Score:3, Insightful)

      by drauh ( 524358 )

      Because they'd be replicating effort by the Fink [sourceforge.net] people, and that without adding value. When it is possible to add value, they have ported "standard" Unix software, the big example being XFree86 which they hacked to take advantage of the Quartz rendering engine.

    • Re:So (Score:5, Funny)

      by Lars T. ( 470328 ) <Lars...Traeger@@@googlemail...com> on Friday May 09, 2003 @12:41PM (#5920126) Journal
      because RMS would demand to put GNU in front of any product they sell. GNU/Mac OS X, GNU/iMac ...
    • Re:So (Score:1, Interesting)

      by Anonymous Coward
      The current size of Mac OS X is already really, really big. Adding extra tools that a majority of users will not use isn't worth the additional size. It used to be that an install of the Mac OS could fit onto one CD, now it takes two CDs or a DVD for an install.
    • Re:So (Score:5, Insightful)

      by WatertonMan ( 550706 ) on Friday May 09, 2003 @02:24PM (#5921204)
      Those who are able to recognize the difference between GNU versions of the BSD utilities are savvy enough to install the GNU utilities or Fink. If you don't like Fink check out Darwinports which is a different approach to the issue. It sounds more like what you want. A lot of us prefer having all the custom source code in /sw rather than replacing the standard BSD stuff from Apple so that we have access to both.

      DarwinPorts [opendarwin.org]

    • Because they'd have to provide support for the programs?
    • Riddle me this Batman. If when Apple makes software that pretty much negates a third-party solution people get pissy why would people then also get pissy when Apple doesn't produce software that no one gets paid for and only .01% of the Apple community would ever use?
    • Porting issues (Score:2, Insightful)

      Have you noticed that Apple tends to only include highly-polished software? There's a reason they built their own KHTML based browser, rather than just porting Konqueror. They have really high standards for the usability of their software, so any non-command-line tool would need to be entirely redesigned to fit their standards, which introduces a lot of work.

      Even for command-line programs, once Apple releases something themselves, they implicitly take responsibility for it. If they start doing half-asse
  • its about iTime. (Score:4, Interesting)

    by Beatbyte ( 163694 ) on Friday May 09, 2003 @10:03AM (#5918821) Homepage
    its about time. i figured with the BSD core they would be a lot quicker at it than this.

    Especially trying to support some new servers [apple.com]

    Either way, this may help the adoption of the Apple into the IT industry a little more.

    It'll be interesting to see whether or not they're included into the next release of X.
    • Re:its about iTime. (Score:2, Informative)

      by Van Halen ( 31671 )
      This is just an update of an older document, probably for Jaguar. Checking my bookmarks, the old url [apple.com] is now gone. I recall checking it in the last few weeks, so clearly it was just moved and updated.
  • by 1155 ( 538047 ) on Friday May 09, 2003 @12:03PM (#5919739) Homepage
    Well, if your a unix head, using a mac, and have been under a rock for a long time, here ya go


    http://www.osxgnu.org/ [osxgnu.org] Go here for packages to install.

    http://fink.sf.net [sf.net] Wow, apt-get for os x

    http://finkcommander.sf.net [sf.net] Wow, a gui for fink

    http://www.apple.com/downloads/macosx/apple/x11for macosx.html [apple.com] An x11 server that uses quartz extreme (or whatever you want to call it)


    There are many other things to use, too
  • getopt.h Not supported, use unistd.h

    Is that all that's required? I tried replacing getopt include with unistd, among other things to try to get http://prdownloads.sourceforge.net/id3v2/id3v2-0. 1 .9.tar.gz [sourceforge.net] to compile on OS X, and it still didn't. I don't have a Mac, this was on a friend's machine, so I don't have the error.

    BTW, in order to get id3lib [sf.net] to compile (which id3v2 [sf.net] above depends on) I had to use these flags:

    ./configure CXX=g++2

  • Easier solution (Score:2, Interesting)

    by js62 ( 609777 ) *
    If you want Unix tools and don't like Apple's, get Yellow Dog Linux and install mac-on-linux. I run my iBook that way and I have instant access to both OS's. No need to reboot to get to the other. OS X runs at near native speeds on top of MOL.
    • Does *everything* run at native speeds under MOL? What about playing DVDs, sound, 3D graphics etc.
    • I really like running KDE on OSX. They work pretty well together, provided you've got the dock set on "autohide". With fink and KDE, I get everything I could ever want from Linux, everything I need from OSX, nothing runs in emulation, and I only have a single kernel. I think it's a pretty good solution.
  • I like the section on available GCC flags, specifically:
    -arch arch
    Compile for the specified target architecture arch. Currently Apple supported arch is ppc.
    "Currently" supported? What does that mean?

    It doesn't seem like such a stretch to assume that other architectures are officially not out of the question, with a hedge statement like this one. Very interesting...

    • Re:Interesting hedge (Score:4, Informative)

      by dadragon ( 177695 ) on Friday May 09, 2003 @07:24PM (#5923245) Homepage
      "Currently" supported? What does that mean?

      It means that at one time, there were more archs supported. NeXT/Open Step ran on ix86, m68k, powerpc, mips, sparc, etc.

      It doesn't seem like such a stretch to assume that other architectures are officially not out of the question, with a hedge statement like this one. Very interesting...

      I wouldn't be too surprised if Apple has most of those running internally. I also wouldn't be too surprised if they release a server based on something that isn't powerpc, but the client is out of the question.

      I also wouldn't be too surprised if an unreleased version of Windows 2003 Server runs on PowerPC and MIPS.

      • I wouldn't be too surprised if Apple has most of those running internally. I also wouldn't be too surprised if they release a server based on something that isn't powerpc, but the client is out of the question.
        They do.

        google://apple+marklar

        I also wouldn't be too surprised if an unreleased version of Windows 2003 Server runs on PowerPC and MIPS.
        *shudder*
    • Umm... maybe because Darwin [apple.com] exists for x86 as well?

      Mac OS X is still PPC only, of course.

    • Apple's gcc is based on NeXT's gcc, which supported multiple architectures already. There's no reason to think this is was added for future compatability, since we know for a fact it is a leftover from a previous version. :-)
  • GNU? (Score:3, Funny)

    by TheRaven64 ( 641858 ) on Saturday May 10, 2003 @05:51AM (#5925132) Journal
    So, the article title is 'Porting Unix Command-Line Tools to Mac OS X', and everyone talks about porting GNU tools to Mac OS X. I thought that the whole point was that GNU's Not Unix?

    Not to moderators: It's a Joke. Laugh.

Is a person who blows up banks an econoclast?

Working...