From: Tony H. <h...@re...> - 2006-10-08 16:46:24
|
In <452...@ky...>, Jonatan Liljedahl wrote: > I'm developing an application and am using autotools for the build > system. I want the app to be contained under one single folder, with the > source in a 'src' subdir. So to make it an AppDir all you need is to add > an AppRun script. > Now, I'm very new to autotools and I'm not sure how this should be done. > I need to use libtool (to link to an .la lib generated by an included > subpackage), and it generates shell wrappers for the binaries, would it > be possible to 'install' the app onto it's own dir? or actually one > level up, so that running configure && make && make install in MyApp/src > installs the binary (real one, no libtool wrapper) as MyApp/my_binary... > > How have you others solved it when using autotools for AppDirs? I've written ROXTerm so that it can cope with being run as a conventional installed package or as a self-contained ROX App. The AppRun script checks whether there's a src directory and if there isn't it looks for the binary in $PATH. If there is a src dir AppRun runs/compiles the binary in place without installing it. Each bit of code that has to load a resource file can cope with both situations: either load it from $prefix (fixed at compile-time if installed, and read from config.h) or from $APP_DIR (you could use getenv, or something based on dirname(argv[0]) but I pass it in from AppRun as a CLI parameter). If it were installed into the app dir it would have to be recompiled if the app dir got moved. ROXTerm doesn't use libtool but I've used libtool for something else. I think make install installs the actual binaries while the shell wrappers are just there so that the program can be run in place and find its dynamic libraries before installing it, so it should work just fine as I've described above. If you're linking statically with your lib it's even less of an issue. -- TH * http://www.realh.co.uk |