From: Robert Hoehne <robert.hoehne@gmx.net>
To: gdb-patches@cygnus.com
Cc: DJ Delorie <dj@delorie.com>, shebs@cygnus.com
Subject: Checking the output filename of YACC
Date: Sun, 14 Mar 1999 14:06:00 -0000 [thread overview]
Message-ID: <199903142206.OAA18507@cygnus.com> (raw)
Message-ID: <19990314140600.wPMnSwMm_hJ6fp-HioICQHfsWfghpSpTAkCORtav3sM@z> (raw)
This patch provides a macro for autoconf to check the right
output filename base for YACC. On DJGPP there is "bison -y"
used and the produced file is there y_tab.c and not y.tab.c
In the second patch, this macro is inserted in configure.in
and in the third patch it is applied to the Makefile.in.
This patch is against "a March 10th snapshot from DJ"
which I got from DJ Delorie.
Sun Mar 14 1999 Robert Hoehne <robert.hoehne@gmx.net>
* aclocal.m4: new macro AC_YACC_OUTPUT_BASE
* configure.in: Calling that macro after AC_PROG_YACC
* Makefile.in: Using now @YACC_OUTPUT_BASE@ instead of y.tab
--- gdb-snap-march-10th-from-DJ/gdb/aclocal.m4.orig Wed Feb 24 21:06:26 1999
+++ gdb-snap-march-10th-from-DJ/gdb/aclocal.m4 Sun Mar 14 18:03:06 1999
@@ -1305,3 +1305,22 @@
fi
fi])
+# Check for the default output filename of YACC which is for instance
+# y_tab.cc on DJGPP
+AC_DEFUN(AC_YACC_OUTPUT_BASE,
+ AC_CACHE_CHECK([for YACC output file base], YACC_OUTPUT_BASE,
+ [cat <<\EOF > conftest.y
+%%
+conftest:;
+%%
+EOF
+ $YACC conftest.y
+ if test -f y_tab.c
+ then
+ YACC_OUTPUT_BASE=y_tab
+ else
+ YACC_OUTPUT_BASE=y.tab
+ fi
+ rm -f conftest.y $YACC_OUTPUT_BASE.c])
+)
+
--- gdb-snap-march-10th-from-DJ/gdb/configure.in.orig Thu Mar 11 19:56:54 1999
+++ gdb-snap-march-10th-from-DJ/gdb/configure.in Sun Mar 14 17:11:52 1999
@@ -59,6 +59,8 @@
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_PROG_YACC
+AC_YACC_OUTPUT_BASE
+AC_SUBST(YACC_OUTPUT_BASE)
AC_ARG_PROGRAM
--- gdb-snap-march-10th-from-DJ/gdb/Makefile.in.orig Thu Mar 11 19:56:54 1999
+++ gdb-snap-march-10th-from-DJ/gdb/Makefile.in Sun Mar 14 22:16:18 1999
@@ -826,42 +826,42 @@
# Makefile.in, but that was a pretty big annoyance.
c-exp.tab.o: c-exp.tab.c
c-exp.tab.c: c-exp.y
- $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/c-exp.y y.tab.c c-exp.tmp -- $(YFLAGS)
+ $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/c-exp.y @YACC_OUTPUT_BASE@.c c-exp.tmp -- $(YFLAGS)
-sed -e '/extern.*malloc/d' \
-e '/extern.*realloc/d' \
-e '/extern.*free/d' \
-e '/include.*malloc.h/d' \
-e 's/malloc/xmalloc/g' \
-e 's/realloc/xrealloc/g' \
- -e '/^#line.*y.tab.c/d' \
+ -e '/^#line.*@YACC_OUTPUT_BASE@.c/d' \
< c-exp.tmp > c-exp.new
-rm c-exp.tmp
mv c-exp.new ./c-exp.tab.c
jv-exp.tab.o: jv-exp.tab.c
jv-exp.tab.c: jv-exp.y
- $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/jv-exp.y y.tab.c jv-exp.tmp -- $(YFLAGS)
+ $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/jv-exp.y @YACC_OUTPUT_BASE@.c jv-exp.tmp -- $(YFLAGS)
-sed -e '/extern.*malloc/d' \
-e '/extern.*realloc/d' \
-e '/extern.*free/d' \
-e '/include.*malloc.h/d' \
-e 's/malloc/xmalloc/g' \
-e 's/realloc/xrealloc/g' \
- -e '/^#line.*y.tab.c/d' \
+ -e '/^#line.*@YACC_OUTPUT_BASE@.c/d' \
< jv-exp.tmp > jv-exp.new
-rm jv-exp.tmp
mv jv-exp.new ./jv-exp.tab.c
f-exp.tab.o: f-exp.tab.c
f-exp.tab.c: f-exp.y c-exp.tab.c
- $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/f-exp.y y.tab.c f-exp.tmp -- $(YFLAGS)
+ $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/f-exp.y @YACC_OUTPUT_BASE@.c f-exp.tmp -- $(YFLAGS)
-sed -e '/extern.*malloc/d' \
-e '/extern.*realloc/d' \
-e '/extern.*free/d' \
-e '/include.*malloc.h/d' \
-e 's/malloc/xmalloc/g' \
-e 's/realloc/xrealloc/g' \
- -e '/^#line.*y.tab.c/d' \
+ -e '/^#line.*@YACC_OUTPUT_BASE@.c/d' \
< f-exp.tmp > f-exp.new
-rm f-exp.tmp
mv f-exp.new ./f-exp.tab.c
@@ -872,14 +872,14 @@
# else.
m2-exp.tab.o: m2-exp.tab.c
m2-exp.tab.c: m2-exp.y
- $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/m2-exp.y y.tab.c m2-exp.tmp -- $(YFLAGS)
+ $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/m2-exp.y @YACC_OUTPUT_BASE@.c m2-exp.tmp -- $(YFLAGS)
-sed -e '/extern.*malloc/d' \
-e '/extern.*realloc/d' \
-e '/extern.*free/d' \
-e '/include.*malloc.h/d' \
-e 's/malloc/xmalloc/g' \
-e 's/realloc/xrealloc/g' \
- -e '/^#line.*y.tab.c/d' \
+ -e '/^#line.*@YACC_OUTPUT_BASE@.c/d' \
< m2-exp.tmp > m2-exp.new
-rm m2-exp.tmp
mv m2-exp.new ./m2-exp.tab.c
******************************************************
* email: Robert Hoehne <robert.hoehne@gmx.net> *
* Post: Am Berg 3, D-09573 Dittmannsdorf, Germany *
* WWW: http://www.tu-chemnitz.de/~sho/rho *
******************************************************
next reply other threads:[~1999-03-14 14:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-04-01 0:00 Robert Hoehne [this message]
1999-03-14 14:06 ` Robert Hoehne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199903142206.OAA18507@cygnus.com \
--to=robert.hoehne@gmx.net \
--cc=dj@delorie.com \
--cc=gdb-patches@cygnus.com \
--cc=shebs@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox