/[gentoo-x86]/eclass/java-utils-2.eclass
Gentoo

Diff of /eclass/java-utils-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.23 Revision 1.24
1160} 1160}
1161 1161
1162java-pkg_get-javac() { 1162java-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
1169 if [[ "${compiler}" = "javac" ]]; then 1169 if [[ "${compiler}" = "javac" ]]; then
1170 # nothing fancy needs to be done for javac 1170 # nothing fancy needs to be done for javac
1178 unset JAVAC 1178 unset JAVAC
1179 # try to get value of JAVAC 1179 # try to get value of JAVAC
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}!"
1188 die "${compiler_executable} doesn't exist, or isn't executable" 1190 echo "${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}
1196} 1199}
1197 1200
1214 1217
1215 debug-print "want source: ${want_source}" 1218 debug-print "want source: ${want_source}"
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}"
1224 else 1228 else
1225 echo "${target_str}" 1229 echo "${target_str}"
1330# @param $@ - Arguments to be passed to the compiler 1334# @param $@ - Arguments to be passed to the compiler
1331# ------------------------------------------------------------------------------ 1335# ------------------------------------------------------------------------------
1332ejavac() { 1336ejavac() {
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_
1340
1341 local compiler_executable
1336# local compiler_executable=$(java-pkg_get-javac) 1342 compiler_executable=$(java-pkg_get-javac)
1337 local compiler_executable="javac" 1343 if [[ ${?} != 0 ]]; then
1344 eerror "There was a problem determining compiler: ${compiler_executable}"
1345 die "get-javac failed"
1346 fi
1338 1347
1348 local javac_args
1349 javac_args="$(java-pkg_javac-args)"
1350 if [[ ${?} != 0 ]]; then
1351 eerror "There was a problem determining JAVACFLAGS: ${javac_args}"
1352 die "java-pkg_javac-args failed"
1353 fi
1354
1339 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ${compiler_executable} $(java-pkg_javac-args) "${@}" 1355 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ${compiler_executable} ${javac_args} "${@}"
1340 ${compiler_executable} $(java-pkg_javac-args) "${@}" || die "ejavac failed" 1356 ${compiler_executable} ${javac_args} "${@}" || die "ejavac failed"
1341} 1357}
1342 1358
1343# ------------------------------------------------------------------------------ 1359# ------------------------------------------------------------------------------
1344# @ebuild-function java-pkg_filter-compiler 1360# @ebuild-function java-pkg_filter-compiler
1345# 1361#
1784 export GENTOO_VM="${JAVA_PKG_FORCE_VM}" 1800 export GENTOO_VM="${JAVA_PKG_FORCE_VM}"
1785 # if we're allowed to switch the vm... 1801 # if we're allowed to switch the vm...
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 eerror "Unable to determine VM for building from dependencies."
1811 echo "NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}}"
1812 echo "VNEED: ${JAVA_PKG_VNEED}"
1813 else
1814 export GENTOO_VM
1792 fi 1815 fi
1793 # otherwise just make sure the current VM is sufficient 1816 # otherwise just make sure the current VM is sufficient
1794 else 1817 else
1795 java-pkg_ensure-vm-version-sufficient 1818 java-pkg_ensure-vm-version-sufficient
1796 fi 1819 fi
1798 1821
1799 java-pkg_setup-vm 1822 java-pkg_setup-vm
1800 1823
1801 export JAVA=$(java-config --java) 1824 export JAVA=$(java-config --java)
1802 export JAVAC=$(java-config --javac) 1825 export JAVAC=$(java-config --javac)
1803 export JAVACFLAGS="$(java-pkg_javac-args)" 1826 JAVACFLAGS="$(java-pkg_javac-args)"
1827 if [[ ${?} != 0 ]]; then
1828 eerror "There was a problem determining JAVACFLAGS: ${JAVACFLAGS}"
1829 die "java-pkg_javac-args failed"
1830 fi
1804 [[ -n ${JAVACFLAGS_EXTRA} ]] && export JAVACFLAGS="${JAVACFLAGS_EXTRA} ${JAVACFLAGS}" 1831 [[ -n ${JAVACFLAGS_EXTRA} ]] && JAVACFLAGS="${JAVACFLAGS_EXTRA} ${JAVACFLAGS}"
1832 export JAVACFLAGS
1805 1833
1806 export JAVA_HOME="$(java-config -g JAVA_HOME)" 1834 export JAVA_HOME="$(java-config -g JAVA_HOME)"
1807 export JDK_HOME=${JAVA_HOME} 1835 export JDK_HOME=${JAVA_HOME}
1808 1836
1809 #TODO If you know a better solution let us know. 1837 #TODO If you know a better solution let us know.

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

  ViewVC Help
Powered by ViewVC 1.1.20