IRIX has native getopt() routines which aren't GNU-compliant - which causes the build of getopt to fail. The source anticiptates this, however, and if LIBCGETOPT is set to 0 then it will build correctly. I'm not sure if this can be passed as a parameter, or whether the Makefiles need to be altered with sed. (Additionally, work/getopt-1.1.4/gnu/getopt.c should '#include <string.h>' - this appears to happen if 'HAVE_STRING_H' is set, but only on VMS(!) and even then this doesn't appear to be set anywhere) [I was hoping that this package would provide getopt_long routines, which IRIX doesn't have natively and several packages - such as groff - require. Unfortunately it doesn't :( ]
so, does it make sense to patch it for IRIX? Additionally, we might want to make a getopt_long package, as I think Interix needs it too.
Created attachment 188948 [details, diff] #include <string.h> on IRIX ebuild changes necessary: --- getopt-1.1.4.ebuild.portage +++ getopt-1.1.4.ebuild @@ -10,7 +10,7 @@ LICENSE="GPL-2" SLOT="0" -KEYWORDS="~ppc-macos ~x86-macos ~x86-solaris" +KEYWORDS="~mips-irix ~ppc-macos ~x86-macos ~x86-solaris" IUSE="nls" RDEPEND="nls? ( virtual/libintl )" @@ -28,13 +28,20 @@ src_unpack() { src_compile() { local nogettext="1" local libintl="" + local libcgetopt="1" if use nls; then nogettext=0 has_version sys-libs/glibc || libintl="-lintl" fi + if [[ ${CHOST} == *-irix* ]]; then + epatch "${FILESDIR}/${P}-irix.patch" + libcgetopt=0 + fi + emake CC="$(tc-getCC)" prefix="${EPREFIX}/usr" \ + LIBCGETOPT=${libcgetopt} \ WITHOUT_GETTEXT=${nogettext} LIBINTL=${libintl} \ CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" || die "emake failed" }
ok, fixed
Confirmed - getopt-1.1.4 now builds correctly. (There are still problems with getopt_long for a number of packages... speex comes to mind, but there are more. I'm not sure how this can be addressed - speex can be configured to use FreeBSD(?)'s libgnugetopt, but I never found a canonical download location for this. There are two different code-bases: IIRC, one eixsts as 1.2 and 1.3 (which are identical, bare-bones, and broken) and one exists as 1.2 (with full configure scripts, and work. However, the presence of this library does cause another build (I forget which) to fail. I can attach the necessary files and ebuild, and we can see whether it's worth including...)