X fails to build on Darwin

Joined
Jun 14, 2009
Messages
14
Reaction score
0
Points
1
I have installed Darwin 8.01 on my computer on an HFS+ partition. I have downloaded X from the x.org website (curl http://ftp.x.org/pub/X11R6.9.0/src-single/X11R6.9.0-src.tar.gz > X11.tar.gz) and extracted it (gzip -dc X11.tar.gz > X11.tar ; tar -xf X11.tar ; cd xc). That works fine, I then try to build it (make World install). It builds with many errors and then installs to /usr/X11R6/. I add /usr/X11R6/bin/ to my path and try to start it (xinit or startx), however, it gives me an error telling me that X does not exist (the executable) it says it could be a simlink to XDarwin or XQuartz. So I checked the bin folder (ls /usr/X11R6/bin) and I do not see either of those files in there. It seems they do not build for some reason, but everything else does. I tried using gcc-3.3 gcc-3.5 and gcc-4.0 which all came installed with darwin, I also tried gcc-4.1 which I compiled myself. All resulted the same way. I looked online for instructions and they were almost identical to what I did, except they told me to get the source from via cvs. What should I do?
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
It builds with many errors and then installs to /usr/X11R6/.
Either those "errors" were warnings or it didn't install.

Compiling source is always tricky and a hard endeavour unless you are willing to track down deps all day long. Your best bet would be to use something that takes this away from you. Now, the only thing I can think of working might be pkgsrc. You can bootstrap this for your platform and install xorg that way. This way, all the deps are handled for you and all you have to do is wait for it to build.

While that doesn't really answer your question, what kind of errors are you getting?
 
OP
P
Joined
Jun 14, 2009
Messages
14
Reaction score
0
Points
1
Nope. There are many warnings too, but there are many errors, namely while its compiling the xserver, drivers, and the fonts (fonts aren't so important). But it continues building through the errors, I know its unusual, but believe me, it does.
I redirected the errors to a file so I could read them, but it ended up being a huge file and as I am working in a Darwin, all I have is the terminal so looking through the file is difficult, its filled mostly with warnings. Heres a few I remember:
dereferencing pointer error (This is the error that keeps xserver and drivers from building)
exports/bin/bdftopcf - file or directory does not exist (One of these occurs with every font, its probably because something failed to build before)

So now that that is all said, I looked at my installation instructions again, and they say to use Xfree86 from their cvs repository, I had been using X.org instead, from the x.org web site. So I tried downloading Xfree86 instead, from the cvs repository, and the result was almost the same, except Xfree86 stops building after the 1st error. (dri_driver - dereferencing pointer error)

So I'm back to the drawing board. I'll try getting Xfree86 sources from the web instead, see if that makes a difference.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
You might have better luck with xfree86 because it isn't modular which I imagine would complicate building. cvs checkouts are always a crapshoot as the code could likely be broken, especially if Darwin isn't a supported platform (I don't know if it is or not). Have you considered bootstrapping NetBSDs pkgsrc (Darwin/OSX is a supported platform)? I've used pkgsrc and it worked well. It will save you a lot of headaches. Mind you, I didn't build something like X but I did build KDE4.

I commend you for trying to undertake this project but I think without some expert knowledge of compiling X, you're going to run into trouble.
 
OP
P
Joined
Jun 14, 2009
Messages
14
Reaction score
0
Points
1
Well I downloaded the current build and the dev snapshot of XFree86 and tried to build those, but they both failed. I really thought this would be easier... I have compiled X for linux before and I have cross-compiled the Xlib part of X for my armeb-xscale processor before. It compiled pretty easily. X has special config files for Darwin, but they just don't work, and from what I've read, XFree86 should just compile... Well I guess I will look into pkgsrc, I will definitely need some kind of package management software, I was looking into DarwinPorts and MacPorts, but they both need X to build and run.
I'll look into it and tell you what I come up with, any more advise would be welcome.
 
OP
P
Joined
Jun 14, 2009
Messages
14
Reaction score
0
Points
1
Well it seems that pkgsrc requires a case specific file system. HFS+ is not... I had a hard enough time setting it up in the first place, I'm not going to reformat in UFS and start over. I tried using it anyway, but it complained about bad checksums and then when I set the variable NO_CHECKSUMS to yes, it failed for other reasons.
So now I need to either manually compile X/XFree86 or find another package management system.... or reinstall on a UFS partition....
Portage is interesting to me, I wonder if that could work in Darwin.
Darwin seems to have a very small user base, I feel as if I am in uncharted waters.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
I don't know if Portage works on Darwin - it seems pretty Gentoo specific.

I'm sorry you had such bad luck with pkgsrc, it worked well for me (sort of). As for MacPorts, I'm not sure if it will work for Darwin. At this point, it might be worth a shot.

Mount DMG and Installer from the CLI.

I just thought of this now - Darwin 8.0.1 is old. This could likely be causing problems with libraries and such. Perhaps you should try a newer version of Darwin.
 
OP
P
Joined
Jun 14, 2009
Messages
14
Reaction score
0
Points
1
it certainly could be my problem. But Darwin 8.01 was the last Darwin that was distributed as an iso, anything newer was only distributed as source. I will look into it. I kind of fear that apple no long distributes source at all for Darwin. I actually got my Darwin 8.01 iso from another non-apple ftp site. But Ill look into getting the source.
As for portage, it is pretty gentoo specific, but there is a project called Gentoo/Alt I think that is dedicated to porting Gentoo to other OS's. I've been trying to install Gentoo/FreeBSD on my other HDD, but their installation CD won't boot for me. But maybe I could get portage running on Darwin. I'll try to upgrade my Darwin version 1st.
 
OP
P
Joined
Jun 14, 2009
Messages
14
Reaction score
0
Points
1
All Darwin source links seem to take me to the Apple Open source page for Mac OS X. But thats probably because those portions of Mac and Darwin are identical. So I downloaded the xnu kernel source and tried to build it, but it failed miserably, I don't know, maybe I'm doing it wrong. So I wrote a script to download and extract all the source for X11R7.4. The script worked mostly, except for some reason, libX11 won't download from the ftp (permission denied?), so I substituted libX11 from 7.3, which needs xcb, which needs python to compile, and python won't build correctly. But I think xcb is a pretty recent addition, so Ill try X11R7.1, which is, I believe the version that I successfully cross compiled for armeb-xscale.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
While I commend you for trying to do this, maybe you should stick to something like PureDarwin. This will let you avoid the tedious parts of compiling all of this and focus on whatever it is you want Darwin for. The nano iso might be what you're looking for and I believe it is based off of Darwin 9.

I will give that nano install a run tonight in VirtualBox to see what I can come up with.
 
OP
P
Joined
Jun 14, 2009
Messages
14
Reaction score
0
Points
1
I am pretty much just using Darwin for fun, to see what I can do with it. Besides the fact that I can't seem to get much running on it, I like it a lot. It boots really fast (under 20 seconds, my windows xp took over 10 minutes, windows 7 takes about 2 minutes), its very bare-bones (which I like, because then I can build from the ground up, or close to it), and its not linux (I love linux, but it has its problems).
I don't want to use PureDarwin because I feel Darwin is a starting point and that I need to add my own customization to it, PureDarwin is somebody else's customization. However, PureDarwin does look very intriguing. It looks like they are working on building a liveCD version of Darwin 9. Turns out I can't build Darwin from source right now as it can only be done on a Mac (according to something I read, I forget where, probably apple dev connection), and I currently do not have OSX installed, but I did just order 2 new hard drives, so I will soon probably.
I'm going to switch to Darwin now and see what I can do with X11R7.1 or 7.0.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
I wish you the best of luck ;). I would also hope this was just for fun. To be otherwise would be insane.

I tried PureDarwin in VirtualBox - that was a no-go. You're on your own now :).
 
OP
P
Joined
Jun 14, 2009
Messages
14
Reaction score
0
Points
1
I got the X11R7.0 sources and everything is there, I compiled everything up to libX11 (all dependencies satisfied). When I try to build libX11, builds a program called "makekeys", I can't figure out what its for, but it gets used in the build process, it does something to a source file, something to do with key codes. makekeys gets built, but when it trys to run it, it dies with a floating point exception. I remember when I cross-compiled I had a similar problem because it built makekeys for my target instead of my build system, so my build system couldn't run it. I fixed it by first compiling xlib for my build system and then moving the file over to my target source tree. That won't work since I can't build it for Darwin or cross-compile for Darwin, but maybe I can think of something, like finding a good output file from a working makekeys or something, I don't know, probably won't work. I think the problem may be that its still trying to use xproto from X11R7.4 instead of R7.0, I think the header that it modifies is from xproto. I'll work on it some more and see what I can come up with.
From what I have read, HFS+ is a very bad and problematic filesystem, causing many compilation errors in many different programs. That may be why xfree86 wouldn't build and it was why pkgsrc faild. If I can't get this to work I'll consider switching to UFS. That would mean starting from scratch, but really the only thing I don't want to lose is a good gcc-4.1 build.
 
OP
P
Joined
Jun 14, 2009
Messages
14
Reaction score
0
Points
1
Ok, I'm back in windows 7 now because libXfont has informed me that I must have freetype installed.
Using the correct xproto version worked, I now have a full client side X11R7.0 running on Darwin. Now all I need it the server and drivers, and I'm almost there.

Edit: After viewing the freetype website, I am wondering whether I should install freetype version 1 or 2. libxfont didn't specifically ask for a version. My gut and brain says go with version 1, but my heart says dev snapshot.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
libxfont didn't specifically ask for a version. My gut and brain says go with version 1, but my heart says dev snapshot.
My intuition say that, despite the nerd factor is using a dev snapshot, you should go with v1. I think you've suffered enough ;).
 
OP
P
Joined
Jun 14, 2009
Messages
14
Reaction score
0
Points
1
freetype version 1 doesn't recognize my Darwin, it asks me to specify my host. So I say ./configure --host=i386-apple-darwin8.0.1 and it says darwin unrecognized. So I just say i386-apple and it thinks I'm using a mac, but configures, however, the build fails. Version 2 recognizes my operating system, but still fails to compile.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
I don't know which gnu make I have, and to me it seems unlikely, but I'll give it a shot.
Execute "make -version" - that should give you the version number.
 
OP
P
Joined
Jun 14, 2009
Messages
14
Reaction score
0
Points
1
I can't right now (I'm working), I plan to though. But I came across a mail archive: Re: Several Darwin quartz objects not being built when using GNU make-3.
Haven't really read it because I'm supposed to be writing an automated testing application, but I did quickly glance at it, looks like the make that comes with Darwin is a special apple modified make that has addition obj-c rules which cause some things to fail, including quartz. So I think with the proper make, XFree86 may build correctly. Seems a shame to do that though, go back to the beginning now that I've put all this work into it. So I'll install gnu make and continue building X11R7, then fall back to XFree86 if that fails.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top