[Mesa-dev] [RFC mesa-demos] Add --with-system-data-files configure option
przanoni at gmail.com
Fri Jan 28 12:09:39 PST 2011
One of the problems with mesa-demos is that the demos have hardcoded paths to
data files (example: fopen("../images/something.rgb", ...)). Distributions
shipping the package need to "sed" all those paths in order to ship working
demos. This patch introduces a DEMOS_DATA_DIR definition that should be used
when trying to open a data file. After this patch, distros packaging mesa-demos
only need to specify "--with-system-data-files" when building and the apps will
automatically look for the file in the right place. If you're a developer that
doesn't use "make install", everything will still work as always: just
don't use the new option, the patch is backwards-compatible.
I have to admit that my autotools-fu is bad, so if you know any better way to
implement this feature, please tell me: I'll be happy to learn and implement.
IMHO, the ugliest part is the addition of the ac_define_dir "m4" macro (stolen
from the xserver tree, btw).
For the CMake system, I only added a definition to keep backward-compatibility.
Suggestions are welcome here too.
Another detail is that image files were moved from "src/images" to "src/data"
(since "data/" contais not only image files, but .dat files too).
As a last note, I didn't do anything to .vert, .geom and .frag files. Maybe they
should be handled the same way? Some of these files are mentioned in ".shtest"
files, and I didn't have time to investigate how these files work (maybe the
only way would be using .in files?).
As a consequence of moving images/ to data/, the patch file is 3.9MB
long, so you can grab it here:
Any comments, improvements or objections?
More information about the mesa-dev