Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Paolo Bonzini <paolo.bonzini@polimi.it>
To: Alexandre Oliva <aoliva@redhat.com>
Cc: tromey@redhat.com, Kelley Cook <kcook@gcc.gnu.org>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	Paolo Bonzini <bonzini@gnu.org>,
	Nathanael Nerode <neroden@twcny.rr.com>,
	gdb-patches@sources.redhat.com, binutils@sources.redhat.com
Subject: [PATCH] Get more stuff compiled for the build machine
Date: Thu, 01 Jul 2004 07:37:00 -0000	[thread overview]
Message-ID: <40E3BFD7.4080100@polimi.it> (raw)
In-Reply-To: <orisd84rxp.fsf@free.redhat.lsd.ic.unicamp.br>

[-- Attachment #1: Type: text/plain, Size: 571 bytes --]

> IIRC Paolo has a patch that gets more stuff compiled for the build
> machine.  jar could certainly be one of those.

Here is the patch, I had posted it to gcc@gcc.gnu.org for comments, but 
since there were none...

Jar is not used yet, but it could as well be.  Surely it is easier to 
add it with this scheme in place.

Regtested on a native i686-pc-linux-gnu configuration, and on a 
pseudo-Canadian with build=i686-pc-linux-gnu, host=i386-pc-linux-gnu, 
target=i386-pc-openbsd.  In both cases the in-tree makeinfo was always 
used.  Ok for mainline and src?

Paolo

[-- Attachment #2: redo-bison-and-friends-configuration.patch --]
[-- Type: text/plain, Size: 12050 bytes --]

Index: configure.in
===================================================================
RCS file: /cvs/src/src/configure.in,v
retrieving revision 1.222
diff -u -r1.222 configure.in
*** configure.in	22 Jun 2004 01:38:35 -0000	1.222
--- configure.in	23 Jun 2004 09:32:10 -0000
***************
*** 956,962 ****
    # If we are doing a Canadian Cross, in which the host and build systems
    # are not the same, we set reasonable default values for the tools.
  
-   BISON=${BISON-bison}
    CC=${CC-${host_alias}-gcc}
    CFLAGS=${CFLAGS-"-g -O2"}
    CXX=${CXX-${host_alias}-c++}
--- 956,961 ----
***************
*** 966,1014 ****
    CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++}
    GCJ_FOR_TARGET=${GCJ_FOR_TARGET-${target_alias}-gcj}
    GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}}
    BUILD_PREFIX=${build_alias}-
    BUILD_PREFIX_1=${build_alias}-
-   MAKEINFO=${MAKEINFO-makeinfo}
- 
-   if test -z "${YACC}" ; then
-     IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
-     for dir in $PATH; do
-       test -z "$dir" && dir=.
-       if test -f $dir/bison; then
- 	YACC="bison -y"
- 	break
-       fi
-       if test -f $dir/byacc; then
- 	YACC=byacc
- 	break
-       fi
-       if test -f $dir/yacc; then
- 	YACC=yacc
- 	break
-       fi
-     done
-     IFS="$save_ifs"
-     if test -z "${YACC}" ; then
-       YACC="bison -y"
-     fi
-   fi
- 
-   if test -z "${LEX}" ; then
-     IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
-     for dir in $PATH; do
-       test -z "$dir" && dir=.
-       if test -f $dir/flex; then
- 	LEX=flex
- 	break
-       fi
-       if test -f $dir/lex; then
- 	LEX=lex
- 	break
-       fi
-     done
-     IFS="$save_ifs"
-     LEX=${LEX-flex}
-   fi
  
  else
    # Set reasonable default values for some tools even if not Canadian.
--- 965,973 ----
    CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++}
    GCJ_FOR_TARGET=${GCJ_FOR_TARGET-${target_alias}-gcj}
    GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}}
+   BUILD_DIR_PREFIX=${build_subdir}
    BUILD_PREFIX=${build_alias}-
    BUILD_PREFIX_1=${build_alias}-
  
  else
    # Set reasonable default values for some tools even if not Canadian.
***************
*** 1019,1089 ****
    # in Makefile.in, so can still be overridden by fragments.
    # This is all going to change when we autoconfiscate...
  
-   BISON="\$(USUAL_BISON)"
    CC_FOR_BUILD="\$(CC)"
    GCC_FOR_TARGET="\$(USUAL_GCC_FOR_TARGET)"
    BUILD_PREFIX=
    BUILD_PREFIX_1=loser-
