]> granicus.if.org Git - graphviz/commitdiff
gvc: autotools: work around cygwin linking problem with .def file
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Mon, 13 Sep 2021 15:11:21 +0000 (17:11 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 28 Sep 2021 16:17:16 +0000 (18:17 +0200)
This workaround is just a temporary measure until an upcoming commit
series towards https://gitlab.com/graphviz/graphviz/-/issues/2058 will
remove the .def file.

Fixes this error with Cygwin when running 'dot -c' during installation.

C:/Users/magja/graphviz/build/bin/dot.exe: error while loading shared libraries: gvc.dll: cannot open shared object file: No such file or directory

Before this commit, the following results were obtained:

ldd build/bin/dot.exe =>
        ntdll.dll => /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffca85c0000)
        KERNEL32.DLL => /cygdrive/c/WINDOWS/System32/KERNEL32.DLL (0x7ffca69d0000)
        KERNELBASE.dll => /cygdrive/c/WINDOWS/System32/KERNELBASE.dll (0x7ffca6170000)
        cygcgraph-6.dll => /cygdrive/c/Users/magja/graphviz/build/bin/cygcgraph-6.dll (0x487030000)
        cygcdt-5.dll => /cygdrive/c/Users/magja/graphviz/build/bin/cygcdt-5.dll (0x552550000)
        cygwin1.dll => /usr/bin/cygwin1.dll (0x180040000)
        gvc.dll => not found

objdump -s lib/gvc/.libs/libgvc.dll.a | grep -i dll =>
In archive lib/gvc/.libs/libgvc.dll.a:
 0000 6776632e 646c6c00                    gvc.dll.

After this commit, the following results are obtained:

ldd build/bin/dot.exe =>
        ntdll.dll => /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffca85c0000)
        KERNEL32.DLL => /cygdrive/c/WINDOWS/System32/KERNEL32.DLL (0x7ffca69d0000)
        KERNELBASE.dll => /cygdrive/c/WINDOWS/System32/KERNELBASE.dll (0x7ffca6170000)
        cyggvc-6.dll => /cygdrive/c/Users/magja/graphviz/build/bin/cyggvc-6.dll (0x5941e0000)
        cygcgraph-6.dll => /cygdrive/c/Users/magja/graphviz/build/bin/cygcgraph-6.dll (0x487030000)
        cygcdt-5.dll => /cygdrive/c/Users/magja/graphviz/build/bin/cygcdt-5.dll (0x552550000)
        cygwin1.dll => /usr/bin/cygwin1.dll (0x180040000)
        cygwin1.dll => /usr/bin/cygwin1.dll (0xe60000)
        cygpathplan-4.dll => /cygdrive/c/Users/magja/graphviz/build/bin/cygpathplan-4.dll (0x461410000)
        cygz.dll => /usr/bin/cygz.dll (0x3ff080000)
        cygexpat-1.dll => /usr/bin/cygexpat-1.dll (0x3fe370000)
        cygltdl-7.dll => /usr/bin/cygltdl-7.dll (0x3feba0000)

objdump -s lib/gvc/.libs/libgvc.dll.a | grep -i dll =>
In archive lib/gvc/.libs/libgvc.dll.a:
 0000 63796767 76632d36 2e646c6c 00000000  cyggvc-6.dll....

lib/gvc/Makefile.am

index 7d2f2fd7f9f5b92129dc0c240908a5471abf8c29..71f7baa69544eb90a38ad2ba27fd3aca0ac2a974 100644 (file)
@@ -75,8 +75,15 @@ libgvc_la_LIBADD = $(libgvc_C_la_LIBADD) \
 libgvc_la_DEPENDENCIES = $(libgvc_C_la_DEPENDENCIES)
 
 if WITH_WIN32
+if WITH_CYGWIN
+cyggvc-6.def: $(top_srcdir)/lib/gvc/gvc.def
+       sed '/^LIBRARY/s/gvc/cyggvc-6/' $< > $@
+BUILT_SOURCES = cyggvc-6.def
+libgvc_la_LDFLAGS += -export-symbols cyggvc-6.def
+else
 libgvc_la_LDFLAGS += -export-symbols $(top_srcdir)/lib/gvc/gvc.def
 endif
+endif
 
 if ENABLE_MAN_PDFS
 if HAVE_PS2PDF