[PATCH FOR REVIEW]: Unset JAVA_HOME and JDK_HOME prior to building OpenJDK
Mark Wielaard
mark at klomp.org
Wed Aug 26 12:09:48 PDT 2009
On Wed, 2009-08-26 at 19:57 +0100, Andrew John Hughes wrote:
> 2009/8/25 Andrew John Hughes <gnu_andrew at member.fsf.org>:
> > 2009/8/25 Mark Wielaard <mark at klomp.org>:
> >> On Tue, 2009-08-25 at 09:29 -0400, Lillian Angel wrote:
> >>> Andrew John Hughes wrote:
> >>> > This simple patch for IcedTea6 unsets JAVA_HOME and JDK_HOME before
> >>> > starting an OpenJDK build. If JAVA_HOME is set, an OpenJDK build will
> >>> > fail.
> >>> >
> >>> > Ok to commit?
> >>> >
> >>> > ChangeLog:
> >>> >
> >>> > 2009-08-25 Andrew John Hughes <ahughes at redhat.com>
> >>> >
> >>> > * Makefile.am:
> >>> > Unset JAVA_HOME and JDK_HOME before building.
> >>>
> >>> I am not thrilled with the idea of unsetting env vars on a system. I
> >>> think maybe it would be better for configure to fail and give an error
> >>> message if either of these are set.
> >>
> >> Why does the build fail if any of these are set in the first place?
> >
> > Because Sun designed it to do so. Clearly you don't have JAVA_HOME set
> > by default on your system (some distros do this) or you would have had
> > the fun of the OpenJDK build failing.
> > See: http://hg.openjdk.java.net/jdk7/build/raw-file/tip/README-builds.html#linux
> >
> >> I agree that in general it is better to have configure figure out
> >> settings. That is really what it is for.
> >>
> >> The GNU Make manual actually warns not to rely on environment variables:
> >>
> >> It is not wise for makefiles to depend for their functioning on
> >> environment variables set up outside their control, since this
> >> would cause different users to get different results from the
> >> same makefile. This is against the whole purpose of most
> >> makefiles.
> >> http://www.gnu.org/software/automake/manual/make/Environment.html
> >>
> > Unfortunately, that is how the entire OpenJDK build works. We already
> > set 30-40 variables in Makefile.am.
> >
> So can I push this or not? FWIW, IcedTea7 already has this change and
> I've not experienced any problems or loss of JAVAC settings with it
> applied.
I might think it is ugly, but it does seem harmless, so if it helps then
please do. But it would be good to know what exactly uses JAVA_HOME
during the build if it is set.
Cheers,
Mark
More information about the distro-pkg-dev
mailing list