Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 277041 - dev-libs/libgnugetopt-1.2 ebuild for IRIX
Summary: dev-libs/libgnugetopt-1.2 ebuild for IRIX
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All IRIX
: High normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-08 15:25 UTC by Stuart Shelton
Modified: 2011-12-15 18:13 UTC (History)
0 users

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


Attachments
libgnugetopt ebuild and source (libgnugetopt.tar.bz2,179.23 KB, application/octet-stream)
2009-07-08 15:27 UTC, Stuart Shelton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Shelton 2009-07-08 15:25:38 UTC
This ebuild of FreeBSD's build of the GNU getopt library provides getopt_long, which is not otherwise present on IRIX (and may not be present on other platforms without a GNU C library).

Some source - media-libs/speex for example - already provide a configure option to use libgnugetopt if present.

I'm not sure where the canonical home of the source is, so I've included the source tarball with the ebuild.  There may well be updated source out there...
Comment 1 Stuart Shelton 2009-07-08 15:27:09 UTC
Created attachment 197197 [details]
libgnugetopt ebuild and source


Extracts to usr/portage/distfiles and usr/local/portage/
Comment 2 Stuart Shelton 2009-07-08 15:37:36 UTC
(Or, looking again at the speex patch, can be convinced to use libgnugetopt at least...)
Comment 3 Michael Haubenwallner (RETIRED) gentoo-dev 2009-07-09 08:11:30 UTC
IIRC, gnulib does provide both getopt and getopt_long.
As we build some modules (including getopt) of gnulib as library on some platforms already, I'm wondering if this could work for IRIX too - please have a look at dev-libs/gnulib/.
Comment 4 Stuart Shelton 2009-07-10 16:40:02 UTC
Hmm - I'm not sure I've quite got the hang of gnulib, but I installed it and then ran 'gnulib-tools --import getopt' during groff's configure stage (since groff is a package which fails due to getopt_long not being present)... but this failed in the same way.

I guess this means that either the above isn't how gnulib is supposed to be used, or that gnulib's getopt module doesn't include getopt_long...

Should this have worked?
Comment 5 Stuart Shelton 2009-07-10 17:56:03 UTC
I just tried "gnulib-tool -s --import getopt" for speex, and got the following output:

Module list with included dependencies:
  getopt
  gettext-h
  include_next
  link-warning
  unistd
File list:
  build-aux/link-warning.h
  lib/dummy.c
  lib/getopt.c
  lib/getopt.in.h
  lib/getopt1.c
  lib/getopt_int.h
  lib/gettext.h
  lib/unistd.in.h
  m4/00gnulib.m4
  m4/getopt.m4
  m4/gnulib-common.m4
  m4/include_next.m4
  m4/onceonly.m4
  m4/unistd_h.m4
Creating directory ./lib
Creating directory ./m4
Copying file ./link-warning.h
Copying file lib/dummy.c
Copying file lib/getopt.c
Copying file lib/getopt.in.h
Copying file lib/getopt1.c
Copying file lib/getopt_int.h
Copying file lib/gettext.h
Copying file lib/unistd.in.h
Copying file m4/00gnulib.m4
Copying file m4/getopt.m4
Copying file m4/gnulib-common.m4
Copying file m4/gnulib-tool.m4
Copying file m4/include_next.m4
Copying file m4/onceonly.m4
Copying file m4/unistd_h.m4
Creating lib/Makefile.am
Creating m4/gnulib-cache.m4
Creating m4/gnulib-comp.m4
Finished.

You may need to add #include directives for the following .h files.
  #include <getopt.h>

You may need to use the following Makefile variables when linking.
Use them in <program>_LDADD when linking a program, or
in <library>_a_LDFLAGS or <library>_la_LDFLAGS when linking a library.
  $(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise

Don't forget to
  - add "lib/Makefile" to AC_CONFIG_FILES in ./configure.ac,
  - mention "lib" in SUBDIRS in Makefile.am,
  - mention "-I m4" in ACLOCAL_AMFLAGS in Makefile.am,
  - mention "m4/gnulib-cache.m4" in EXTRA_DIST in Makefile.am,
  - invoke gl_EARLY in ./configure.ac, right after AC_PROG_CC,
  - invoke gl_INIT in ./configure.ac.


... which is, I'm afraid, out of my depth :o

(AC_CONFIG_FILES doesn't exist in configure.ac, ACLOCAL_AMFLAGS doesn't exist in Makefile.am, AC_PROG_CC doesn't existing in configure.ac, and I don't know where to put the last one!)
Comment 6 Michael Haubenwallner (RETIRED) gentoo-dev 2009-07-13 07:55:31 UTC
(In reply to comment #4)
> then ran 'gnulib-tools --import getopt' during groff's configure stage

We make use of 'gnulib-tool --import' within dev-libs/gnulib.ebuild to create a libgnu.a with some subset of gnulib modules suitable for one specific platform. You might need to add another set of modules for your platform there.

As 'gnulib-tools --import' usually is upstream package maintainers's job, we just link against libgnu.a instead. As long as the Makefiles know CFLAGS/CXXFLAGS, LDFLAGS, LIBS, this should be enough:

  inherit flag-o-matic
  DEPEND="mips-irix? ( dev-libs/gnulib )"
  src_configure() {
      if use mips-irix; then
          append-flags -I"${EPREFIX}"/usr/$(get_libdir)/gnulib/include
          append-ldflags -I"${EPREFIX}"/usr/$(get_libdir)/gnulib/lib
          append-libs -lgnu
      fi
      econf ...
  }

Comment 7 Stuart Shelton 2009-07-13 10:18:57 UTC
Hmm - problems here, then: my installation of gnulib includes neither the includes for any library to link against :(

The only files installed by gnulib outside of ${EPREFIX}/usr/share/gnulib/ are:

/opt/gentoo/usr/share/doc/gnulib-2009.03.03.14.07.45-r00.1/README.bz2
/opt/gentoo/usr/share/doc/gnulib-2009.03.03.14.07.45-r00.1/ChangeLog.bz2
/opt/gentoo/usr/bin/gnulib-tool
Comment 8 Fabian Groffen gentoo-dev 2011-12-15 18:13:21 UTC
We are sorry to close this bug.  We lack the man-power and devotion to support mips-irix in the tree.