# AC_HEADER_STDC
AC_CHECK_HEADERS(stdarg.h stddef.h stddef.h stdlib.h stdint.h malloc.h \
- fcntl.h search.h getopt.h pthread.h values.h float.h limits.h termios.h \
+ fcntl.h search.h pthread.h values.h float.h limits.h termios.h \
errno.h time.h unistd.h fenv.h string.h strings.h inttypes.h setjmp.h \
sys/time.h sys/times.h sys/types.h sys/select.h fpu_control.h \
sys/fpu.h sys/socket.h sys/stat.h sys/mman.h \
# -----------------------------------
-AC_MSG_CHECKING(if getopt externs are declared)
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
- #include <stdio.h>
- #if HAVE_UNISTD_H
- #include <unistd.h>
- #endif
- ]], [[if ( optopt ) exit(0); else exit(1);
- ]])],[AC_MSG_RESULT(yes)
- AC_DEFINE_UNQUOTED(HAVE_GETOPT_DECL,1,Define if getopt externs are declared)
- ],[AC_MSG_RESULT(no)
- ])
-
-# -----------------------------------
-
AC_MSG_CHECKING(if intptr_t is declared)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
#if HAVE_STDINT_H
}
#include "config.h"
-
-#ifndef HAVE_GETOPT_DECL
-/*
-public domain AT&T getopt source
-*/
-#include <string.h>
-
-/*LINTLIBRARY*/
-
-#if 0
-#define EOF (-1)
-#define ERR(s, c) if(opterr){\
- char errbuf[2];\
- errbuf[0] = c; errbuf[1] = '\n';\
- (void) write(2, argv[0], (unsigned)strlen(argv[0]));\
- (void) write(2, s, (unsigned)strlen(s));\
- (void) write(2, errbuf, 2);}
-#endif
-#define ERR(s, c) if(opterr) fprintf (stderr, "%s%s'%c'\n", argv[0], s, c)
-
-int opterr = 1;
-int optind = 1;
-int optopt;
-char *optarg;
-
-int
-getopt(int argc, char** argv, char* opts)
-{
- static int sp = 1;
- register int c;
- register char *cp;
-
- if(sp == 1) {
- if(optind >= argc ||
- argv[optind][0] != '-' || argv[optind][1] == '\0')
- return(EOF);
- else if(strcmp(argv[optind], "--") == 0) {
- optind++;
- return(EOF);
- }
- }
-
- optopt = c = argv[optind][sp];
- if(c == ':' || (cp=strchr(opts, c)) == 0) {
- ERR(": illegal option -- ", c);
- if(argv[optind][++sp] == '\0') {
- optind++;
- sp = 1;
- }
- return('?');
- }
- if(*++cp == ':') {
- if(argv[optind][sp+1] != '\0')
- optarg = &argv[optind++][sp+1];
- else if(++optind >= argc) {
- ERR(": option requires an argument -- ", c);
- sp = 1;
- return('?');
- } else
- optarg = argv[optind++];
- sp = 1;
- } else {
- if(argv[optind][++sp] == '\0') {
- sp = 1;
- optind++;
- }
- optarg = 0;
- }
- return(c);
-}
-#endif
/* Define to 1 if you have the `getenv' function. */
#define HAVE_GETENV 1
-/* Define if getopt externs are declared */
-#define HAVE_GETOPT_DECL 1
-
-/* Define to 1 if you have the <getopt.h> header file. */
-#define HAVE_GETOPT_H 1
-
/* Define to 1 if you have the `getrusage' function. */
/* #undef HAVE_GETRUSAGE */