[PATCH FOR REVIEW]: Unset JAVA_HOME and JDK_HOME prior to building OpenJDK

Andrew John Hughes gnu_andrew at member.fsf.org
Wed Aug 26 11:57:28 PDT 2009


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.
>
>> Cheers,
>>
>> Mark
>>
>>
>
>
>
> --
> Andrew :-)
>
> Free Java Software Engineer
> Red Hat, Inc. (http://www.redhat.com)
>
> Support Free Java!
> Contribute to GNU Classpath and the OpenJDK
> http://www.gnu.org/software/classpath
> http://openjdk.java.net
>
> PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
> Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
>

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.
-- 
Andrew :-)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8



More information about the distro-pkg-dev mailing list