Hi Vladimir,

ian> Sorry, this patch is not OK.  It will just lead us down the path of
ian> increasing the #ifdef over and over again.  The question here is why
ian> HAVE_DECL_GETOPT is not defined.
ian>
ian> Looking at gcc, I would say that the binutils configure.in file should
ian> do the equivalent of gcc_AC_CHECK_DECLS(getopt) to get
ian> HAVE_DECL_GETOPT defined appropriately.

I am not gury in configure magic and then I can't provide acceptable patch.


*sigh* I hate configure file hacking.

Please could you try the patch below which *might* work. I have not tested it very much. You ought to regenerate the configure files after applying this patch but in case this is a problem for you I am attaching a compressed diff for them as well.

Cheers
  Nick



Index: binutils/configure.in
===================================================================
RCS file: /cvs/src/src/binutils/configure.in,v
retrieving revision 1.48
diff -c -3 -p -r1.48 configure.in
*** binutils/configure.in       16 Mar 2005 17:18:15 -0000      1.48
--- binutils/configure.in       24 Mar 2005 21:04:39 -0000
*************** if test $bu_cv_decl_time_t_types_h = yes
*** 180,185 ****
--- 180,195 ----
            [Is the type time_t defined in <sys/types.h>?])
  fi

+ AC_MSG_CHECKING(for an known getopt prototype in unistd.h)
+ AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
+ [AC_TRY_COMPILE([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);],
+ bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
+ AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
+ if test $bu_cv_decl_getopt_unistd_h = yes; then
+ AC_DEFINE([HAVE_DECL_GETOPT], 1,
+ [Is the prototype for getopt in <unistd.h> in the expected format?])
+ fi
+
# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
# by default.
AC_MSG_CHECKING([for utime.h])
Index: binutils/config.in
===================================================================
RCS file: /cvs/src/src/binutils/config.in,v
retrieving revision 1.16
diff -c -3 -p -r1.16 config.in
*** binutils/config.in 13 Oct 2004 14:33:50 -0000 1.16
--- binutils/config.in 24 Mar 2005 21:04:39 -0000
***************
*** 178,183 ****
--- 178,186 ----
/* Is the type time_t defined in <sys/types.h>? */
#undef HAVE_TIME_T_IN_TYPES_H

+ /* Is the prototype for getopt in <unistd.h> in the expected format?  */
+ #undef HAVE_DECL_GETOPT
+
  /* Does <utime.h> define struct utimbuf? */
  #undef HAVE_GOOD_UTIME_H


Attachment: binutils.config.patch.supplimental.bz2
Description: BZip2 compressed data

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to