rungen revision 4632
70N/A#!/usr/bin/env ruby
70N/A#
1339N/A# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
70N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1339N/A#
70N/A# This code is free software; you can redistribute it and/or modify it
70N/A# under the terms of the GNU General Public License version 2 only, as
919N/A# published by the Free Software Foundation. Oracle designates this
919N/A# particular file as subject to the "Classpath" exception as provided
919N/A# by Oracle in the LICENSE file that accompanied this code.
919N/A#
919N/A# This code is distributed in the hope that it will be useful, but WITHOUT
919N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
919N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
919N/A# version 2 for more details (a copy is included in the LICENSE file that
919N/A# accompanied this code).
919N/A#
919N/A# You should have received a copy of the GNU General Public License version
919N/A# 2 along with this work; if not, write to the Free Software Foundation,
919N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
919N/A#
919N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
919N/A# or visit www.oracle.com if you need additional information or have any
919N/A# questions.
70N/A#
70N/A#
70N/A
70N/AxcodeAction = ARGV[0]
493N/A
70N/Aexit unless xcodeAction == "install"
70N/A
1370N/AJOBJC_JAR = ARGV[1]
70N/ALIBPATH = ARGV[2]
911N/AOBJROOT = ARGV[3]
1370N/AARCHS = ARGV[4]
1370N/ASTABLE_GEN_DIR = ARGV[5]
1370N/A
911N/AourJavaHome = ENV['JAVA_HOME']
970N/AourJavaVersion = `java -fullversion 2>&1`
977N/A$stderr.puts "ENV['JAVA_HOME'] = #{ourJavaHome}"
970N/A$stderr.puts "java -fullversion = #{ourJavaVersion}"
970N/A
1339N/A$stderr.puts "jobjc_jar = #{JOBJC_JAR}"
1339N/A$stderr.puts "libpath = #{LIBPATH}"
1339N/A$stderr.puts "objroot = #{OBJROOT}"
970N/A$stderr.puts "ARCHS = #{ARCHS}"
970N/A$stderr.puts "STABLE_GEN_DIR = #{STABLE_GEN_DIR}"
970N/A
970N/Ajarch = if ARCHS =~ /x86_64/ then "-d64" else "-d32" end
970N/A
970N/A# compute the boot class path, but remove the JObjC jar file that may have been installed in the boot jdk
970N/A
1370N/Abootclasspathcmd = "java -classpath #{OBJROOT}/bin/core:#{OBJROOT}/bin/generator com.apple.internal.jobjc.generator.BootClassPathMinus #{JOBJC_JAR}"
1370N/A$stderr.puts bootclasspathcmd
970N/Abootclasspath = `#{bootclasspathcmd}`
70N/A
1179N/A$stderr.puts "bootclasspath is: "
493N/A$stderr.puts bootclasspath
70N/A
970N/A# we run the generator with our newly created JObjC. The installed version (if available) has been removed from
970N/A# the boot class path, so we are building with everything newly created.
970N/Acmd = "java #{jarch} -Xms128m -Xmx512m -Djava.library.path=#{LIBPATH} -Xbootclasspath:#{bootclasspath.chomp} -classpath #{OBJROOT}/bin/core:#{OBJROOT}/bin/generator -ea com.apple.internal.jobjc.generator.Generator dst=#{OBJROOT}/src/jobjc frameworks=#{STABLE_GEN_DIR}"
1196N/A
1196N/A$stderr.puts cmd
1447N/Aputs `#{cmd} 2>&1`
1196N/A
70N/Araise $?.to_i if $?.to_i != 0
970N/A