|
From: <tim...@en...> - 2006-06-19 21:20:57
|
Timoth=E9e Lecomte wrote:
> Daniel J Sebald wrote:
> =20
>> Dr. Johannes Zellner wrote:
>> =20
>> =20
>>> in trm/post.trm there's a really ugly hardcoded path:
>>>
>>> #ifndef GNUPLOT_PS_DIR
>>> #define GNUPLOT_PS_DIR "/usr/local/share/gnuplot/4.1/PostScript"
>>> #endif
>>> =20
> (...)
>
> I don't have any opinion on what to do when GNUPLOT_PS_DIR is not=20
> defined (ie when not using ./configure), the best is to make sure that=20
> all custom makefile's do that properly (something else to do before 4.2=
=20
> I think).
> =20
In fact this would be wrong for Windows and probably other platforms=20
(OS/2 ?), where there are no standard filesystem directories. On these=20
platforms, hardcoding a path at compile time is completely wrong.
Two alternatives for them :
- Encode the paths relatively to the binary. Windows has a function for=20
that : GetModuleFileName().
- Include the postscript prologue files at compile time, with something=20
like :
#ifndef GNUPLOT_PS_DIR
static char* prologue[] =3D "
# include PostScript/prologue_ps.h"
}
...
#endif
where prologue_ps.h has been written from prologue.ps so that it can=20
be included (replace '{' by '\{' for example ?).
I vote for the second alternative, which would save a lot of work on=20
each platform. As far as I understand, those Postscript files used to=20
live inside post.trm, but are now separate to make development and=20
corrections easier, right ? Falling back to including them at compile=20
time on some platforms doesn't seem a big drawback then.
Timoth=E9e
|