Subject: pkg/37253: vorbits-tools no longer builds on pkgsrc/IRIX
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <srcshelton@gmail.com>
List: pkgsrc-bugs
Date: 10/31/2007 13:40:07
>Number:         37253
>Category:       pkg
>Synopsis:       vorbits-tools no longer builds on pkgsrc/IRIX
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 31 13:40:07 +0000 2007
>Originator:     Stuart Shelton
>Release:        pkgsrc latest from CVS
>Organization:
>Environment:
IRIX64 octane 6.5 07202013 IP30 - IRIX 6.5.30
>Description:

vorbis-tools hasn't compiled under IRIX for some time now, but previous I was able to fix this my altering ogg123/cmdline_options.c to '#include <getopt.h>' rather than '#include "getopt.h"', removing all *getopt* files from .buildlink, and adding '.include "../../pkgtools/libnbcompat/buildlink3.mk' to the vorbis-tools Makefile.

However, since libnbcompat's 'buildlink3.mk' was removed for 'inplace.mk' this method doesn't work either :(

The build output is as follows:

source='cmdline_options.c' object='cmdline_options.o' libtool=no  DEPDIR=.deps depmode=sgi /bin/ksh ../depcomp  cc -DLOCALEDIR=\"/usr/bsd/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/bsd/include   -I/usr/bsd/include   -I/usr/bsd/include -I/usr/bsd/include  -D_REENTRANT -I../include -I../intl   -I/usr/bsd/include -D__inline__=inline -I/usr/include -I/usr/bsd/include -I/usr/bsd/include  -O2 -w -signed -c99 -O2 -n32 -mips4 -r14000 -apo -float_const -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 1174,1183,1185,1552,3970,3968 -n32 -I/usr/bsd/include -I/usr/include -c cmdline_options.c
cc-1020 cc: ERROR File = cmdline_options.c, Line = 87
  The identifier "optarg" is undefined.

          ogg123_opts->buffer_size = 1024 * atoi(optarg);
                                                 ^

cc-1020 cc: ERROR File = cmdline_options.c, Line = 94
  The identifier "optarg" is undefined.

        ogg123_opts->input_buffer_size = atoi(optarg) * 1024;
                                              ^

cc-1020 cc: ERROR File = cmdline_options.c, Line = 275
  The identifier "optind" is undefined.

    return optind;
           ^

3 errors detected in the compilation of "cmdline_options.c".
*** Error code 2

Stop.
bmake: stopped in /usr/bsd/var/tmp/audio/vorbis-tools/work/vorbis-tools-1.1.1/ogg123
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/var/tmp/audio/vorbis-tools/work/vorbis-tools-1.1.1
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/var/tmp/audio/vorbis-tools/work/vorbis-tools-1.1.1
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/src/audio/vorbis-tools
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/src/audio/vorbis-tools

... now, all of these variables *are* defined in the system /usr/include/getopt.h - so it seems that by including its own implementation, vorbis-tools is breaking.
>How-To-Repeat:
cd $PKGSRCDIR/audio/vorbis-tools && bmake
>Fix:

If the definitions of the (apparently) missing variables are added to ogg123/cmdline_options.c, then the build process instead fails at the linker stage, because it cannot find a library for -lnbcompat (which isn't mentioned in the package Makefile... is this pulled in from a .la?):

Making all in ogg123
/bin/ksh ../libtool --tag=CC --mode=link cc  -O2 -w -signed -c99 -O2 -n32 -mips4 -r14000 -apo -float_const -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 1174,1183,1185,1552,3970,3968 -n32 -I/usr/bsd/include -I/usr/include   -Wl,-v,-s,-x,-n32,-mips4,-rdata_shared,-allow_jump_at_eop,-rpath,/usr/bsd/lib -n32 -L/usr/bsd/lib32 -Wl,-rpath,/usr/bsd/lib32 -L/usr/lib32 -Wl,-rpath,/usr/lib32 -Wl,-rpath,/usr/bsd/lib -L/usr/bsd/lib -Wl,-v,-s,-x,-n32,-mips4,-rdata_shared,-allow_jump_at_eop,-rpath,/usr/bsd/lib -n32 -L/usr/bsd/lib32 -Wl,-rpath,/usr/bsd/lib32 -L/usr/lib32 -Wl,-rpath,/usr/lib32 -Wl,-rpath,/usr/bsd/lib -L/usr/bsd/lib -L/usr/bsd/lib -o ogg123  audio.o buffer.o  callbacks.o cfgfile_options.o  cmdline_options.o file_transport.o  format.o http_transport.o ogg123.o  oggvorbis_format.o playlist.o status.o  transport.o vorbis
 _comments.o flac_format.o  speex_format.o ../share/libutf8.a ../share/libgetopt.a  -lvorbisfile -Wl,-rpath,/usr/bsd/lib -L/usr/bsd/lib -lvorbis -lm -logg   -Wl,-rpath,/usr/bsd/lib -L/usr/bsd/lib -logg   -L/usr/bsd/lib -lao   -lnsl -lsocket -liconv -L/usr/bsd/lib -lcurl  -D_REENTRANT  -lpthread -lrt -lintl -lFLAC -lm -lspeex -lm 
cc -O2 -w -signed -c99 -O2 -n32 -mips4 -r14000 -apo -float_const -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 1174,1183,1185,1552,3970,3968 -n32 -I/usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/include -Wl,-v -Wl,-s -Wl,-x -Wl,-n32 -Wl,-mips4 -Wl,-rdata_shared -Wl,-allow_jump_at_eop -Wl,-rpath -Wl,/usr/bsd/lib -n32 -Wl,-rpath -Wl,/usr/bsd/lib32 -Wl,-rpath -Wl,/usr/lib32 -Wl,-v -Wl,-s -Wl,-x -Wl,-n32 -Wl,-mips4 -Wl,-rdata_shared -Wl,-allow_jump_at_eop -n32 -o ogg123 audio.o buffer.o callbacks.o cfgfile_options.o cmdline_options.o file_transport.o format.o http_transport.o ogg123.o oggvorbis_format.o playlist.o status.o transport.o vorbis_comments.o flac_format.o speex_format.o -D_REENTRANT  -L/usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib32 -L/usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib ../sha
 re/libutf8.a ../share/libgetopt.a /usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib/libvorbisfile.so /usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib/libvorbis.so /usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib/libao.so -ldl -lnsl -lsocket /usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib/libcurl.so /usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib/libidn.so -lmp -lssl -lcrypto -llber -lldap -lz -lpthread -lrt /usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib/libintl.so /usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib/libiconv.so -lc /usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib/libFLAC.so /usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib/libogg.so /usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib/libspeex.so -lnbcompat -lm   -Wl,-rpath -Wl,/usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib
...
ld32: Trying to open /usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib32/libnbcompat.so...
ld32: Trying to open /usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib32/libnbcompat.a...
ld32: Trying to open /usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib/libnbcompat.so...
ld32: Trying to open /usr/bsd/var/tmp/audio/vorbis-tools/work/.buildlink/lib/libnbcompat.a...
ld32: Trying to open /usr/lib32/mips4/r10000/libnbcompat.so...
ld32: Trying to open /usr/lib32/mips4/r10000/libnbcompat.a...
ld32: Trying to open /usr/lib32/mips4/libnbcompat.so...
ld32: Trying to open /usr/lib32/mips4/libnbcompat.a...
ld32: Trying to open /usr/lib32/libnbcompat.so...
ld32: Trying to open /usr/lib32/libnbcompat.a...
ld32: Trying to open /usr/lib32/libnbcompat.so...
ld32: Trying to open /usr/lib32/libnbcompat.a...
ld32: Trying to open /lib32/libnbcompat.so...
ld32: Trying to open /lib32/libnbcompat.a...
ld32: Trying to open /usr/local/lib32/libnbcompat.so...
ld32: Trying to open /usr/local/lib32/libnbcompat.a...
ld32: FATAL   9  : I/O error (-lnbcompat): No such file or directory

... and adding the reference to libnbcompat back into the Makefile doesn't change anything.