Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

How to compile a UNIX app for X UNIX
[Editor's note: Please see the comments for some useful suggestions]

I have been having some nagging difficulties compiling c code into X ... Can any one explain the full path to doing this this successfully ?

I mean this must be one of the most appealing aspects of OS X, the ability to run any shell based unix app.....if you could get it to actually work.... :-(

I keep getting the compiler demanding a machine type when using the ./configure command. However when I specify a system like BSD, Darwin, PPC or whatever nothing seems to work. A typical result is:

[localhost:/downloads/nmap-2.53/libpcap-possiblymodified] root# ./configure freeBSD
configure: warning: freeBSD: invalid host type
creating cache ./config.cache
checking host system type... Invalid configuration `freeBSD': machine `freeBSD' not recognized
checking target system type... Invalid configuration `freeBSD': machine `freeBSD' not recognized
checking build system type... Invalid configuration `freeBSD': machine `freeBSD' not recognized
It's also quite unhappy about using cc and not gcc ...what can I do ? I'm longing for all these Unix aps out there.........HELP.
    •    
  • Currently 1.20 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[11,426 views]  

How to compile a UNIX app for X | 5 comments | Create New Account
Click here to return to the 'How to compile a UNIX app for X' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Host types for Mac OS X
Authored by: _merlin on Dec 05, '00 08:26:22PM

I've compiled quite a few UN*X tools under Mac OS X, so I'll share my experience.

The following host types will work with Mac OS X public beta:

powerpc-apple-macosx
powerpc-apple-darwin1.2
powerpc-apple-darwin
powerpc-apple-bsd

If you're using DP4 or earlier, powerpc-apple-darwin1.2 won't work. Try these host types one
at a time, starting from the top of the list until one works. The host types higher in the list
allow more optimisation for Mac OS X. You specify a host type as follows:

./configure -host=<host type>

Substitute in the host type where I've put <host type>, removing the angle brackets, of
course.

If a tool wants to be compiled with gcc rather than cc, you can usually fix it by running
configure like this if you're using csh or tcsh (the default under Mac OS X):

env CC=cc ./configure -host=<host type>

Or like this if you use bash:

CC=cc ./configure -host=<host type>

Of course, you have to substitute in the host type.

I usually use the following sequence of commands to build and install a tool:

env CC=cc ./configure -host=powerpc-apple-macosx
make
su
<password>
make install
exit

Substituting the administrator password where I've put <password> (once again, don't put
the angle brackets).

Note that your tool still might not compile straight away. You may have to download and
install libraries, modify source trees, or hack make files. Notably, bash and lynx require
Makefile modifications before they will compile. If you e-mail me and ask me nicely, I might
be able to help you with a particular program, but I can't guarantee I'll have the time to help
you.

Regards,

Vasantha Crabb

Professional Audio Services

Legal notice:

Use these instructions at your own risk. Neither Professional Audio Services, Apple or
Vasantha Crabb accept any responsibility for any damage caused to your hardware,
software or data.



[ Reply to This | # ]
Linux programs for Mac OS X
Authored by: Anonymous on Dec 09, '00 10:37:54AM

Yes, bash and lynx are good examples which are even available already compiled
They are running quite well
Could you give us a new one or two:
1) mc (the gnu/linux norton commander) (probably easy to compile )
2) tkdesk ( a very useful filemanager ) ( it needs special tk libraries )
Note: tcl is present inside macosx but tk is badly missing!
m.creiss



[ Reply to This | # ]
Host types for Mac OS X
Authored by: M-Rick on Feb 04, '03 06:22:37PM

Hi !

I have done what you were explaining.

I wanted to compile ncurses 5.1 and netpbm 10.11

I have tried with all the 4 : powerpc-apple-macosx
powerpc-apple-darwin1.2
powerpc-apple-darwin
powerpc-apple-bsd

no one works with the make :

each time for netpbm I get at the end :
/usr/bin/libtool: internal link edit command failed
make[1]: *** [libnetpbm.10.11.dylib] Error 1
make: *** [lib/all] Error 2

and for ncurses I get :

cc1plus: warning: changing search order for system directory "/usr/local/include"
cc1plus: warning: as it has already been specified as a non-system directory
../c++/cursesw.cc: In member function `int NCursesWindow::scanw(const char*,
...)':
../c++/cursesw.cc:55: no matching function for call to `std::strstreambuf::
vscan(const char*&, char*&)'
../c++/cursesw.cc: In member function `int NCursesWindow::scanw(int, int, const
char*, ...)':
../c++/cursesw.cc:77: no matching function for call to `std::strstreambuf::
vscan(const char*&, char*&)'
make[1]: *** [../objects/cursesw.o] Error 1
make: *** [all] Error 2

do you have any idea ?



[ Reply to This | # ]
unix apps on osx
Authored by: Anonymous on Dec 08, '00 06:23:52PM

does does this mean i can run/compile GAIM, KDE, XFree86, or some other popular unix app under OSX?



[ Reply to This | # ]
unix apps on osx
Authored by: Anonymous on Dec 11, '00 08:35:58AM

There's already a binary of XFree86 for OS X, so you don't have to compile that.
Get it here: http://www.darwinfo.org/pub/darwin/X11/X11R6-darwin.tar.gz



[ Reply to This | # ]