From c6d2a20b8f8f9600b172b805e923d93ca54d3d30 Mon Sep 17 00:00:00 2001 From: rouat Date: Sun, 25 Nov 2001 18:11:44 +0000 Subject: [PATCH] Changed handling of GNU getopt --- ChangeLog | 4 +++ acconfig.h | 3 +++ configure.in | 11 ++++----- src/misc/ChangeLog | 4 +++ src/misc/Makefile.am | 59 +++++++++++++++++++++++++++++++++++++++++++- 5 files changed, 74 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1401fb6fd..7bf8bb46a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-11-25 Emmanuel Rouat + + * configure.in: New way (cleaner) to handle GNU getopt. + 2001-01-21 Paolo Nenzi * bsim3soi_dd/*: BSIM3SOI (DD) support added as level 11. Added tests in diff --git a/acconfig.h b/acconfig.h index 2f60a074f..0c89ece34 100644 --- a/acconfig.h +++ b/acconfig.h @@ -34,3 +34,6 @@ /* Undefine HAVE_GNUREADLINE */ #undef HAVE_GNUREADLINE + +/* Define if we don't have GETOPT in the library */ +#undef HAVE_GETOPT diff --git a/configure.in b/configure.in index b1b023d4e..d997fc76e 100644 --- a/configure.in +++ b/configure.in @@ -119,8 +119,9 @@ dnl libraries are present (error if they are not) if test ! "$no_x" = "yes" ; then X_LIBS="$X_LIBS -lX11 -lXt" AC_CHECK_LIB(Xext, XShmAttach,X_LIBS="$X_LIBS -lXext",AC_MSG_ERROR(Couldn't find Xext librairies), $X_LIBS $X_EXTRA_LIBS) - AC_CHECK_LIB(Xaw,main,X_LIBS="$X_LIBS -lXaw",AC_MSG_ERROR(Couldn't find Xaw librairies),$X_LIBS $X_EXTRA_LIBS) AC_CHECK_LIB(Xmu,main,X_LIBS="$X_LIBS -lXmu",AC_MSG_ERROR(Couldn't find Xmu librairies), $X_LIBS $X_EXTRA_LIBS) + AC_CHECK_LIB(Xaw,main,X_LIBS="$X_LIBS -lXaw",AC_MSG_ERROR(Couldn't find Xaw librairies),$X_LIBS $X_EXTRA_LIBS) + fi @@ -172,14 +173,12 @@ AC_MSG_RESULT(Checking for the presence of the Garbage Collector:) dnl Check for the garbage collector: AC_CHECK_LIB(gc,GC_malloc,AC_DEFINE(HAVE_LIBGC) LIBS="$LIBS -lgc") -AC_MSG_RESULT(Checking for the asprintf function:) dnl Check for the asprintf function: AC_CHECK_FUNC(asprintf) -AC_MSG_RESULT(Checking for getopt:) -dnl Check for getopt function and if not found uses a local copy: -AC_CHECK_FUNC(getopt, GETOPTSRC="", GETOPTSRC= "getopt.h getopt.c getopt1.c") -AC_SUBST(GETOPTSRC) + +AC_CHECK_FUNC(getopt_long, getopt_long=true) +AM_CONDITIONAL(HAVE_GETOPT_LONG, test "$getopt_long" = "true") # Expand the prefix variable (this is really annoying!) if eval "test x$prefix = xNONE"; then diff --git a/src/misc/ChangeLog b/src/misc/ChangeLog index f79b36883..2a439a371 100644 --- a/src/misc/ChangeLog +++ b/src/misc/ChangeLog @@ -1,3 +1,7 @@ +2001-11-25 Emmanuel Rouat + + * Makefile.am: adapted for new GNU getopt handling by autoconf + 2000-07-18 Arno W. Peters * Makefile.am: Added wlist.c. diff --git a/src/misc/Makefile.am b/src/misc/Makefile.am index 7c10505c3..89241de0f 100644 --- a/src/misc/Makefile.am +++ b/src/misc/Makefile.am @@ -2,8 +2,34 @@ noinst_LIBRARIES = libmisc.a +EXTRA_libmisc_a_SOURCES = \ + getopt1.c \ + getopt.c \ + getopt.h \ + alloc.c \ + alloc.h \ + dup2.c \ + dup2.h \ + ivars.c \ + ivars.h \ + missing_math.c \ + missing_math.h \ + mktemp.c \ + mktemp.h \ + printnum.c \ + printnum.h \ + string.c \ + stringutil.h \ + terminal.c \ + terminal.h \ + tilde.c \ + tilde.h \ + misc_time.c \ + misc_time.h \ + wlist.c + +if HAVE_GETOPT_LONG libmisc_a_SOURCES = \ - @GETOPTSRC@ \ alloc.c \ alloc.h \ dup2.c \ @@ -27,6 +53,37 @@ libmisc_a_SOURCES = \ wlist.c +else +libmisc_a_SOURCES = \ + getopt1.c \ + getopt.c \ + getopt.h \ + alloc.c \ + alloc.h \ + dup2.c \ + dup2.h \ + ivars.c \ + ivars.h \ + missing_math.c \ + missing_math.h \ + mktemp.c \ + mktemp.h \ + printnum.c \ + printnum.h \ + string.c \ + stringutil.h \ + terminal.c \ + terminal.h \ + tilde.c \ + tilde.h \ + misc_time.c \ + misc_time.h \ + wlist.c + +endif + + + INCLUDES = -I$(top_srcdir)/src/include MAINTAINERCLEANFILES = Makefile.in