!   MAKEINFO="\$(USUAL_MAKEINFO)"
!   LEX="\$(USUAL_LEX)"
!   YACC="\$(USUAL_YACC)"
! 
!   # If CC is still not set, try to get gcc.
!   cc_prog_is_gcc=
!   if test -z "${CC}" ; then
!     IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
!     for dir in $PATH; do
!       test -z "$dir" && dir=.
!       if test -f $dir/gcc; then
! 	CC="gcc"
! 	cc_prog_is_gcc=yes
! 	echo 'void f(){}' > conftest.c
! 	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
! 	  CFLAGS=${CFLAGS-"-g -O2"}
! 	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
! 	else
! 	  CFLAGS=${CFLAGS-"-O2"}
! 	  CXXFLAGS=${CXXFLAGS-"-O2"}
! 	fi
! 	rm -f conftest*
! 	break
!       fi
!     done
!     IFS="$save_ifs"
!     CC=${CC-cc}
!   else
!     # Determine if we are using gcc.
!     cat > conftest.c <<EOF
! #ifdef __GNUC__
!   yes;
! #endif
! EOF
!     if ${CC} -E conftest.c | grep yes >/dev/null 2>&1; then
!       cc_prog_is_gcc=yes
!     fi
!     rm -f conftest.c
!     if test -z "${CFLAGS}"; then
!       # Here CC is set but CFLAGS is not.  Use a quick hack to use -O2 if CC
!       # is set to a version of gcc.
!       if test "$cc_prog_is_gcc" = yes; then
! 	echo 'void f(){}' > conftest.c
! 	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
! 	  CFLAGS=${CFLAGS-"-g -O2"}
! 	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
! 	else
! 	  CFLAGS=${CFLAGS-"-O2"}
! 	  CXXFLAGS=${CXXFLAGS-"-O2"}
! 	fi
! 	rm -f conftest*
!       fi
!     fi
!   fi
  
    # We must set the default linker to the linker used by gcc for the correct
    # operation of libtool.  If LD is not defined and we are using gcc, try to
    # set the LD default to the ld used by gcc.
    if test -z "$LD"; then
!     if test "$cc_prog_is_gcc" = yes; then
        case $build in
        *-*-mingw*)
  	gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
--- 978,996 ----
    # in Makefile.in, so can still be overridden by fragments.
    # This is all going to change when we autoconfiscate...
  
    CC_FOR_BUILD="\$(CC)"
    GCC_FOR_TARGET="\$(USUAL_GCC_FOR_TARGET)"
+   BUILD_DIR_PREFIX=
    BUILD_PREFIX=
    BUILD_PREFIX_1=loser-
! 
!   AC_PROG_CC
  
    # We must set the default linker to the linker used by gcc for the correct
    # operation of libtool.  If LD is not defined and we are using gcc, try to
    # set the LD default to the ld used by gcc.
    if test -z "$LD"; then
!     if test "$GCC" = yes; then
        case $build in
        *-*-mingw*)
  	gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
***************
*** 1600,1608 ****
  # Generate default definitions for YACC, M4, LEX.  These are used if the
  # Makefile can't locate these programs in objdir.
  MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
! AC_CHECK_PROGS([DEFAULT_YACC], ['bison -y' byacc yacc], [$MISSING bison])
! AC_CHECK_PROGS([DEFAULT_M4], [gm4 gnum4 m4], [$MISSING m4])
! AC_CHECK_PROGS([DEFAULT_LEX], [flex lex], [$MISSING flex])
  
  # Create a .gdbinit file which runs the one in srcdir
  # and tells GDB to look there for source files.
--- 1507,1517 ----
  # Generate default definitions for YACC, M4, LEX.  These are used if the
  # Makefile can't locate these programs in objdir.
  MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
! AC_CHECK_PROG([CONFIGURED_BISON], [bison], [$MISSING bison])
! AC_CHECK_PROGS([CONFIGURED_YACC], ['bison -y' byacc yacc], [$MISSING bison -y])
! AC_CHECK_PROGS([CONFIGURED_M4], [gm4 gnum4 m4], [$MISSING m4])
! AC_CHECK_PROGS([CONFIGURED_LEX], [flex lex], [$MISSING flex])
! AC_CHECK_PROG([CONFIGURED_MAKEINFO], makeinfo, [$MISSING makeinfo])
  
  # Create a .gdbinit file which runs the one in srcdir
  # and tells GDB to look there for source files.
