bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DJGPP support for bison


From: Juan Manuel Guerrero
Subject: DJGPP support for bison
Date: Wed, 30 Jan 2002 15:22:34 +0100

DJGPP support for bison 1.32.
Patch 2/3

diff -acprNC3 bison-1.32.orig/arch/djgpp/config.bat 
bison-1.32.djgpp/arch/djgpp/config.bat
*** bison-1.32.orig/arch/djgpp/config.bat       Thu Jan  1 00:00:00 1970
--- bison-1.32.djgpp/arch/djgpp/config.bat      Wed Jan 30 02:43:20 2002
***************
*** 0 ****
--- 1,258 ----
+ @echo off
+ echo Configuring GNU Bison for DJGPP v2.x...
+ 
+ Rem The SmallEnv tests protect against fixed and too small size
+ Rem of the environment in stock DOS shell.
+ 
+ Rem Find out if NLS is wanted or not,
+ Rem if dependency-tracking is wanted or not,
+ Rem if caching is wanted or not
+ Rem and where the sources are.
+ Rem We always default to NLS support,
+ Rem no dependency tracking
+ Rem and to in place configuration.
+ set ARGS=
+ set NLS=enabled
+ if not "%NLS%" == "enabled" goto SmallEnv
+ set CACHING=enabled
+ if not "%CACHING%" == "enabled" goto SmallEnv
+ set DEPENDENCY_TRACKING=disabled
+ if not "%DEPENDENCY_TRACKING%" == "disabled" goto SmallEnv
+ set XSRC=.
+ if not "%XSRC%" == "." goto SmallEnv
+ 
+ Rem Loop over all arguments.
+ Rem Special arguments are: NLS, XSRC, CACHE and DEPS.
+ Rem All other arguments are stored into ARGS.
+ :ArgLoop
+ if "%1" == "nls" goto NextArgument
+ if "%1" == "NLS" goto NextArgument
+ if "%1" == "no-nls" goto NoNLS
+ if "%1" == "no-NLS" goto NoNLS
+ if "%1" == "NO-NLS" goto NoNLS
+ goto CachingOption
+ :NoNLS
+ if "%1" == "no-nls" set NLS=disabled
+ if "%1" == "no-NLS" set NLS=disabled
+ if "%1" == "NO-NLS" set NLS=disabled
+ if not "%NLS%" == "disabled" goto SmallEnv
+ goto NextArgument
+ :CachingOption
+ if "%1" == "cache" goto NextArgument
+ if "%1" == "CACHE" goto NextArgument
+ if "%1" == "no-cache" goto NoCaching
+ if "%1" == "no-CACHE" goto NoCaching
+ if "%1" == "NO-CACHE" goto NoCaching
+ goto DependencyOption
+ :NoCaching
+ if "%1" == "no-cache" set CACHING=disabled
+ if "%1" == "no-CACHE" set CACHING=disabled
+ if "%1" == "NO-CACHE" set CACHING=disabled
+ if not "%CACHING%" == "disabled" goto SmallEnv
+ goto NextArgument
+ :DependencyOption
+ if "%1" == "no-dep" goto NextArgument
+ if "%1" == "no-DEP" goto NextArgument
+ if "%1" == "NO-DEP" goto NextArgument
+ if "%1" == "dep" goto DependecyTraking
+ if "%1" == "DEP" goto DependecyTraking
+ goto SrcDirOption
+ :DependecyTraking
+ if "%1" == "dep" set DEPENDENCY_TRACKING=enabled
+ if "%1" == "DEP" set DEPENDENCY_TRACKING=enabled
+ if not "%DEPENDENCY_TRACKING%" == "enabled" goto SmallEnv
+ goto NextArgument
+ :SrcDirOption
+ echo %1 | grep -q "/"
+ if errorlevel 1 goto CollectArgument
+ set XSRC=%1
+ if not "%XSRC%" == "%1" goto SmallEnv
+ goto NextArgument
+ :CollectArgument
+ set _ARGS=%ARGS% %1
+ if not "%_ARGS%" == "%ARGS% %1" if not "%_ARGS%" == "%ARGS%%1" goto SmallEnv
+ echo %_ARGS% | grep -q "[^ ]"
+ if not errorlevel 0 set ARGS=%_ARGS%
+ set _ARGS=
+ :NextArgument
+ shift
+ if not "%1" == "" goto ArgLoop
+ 
+ Rem Create an arguments file for the configure script.
+ echo --srcdir=%XSRC% > arguments
+ if "%CACHING%" == "enabled"              echo 
--cache-file=%XSRC%/arch/djgpp/config.cache >> arguments
+ if "%DEPENDENCY_TRACKING%" == "enabled"  echo --enable-dependency-tracking >> 
arguments
+ if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking 
>> arguments
+ if not "%ARGS%" == ""                    echo %ARGS% >> arguments
+ set ARGS=
+ set CACHING=
+ set DEPENDENCY_TRACKING=
+ 
+ if "%XSRC%" == "." goto InPlace
+ 
+ :NotInPlace
+ redir -e /dev/null update %XSRC%/configure.orig ./configure
+ test -f ./configure
+ if errorlevel 1 update %XSRC%/configure ./configure
+ 
+ :InPlace
+ Rem Update configuration files
+ echo Updating configuration scripts...
+ test -f ./configure.orig
+ if errorlevel 1 update configure configure.orig
+ sed -f %XSRC%/arch/djgpp/config.sed configure.orig > configure
+ if errorlevel 1 goto SedError
+ 
+ Rem Make sure they have a config.site file
+ set CONFIG_SITE=%XSRC%/arch/djgpp/config.site
+ if not "%CONFIG_SITE%" == "%XSRC%/arch/djgpp/config.site" goto SmallEnv
+ 
+ Rem Make sure crucial file names are not munged by unpacking
+ test -f %XSRC%/po/Makefile.in.in
+ if not errorlevel 1 mv -f %XSRC%/po/Makefile.in.in %XSRC%/po/Makefile.in-in
+ test -f %XSRC%/po/Makefile.am.in
+ if not errorlevel 1 mv -f %XSRC%/po/Makefile.am.in %XSRC%/po/Makefile.am-in
+ 
+ Rem Absolute paths in tests/bison.in must be replaced
+ Rem by relative paths so the configured package works
+ Rem with every DJGPP installation.
+ test -f %XSRC%/tests/bison.orig
+ if errorlevel 1 update %XSRC%/tests/bison.in %XSRC%/tests/bison.orig
+ sed -e "/buildpath/s,/,," -e "s/path/dir/" %XSRC%/tests/bison.orig > bison.tmp
+ if errorlevel 1 goto SedError
+ mv -f ./bison.tmp %XSRC%/tests/bison.in
+ 
+ Rem This is required because DOS/Windows are case-insensitive
+ Rem to file names, and "make install" will do nothing if Make
+ Rem finds a file called `install'.
+ if exist INSTALL ren INSTALL INSTALL.txt
+ 
+ Rem Set SHELL to a sane default or some configure tests stop working
+ Rem if the package is configured across partitions.
+ if not "%SHELL%" == "" goto HomeName
+ set SHELL=/bin/sh
+ if not "%SHELL%" == "/bin/sh" goto SmallEnv
+ echo No SHELL found in the environment, using default value
+ 
+ :HomeName
+ Rem Set HOME to a sane default so configure stops complaining.
+ if not "%HOME%" == "" goto HostName
+ set HOME=%XSRC%/arch/djgpp
+ if not "%HOME%" == "%XSRC%/arch/djgpp" goto SmallEnv
+ echo No HOME found in the environment, using default value
+ 
+ :HostName
+ Rem Set HOSTNAME so it shows in config.status
+ if not "%HOSTNAME%" == "" goto hostdone
+ if "%windir%" == "" goto msdos
+ set OS=MS-Windows
+ if not "%OS%" == "MS-Windows" goto SmallEnv
+ goto haveos
+ :msdos
+ set OS=MS-DOS
+ if not "%OS%" == "MS-DOS" goto SmallEnv
+ :haveos
+ if not "%USERNAME%" == "" goto haveuname
+ if not "%USER%" == "" goto haveuser
+ echo No USERNAME and no USER found in the environment, using default values
+ set HOSTNAME=Unknown PC
+ if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv
+ goto userdone
+ :haveuser
+ set HOSTNAME=%USER%'s PC
+ if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv
+ goto userdone
+ :haveuname
+ set HOSTNAME=%USERNAME%'s PC
+ if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv
+ :userdone
+ set _HOSTNAME=%HOSTNAME%, %OS%
+ if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv
+ set HOSTNAME=%_HOSTNAME%
+ :hostdone
+ set _HOSTNAME=
+ set OS=
+ 
+ Rem install-sh is required by the configure script but clashes with the
+ Rem various Makefile install-foo targets, so we MUST have it before the
+ Rem script runs and rename it afterwards
+ test -f %XSRC%/install-sh
+ if not errorlevel 1 goto NoRen0
+ test -f %XSRC%/install-sh.sh
+ if not errorlevel 1 mv -f %XSRC%/install-sh.sh %XSRC%/install-sh
+ :NoRen0
+ 
+ if "%NLS%" == "disabled" goto WithoutNLS
+ 
+ :WithNLS
+ Rem Check for the needed libraries and binaries.
+ test -x /dev/env/DJDIR/bin/msgfmt.exe
+ if not errorlevel 0 goto MissingNLSTools
+ test -x /dev/env/DJDIR/bin/xgettext.exe
+ if not errorlevel 0 goto MissingNLSTools
+ test -f /dev/env/DJDIR/include/libcharset.h
+ if not errorlevel 0 goto MissingNLSTools
+ test -f /dev/env/DJDIR/lib/libcharset.a
+ if not errorlevel 0 goto MissingNLSTools
+ test -f /dev/env/DJDIR/include/iconv.h
+ if not errorlevel 0 goto MissingNLSTools
+ test -f /dev/env/DJDIR/lib/libiconv.a
+ if not errorlevel 0 goto MissingNLSTools
+ test -f /dev/env/DJDIR/include/libintl.h
+ if not errorlevel 0 goto MissingNLSTools
+ test -f /dev/env/DJDIR/lib/libintl.a
+ if not errorlevel 0 goto MissingNLSTools
+ 
+ Rem Recreate the files in the %XSRC%/po subdir with our ported tools.
+ redir -e /dev/null rm %XSRC%/po/*.gmo
+ redir -e /dev/null rm %XSRC%/po/bison.pot
+ redir -e /dev/null rm %XSRC%/po/cat-id-tbl.c
+ redir -e /dev/null rm %XSRC%/po/stamp-cat-id
+ 
+ Rem Update the arguments file for the configure script.
+ Rem We prefer without-included-gettext because libintl.a from gettext package
+ Rem is the only one that is garanteed to have been ported to DJGPP.
+ echo --enable-nls --without-included-gettext >> arguments
+ goto ConfigurePackage
+ 
+ :MissingNLSTools
+ echo Needed libs/tools for NLS not found. Configuring without NLS.
+ :WithoutNLS
+ Rem Update the arguments file for the configure script.
+ echo --disable-nls >> arguments
+ 
+ :ConfigurePackage
+ echo Running the ./configure script...
+ sh ./configure @arguments
+ if errorlevel 1 goto CfgError
+ rm arguments
+ echo Done.
+ goto End
+ 
+ :SedError
+ echo ./configure script editing failed!
+ goto End
+ 
+ :CfgError
+ echo ./configure script exited abnormally!
+ goto End
+ 
+ :SmallEnv
+ echo Your environment size is too small.  Enlarge it and run me again.
+ echo Configuration NOT done!
+ 
+ :End
+ test -f %XSRC%/install-sh.sh
+ if not errorlevel 1 goto NoRen1
+ test -f %XSRC%/install-sh
+ if not errorlevel 1 mv -f %XSRC%/install-sh %XSRC%/install-sh.sh
+ :NoRen1
+ if "%SHELL%" == "/bin/sh" set SHELL=
+ if "%HOME%" == "%XSRC%/arch/djgpp" set HOME=
+ set ARGS=
+ set CONFIG_SITE=
+ set HOSTNAME=
+ set NLS=
+ set CACHING=
+ set DEPENDENCY_TRACKING=
+ set XSRC=
diff -acprNC3 bison-1.32.orig/arch/djgpp/config.in 
bison-1.32.djgpp/arch/djgpp/config.in
*** bison-1.32.orig/arch/djgpp/config.in        Thu Jan  1 00:00:00 1970
--- bison-1.32.djgpp/arch/djgpp/config.in       Wed Jan 30 02:30:08 2002
***************
*** 0 ****
--- 1,79 ----
+ # Additional editing of Makefiles
+ /(echo[       ]*':t/ a\
+ # DJGPP specific Makefile changes.\
+   /^aliaspath *       *=/s,:,";",g;t t\
+   /TEXINPUTS=/s,:,";",g;t t\
+   /PATH=/s,:,";",g;t t\
+   s,\\.deps,_deps,g;t t\
+   s,\\.new\\.,_new.,g;t t\
+   s,\\.old\\.,_old.,g;t t\
+   s,\\.tab\\.,_tab.,g;t t\
+   s,Makefile\\.in\\.in,Makefile.in-in,g;t t\
+   s,Makefile\\.am\\.in,Makefile.am-in,g;t t\
+   /^install-info-am:/,/^$/ {\
+     /@list=/ s,\\\$(INFO_DEPS),& bison.i,\
+     /@for *file/ s,\\\$(INFO_DEPS),& bison.i,\
+     s,file-\\[0-9\\]\\[0-9\\],& \\$\\$file[0-9] \\$\\$file[0-9][0-9],\
+   }\
+   /^install-pkgdataDATA:[     ]\\\$(pkgdata_DATA)/,/^$/ {\
+     /^$/ i\\\
+       \\\$(mkinstalldirs) \\\$(libdir)\\\
+       \\\$(INSTALL_DATA) \\\$(srcdir)/bison.hairy \\\$(libdir)/bison.hai \\\
+       \\\$(INSTALL_DATA) \\\$(srcdir)/bison.simple \\\$(libdir)/bison.sim \
+   }
+ 
+ # Makefile.in.in is renamed to Makefile.in-in.
+ /^ac_config_files=/,/_ACEOF/ {
+   s|po/Makefile\.in|&:po/Makefile.in-in|
+ }
+ /CONFIG_FILES=/ s|po/Makefile\.in|&:po/Makefile.in-in|2
+ 
+ # We always use _deps instead of .deps.
+ # This make the generated Makefiles good
+ # for every DJGPP installation, not only
+ # the one where the package was configured.
+ s,\.deps,_deps,g
+ 
+ # Replace (command) > /dev/null with `command > /dev/null`, since
+ # parenthesized commands always return zero status in the ported Bash,
+ # even if the named command doesn't exist
+ /if ([^|;]*null/{
+   s,(,`,
+   s,),,
+   s,;  *then,`; then,
+ }
+ 
+ # DOS-style absolute file names should be supported as well
+ /\*) top_srcdir=/s,/\*,[\\\\/]* | ?:[\\\\/]*,
+ 
+ # Prevent the spliting of subs.sed.
+ # The sed script: subs.sed is split into 48 lines long files.
+ # This will produce sed scripts called subs-$ac_sed_frag.sed, where
+ # $ac_sed_frag is some unique number. This will not work if the splited
+ # sed script contains a multiple line sed command at line #48. In this
+ # case the first part of the multiple line sed command will be written
+ # at the end of one particular subs-$ac_sed_frag.sed and the rest of the
+ # sed command will be written at the begining of the next 
subs-$ac_sed_frag.sed
+ # making both sed script useless.
+ # This matches the configure script produced by Autoconf 2.52
+ /ac_max_sed_lines=[0-9]/ s,=.*$,=`sed -n "$=" $tmp/subs.sed`,
+ 
+ # The following two items are changes needed for configuring
+ # and compiling across partitions.
+ # 1) The given srcdir value is always translated from the
+ #    "x:" syntax into "/dev/x" syntax while we run configure.
+ /^[   ]*-srcdir=\*.*$/ a\
+     ac_optarg=`echo "$ac_optarg" | sed "s,^\\([A-Za-z]\\):,/dev/\\1,"`
+ /set X `ls -Lt \$srcdir/ i\
+    if `echo $srcdir | grep "^/dev/" - > /dev/null`; then\
+      srcdir=`echo "$srcdir" | sed -e "s%^/dev/%%" -e "s%/%:/%"`\
+    fi
+ 
+ # Autoconf 2.52e generated configure scripts
+ # write absolute paths into Makefiles making
+ # them useless for DJGPP installations for which
+ # the package has not been configured for.
+ /MISSING=/,/^$/ {
+   /^fi$/ a\
+ am_missing_run=`echo "$am_missing_run" | sed 
's%/dev.*/address@hidden@%${top_srcdir}%'`
+ }
diff -acprNC3 bison-1.32.orig/arch/djgpp/config.site 
bison-1.32.djgpp/arch/djgpp/config.site
*** bison-1.32.orig/arch/djgpp/config.site      Thu Jan  1 00:00:00 1970
--- bison-1.32.djgpp/arch/djgpp/config.site     Mon Sep 10 19:52:10 2001
***************
*** 0 ****
--- 1,44 ----
+ #! /bin/sh
+ 
+ # These two variables are required, otherwise looking for
+ # programs along the PATH will not work.
+ PATH_SEPARATOR=:
+ PATH_EXPAND=y
+ 
+ # This is required in for "test -f foo" to find foo.exe
+ export TEST_FINDS_EXE=y
+ 
+ # The root of the DJGPP tree serves as the default prefix
+ # for all paths that are hardcoded in the binaries.
+ # When installing the installation prefix must be supplied.
+ test "x$prefix" = xNONE && prefix='/dev/env/DJDIR'
+ 
+ # This is required for config.status script to be run, since
+ # ./configure runs it by invoking ${CONFIG_SHELL-/bin/sh}
+ # CONFIG_SHELL=${CONFIG_SHELL='sh'}
+ 
+ # These are set here so the generated Makefile's will be good
+ # for every DJGPP installation, not only the one where the
+ # package was configured.
+ # $INSTALL must be an absolute path name, otherwise config.status
+ # will try to prepend ./ and ../ to it when it goes into subdirs.
+ INSTALL=${INSTALL='/dev/env/DJDIR/bin/ginstall -c'}
+ RANLIB=${RANLIB='ranlib'}
+ GMSGFMT=${GMSGFMT='/dev/env/DJDIR/bin/msgfmt'}
+ MSGFMT=${MSGFMT='/dev/env/DJDIR/bin/msgfmt'}
+ XGETTEXT=${XGETTEXT='/dev/env/DJDIR/bin/xgettext'}
+ 
+ # A sane default for emacs.
+ ac_cv_path_EMACS=${EMACS='/dev/env/DJDIR/gnu/emacs/bin/emacs'}
+ 
+ # A sane default for m4.
+ ac_cv_path_M4=${M4='/dev/env/DJDIR/bin/m4'}
+ 
+ # These are set here so the generated libtool will be good
+ # for every DJGPP installation, not only the one where the
+ # package was configured.
+ NM=${NM='nm'}
+ LD=${LD='ld'}
+ 
+ # Force the test for 'ln -s' to report 'cp -pf'.
+ ac_cv_prog_LN_S='cp -pf'
diff -acprNC3 bison-1.32.orig/arch/djgpp/Makefile.am 
bison-1.32.djgpp/arch/djgpp/Makefile.am
*** bison-1.32.orig/arch/djgpp/Makefile.am      Thu Jan  1 00:00:00 1970
--- bison-1.32.djgpp/arch/djgpp/Makefile.am     Wed Jan 30 02:30:30 2002
***************
*** 0 ****
--- 1,25 ----
+ ## Process this file with automake to produce Makefile.in -*-Makefile-*-
+ 
+ EXTRA_DIST = README README.in config.bat config.sed config.site
+ MAINTAINERCLEANFILES = README
+ 
+ all-local: README config.sed
+ 
+ config.sed: config.in $(top_srcdir)/configure.in
+       VERSION=`grep AM_INIT_AUTOMAKE $(top_srcdir)/configure.in | sed -e 
's/AM_INIT_AUTOMAKE([^,)]*, *\([^,)]*\).*$$/\1/'`; \
+       sed "s/@VERSION@/$${VERSION}/" \
+         $(srcdir)/README.in > t-$@
+       mv t-$@ $@
+ 
+ README: README.in $(top_srcdir)/configure.in
+       PACKAGE=`grep AM_INIT_AUTOMAKE $(top_srcdir)/configure.in | sed -e 
's/AM_INIT_AUTOMAKE(\([^,)]*\),.*$$/\1/'`; \
+       VERSION=`grep AM_INIT_AUTOMAKE $(top_srcdir)/configure.in | sed -e 
's/AM_INIT_AUTOMAKE([^,)]*, *\([^,)]*\).*$$/\1/'`; \
+       packageversion=`echo "$${VERSION}" | sed 's/\.//'`; \
+       treeversion=`echo "$${VERSION}"`; \
+       sed \
+           -e "s/@V@/$${PACKAGE}-$${VERSION}/g" \
+           -e "s/@VER@/$${VERSION}/g" \
+           -e "s/@packageversion@/$$packageversion/g" \
+           -e "s/@treeversion@/$$treeversion/g" \
+         $(srcdir)/README.in > t-$@
+       mv t-$@ $@



reply via email to

[Prev in Thread] Current Thread [Next in Thread]