thewml / website-meta-language

An old offline HTML preprocessor (which can be used for static site generation), written in Perl and C that is still maintained for legacy reasons, but probably not recommended for new sites.
https://www.shlomifish.org/open-source/projects/website-meta-language/
GNU General Public License v2.0
14 stars 8 forks source link

cmake doesn't check for -lgdbm_compat #9

Closed xtaran closed 5 years ago

xtaran commented 5 years ago

While cmake . runs through fine in src/, make bails out as follows for me:

Scanning dependencies of target eperl
[ 24%] Building C object wml_backend/p3_eperl/CMakeFiles/eperl.dir/eperl_config.c.o
[ 25%] Building C object wml_backend/p3_eperl/CMakeFiles/eperl.dir/eperl_debug.c.o
[ 25%] Building C object wml_backend/p3_eperl/CMakeFiles/eperl.dir/eperl_getopt.c.o
[ 26%] Building C object wml_backend/p3_eperl/CMakeFiles/eperl.dir/eperl_http.c.o
[ 26%] Building C object wml_backend/p3_eperl/CMakeFiles/eperl.dir/eperl_license.c.o
[ 27%] Building C object wml_backend/p3_eperl/CMakeFiles/eperl.dir/eperl_logo.c.o
[ 27%] Building C object wml_backend/p3_eperl/CMakeFiles/eperl.dir/eperl_main.c.o
[ 28%] Building C object wml_backend/p3_eperl/CMakeFiles/eperl.dir/eperl_parse.c.o
[ 28%] Building C object wml_backend/p3_eperl/CMakeFiles/eperl.dir/eperl_perl5.c.o
[ 29%] Building C object wml_backend/p3_eperl/CMakeFiles/eperl.dir/eperl_powered.c.o
[ 29%] Building C object wml_backend/p3_eperl/CMakeFiles/eperl.dir/eperl_pp.c.o
[ 30%] Building C object wml_backend/p3_eperl/CMakeFiles/eperl.dir/eperl_readme.c.o
[ 31%] Building C object wml_backend/p3_eperl/CMakeFiles/eperl.dir/eperl_sys.c.o
[ 31%] Building C object wml_backend/p3_eperl/CMakeFiles/eperl.dir/eperl_version.c.o
[ 32%] Linking C executable wml_p3_eperl
/usr/bin/ld: cannot find -lgdbm_compat
collect2: error: ld returned 1 exit status
make[2]: *** [wml_backend/p3_eperl/CMakeFiles/eperl.dir/build.make:284: wml_backend/p3_eperl/wml_p3_eperl] Error 1
make[1]: *** [CMakeFiles/Makefile2:1206: wml_backend/p3_eperl/CMakeFiles/eperl.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

(Tested with current git HEAD, commit commit 050c492f05f8dbadcd9ceb2af8e7640b9d6bd94a, i.e. releases/wml-2.10.1.)

shlomif commented 5 years ago
shlomif[wml]:$trunk/src$ ack gdbm ..
../.appveyor.yml
34:    - C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P cmake -P gcc -P g++ -P glibc-devel -P libdb-devel -P libcrypt-devel -P libncurses-devel -P libgd-devel -P libgdbm-devel -P libpcre-devel -P lynx -P perl -P perl-CPAN -P perl-GD -P perl-devel

../B/wml_backend/p3_eperl/config_sc.h
13:#define AC_perl_libs      "-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat"

../B/FOO/wml_backend/p3_eperl/config_sc.h
13:#define AC_perl_libs      "-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat"
shlomif[wml]:$trunk/src$ 

-lgdbm_compat is likely something that the perl5 build scripts/config specify, so please provide it.

xtaran commented 5 years ago

Not 100% sure where to look for it. Does the following suffice?

→ perl -V | fgrep gdbm
    libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
    DEBPKG:debian/gdbm-fatal - [perl #133295] https://bugs.debian.org/904005 Temporarily skip GDBM_File fatal.t for gdbm >= 1.15 compatibility

Happened on Debian Unstable with Debian stock perl, package version 5.28.1-3.

shlomif commented 5 years ago
MACRO(GET_PERL_CONFIG cfg)
    EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE}
        "-e" "use Config; print \$Config{${cfg}}"
        OUTPUT_VARIABLE "perl_${cfg}"
    )
ENDMACRO(GET_PERL_CONFIG)

SET (PERL_CONFIGS archlib libs usedl ccflags optimize ccdlflags ldflags)
FOREACH (cfg ${PERL_CONFIGS})
    GET_PERL_CONFIG(${cfg})
ENDFOREACH(cfg)

.
.
.

TARGET_LINK_LIBRARIES(${EXE}
    ${perl_dla} -lperl ${perl_libs}
)
shlomif commented 5 years ago

In https://github.com/thewml/website-meta-language/blob/master/src/wml_backend/p3_eperl/CMakeLists.txt

xtaran commented 5 years ago
[…]te-meta-language/src → for cfg in archlib libs usedl ccflags optimize ccdlflags ldflags; do perl -E "use Config; say '${cfg}='.\$Config{${cfg}}"; done
archlib=/usr/lib/x86_64-linux-gnu/perl/5.28
libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
usedl=define
ccflags=-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
optimize=-O2 -g
ccdlflags=-Wl,-E
ldflags= -fstack-protector-strong -L/usr/local/lib

HTH

I'm though not really sure, if you're trying to track this down or if you're trying to tell me that the issue is with my (well, Debian's) setup. Would be nice if you could specify that explicitly. :-)

shlomif commented 5 years ago
[…]te-meta-language/src → for cfg in archlib libs usedl ccflags optimize ccdlflags ldflags; do perl -E "use Config; say '${cfg}='.\$Config{${cfg}}"; done
archlib=/usr/lib/x86_64-linux-gnu/perl/5.28
libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
usedl=define
ccflags=-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
optimize=-O2 -g
ccdlflags=-Wl,-E
ldflags= -fstack-protector-strong -L/usr/local/lib

HTH

I'm though not really sure, if you're trying to track this down or if you're trying to tell me that the issue is with my (well, Debian's) setup. Would be nice if you could specify that explicitly. :-)

The libperl linking instructions are to link the generated exe with all the libs in $Config{libs} which happens to include -lgdbm_compat on Debian (and here on mageia). Please install the package containing libgdbm_compat to proceed and make the build successful.

xtaran commented 5 years ago

Please install the package containing libgdbm_compat to proceed and make the build successful.

Already done since before I wrote that bug report. :-)