***************
*** 2138,2143 ****
--- 2047,2053 ----
  # Miscellanea: directories, flags, etc.
  AC_SUBST(SET_LIB_PATH)
  AC_SUBST(RPATH_ENVVAR)
+ AC_SUBST(BUILD_DIR_PREFIX)
  AC_SUBST(BUILD_PREFIX)
  AC_SUBST(BUILD_PREFIX_1)
  AC_SUBST(gcc_version_trigger)
***************
*** 2162,2172 ****
  AC_SUBST(target_configdirs)
  
  # Build tools.
- AC_SUBST(BISON)
  AC_SUBST(CC_FOR_BUILD)
- AC_SUBST(LEX)
- AC_SUBST(MAKEINFO)
- AC_SUBST(YACC)
  AC_SUBST(config_shell)
  
  # Host tools.
--- 2072,2078 ----
***************
*** 2184,2192 ****
  AC_SUBST(CFLAGS)
  AC_SUBST(CFLAGS_FOR_BUILD)
  AC_SUBST(CXXFLAGS)
- AC_SUBST(DEFAULT_YACC)
- AC_SUBST(DEFAULT_LEX)
- AC_SUBST(DEFAULT_M4)
  
  # Target tools.
  NCN_STRICT_CHECK_TARGET_TOOL(CONFIGURED_AR_FOR_TARGET, ar)
--- 2090,2095 ----
Index: Makefile.def
===================================================================
RCS file: /cvs/src/src/Makefile.def,v
retrieving revision 1.25
diff -u -r1.25 Makefile.def
*** Makefile.def	9 Jun 2004 08:32:32 -0000	1.25
--- Makefile.def	23 Jun 2004 09:32:10 -0000
***************
*** 26,31 ****
--- 26,36 ----
  
  build_modules= { module= libiberty; };
  build_modules= { module= libbanshee; };
+ build_modules= { module= bison; };
+ build_modules= { module= byacc; };
+ build_modules= { module= lex; };
+ build_modules= { module= m4; };
+ build_modules= { module= texinfo; };
  
  host_modules= { module= ash; };
  host_modules= { module= autoconf; };
Index: Makefile.tpl
===================================================================
RCS file: /cvs/src/src/Makefile.tpl,v
retrieving revision 1.106
diff -u -r1.106 Makefile.tpl
*** Makefile.tpl	23 Jun 2004 08:36:45 -0000	1.106
--- Makefile.tpl	23 Jun 2004 09:32:10 -0000
***************
*** 233,279 ****
  
  CXX_FOR_BUILD = $(CXX)
  
  # Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
  # here so that they can be overridden by Makefile fragments.
  BUILD_PREFIX = @BUILD_PREFIX@
  BUILD_PREFIX_1 = @BUILD_PREFIX_1@
  
! BISON=@BISON@
! USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \
! 	    echo $$r/bison/bison -L $$s/bison/ ; \
  	 else \
! 	    echo bison ; \
  	 fi`
  
! DEFAULT_YACC = @DEFAULT_YACC@
! YACC=@YACC@
! USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \
! 	    echo $$r/bison/bison -y -L $$s/bison/ ; \
! 	elif [ -f $$r/byacc/byacc ] ; then \
! 	    echo $$r/byacc/byacc ; \
  	else \
! 	    echo ${DEFAULT_YACC} ; \
  	fi`
  
! DEFAULT_LEX = @DEFAULT_LEX@
! LEX=@LEX@
! USUAL_LEX = `if [ -f $$r/flex/flex ] ; \
! 	then echo $$r/flex/flex ; \
! 	else echo ${DEFAULT_LEX} ; fi`
! 
! DEFAULT_M4 = @DEFAULT_M4@
! M4 = `if [ -f $$r/m4/m4 ] ; \
! 	then echo $$r/m4/m4 ; \
! 	else echo ${DEFAULT_M4} ; fi`
  
  # For an installed makeinfo, we require it to be from texinfo 4.2 or
