Problem with configure

Richard Moore rich at
Wed Apr 26 14:09:27 UTC 2000

Michael Mueller wrote:
> Hi,
> I have a little problem with the -D compiler option to define a macro.
> I have a macro, say SOMEPATH and I want it to expand to a string, i.e., the
> effect should be the same as #define SOMEPATH "/foo/bar".
> However, I need to define the macro as a command line option to the
> compiler, i.e., as -DSOMEPATH="/foo/bar".
> When I call the compiler from the shell, I have to escape the quotes using
> backslashes, i.e., I have to type -DSOMEPATH=\"/foo/bar\". But what do I
> have to do, if I want to specify the -D in the KDevelop project compiler
> options? In the KDevelop build process there seems to be another point,
> where backslash escapes are converted.
> When I enter -DSOMEPATH=\"/foo/bar\" in the additional options filed of the
> project options dialog, it configure is executed when I close the dialog
> and configure checks the compiler with -DSOMEPATH="/foo/bar". This works,
> since configure calls the compiler with eval and thus it seems that the
> quotes must not be escaped. But when I execute make I get error messages
> that foo and bar are not defined, i.e., in the call to the compiler from
> make, the quotes obviously have to be escaped.

You could try something like: -DSOMEPATH='"/foo/bar"'


> When I try to use additional backslashes,  to overcome the first backslash
> conversision, configure calls the compiler with -DSOMEPATH=\"/foo/bar\" and
> this doesn't succeed. The error message in config.log says "unterminated
> string or character constant".
> Can anybody tell me how I have to specify this -D option so that both
> configure and make/gcc are happy?
> Thanks
> Michael

     Richard Moore		rich at	richard at	rich at

More information about the KDevelop mailing list