ChrisSteinbach / mscgen

Automatically exported from code.google.com/p/mscgen
GNU General Public License v2.0
0 stars 0 forks source link

[Patch] Implicit -i broken + replace ".msc" with "type" + wrong path for "out of dir" builds #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi

I made a patch for stripping input-files of their ".msc" extension, so it
will be replaced by the "type", when -o is not given. So instead of
"file.msc.png" it will now produce "file.png", when running:

mscgen -Tpng "file.msc"

I have introduced str.c and str.h that contains "strcaseequals()", which
uses strcasecmp to do its job. For platforms without strcasecmp, an
emulation is inserted. Feel free to merge this code into another file, I
just couldn't figure out a good spot to place it. configure.ac includes
check for this function and for "_strcasecmp" (Windows/Cygwin tends to
"prefix" functions with _ - not sure if strcasecmp was one of them).

While testing this I noticed that the implicit "-i" flag "eats" the two
first characters of the input-file name (it believes that the "input file"
argument is actually "-i$name" instead of just "$name"). The patch also
fixes this. I have modified the test to not use the "-i" flag to catch
regressions. It does however still use the -o flag (or else the output ends
in the source dir rather than the build dir!). Other modifications to the
test includes looping through "types" and usage of the "-T<type>" instead
of "-T <type>" to check for regressions here.

Last but not least, when building out of "dir", the "included" libgd was
not detected - the patch also fixes this. 

The patch was made based on revision 71. I can split the patch into
separate patches, if desired.

~Niels

Original issue reported on code.google.com by NThykier@gmail.com on 25 Jul 2009 at 5:03

Attachments:

GoogleCodeExporter commented 9 years ago
Excellent observations again.  I'll get to fixing this.

Thanks!

Original comment by Michael....@gmail.com on 25 Jul 2009 at 6:24

GoogleCodeExporter commented 9 years ago
Glad to be of assistance.

I noticed you committed revision 73, that implements the "build out of dir" 
part.
Sadly, there are missing some "/" in it, so it fails (in fact I believe it also
breaks on "in dir" builds - but I haven't tested those).

~Niels

Original comment by NThykier@gmail.com on 25 Jul 2009 at 8:44

GoogleCodeExporter commented 9 years ago
In dir worked, but as you spotted, out of dir didn't :(

r74 adds the slashes - many thanks!

Original comment by Michael....@gmail.com on 25 Jul 2009 at 11:08

GoogleCodeExporter commented 9 years ago
This issue was closed by r75.

Original comment by Michael....@gmail.com on 26 Jul 2009 at 2:46

GoogleCodeExporter commented 9 years ago
In revision 75, when doing an "out of dir" build, the "test outputs" goes into 
the
"source" test folder and are therefore no cleaned by a make clean/make 
distclean. 

Also this causes multiple "out of dir" builds to "overwrite" each others' test
output, so manual move/copy is required when comparing outputs of two different
builds (e.g. with and without USE_FREETYPE).

~Niels

Original comment by NThykier@gmail.com on 26 Jul 2009 at 4:35

GoogleCodeExporter commented 9 years ago

Original comment by Michael....@gmail.com on 27 Jul 2009 at 8:08

GoogleCodeExporter commented 9 years ago
This issue was closed by r76.

Original comment by Michael....@gmail.com on 28 Jul 2009 at 7:17