! # higher, else we use the "missing" dummy.
! MAKEINFO=@MAKEINFO@
! USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
! 	then echo $$r/texinfo/makeinfo/makeinfo ; \
! 	else if (makeinfo --version \
  	  | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \
!         then echo makeinfo; else echo $$s/missing makeinfo; fi; fi`
  
  # This just becomes part of the MAKEINFO definition passed down to
  # sub-makes.  It lets flags be given on the command line while still
--- 233,282 ----
  
  CXX_FOR_BUILD = $(CXX)
  
+ # Path to the build directory for a Canadian cross, empty otherwise.
+ BUILD_DIR_PREFIX = @BUILD_DIR_PREFIX@
+ 
  # Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
  # here so that they can be overridden by Makefile fragments.
  BUILD_PREFIX = @BUILD_PREFIX@
  BUILD_PREFIX_1 = @BUILD_PREFIX_1@
  
! CONFIGURED_BISON = @CONFIGURED_BISON@
! BISON = `if [ -f $$r/$(BUILD_DIR_PREFIX)/bison/bison ] ; then \
! 	    echo $$r/$(BUILD_DIR_PREFIX)/bison/bison -L $$s/bison/ ; \
  	 else \
! 	    echo ${CONFIGURED_BISON} ; \
  	 fi`
  
! CONFIGURED_YACC = @CONFIGURED_YACC@
! YACC = `if [ -f $$s/$(BUILD_DIR_PREFIX)/bison/bison ] ; then \
! 	    echo $$r/$(BUILD_DIR_PREFIX)/bison/bison -y -L $$s/bison/ ; \
! 	elif [ -f $$s/$(BUILD_DIR_PREFIX)/byacc/byacc ] ; then \
! 	    echo $$r/$(BUILD_DIR_PREFIX)/byacc/byacc ; \
  	else \
! 	    echo ${CONFIGURED_YACC} ; \
  	fi`
  
! CONFIGURED_LEX = @CONFIGURED_LEX@
! LEX = `if [ -f $$r/$(BUILD_DIR_PREFIX)/flex/flex ] ; \
! 	then echo $$r/$(BUILD_DIR_PREFIX)/flex/flex ; \
! 	else echo ${CONFIGURED_LEX} ; fi`
! 
! CONFIGURED_M4 = @CONFIGURED_M4@
! M4 = `if [ -f $$r/$(BUILD_DIR_PREFIX)/m4/m4 ] ; \
! 	then echo $$r/$(BUILD_DIR_PREFIX)/m4/m4 ; \
! 	else echo ${CONFIGURED_M4} ; fi`
  
  # For an installed makeinfo, we require it to be from texinfo 4.2 or
! # higher, else we use the "missing" dummy.  We also pass the subdirectory
! # makeinfo even if only the Makefile is there, because Texinfo builds its
! # manual when made, and it requires its own version.
! CONFIGURED_MAKEINFO = @CONFIGURED_MAKEINFO@
! MAKEINFO = `if [ -f $$r/$(BUILD_DIR_PREFIX)/texinfo/makeinfo/Makefile ] ; \
! 	then echo $$r/$(BUILD_DIR_PREFIX)/texinfo/makeinfo/makeinfo ; \
! 	else if (${CONFIGURED_MAKEINFO} --version \
  	  | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \
!         then echo ${CONFIGURED_MAKEINFO}; else echo $$s/missing makeinfo; fi; fi`
  
  # This just becomes part of the MAKEINFO definition passed down to
  # sub-makes.  It lets flags be given on the command line while still
***************
*** 1642,1647 ****
--- 1647,1658 ----
  # are specified by depending on a 'maybe-' target.  If you're not sure,
  # it's safer to use a soft dependency.
  
+ # Build modules
+ all-build-bison: maybe-all-build-texinfo
+ all-build-m4: maybe-all-build-libiberty maybe-all-build-texinfo
+ all-build-flex: maybe-all-build-texinfo
+ all-build-texinfo: maybe-all-build-libiberty
+ 
  # Host modules specific to gcc.
  # GCC needs to identify certain tools.
  # GCC also needs the information exported by the intl configure script.

       reply	other threads:[~2004-07-01  7:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <40DC4524.10905@gcc.gnu.org>
     [not found] ` <87acyngzi9.fsf@fleche.redhat.com>
     [not found]   ` <orisd84rxp.fsf@free.redhat.lsd.ic.unicamp.br>
2004-07-01  7:37     ` Paolo Bonzini [this message]
2004-07-01 18:02       ` DJ Delorie

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=40E3BFD7.4080100@polimi.it \
    --to=paolo.bonzini@polimi.it \
    --cc=aoliva@redhat.com \
    --cc=binutils@sources.redhat.com \
    --cc=bonzini@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kcook@gcc.gnu.org \
    --cc=neroden@twcny.rr.com \
    --cc=tromey@redhat.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