Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 211499 - app-misc/getopt-1.1.4 patch to allow IRIX build
Summary: app-misc/getopt-1.1.4 patch to allow IRIX build
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: MIPS IRIX
: Normal minor
Assignee: Gentoo non-Linux Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-26 10:53 UTC by Stuart Shelton
Modified: 2009-07-08 15:37 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
#include <string.h> on IRIX (getopt-1.1.4-irix.patch,382 bytes, patch)
2009-04-20 12:13 UTC, Stuart Shelton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Shelton 2008-02-26 10:53:39 UTC
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 :( ]
Comment 1 Fabian Groffen gentoo-dev 2008-05-16 20:34:09 UTC
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.
Comment 2 Stuart Shelton 2009-04-20 12:13:17 UTC
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"
 }
Comment 3 Fabian Groffen gentoo-dev 2009-07-06 18:04:42 UTC
ok, fixed
Comment 4 Stuart Shelton 2009-07-08 11:47:13 UTC
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...)