bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] gl_GETOPT broken for Solaris?


From: Albert Chin
Subject: [Bug-gnulib] gl_GETOPT broken for Solaris?
Date: Tue, 2 Nov 2004 19:55:05 -0600
User-agent: Mutt/1.5.6i

I just built coreutils from CVS on Solaris 9/SPARC with the Sun C
compiler. It does not have getopt so the gl_GETOPT_SUBSTITUTE gets
called from m4/getopt.m4 because of the following in gl_GETOPT:
  AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])

In gl_GETOPT_SUBSTITUTE, we see:
  ...
  AC_DEFINE([optarg], [rpl_optarg],
    [Define to rpl_optarg if the replacement variable should be used.])
  AC_DEFINE([optind], [rpl_optind],
    [Define to rpl_optind if the replacement variable should be used.])
  ...

Why? If the system has neither <getopt.h> nor the getopt_long_only
symbol, why replace anything? Removing the AC_DEFINE's in
gl_GETOPT_SUBSTITUTE makes the coreutils test suite pass. Else, odd
things happen, like 'src/basename' returning 'basename' *always*.

Also, why not just blindly use the getopt provided by the program?
What would it harm?

-- 
albert chin (address@hidden)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]