how to change X11 location?

does anyone know how to actually change the X11 install location? Do they have an environment variable that is the path it uses.. or is it all hard coded to /usr/X11R6/ ????? is Xquartz or XDarwin any different in this regard?

I can only get them both to work from that folder like its hard coded in... I assume there is a way to change that without having to edit source code.. or it would be very poor programming.

Macbook Pro 15" Unibody 2.53ghz, Mac OS X (10.5.7), Macbook Pro 2ghz Original, iPhone 3G S 32GB, iPod Touch 1st gen 16gb

Posted on Jul 17, 2009 3:28 PM

Reply
9 replies

Jul 17, 2009 4:05 PM in response to doh1231

doh1231 wrote:
I can only get them both to work from that folder like its hard coded in... I assume there is a way to change that without having to edit source code..


I sincerely doubt it.

or it would be very poor programming.


Take a look at the low-level X11 API sometimes. I hesitate to call it poor. It is 25 years old after all. Let's just call it "set in its ways". It's been sitting it its comfortable /usr/X11 chair for a long time and isn't going to be moved by any young greenhorn whipper-snapper.

Jul 17, 2009 5:12 PM in response to etresoft

well, I've seen different Linux distros have it installed and working in different locations, so its got to be configurable easily in some way... seen some put it in /opt/

also Crossover uses their own XDarwin run on the fly that runs without modifying the current X11 on the system... and it doesn't run from that location.

Jul 17, 2009 6:32 PM in response to doh1231

doh1231 wrote:
well, I've seen different Linux distros have it installed and working in different locations, so its got to be configurable easily in some way... seen some put it in /opt/


Configurable? Perhaps. Easily? Not likely.

also Crossover uses their own XDarwin run on the fly that runs without modifying the current X11 on the system... and it doesn't run from that location.


Really? That seems wasteful.

Unfortunately, I think it is a moot point as far as MacOS X is concerned. It isn't designed to be as configurable as Linux. It has a distinctly different user base.

Just why do you want to change the X11 location? Perhaps there is some clever workaround to give you whatever end result you are really seeking.

Jul 17, 2009 8:28 PM in response to etresoft

I'm building a Wine based wrapper tool that is made for helping port software over to Macs in a wine wrapper... making it like a self contained app kind of like Cider. most of that is done, except some more features to make it easier for the user, but I'm currently having it use normal X11.app, which is a pain because it doesnt support RandR correctly and fullscreen has issues, which limits many games to have to run in a virtual desktop window and not full screen. Crossover uses its own built in version of Xdarwin, instead of Xquartz, which I can get working locally on my machine fine... and it works MUCH MUCH better for Wine than XQuartz, including full screen and resolution switching and stuff.... but I need to find a way to include it in the wrapper like Crossover does to add this in. I'd rather use Xquartz, but its far too limited for what needs I have... and the limitations of XDarwin doesn't effect what I'm doing with Wine.

it would be easy to put a symlink in for a moment, but that would not only take root access to do, but mess up other apps trying to use Xquartz

Jul 18, 2009 3:24 AM in response to doh1231

In that case you need to start from the beginning. What were the results when you downloaded the entire X11 source and rebuilt. Does X11 even use configure?

One thing you might want to look at, assuming you've gone that far, is the "install nametool". This allows you to go into an executable and change the paths it uses for shared libraries. One of the options you can use is @executable_path which will cause your executable to use dynamic libraries in its application bundle.

Good luck. This is a lot of work.

Jul 18, 2009 11:41 AM in response to etresoft

I don't see a way to use Install nametool for what I need, but I'll look for more info on it.

When i compile from source, I can configure it for whatever folder I want it to run in, but I haven't found a way to make that like look at a global variable, it always wants a hard set path.... thinking about it... maybe I can make the hard set path some hidden special folder in the users home folder and make a symlink on launch of the program it sticks over there... linked to the current location of the X11 files inside the .app ... hmm that should work, not sure why I didn't think of that before, as too preoccupied with the default in /usr/

Jul 18, 2009 2:08 PM in response to doh1231

There are a couple of possibilities.

One thing to try is setting the hard coded path to be /Applications/doh1231.app/Contents/Resources or something like that. That isn't much better than /usr/X11R6, but it would work for your purposes - for testing if nothing else.

I do think install nametool is something you will need. If you put all of your shared libraries into the application bundle, you can use that to tell all the applications where to find the libraries instead of relying on some environment variable.

Speaking of environment variables. I don't know how the X11 internals works on that level. If there is a global variable you need to set, you can also do that with the application wrapper. Your application will just one or more X11 environment variables to be the location of the application bundle. Then it can fork/exec any other processes it needs.

Is that what you mean by "global variable"?

Jul 18, 2009 3:09 PM in response to etresoft

i mean stuff like... $XINITRC is a global variable to the path to the xinitrc file... one of the few X11 has set up in itself... so it will look for ~/.xinitrc by default, but i can stick in that variable whatever path i want and thats where X will look for its xinitrc at least for that session.

Also like in Wine, it has a fake registry files and a fake C drive set up by default in ~/.wine but you can use a gobal variable built into it of $WINEPREFIX to se that folder wherever you want it to look. I was just wondering why no X11 program Ive seen, Xfree86, X.org whatever... uses anything like that, just hard code it to a variable, and if the variable is not found, it defaults to a certain location. I guess its because most OSes that use X11 use it as a main window server thats always running.

Wine has some preliminary Quartz support, but it doesn't look like the people who work on that have done much lately. It would be nice if it could just use Quartz one day and forget X11.

But I think I figured out a way to do it that will be the same on all boxes of OSX. I'm just going to temporarily put a hidden folder inside of Applications with a folder symlink inside of it that points over to where ever the current location of the X11 files are... and when the app is done, remove the hidden folder there. I'll compile X to always look for that hidden folder in Applications.... just trying to keep my app self contained as much as possible... if i have to I can do a whole shadow directory.

Compiling stuff up now to test it out, I'll see how it works

PS thanks for the help 🙂

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

how to change X11 location?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.