Hi Leonardo,
I get the same problem that Stumpy described and his patch fixes it for
me. I'm running 'make config' under Linux like Stumpy, are you too?
I checked out from http://svn.gerf.org/leocad/tags/leocad-0.75 at
revision 742 since I see that tags/leocad-0.75 seems to be where all the
recent commits have been; I assume that is where you are both working from?
After checking out, I see the following in the 'make config' output:
>>>
checking size of char... 1\n
checking size of short... 2\n
checking size of long... 4\n
checking size of int... 4\n
checking size of void *... 4\n
checking size of long long... 8\n
<<<
whereas after the patch, this is fixed:
>>>
checking size of char... 1
checking size of short... 2
checking size of long... 4
checking size of int... 4
checking size of void *... 4
checking size of long long... 8
<<<
Both before and after the patch, I hacked config.mk to save the
generated 'conftest.c' and 'conftestval' files from the "checking size
of char..." step, and here are the results:
Without patch:
- conftest.c contains:
>>>
#include
int main() { FILE *f=fopen("conftestval", "w");
if (!f) return (1); fprintf(f, "%d\\n", sizeof(char)); return (0); }
<<<
- conftestval contains:
>>>
1\n
<<< (NOTE: no newline at end of file)
With patch:
- conftest.c contains:
>>>
#include
int main() { FILE *f=fopen("conftestval", "w");
if (!f) return (1); fprintf(f, "%d\n", sizeof(char)); return (0); }
<<<
- conftestval contains:
>>>
1
<<<
I notice one of the original (before patch) lines is:
>>>
echo "if (!f) return (1); fprintf(f, \"%d\\\n\", sizeof(char)); return
(0); }">> conftest.c; \
<<<
My interpretation is that this line (along with the ones before and
after it which are part of the same block of lines with backslashes at
the end) will be passed to the shell by 'make' and if the shell is bash
it will interpret that line above as a command with four words:
1. echo
2. if (!f) return (1); fprintf(f, "%d\\n", sizeof(char)); return (0); }
3.>>
4. conftest.c
From bash.info Section 3.1.2.3 Double Quotes: "The backslash retains
its special meaning only when followed by one of the following
characters: `$', ``', `"', `\', or `newline'. Within double quotes,
backslashes that are followed by one of these characters are removed.
Backslashes preceding characters without a special meaning are left
unmodified." This is why in #2 above the "\\" has been changed to "\"
but the "\n" is left unmodified.
bash's built-in 'echo' command will echo exactly the text shown in #2
above without further expansion, which is obviously not what we desire
since we want the format string to be "%d\n".
I'm considering what 'bash' does because make.info Section 5.3.1
"Choosing the Shell" says "The program used as the shell is taken from
the variable `SHELL'. If this variable is not set in your makefile, the
program `/bin/sh' is used as the shell." and "Unlike most variables, the
variable `SHELL' is never set from the environment." and I can't see
SHELL set in config.mk or version.mk which it includes and:
>>>
$ /bin/sh --version
GNU bash, version 3.2.39(1)-release (i386-redhat-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.
<<<
Also for reference:
>>>
$ make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-redhat-linux-gnu
<<<
I'm guessing that at least one of these must be different for you if you
are seeing different behaviour?
Regards,
David
Leonardo Zide wrote:
>
> That's weird, I can run make config fine without the patch, if I apply
> it then I can't run the tests anymore. There has to be an easier way to
> do this, maybe I should use a shell script instead of the make system.
>
>
> On Mon, Feb 23, 2009 at 9:26 PM, Stumpy842 > wrote:
>
> I just checked out revision 742 and this bug is back (or did it ever
> go away?)
>
> In config.mk it seems the author got a little too
> happy with those backslashes ;-)
>
> Here's a patch for config.mk which will fix
> things up, and get rid of those errors in linux/config.h
> for those Linux users out there.
_________________________________________________________________
View photos of singles in your area. Click Here
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fdating%2Eninemsn%2Ecom%2Eau%2Fchannel%2Findex%2Easpx%3Ftrackingid%3D1046247&_t=773166080&_r=Hotmail_Endtext&_m=EXT_______________________________________________
Leocad mailing list
[email protected]
https://list.gerf.org/listinfo/leocad