Gentoo/FreeBSD does not have libtermcap.so. However, gawk-4.1.1 requires it. http://git.savannah.gnu.org/cgit/gawk.git/commit/?id=ac5d2bf77c871ab5c9da4ff34a11416a61cee826 Reproducible: Always Steps to Reproduce: 1. emerge sys-apps/gawk 2. 3. Actual Results: x86_64-gentoo-freebsd10.0-gcc -DDEFPATH='".:/usr/share/awk"' -DDEFLIBPATH="\"/usr/lib/gawk\"" -DSHLIBEXT="\"so"\" -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/share/locale"' -I. -O0 -pipe -ggdb -DNDEBUG -c version.c x86_64-gentoo-freebsd10.0-gcc -O0 -pipe -ggdb -DNDEBUG -export-dynamic -o gawk array.o awkgram.o builtin.o cint_array.o command.o debug.o dfa.o eval.o ext.o field.o floatcomp.o gawkapi.o gawkmisc.o getopt.o getopt1.o int_array.o io.o main.o mpfr.o msg.o node.o profile.o random.o re.o regex.o replace.o str_array.o symbol.o version.o /usr/lib/libintl.so -lreadline -ltermcap -lm -lm /usr/lib/gcc/x86_64-gentoo-freebsd10.0/4.8.2/../../../../x86_64-gentoo-freebsd10.0/bin/ld: cannot find -ltermcap collect2: error: ld returned 1 exit status Makefile:643: recipe for target 'gawk' failed gmake[2]: *** [gawk] Error 1 gmake[2]: Leaving directory '/var/tmp/portage/sys-apps/gawk-4.1.1/work/gawk-4.1.1' Makefile:727: recipe for target 'all-recursive' failed gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory '/var/tmp/portage/sys-apps/gawk-4.1.1/work/gawk-4.1.1' Makefile:546: recipe for target 'all' failed gmake: *** [all] Error 2 * ERROR: sys-apps/gawk-4.1.1::gentoo failed (compile phase): * emake failed * * If you need support, post the output of `emerge --info '=sys-apps/gawk-4.1.1::gentoo'`, * the complete build log and the output of `emerge -pqv '=sys-apps/gawk-4.1.1::gentoo'`. * The complete build log is located at '/var/tmp/portage/sys-apps/gawk-4.1.1/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-apps/gawk-4.1.1/temp/environment'. * Working directory: '/var/tmp/portage/sys-apps/gawk-4.1.1/work/gawk-4.1.1' * S: '/var/tmp/portage/sys-apps/gawk-4.1.1/work/gawk-4.1.1' FYI, Results on Gentoo/FreeBSD 10.0) $ ls -lha /usr/lib/libtermcap* ls: /usr/lib/libtermcap*: No such file or directory Results on Vanilla FreeBSD 10.0) $ ls -lha /usr/lib/libtermcap* lrwxr-xr-x 1 root wheel 12B Jan 17 07:39 /usr/lib/libtermcap.a -> libncurses.a lrwxr-xr-x 1 root wheel 13B Jan 17 07:39 /usr/lib/libtermcap.so -> libncurses.so lrwxr-xr-x 1 root wheel 14B Jan 17 07:39 /usr/lib/libtermcap_p.a -> libncurses_p.a lrwxr-xr-x 1 root wheel 13B Jan 17 07:39 /usr/lib/libtermcapw.a -> libncursesw.a lrwxr-xr-x 1 root wheel 14B Jan 17 07:39 /usr/lib/libtermcapw.so -> libncursesw.so lrwxr-xr-x 1 root wheel 15B Jan 17 07:39 /usr/lib/libtermcapw_p.a -> libncursesw_p.a
(In reply to Yuta SATOH from comment #0) > Gentoo/FreeBSD does not have libtermcap.so. > However, gawk-4.1.1 requires it. > Reproducible: Always > > Steps to Reproduce: > 1. emerge sys-apps/gawk > 2. > 3. > > Actual Results: ... /usr/lib/gcc/i686-gentoo-freebsd9.1/4.6.3/../../../../i686-gentoo-freebsd9.1/bin/ld: cannot find -ltermcap collect2: error: ld returned 1 exit status ... I have the same result on g/fbsd-9.1.
Created attachment 381574 [details, diff] bad patch for gawk-4.1.1/configure This is not good patch. I used to make stages 1,2,3...
USE=-readline gets around this issue.
I don't think that we would need readline support and recommend putting "sys-apps/gawk readline" in profiles/package.use.mask
+ 30 Jun 2015; Lars Wendler <polynomial-c@gentoo.org> gawk-4.1.3.ebuild, + +files/gawk-4.1.3-bsd_configure_readline.patch: + Fixed build with readline support on bsd (bug #507468). + Sorry this took so long.
EPATCH_OPTS="-Z" does fail here, causing autotools to be run by Makefile. patch's output (hidden by epatch) actually is: > patching file configure > Hunk #1 succeeded at 10825 (offset -7 lines). > Not setting time of file configure (contents mismatch) > patching file m4/readline.m4 > patch unexpectedly ends in middle of line > Hunk #1 succeeded at 92 with fuzz 1. > Not setting time of file m4/readline.m4 (contents mismatch) Proposing: diff -u -r1.2 gawk-4.1.3.ebuild --- gawk-4.1.3.ebuild 30 Jun 2015 20:31:53 -0000 1.2 +++ gawk-4.1.3.ebuild 1 Jul 2015 10:44:08 -0000 @@ -32,7 +32,6 @@ -e '/check-recursive all-recursive: check-for-shared-lib-support/d' \ extension/Makefile.in || die - EPATCH_OPTS="-Z" \ epatch "${FILESDIR}/${P}-bsd_configure_readline.patch" #507468 } diff -u -r1.1 gawk-4.1.3-bsd_configure_readline.patch --- files/gawk-4.1.3-bsd_configure_readline.patch 30 Jun 2015 20:31:53 -0000 1.1 +++ files/gawk-4.1.3-bsd_configure_readline.patch 1 Jul 2015 10:44:08 -0000 @@ -50,9 +50,9 @@ ;; esac ---- gawk-4.1.3/m4/readline.m4 2015-04-05 06:19:19.000000000 -0400 -+++ gawk-4.1.3/m4/readline.m4 2015-04-05 06:19:19.000000000 -0400 -@@ -92,7 +92,7 @@ +#--- gawk-4.1.3/m4/readline.m4 2015-04-05 06:19:19.000000000 -0400 +#+++ gawk-4.1.3/m4/readline.m4 2015-04-05 06:19:19.000000000 -0400 +#@@ -92,7 +92,7 @@ if test $_found_readline = yes ; then case $host_os in @@ -60,4 +60,4 @@ + *bsd* ) AC_CHECK_LIB(termcap, tgetent, _combo="$_combo -ltermcap") ;; esac - AC_DEFINE(HAVE_LIBREADLINE,1, \ No newline at end of file + AC_DEFINE(HAVE_LIBREADLINE,1,
(In reply to Michael Haubenwallner from comment #6) > EPATCH_OPTS="-Z" does fail here, causing autotools to be run by Makefile. > > patch's output (hidden by epatch) actually is: > > patching file configure > > Hunk #1 succeeded at 10825 (offset -7 lines). > > Not setting time of file configure (contents mismatch) > > patching file m4/readline.m4 > > patch unexpectedly ends in middle of line > > Hunk #1 succeeded at 92 with fuzz 1. > > Not setting time of file m4/readline.m4 (contents mismatch) > > Proposing: > > diff -u -r1.2 gawk-4.1.3.ebuild > --- gawk-4.1.3.ebuild 30 Jun 2015 20:31:53 -0000 1.2 > +++ gawk-4.1.3.ebuild 1 Jul 2015 10:44:08 -0000 > @@ -32,7 +32,6 @@ > -e '/check-recursive all-recursive: > check-for-shared-lib-support/d' \ > extension/Makefile.in || die > > - EPATCH_OPTS="-Z" \ > epatch "${FILESDIR}/${P}-bsd_configure_readline.patch" #507468 > } > > diff -u -r1.1 gawk-4.1.3-bsd_configure_readline.patch > --- files/gawk-4.1.3-bsd_configure_readline.patch 30 Jun 2015 20:31:53 > -0000 1.1 > +++ files/gawk-4.1.3-bsd_configure_readline.patch 1 Jul 2015 10:44:08 > -0000 > @@ -50,9 +50,9 @@ > ;; > esac > > ---- gawk-4.1.3/m4/readline.m4 2015-04-05 06:19:19.000000000 -0400 > -+++ gawk-4.1.3/m4/readline.m4 2015-04-05 06:19:19.000000000 -0400 > -@@ -92,7 +92,7 @@ > +#--- gawk-4.1.3/m4/readline.m4 2015-04-05 06:19:19.000000000 -0400 > +#+++ gawk-4.1.3/m4/readline.m4 2015-04-05 06:19:19.000000000 -0400 > +#@@ -92,7 +92,7 @@ > > if test $_found_readline = yes ; then > case $host_os in > @@ -60,4 +60,4 @@ > + *bsd* ) AC_CHECK_LIB(termcap, tgetent, _combo="$_combo > -ltermcap") > ;; > esac > - AC_DEFINE(HAVE_LIBREADLINE,1, > \ No newline at end of file > + AC_DEFINE(HAVE_LIBREADLINE,1, I can't seem to replicate the issue here. I've combinations of the patch and ebuild changes, and I have yet to see autotools interference. Though, Yutah SATOH (nigoro) has. nigoro, can you confirm that Michael's (haubi's) changes fix it on your end?
+ 02 Jul 2015; Lars Wendler <polynomial-c@gentoo.org> + files/gawk-4.1.3-bsd_configure_readline.patch: + Fixed gawk-4.1.3-bsd_configure_readline.patch so it applies correctly with -Z + option. + Sorry for the inconveniences.
(In reply to Lars Wendler (Polynomial-C) from comment #8) Seems to work now, thanks! > Sorry for the inconveniences. This is what a buildbot setup is for ;)