Also removes these three warnings in standard Windows MSVC builds:
C:\Users\magja\graphviz\cmd\dot\no_builtins.c(13,37): warning C4273: 'lt_preloaded_symbols': inconsistent dll linkage [C:\Users\magja\graphviz\build\cmd\dot\dot.vcxproj]
C:\Users\magja\graphviz\cmd\tools\gvpack.c(34,37): warning C4273: 'lt_preloaded_symbols': inconsistent dll linkage [C:\Users\magja\graphviz\build\cmd\tools\gvpack.vcxproj]
LINK : warning LNK4217: symbol 'lt_preloaded_symbols' defined in 'no_builtins.obj' is imported by 'dot.obj' in function 'main' [C:\Users\magja\graphviz\build\cmd\dot\dot.vcxproj]
Magnus Jacobsson [Thu, 29 Jul 2021 05:58:37 +0000 (07:58 +0200)]
label: CMake: ensure label symbols are exported from the gvc lib
The object modules from the static label lib are statically linked
into the gvc shared lib through the common object library which means
that their symbols should be exported from gvc instead of
imported. Defining GVC_EXPORTS achieves this.
This is what the autotools build already does.
Fixes this error with MinGW:
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../label/liblabel.a(xlabels.c.obj):xlabels.c:(.text+0x98): undefined reference to `__imp_zmalloc'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../label/liblabel.a(xlabels.c.obj):xlabels.c:(.text+0x1f40): undefined reference to `__imp_zmalloc'
Magnus Jacobsson [Sat, 24 Jul 2021 06:04:53 +0000 (08:04 +0200)]
ortho: CMake: ensure ortho symbols are exported from gvc
The object modules from the static ortho lib are statically linked
into the gvc shared lib which means that its symbols should be
exported from gvc instead of imported. Defining GVC_EXPORTS achieves
this.
Fixes errors like this with MinGW:
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../ortho/CMakeFiles/ortho_obj.dir/fPQ.c.obj:fPQ.c:(.text+0x6d): undefined reference to `__imp_gcalloc'
Magnus Jacobsson [Thu, 29 Jul 2021 16:31:12 +0000 (18:31 +0200)]
common: ensure correct import/export declarations of expat with MinGW
The expat library does not seem to recognize MinGW and therefore does
not apply the Microsoft storage class attributes to its function
declarations when using MinGW. Defining XML_USE_MSC_EXTENSIONS forces
it to use those.
Fixes errors like this with MinGW:
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../common/CMakeFiles/common_obj.dir/htmllex.c.obj:htmllex.c:(.text+0x1cec): undefined reference to `XML_ParserCreate'
Magnus Jacobsson [Mon, 16 Aug 2021 18:28:23 +0000 (20:28 +0200)]
CMake: FindLTDL: ensure ltdl is found with MinGW
CMake defines both WIN32 and MINGW when the compiler is some version
of MinGW. With MinGW we do want to use the ltdl library athough on
native Windows we only use the ltdl compatibility header introduced in d70cdba7937724c19393d97bd280320cdf8c3c8f, not the library itself.
Fixes the following errors with MinGW:
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/gvc.dir/objects.a(gvplugin.c.obj):gvplugin.c:(.text+0x4f7): undefined reference to `lt_dlinit'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/gvc.dir/objects.a(gvplugin.c.obj):gvplugin.c:(.text+0x529): undefined reference to `lt_dlopen'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/gvc.dir/objects.a(gvplugin.c.obj):gvplugin.c:(.text+0x578): undefined reference to `lt_dlerror'
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/gvc.dir/objects.a(gvplugin.c.obj):gvplugin.c:(.text+0x69e): undefined reference to `lt_dlsym'
Towards https://gitlab.com/graphviz/graphviz/-/issues/2102.
Magnus Jacobsson [Mon, 30 Aug 2021 06:29:29 +0000 (08:29 +0200)]
common: link to expat privately instead of publicly
Downstream libraries that explicitly use expat now all link to expat
themselves and no longer rely on a transitive dependency to expat
through gvc via common.
Magnus Jacobsson [Wed, 18 Aug 2021 18:29:43 +0000 (20:29 +0200)]
gvc: CMake: link to pack privately instead of publicly
The pack object modules are part of the gvc library and downstream
libraries should link to the gvc library, not to the pack
library. Hence no need for a transitive dependency to pack in gvc.
These lines were working around an issue where SWIG-generated code includes the
non-standard header malloc.h This was fixed in SWIG commit 571a84c9e788a8e97517a5d730d0e01edf0085e2 which made it into SWIG v1.3.32
released in 2007. Thus this work around is no longer necessary.
This allows removing parts of this script that were unused. configure.ac was
already calling snippets of Python inline, so this is slightly more consistent.
Supersedes !1801.
Final Python 2 support was removed in 61ae0419198465b457df875881a2dae0aadc8bfd.
But this configure logic was still attempting to discriminate between minor
Python 2 and Python 1 versions. After this change, we just simply reject
anything < Python 3.
fix dangerous-default-value issues in gvtest.py test suite support
Pylint warns that using `[]` as a default is dangerous due to modifications to
the parameter unintentionally persisting across calls. I do not believe that
happens in this case, but it is better to rephrase this code to pacify Pylint
and make it clearer to readers that this is not happening.
Magnus Jacobsson [Mon, 26 Jul 2021 14:51:16 +0000 (16:51 +0200)]
common: add declaration of drand48 to utils.h when the system doesn't have it
This function is implemented in utils.c when not available otherwise.
Removes this warning with MinGW:
C:/Users/magja/graphviz/lib/fdpgen/tlayout.c:597:33: warning: implicit declaration of function 'drand48'; did you mean 'srand48'? [-Wimplicit-function-declaration]
597 | double angle = PItimes2 * drand48();
| ^~~~~~~
| srand48
Magnus Jacobsson [Sat, 24 Jul 2021 10:57:04 +0000 (12:57 +0200)]
common: remove weak declaration of drand48 that causes it to be undefined with MinGW
Fixes this error with MinGW:
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export drand48: symbol not defined
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../ortho/CMakeFiles/ortho_obj.dir/partition.c.obj:partition.c:(.text+0x4de): undefined reference to `drand48'
Towards https://gitlab.com/graphviz/graphviz/-/issues/2102.
There is no need to generate this file. It contains statically known content.
Generating it was proving a maintenance headache across the three build systems.
Related to #2102.