Skip to content
Myr

Add AIX support

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Currently AIX isn't supported in nvm so I have made a few small changes to make this work: change tar to gtar for AIX change make to gmake for AIX Set ARCH as ppc64 for AIX

authored by George Adams · committed by George Adams · parent 9c92b5a · Browse files · 1 file+21 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+21 added−3 removed

  • other:+21 added−3 removed

1 file+21 added−3 removed

modified:nvm.sh+21 added-3 removed
1443 unmodified lines
1444 Linux\ *) NVM_OS=linux ;;1445 Darwin\ *) NVM_OS=darwin ;;1446 SunOS\ *) NVM_OS=sunos ;;1447 FreeBSD\ *) NVM_OS=freebsd ;;1448 AIX\ *) NVM_OS=aix ;;1449 esac1450 nvm_echo "${NVM_OS-}"1451}1452
14 unmodified lines
1467 HOST_ARCH=$(isainfo -n)1468 else1469 HOST_ARCH=$(echo "$HOST_ARCH" | command tail -1)1470 fi1471 elif [ "_$NVM_OS" = "_aix" ]; then1472 HOST_ARCH=ppc641473 else1474 HOST_ARCH="$(command uname -m)"1475 fi1476
115 unmodified lines
1592 TARBALL="$(nvm_download_artifact "${FLAVOR}" binary "${TYPE-}" "${VERSION}" | command tail -1)"1593 if [ -f "${TARBALL}" ]; then1594 TMPDIR="$(dirname "${TARBALL}")/files"1595 fi1596 local tar1597 tar='tar'1598 if [ "${NVM_OS}" = 'aix' ]; then1599 tar='gtar'1600 fi1601 if (1602 [ -n "${TMPDIR-}" ] && \1603 command mkdir -p "${TMPDIR}" && \1596 command tar -x${tar_compression_flag}f "${TARBALL}" -C "${TMPDIR}" --strip-components 1 && \1604 command "${tar}" -x${tar_compression_flag}f "${TARBALL}" -C "${TMPDIR}" --strip-components 1 && \1605 VERSION_PATH="$(nvm_version_path "${PREFIXED_VERSION}")" && \1606 command mkdir -p "${VERSION_PATH}" && \1607 command mv "${TMPDIR}/"* "${VERSION_PATH}" && \1608 command rm -rf "${TMPDIR}"
166 unmodified lines
1775 elif [ "_$NVM_OS" = "_freebsd" ] || [ "_$NVM_OS" = "_darwin" ]; then1776 NVM_CPU_THREADS="$(sysctl -n hw.ncpu)"1777 elif [ "_$NVM_OS" = "_sunos" ]; then1778 NVM_CPU_THREADS="$(psrinfo | wc -l)"1779 elif [ "_$NVM_OS" = "_aix" ]; then1780 NVM_CPU_THREADS="$(lsconf|grep 'Number Of Processors:'| awk '{print $4}')"1781 fi1782 if ! nvm_is_natural_num "$NVM_CPU_THREADS" ; then1783 nvm_err 'Can not determine how many thread(s) we can use, set to only 1 now.'1784 nvm_err 'Please report an issue on GitHub to help us make it better and run it faster on your computer!'
56 unmodified lines
1841 local make1842 make='make'1843 if [ "${NVM_OS}" = 'freebsd' ]; then1844 make='gmake'1835 MAKE_CXX='CXX=c++'1845 MAKE_CXX='CXX=c++' 1846 elif [ "${NVM_OS}" = 'aix' ]; then1847 make='gmake'1848 fi18491850 local tar_compression_flag1851 tar_compression_flag='z'1852 if nvm_supports_xz "${VERSION}"; then1853 tar_compression_flag='J'1854 fi18551856 local tar1857 tar='tar'1858 if [ "${NVM_OS}" = 'aix' ]; then1859 tar='gtar'1860 fi18611862 local TARBALL1863 local TMPDIR1864 local VERSION_PATH1865
2 unmodified lines
1868 TARBALL="$(nvm_download_artifact "${FLAVOR}" source "${TYPE}" "${VERSION}" | command tail -1)" && \1869 [ -f "${TARBALL}" ] && \1870 TMPDIR="$(dirname "${TARBALL}")/files" && \1871 command mkdir -p "${TMPDIR}" && \1854 command tar -x${tar_compression_flag}f "${TARBALL}" -C "${TMPDIR}" --strip-components 1 && \1872 command "${tar}" -x${tar_compression_flag}f "${TARBALL}" -C "${TMPDIR}" --strip-components 1 && \1873 VERSION_PATH="$(nvm_version_path "${PREFIXED_VERSION}")" && \1874 nvm_cd "${TMPDIR}" && \1875 ./configure --prefix="${VERSION_PATH}" $ADDITIONAL_PARAMETERS && \1876 $make -j "${NVM_MAKE_JOBS}" ${MAKE_CXX-} && \
1376 unmodified lines