This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] add --enable-snapshot for defining parsedir & objdocdir
- From: Kelley Cook <kcook34 at ford dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 16 Oct 2003 16:31:45 -0400
- Subject: [PATCH] add --enable-snapshot for defining parsedir & objdocdir
- Hop-count: 1
- Reply-to: Kelley Cook <kelleycook at wideopenwest dot com>
This is my first step towards resolving PR10996, which is to make it
possible to build from a Read Only source tree.
The basic problem is that since GCC does not require bison and flex to
compile, snapshots and releases contain those bison and flex generated
files within their source tarballs. Furthermore, releases come with
there info and man files already made, so that the user will not need
makeinfo to get manuals.
However having generated files within the source tree is directly
opposed to having a read-only directory goal.
The recently added parsedir and objdocdir made a large stride towards
resolving this problem, but require a manual edit of Makefile.in to
change the default behavior.
This patch adds in an --enable-snapshot configure option, which defines
parsedir and objdocdir to be in source. With --disable-snapshot, these
two locations are switched to the build tree, thereby fixing the PR.
The status quo (--enable-snapshot) is currently enabled after this
patch, because --disable-snapshot will not bootstrap a snapshot when
Bison or Flex is not installed. I plan on flip-flopping the default
behavior as soon as this is fixed and the gcc-release script is modified
to configure with "--enable-snapshot".
In addition, for future patch enablement, it moves the definition of
$(docdir) higher than the included front-end fragments in GCC's Makefile.in
Bootstrapped with i686-pc-cygwin with "--disable-snapshot",
"--enable-snapshot" and nothing specified.
OK?
Kelley Cook
2003-10-16 Kelley Cook <kcook@gcc.gnu.org>
* Makefile.in: Get parsedir and docobjdir from configure.
Define $(docdir) before including Make-lang frags.
* configure.in: Add in support for --enable-snapshot. Pass along
parsedir and docobjdir.
diff -upr /home/kcook34/gcc-3.4-20031008/gcc/Makefile.in /home/kcook34/gcc-snapshot/gcc/Makefile.in
--- /home/kcook34/gcc-3.4-20031008/gcc/Makefile.in 2003-10-13 23:41:41.000000000 -0400
+++ /home/kcook34/gcc-snapshot/gcc/Makefile.in 2003-10-16 13:09:32.909778500 -0400
@@ -75,19 +75,19 @@ program_transform_cross_name = @program_
# Directory where sources are, from where we are.
srcdir = @srcdir@
-# These directories contain files that are provided as part of a FSF tarball,
-# but not provided in CVS. Some GCC integrators like to use the CVS sources
-# but keep them read-only during a build, and so change these variables
-# from these defaults.
-parsedir = $(srcdir)
-docobjdir = $(srcdir)/doc
-
# Top build directory, relative to here.
top_builddir = ..
# objdir is set by configure.
# It's normally the absolute path to the current directory.
objdir = @objdir@
+# These directories contain files that are provided as part of a FSF tarball,
+# but not provided in CVS. Unless --enable-snapshot is specified these files
+# will be put in the object directory.
+parsedir = @parsedir@
+docobjdir = @docobjdir@
+docdir = $(srcdir)/doc
+
# --------
# UNSORTED
# --------
@@ -2609,8 +2609,6 @@ stmp-fixproto: fixhdr.ready fixproto stm
#
# Remake the info files.
-docdir = $(srcdir)/doc
-
stmp-docobjdir:
-test -d $(docobjdir) || mkdir $(docobjdir)
$(STAMP) stmp-docobjdir
diff -upr /home/kcook34/gcc-3.4-20031008/gcc/configure.in /home/kcook34/gcc-snapshot/gcc/configure.in
--- /home/kcook34/gcc-3.4-20031008/gcc/configure.in 2003-10-14 18:10:17.000000000 -0400
+++ /home/kcook34/gcc-snapshot/gcc/configure.in 2003-10-16 13:48:37.544576500 -0400
@@ -148,6 +148,23 @@ elif test x$withval != xno; then
cpp_install_dir=$withval
fi])
+# We would like to our source tree to be readonly. However when snapshots or
+# releases are generated, the flex/bison generated files as well as the
+# various formats of manuals need to be included along with the rest of the
+# sources. Therefore we have --enable-snapshot to do just that.
+#
+# *** FIXME ** temporarily, the default is set to the same as --enable-snapshot
+# This will change as soon as some issues are worked out.
+# Until then --disable-snapshot will get the desired functionality.
+
+AC_ARG_ENABLE(snapshot,
+[ --enable-snapshot put some generated files in source dir for snapshots],
+[case ${enableval} in
+ no) parsedir='$(objdir)'; docobjdir='$(objdir)/doc';;
+ yes,*) parsedir='$(srcdir)'; docobjdir='$(srcdir)/doc';;
+esac],
+[parsedir='$(srcdir)'; docobjdir='$(srcdir)/doc';])
+
# -------------------
# Find default linker
# -------------------
@@ -2922,6 +2939,8 @@ AC_SUBST(objdir)
# Substitute configuration variables
AC_SUBST(subdirs)
AC_SUBST(srcdir)
+AC_SUBST(docobjdir)
+AC_SUBST(parsedir)
AC_SUBST(all_boot_languages)
AC_SUBST(all_compilers)
AC_SUBST(all_gtfiles)