[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop
Subject:    Problem with configure
From:       Michael Mueller <michael_p_mueller () agilent ! com>
Date:       2000-04-26 11:19:55
[Download RAW message or body]

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.

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic