Lines 1162-1168
Link Here
|
1162 |
java-pkg_get-javac() { |
1162 |
java-pkg_get-javac() { |
1163 |
debug-print-function ${FUNCNAME} $* |
1163 |
debug-print-function ${FUNCNAME} $* |
1164 |
|
1164 |
|
1165 |
java-pkg_init-compiler_ |
1165 |
|
1166 |
local compiler="${GENTOO_COMPILER}" |
1166 |
local compiler="${GENTOO_COMPILER}" |
1167 |
|
1167 |
|
1168 |
local compiler_executable |
1168 |
local compiler_executable |
Lines 1180-1195
Link Here
|
1180 |
compiler_executable="$(source ${compiler_env} 1>/dev/null 2>&1; echo ${JAVAC})" |
1180 |
compiler_executable="$(source ${compiler_env} 1>/dev/null 2>&1; echo ${JAVAC})" |
1181 |
export JAVAC=${old_javac} |
1181 |
export JAVAC=${old_javac} |
1182 |
|
1182 |
|
1183 |
[[ -z ${compiler_executable} ]] && die "JAVAC is empty or undefined in ${compiler_env}" |
1183 |
if [[ -z ${compiler_executable} ]]; then |
|
|
1184 |
echo "JAVAC is empty or undefined in ${compiler_env}" |
1185 |
return 1 |
1186 |
fi |
1184 |
|
1187 |
|
1185 |
# check that it's executable |
1188 |
# check that it's executable |
1186 |
if [[ ! -x ${compiler_executable} ]]; then |
1189 |
if [[ ! -x ${compiler_executable} ]]; then |
1187 |
eerror "Could not find ${compiler_executable}!" |
1190 |
echo "${compiler_executable} doesn't exist, or isn't executable" |
1188 |
die "${compiler_executable} doesn't exist, or isn't executable" |
1191 |
return 1 |
1189 |
fi |
1192 |
fi |
1190 |
else |
1193 |
else |
1191 |
eerror "Could not find environment file for ${compiler}" |
1194 |
echo "Could not find environment file for ${compiler}" |
1192 |
die "Could not find ${compiler_env}" |
1195 |
return 1 |
1193 |
fi |
1196 |
fi |
1194 |
fi |
1197 |
fi |
1195 |
echo ${compiler_executable} |
1198 |
echo ${compiler_executable} |
Lines 1216-1223
Link Here
|
1216 |
debug-print "want target: ${want_target}" |
1219 |
debug-print "want target: ${want_target}" |
1217 |
|
1220 |
|
1218 |
if [[ -z "${want_source}" || -z "${want_target}" ]]; then |
1221 |
if [[ -z "${want_source}" || -z "${want_target}" ]]; then |
1219 |
debug-print "could not find valid -source/-target values" |
1222 |
debug-print "could not find valid -source/-target values for javac" |
1220 |
die "Could not find valid -source/-target values" |
1223 |
echo "Could not find valid -source/-target values for javac" |
|
|
1224 |
return 1 |
1221 |
else |
1225 |
else |
1222 |
if java-pkg_is-vm-version-ge "1.4"; then |
1226 |
if java-pkg_is-vm-version-ge "1.4"; then |
1223 |
echo "${source_str} ${target_str}" |
1227 |
echo "${source_str} ${target_str}" |
Lines 1332-1343
Link Here
|
1332 |
ejavac() { |
1336 |
ejavac() { |
1333 |
debug-print-function ${FUNCNAME} $* |
1337 |
debug-print-function ${FUNCNAME} $* |
1334 |
|
1338 |
|
1335 |
# FIXME using get-javac ends up printing stuff with einfo |
1339 |
java-pkg_init-compiler_ |
1336 |
# local compiler_executable=$(java-pkg_get-javac) |
|
|
1337 |
local compiler_executable="javac" |
1338 |
|
1340 |
|
1339 |
[[ -n ${JAVA_PKG_DEBUG} ]] && echo ${compiler_executable} $(java-pkg_javac-args) "${@}" |
1341 |
local compiler_executable |
1340 |
${compiler_executable} $(java-pkg_javac-args) "${@}" || die "ejavac failed" |
1342 |
compiler_executable=$(java-pkg_get-javac) |
|
|
1343 |
if [[ ${?} != 0 ]]; then |
1344 |
eerror "${compiler_executable}" |
1345 |
die "get-javac failed" |
1346 |
fi |
1347 |
|
1348 |
local javac_args |
1349 |
javac_args="$(java-pkg_javac-args)" |
1350 |
if [[ ${?} != 0 ]]; then |
1351 |
eerror "${javac_args}" |
1352 |
die "java-pkg_javac-args failed" |
1353 |
fi |
1354 |
|
1355 |
[[ -n ${JAVA_PKG_DEBUG} ]] && echo ${compiler_executable} ${javac_args} "${@}" |
1356 |
${compiler_executable} ${javac_args} "${@}" || die "ejavac failed" |
1341 |
} |
1357 |
} |
1342 |
|
1358 |
|
1343 |
# ------------------------------------------------------------------------------ |
1359 |
# ------------------------------------------------------------------------------ |
Lines 1786-1794
Link Here
|
1786 |
elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then |
1802 |
elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then |
1787 |
debug-print "depend-java-query: NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}} VNEED: ${JAVA_PKG_VNEED}" |
1803 |
debug-print "depend-java-query: NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}} VNEED: ${JAVA_PKG_VNEED}" |
1788 |
if [[ -n ${JAVA_PKG_VNEED} ]]; then |
1804 |
if [[ -n ${JAVA_PKG_VNEED} ]]; then |
1789 |
export GENTOO_VM="$(depend-java-query --need-virtual "${JAVA_PKG_VNEED}" --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")" |
1805 |
GENTOO_VM="$(depend-java-query --need-virtual "${JAVA_PKG_VNEED}" --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")" |
1790 |
else |
1806 |
else |
1791 |
export GENTOO_VM="$(depend-java-query --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")" |
1807 |
GENTOO_VM="$(depend-java-query --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")" |
|
|
1808 |
fi |
1809 |
if [[ -z "${GENTOO_VM}" || "${GENTOO_VM}" == "None" ]]; then |
1810 |
die "Unable to determine VM for building from dependencies. NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}} VNEED: ${JAVA_PKG_VNEED}" |
1811 |
else |
1812 |
export GENTOO_VM |
1792 |
fi |
1813 |
fi |
1793 |
# otherwise just make sure the current VM is sufficient |
1814 |
# otherwise just make sure the current VM is sufficient |
1794 |
else |
1815 |
else |
Lines 1800-1807
Link Here
|
1800 |
|
1821 |
|
1801 |
export JAVA=$(java-config --java) |
1822 |
export JAVA=$(java-config --java) |
1802 |
export JAVAC=$(java-config --javac) |
1823 |
export JAVAC=$(java-config --javac) |
1803 |
export JAVACFLAGS="$(java-pkg_javac-args)" |
1824 |
JAVACFLAGS="$(java-pkg_javac-args)" |
1804 |
[[ -n ${JAVACFLAGS_EXTRA} ]] && export JAVACFLAGS="${JAVACFLAGS_EXTRA} ${JAVACFLAGS}" |
1825 |
if [[ ${?} != 0 ]]; then |
|
|
1826 |
eerror "${JAVACFLAGS}" |
1827 |
die "java-pkg_javac-args failed" |
1828 |
fi |
1829 |
[[ -n ${JAVACFLAGS_EXTRA} ]] && JAVACFLAGS="${JAVACFLAGS_EXTRA} ${JAVACFLAGS}" |
1830 |
export JAVACFLAGS |
1805 |
|
1831 |
|
1806 |
export JAVA_HOME="$(java-config -g JAVA_HOME)" |
1832 |
export JAVA_HOME="$(java-config -g JAVA_HOME)" |
1807 |
export JDK_HOME=${JAVA_HOME} |
1833 |
export JDK_HOME=${JAVA_HOME} |