lefty SFfindFile: remove MSVC 'strncasecmp' fall back
Commit 69f8a328e1d41b1cd799c715a8398ab0f096a8f4 replaced `SFstrncmp` with
`strncasecmp` or `_strnicmp` depending on whether we were compiling with a
non-MSVC compiler or with MSVC, respectively. However, this code is part of the
X11 GUI support and hence never built with MSVC. This commit removes this
unnecessary fall back which was dead code.
The clang-format style used in Graphviz is already pure LLVM style, but was
generated with clang-format-12. This means older versions of clang-format fail
because they do not understand some of the style options that were emitted by
clang-format-12. Reverting to using only `BasedOnStyle` makes it more obvious
that pure LLVM style is in use and permits older versions of clang-format to be
used. None of the newer options introduced by clang-format-12 are critical for
Graphviz formatting.
tclpathplan gt: rephrase into something more obvious
Similar to commit 1cf8e0225a6a215c93437a9972497f1cae0ffc8c. This is intended to
preserve the same semantics. It not only avoids two -Wfloat-equal warnings, but
makes this code so close to the leading comment that the comment can simply be
removed now.
fix inability to include and use gvc.h from a parent CMake project
When attempting to declare a dependency on gvc when using Graphviz as a CMake
subproject, the include path necessary to compile gvc headers would not be
propagated to dependent targets. The result would be a compilation error when
the transitive includes of gvc.h could not be found.
To validate this change, create an empty directory and add the following
CMakeLists.txt:
Clone Graphviz into the subdirectory 'graphviz'. Then the standard CMake steps:
mkdir build
cd build
cmake ..
make
Note that Graphviz dependencies and then 'bar' are correctly built.
I am not a CMake expert; this was written based on my best guess of what
Graphviz should be doing according to the CMake docs. Assuming this is correct,
other Graphviz targets probably need similar fixes.
colxlate canoncolor: operate on 'char' instead of 'unsigned char'
It is unclear to me why this code was using unsigned char variables. This was
unnecessary, induced noisy casting and caused build warnings. This also changes
the `orig` parameter to a const pointer as the function does not modify the
pointed to data.
Magnus Jacobsson [Tue, 14 Sep 2021 10:31:44 +0000 (12:31 +0200)]
cmd/edgepaint: autotools: link to the gvc lib instead of the static common lib
The common lib is part of gvc and should not be linked to directly.
This will allow an upcoming MR to correct the storage class attributes
in lib/common/globals.h.
Wihout this commit, many errors like this would appear when linking
the edegpaint executable:
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: ../../lib/edgepaint/.libs/libedgepaint_C.a(node_distinct_coloring.o): in function `node_distinct_coloring_internal2':
/home/magja/graphviz/lib/edgepaint/node_distinct_coloring.c:137: undefined reference to `__imp_Verbose'
Towards https://gitlab.com/graphviz/graphviz/-/issues/2058.
Magnus Jacobsson [Tue, 14 Sep 2021 10:31:44 +0000 (12:31 +0200)]
cluster: autotools: link to the gvc lib instead of the static common lib
The common lib is part of gvc and should not be linked to directly.
This will allow an upcoming MR to correct the storage class attributes
in lib/common/globals.h.
Wihout this commit, many errors like this would appear when linking
cluster:
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: ../../lib/edgepaint/.libs/libedgepaint_C.a(node_distinct_coloring.o): in function `node_distinct_coloring_internal2':
/home/magja/graphviz/lib/edgepaint/node_distinct_coloring.c:137: undefined reference to `__imp_Verbose'
Towards https://gitlab.com/graphviz/graphviz/-/issues/2058.
Magnus Jacobsson [Tue, 14 Sep 2021 10:31:44 +0000 (12:31 +0200)]
gvmap: autotools: link to the gvc lib instead of the static common lib
The common lib is part of gvc and should not be linked to directly.
This will allow an upcoming MR to correct the storage class attributes
in lib/common/globals.h.
Wihout this commit, many errors like this would appear when linking
gvmap:
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: ../../lib/edgepaint/.libs/libedgepaint_C.a(node_distinct_coloring.o): in function `node_distinct_coloring_internal2':
/home/magja/graphviz/lib/edgepaint/node_distinct_coloring.c:137: undefined reference to `__imp_Verbose'
Towards https://gitlab.com/graphviz/graphviz/-/issues/2058.
Magnus Jacobsson [Sun, 12 Sep 2021 06:39:38 +0000 (08:39 +0200)]
plugin/pango: autotools: add linking to cgraph
E.g. plugin/pango/gvgetfontlist_pango.c uses agxbputc from
lib/cgraph/agxbuf.c.
Fixes errors like this with Cygwin:
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: .libs/gvgetfontlist_pango.o: in function `agxbputc':
/cygdrive/c/GitLab-Runner/builds/magjac/graphviz/graphviz-2.49.1~dev.20210911.2106/plugin/pango/../../lib/cgraph/agxbuf.h:93: undefined reference to `agxbmore'
lefty: autotools: don't try to build lefty when it's not possible
Fixes this error with Cygwin:
In file included from garray.c:14:
../../../../cmd/lefty/g.h:20:10: fatal error: X11/Intrinsic.h: No such file or directory
20 | #include <X11/Intrinsic.h>
| ^~~~~~~~~~~~~~~~~
Magnus Jacobsson [Sun, 22 Aug 2021 09:22:29 +0000 (11:22 +0200)]
plugin/webp: autotools: add linking to gvc
E.g. plugin/webp/gvloadimage_webp.c used gvusershape_file_access from
lib/gvc/gvusershape.c.
Fixes the following errors with Cygwin:
gvloadimage_webp.o: in function `webp_loadimage':
plugin/webp/gvloadimage_webp.c:139: undefined reference to `__imp_gvusershape_file_access'
plugin/webp/gvloadimage_webp.c:153: undefined reference to `__imp_gvusershape_file_release'
plugin/webp/gvloadimage_webp.c:153: undefined reference to `__imp_gvusershape_file_release'
gvdevice_webp.o: in function `writer':
plugin/webp/gvdevice_webp.c:43: undefined reference to `gvwrite'