Created attachment 157071 [details] gawk diff - Use USES=readline:port Without this, gawk may pick libreadline.so from base.
I would be interested in a build log for this. The --with-readline=${LOCALBASE} really should prevent this.
Since I do not have devel/readline installed, configure failed with --with-readline=${LOCALBASE}. Then it checked -lreadline and found it from base. % make ===> gawk-4.1.3 depends on package: libiconv>=1.14_8 - found ===> gawk-4.1.3 depends on shared library: libsigsegv.so - found (/usr/local/lib/libsigsegv.so) ===> gawk-4.1.3 depends on shared library: libreadline.so - found (/usr/lib/libreadline.so) ===> Configuring for gawk-4.1.3 ... % make package ===> Building package for gawk-4.1.3 actual-package-depends: dependency on /usr/lib/libreadline.so not registered (normal if it belongs to base) * cited from config.log: configure:10750: checking whether readline via "-lreadline" is present and sane configure:10811: clang -o conftest -O2 -pipe -march=core2 -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing -DNDEBUG -DLIBICONV_PLUG -I/usr/local/include -I/usr/local/include -fstack-protector -Wl,-export-dynamic -L/usr/local/lib conftest.c -lm -lreadline >&5 conftest.c:120:2: warning: implicit declaration of function 'close' is invalid in C99 [-Wimplicit-function-declaration] close(0); ^ conftest.c:122:7: warning: implicit declaration of function 'open' is invalid in C99 [-Wimplicit-function-declaration] fd = open("/dev/null", 2); /* should get fd 0 */ ^ conftest.c:123:2: warning: implicit declaration of function 'dup' is invalid in C99 [-Wimplicit-function-declaration] dup(fd); ^ 3 warnings generated. configure:10811: $? = 0 configure:10811: ./conftest configure:10811: $? = 0 configure:10821: result: yes configure:10837: checking for history_list in -lreadline configure:10862: clang -o conftest -O2 -pipe -march=core2 -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing -DNDEBUG -DLIBICONV_PLUG -I/usr/local/include -I/usr/local/include -fstack-protector -Wl,-export-dynamic -L/usr/local/lib conftest.c -lreadline -lreadline -ltermcap -lm >&5 configure:10862: $? = 0 configure:10871: result: yes
I missed some words. Since I do not have devel/readline installed, configure SHOULD failed with --with-readline=${LOCALBASE} but it didn't. It seems that configure only checked -lreadline and found it from base.
Ah, I get it now. The issue is with the LIB_DEPENDS line that adds readline. This uses readline.so rather than readline.so.6 (as is used by Mk/Uses/readline.mk). So I should either add the .6 here, or use your patch. I'll go with your patch, as it is shorter and avoid having the version number listed in many files. Thank you
A commit references this bug: Author: johans Date: Sat May 23 14:52:36 UTC 2015 New revision: 387131 URL: https://svnweb.freebsd.org/changeset/ports/387131 Log: - Force linking with readline from ports Note that gawk works fine with readline from base, but it would break dependency tracking if we get this wrong PR: 200408 Submitted by: sunpoet Changes: head/lang/gawk/Makefile
I guess the dependency tracking issue in the commit log means that gawk depends on readline from port but did not register the dependency to pkg db. Since gawk works fine with readline from base, USES=readline should be enough. I made a simple test as follows: - Change lang/gawk/Makefile from USES=readline:port to USES=readline - Install devel/readline - Install lang/gawk % pkg info -x readline p5-ReadLine-Gnu-1.26 p5-ReadLine-Perl-1.0303_3 php56-readline-5.6.8 readline-6.3.8 % ldd /usr/local/bin/gawk /usr/local/bin/gawk: libsigsegv.so.2 => /usr/local/lib/libsigsegv.so.2 (0x8008af000) libreadline.so.8 => /lib/libreadline.so.8 (0x800ab2000) libncurses.so.8 => /lib/libncurses.so.8 (0x800cf5000) libm.so.5 => /lib/libm.so.5 (0x800f42000) libc.so.7 => /lib/libc.so.7 (0x80116a000) % pkg info -dx gawk gawk-4.1.3: indexinfo-0.2.3 libsigsegv-2.10_1 It seems the dependency is correct.
May I change lang/gawk/Makefile from USES=readline:port to USES=readline since the dependency looks correct?
A commit references this bug: Author: sunpoet Date: Mon Jun 15 13:40:56 UTC 2015 New revision: 389707 URL: https://svnweb.freebsd.org/changeset/ports/389707 Log: - Use USES=readline instead of USES=readline:port gawk works fine with readline from base and readline.mk handles readline dependency (from base or ports) correctly. PR: 200408 Submitted by: sunpoet (myself) Approved by: johans (maintainer, via email) Changes: head/lang/gawk/Makefile
Committed. Thanks!