automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Installation dirs in code


From: Brendon Costa
Subject: Installation dirs in code
Date: Wed, 13 Dec 2006 10:17:39 +1100
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051204)

Hi all,

I was wondering if there exists a kindof standard way to obtain final installation directory information within code being compiled when using autotools?

E.g.
I have a program that requires a configuration file that will usually go into the ${prefix}/etc as given by $sysconfdir. So this program needs to know where it is going to find this installed configuration file. I was initially going to export the evaluated value of $sysconfigdir into a define in config.h as an absolute path, however I found there are two problems with this.

1) On windows using MinGW/MSYS the path is not a native windows one but rather a MSYS path. So then i started to write a autoconf macro that converted a MSYS path to a native windows one.

2) I also often perform cross compiles as it is a whole lot simpler than rebooting into a different operating system. When doing a cross compile usually the installation prefix is not the name of the actual install path that will be used on the end system, but just some temporary directory that the binaries are compiled into before being copied across to the host system later. This gets even more complex with problem 1 above when cross compiling on say NetBSD for a host system of i386-mingw32 as I cant convert the MSYS path to a windows native one without the build actually being done on the windows machine...


Is there a standard way of solving this problem or even just a method of doing things that will work in the above scenarios?

Thanks,
Brendon.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]