Defined locations of parser files in config.h instead of Makefile.

This commit is contained in:
Jesse Thilo
1999-02-12 15:18:12 +00:00
parent 315f05ae6c
commit 9eceb6c6d3
6 changed files with 29 additions and 11 deletions

View File

@@ -1,12 +1,5 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*- ## Process this file with automake to produce Makefile.in -*-Makefile-*-
AUTOMAKE_OPTIONS = 1.3 AUTOMAKE_OPTIONS = 1.4
#names of parser files
PFILE = bison.simple
PFILE1 = bison.hairy
INCLUDES = -DXPFILE=\"$(datadir)/$(PFILE)\" \
-DXPFILE1=\"$(datadir)/$(PFILE1)\"
bin_PROGRAMS = bison bin_PROGRAMS = bison
@@ -22,7 +15,7 @@ bison_LDADD = @ALLOCA@
noinst_HEADERS = alloc.h files.h gram.h lex.h machine.h state.h \ noinst_HEADERS = alloc.h files.h gram.h lex.h machine.h state.h \
symtab.h system.h types.h getopt.h symtab.h system.h types.h getopt.h
data_DATA = $(PFILE) $(PFILE1) data_DATA = bison.simple bison.hairy
info_TEXINFOS = bison.texinfo info_TEXINFOS = bison.texinfo
man_MANS = bison.1 man_MANS = bison.1

View File

@@ -10,6 +10,12 @@
/* Define if the compiler understands prototypes. */ /* Define if the compiler understands prototypes. */
#undef PROTOTYPES #undef PROTOTYPES
/* The location of the simple parser (bison.simple). */
#undef XPFILE
/* The location of the semantic parser (bison.hairy). */
#undef XPFILE1
@BOTTOM@ @BOTTOM@
#if defined(PROTOTYPES) || defined(__cplusplus) #if defined(PROTOTYPES) || defined(__cplusplus)

13
acinclude.m4 Normal file
View File

@@ -0,0 +1,13 @@
dnl BISON_DEFINE_FILE(VARNAME, FILE)
dnl Defines (with AC_DEFINE) VARNAME to the expansion of the FILE
dnl variable, expanding ${prefix} and such.
dnl Example: BISON_DEFINE_FILE(DATADIR, datadir)
dnl By Alexandre Oliva <oliva@dcc.unicamp.br>
AC_DEFUN(BISON_DEFINE_FILE, [
ac_expanded=`(
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
eval echo \""[$]$2"\"
)`
AC_DEFINE_UNQUOTED($1, "$ac_expanded")
])

View File

@@ -30,4 +30,9 @@ dnl Checks for library functions.
AC_FUNC_ALLOCA AC_FUNC_ALLOCA
AC_CHECK_FUNCS(mkstemp setlocale) AC_CHECK_FUNCS(mkstemp setlocale)
PFILE="${datadir}/bison.simple"
BISON_DEFINE_FILE(XPFILE, PFILE)
PFILE1="${datadir}/bison.hairy"
BISON_DEFINE_FILE(XPFILE1, PFILE1)
AC_OUTPUT(Makefile) AC_OUTPUT(Makefile)

View File

@@ -19,6 +19,8 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include "system.h"
#if defined (VMS) & !defined (__VMS_POSIX) #if defined (VMS) & !defined (__VMS_POSIX)
#include <ssdef.h> #include <ssdef.h>
#define unlink delete #define unlink delete
@@ -40,7 +42,6 @@ Boston, MA 02111-1307, USA. */
#endif #endif
#include <stdio.h> #include <stdio.h>
#include "system.h"
#include "files.h" #include "files.h"
#include "alloc.h" #include "alloc.h"
#include "gram.h" #include "gram.h"

View File

@@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA. */
/* These two should be pathnames for opening the sample parser files. /* These two should be pathnames for opening the sample parser files.
When bison is installed, they should be absolute pathnames. When bison is installed, they should be absolute pathnames.
XPFILE1 and XPFILE2 normally come from the Makefile. */ XPFILE1 and XPFILE2 normally come from config.h. */
#define PFILE XPFILE /* Simple parser */ #define PFILE XPFILE /* Simple parser */
#define PFILE1 XPFILE1 /* Semantic parser */ #define PFILE1 XPFILE1 /* Semantic parser */