From cd7f95831ea5c66df7789cbbeb2583c8d59ffa79 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 26 Nov 2001 09:19:56 +0000 Subject: [PATCH] * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE. * lib/Makefile.am (libbison_a_SOURCES): Adjust. --- ChangeLog | 5 +++ config.hin | 3 ++ configure | 104 ++++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 2 + lib/Makefile.am | 2 - lib/Makefile.in | 20 +++++----- src/files.c | 4 +- 7 files changed, 125 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39ea13d6..2fccc939 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-11-26 Akim Demaille + + * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE. + * lib/Makefile.am (libbison_a_SOURCES): Adjust. + 2001-11-26 Akim Demaille * src/conflicts.c (conflicts_print): Don't complain at all when diff --git a/config.hin b/config.hin index 798b33ff..3fd84502 100644 --- a/config.hin +++ b/config.hin @@ -145,6 +145,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NL_TYPES_H +/* Define to 1 if libc includes obstacks. */ +#undef HAVE_OBSTACK + /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV diff --git a/configure b/configure index 7ca54b05..c0fe3898 100755 --- a/configure +++ b/configure @@ -4840,6 +4840,110 @@ _ACEOF fi +echo "$as_me:$LINENO: checking for obstacks" >&5 +echo $ECHO_N "checking for obstacks... $ECHO_C" >&6 +if test "${ac_cv_func_obstack+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include "obstack.h" +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +struct obstack *mem; obstack_free(mem,(char *) 0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_obstack=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_obstack=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_obstack" >&5 +echo "${ECHO_T}$ac_cv_func_obstack" >&6 +if test $ac_cv_func_obstack = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_OBSTACK 1 +_ACEOF + +else + LIBOBJS="$LIBOBJS obstack.$ac_objext" +fi + +echo "$as_me:$LINENO: checking for error_at_line" >&5 +echo $ECHO_N "checking for error_at_line... $ECHO_C" >&6 +if test "${ac_cv_lib_error_at_line+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +error_at_line (0, 0, "", 0, ""); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_error_at_line=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_error_at_line=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5 +echo "${ECHO_T}$ac_cv_lib_error_at_line" >&6 +if test $ac_cv_lib_error_at_line = no; then + LIBOBJS="$LIBOBJS error.$ac_objext" +fi + for ac_func in mkstemp setlocale diff --git a/configure.in b/configure.in index 616d29bb..a549bb9b 100644 --- a/configure.in +++ b/configure.in @@ -80,6 +80,8 @@ AM_C_PROTOTYPES # Checks for library functions. AC_FUNC_ALLOCA +AC_FUNC_OBSTACK +AC_FUNC_ERROR_AT_LINE AC_CHECK_FUNCS(mkstemp setlocale) AC_CHECK_DECLS([stpcpy, strndup, strnlen, memchr]) AC_REPLACE_FUNCS(stpcpy strndup strnlen strspn memchr) diff --git a/lib/Makefile.am b/lib/Makefile.am index bda16e0f..cdd19613 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -12,9 +12,7 @@ INCLUDES = -I.. -I$(srcdir) -I../intl EXTRA_DIST = malloc.c realloc.c libbison_a_SOURCES = \ - error.c error.h \ getopt.h getopt.c getopt1.c \ - obstack.h obstack.c \ quote.h quote.c quotearg.h quotearg.c \ xalloc.h xmalloc.c xstrdup.c diff --git a/lib/Makefile.in b/lib/Makefile.in index 0c9339ab..b2c64aa4 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -113,9 +113,7 @@ INCLUDES = -I.. -I$(srcdir) -I../intl EXTRA_DIST = malloc.c realloc.c libbison_a_SOURCES = \ - error.c error.h \ getopt.h getopt.c getopt1.c \ - obstack.h obstack.c \ quote.h quote.c quotearg.h quotearg.c \ xalloc.h xmalloc.c xstrdup.c @@ -129,9 +127,9 @@ CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) libbison_a_AR = $(AR) cru -am_libbison_a_OBJECTS = error$U.$(OBJEXT) getopt$U.$(OBJEXT) \ - getopt1$U.$(OBJEXT) obstack$U.$(OBJEXT) quote$U.$(OBJEXT) \ - quotearg$U.$(OBJEXT) xmalloc$U.$(OBJEXT) xstrdup$U.$(OBJEXT) +am_libbison_a_OBJECTS = getopt$U.$(OBJEXT) getopt1$U.$(OBJEXT) \ + quote$U.$(OBJEXT) quotearg$U.$(OBJEXT) xmalloc$U.$(OBJEXT) \ + xstrdup$U.$(OBJEXT) libbison_a_OBJECTS = $(am_libbison_a_OBJECTS) DEFS = @DEFS@ @@ -140,10 +138,10 @@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp -@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/alloca.Po $(DEPDIR)/error$U.Po \ +@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/alloca.Po $(DEPDIR)/error.Po \ @AMDEP_TRUE@ $(DEPDIR)/getopt$U.Po $(DEPDIR)/getopt1$U.Po \ @AMDEP_TRUE@ $(DEPDIR)/malloc.Po $(DEPDIR)/memchr.Po \ -@AMDEP_TRUE@ $(DEPDIR)/obstack$U.Po $(DEPDIR)/quote$U.Po \ +@AMDEP_TRUE@ $(DEPDIR)/obstack.Po $(DEPDIR)/quote$U.Po \ @AMDEP_TRUE@ $(DEPDIR)/quotearg$U.Po $(DEPDIR)/realloc.Po \ @AMDEP_TRUE@ $(DEPDIR)/stpcpy.Po $(DEPDIR)/strndup.Po \ @AMDEP_TRUE@ $(DEPDIR)/strnlen.Po $(DEPDIR)/strspn.Po \ @@ -155,8 +153,8 @@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(libbison_a_SOURCES) DIST_COMMON = Makefile.am Makefile.in alloca.c ansi2knr.1 ansi2knr.c \ - malloc.c memchr.c realloc.c stpcpy.c strndup.c strnlen.c \ - strspn.c + error.c error.h malloc.c memchr.c obstack.c obstack.h realloc.c \ + stpcpy.c strndup.c strnlen.c strspn.c SOURCES = $(libbison_a_SOURCES) all: all-am @@ -196,12 +194,12 @@ mostlyclean-kr: -test "$U" = "" || rm -f *_.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/error$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt1$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/malloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/memchr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/obstack$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/obstack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/quote$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/quotearg$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/realloc.Po@am__quote@ diff --git a/src/files.c b/src/files.c index ce70fa62..f8fc1842 100644 --- a/src/files.c +++ b/src/files.c @@ -211,9 +211,9 @@ skeleton_find (const char *envvar, const char *skeleton_name) if (!res) { /* Skeleton file name without path */ - const char *skel_name = strrchr(skeleton_name, '/'); + const char *skel_name = strrchr (skeleton_name, '/'); if (!skel_name) - skel_name = strrchr(skeleton_name, '\\'); + skel_name = strrchr (skeleton_name, '\\'); if (!skel_name) skel_name = skeleton_name; else -- 2.50.0