I don't like the default C compiler clang
provided by Termux. Is there a way I can get GNU GCC in my Termux environment?
Je n'aime pas le compilateur C par défaut clang
fourni par TERMUX. Y a-t-il une façon de pouvoir obtenir GNU GCC dans mon environnement termux?
I don't like the default C compiler clang
provided by Termux. Is there a way I can get GNU GCC in my Termux environment?
Une autre façon d'obtenir GCC serait d'ajouter le repo communautaire hébergé par son point inutile à https://github.com/its-pointless/its-pointsless.github.io . Les sources sont (plus ou moins) disponibles à https://github.com/its-poindless/gcc_termux.
D'autres paquets populaires disponibles incluent NUMPY et SICPY.
Plus d'informations sur ce sujet et d'autres référentiels de la Communauté se trouvent dans le Termux Wiki .
Pour ajouter ce référentiel particulier à votre environnement Termux, exécutez:
# Get some needed tools. coreutils for mkdir command, gnugp for the signing key, and apt-transport-https to actually connect to the repo apt-get update apt-get --assume-yes upgrade apt-get --assume-yes install coreutils gnupg2 apt-transport-https wget # Make the sources.list.d directory mkdir $PREFIX/etc/apt/sources.list.d # Write the needed source file - Added Missing "> character on line below echo "deb [trusted=yes] https://its-pointless.github.io/files/ termux extras" > $PREFIX/etc/apt/sources.list.d/pointless.list # Download signing key from https://its-pointless.github.io/pointless.gpg wget https://its-pointless.github.io/pointless.gpg apt-key add pointless.gpg # Update apt apt update
(instructions prises à partir de https://github.com/its-pointsless/its-pointsless.github.IO/blob/master/setup-pointsless-repo.sh )
Another way to get gcc would be to add the community repo hosted by its-pointless at https://github.com/its-pointless/its-pointless.github.io. Sources are (more or less) available at https://github.com/its-pointless/gcc_termux.
Other popular packages available includes numpy and scipy.
More information about this and other community repositories can be found in the termux wiki.
To add this particular repository to your termux environment, run:
# Get some needed tools. coreutils for mkdir command, gnugp for the signing key, and apt-transport-https to actually connect to the repo apt-get update apt-get --assume-yes upgrade apt-get --assume-yes install coreutils gnupg2 apt-transport-https wget # Make the sources.list.d directory mkdir $PREFIX/etc/apt/sources.list.d # Write the needed source file - Added Missing "> character on line below echo "deb [trusted=yes] https://its-pointless.github.io/files/ termux extras" > $PREFIX/etc/apt/sources.list.d/pointless.list # Download signing key from https://its-pointless.github.io/pointless.gpg wget https://its-pointless.github.io/pointless.gpg apt-key add pointless.gpg # Update apt apt update
(instructions taken from https://github.com/its-pointless/its-pointless.github.io/blob/master/setup-pointless-repo.sh)
C'est une solution très intéressante.
première téléchargement GCC pour C4Droid de Google Jouer.
aller trouver son apk sous /data/app/com.n0n3m4.gcc4droid-#
, prenez l'APK et extrait /assets/gcc.zip
. Maintenant, extrait gcc.zip
à
/data/data/com.termux/files/usr/libexec
Appliquer chmod -R 644
dans l'ensemble du dossier et chmod -R 755
à ARCH/bin
, bin
et libexec
. Link GCC Programmes à /data/app/com.n0n3m4.gcc4droid-#0
et vous pourrez utiliser GCC au lieu de Clang. N'oubliez pas d'ajouter /data/app/com.n0n3m4.gcc4droid-#1
lors de la compilation des exécutables.
This is a very interesting solution.
First download GCC for C4droid from Google Play.
Go find its apk under /data/app/com.n0n3m4.gcc4droid-#
, take the APK and extract /assets/gcc.zip
. Now extract gcc.zip
to
/data/data/com.termux/files/usr/libexec
Apply chmod -R 644
to the whole folder and chmod -R 755
to ARCH/bin
, bin
and libexec
. Link gcc programs to $PREFIX/bin
and you'll be able to use GCC instead of Clang. Remember to add -pie
when compiling executables.
Installez Arch Linux à Termux Proot pour obtenir un environnement de développement de Linux complet. Voir https://sdrusty.github.io/termuxarch/docs/install pour l'installation instructions. Utilisez /data/app/com.n0n3m4.gcc4droid-#2
pour installer l'environnement du développeur qui comprend GCC.
Install Arch Linux in Termux PRoot to get a full Linux development environment. See https://sdrausty.github.io/TermuxArch/docs/install for installation instructions. Use pacman -S base base-devel
to install the developer's environment which includes GCC.
J'ai créé Termux Repo avec GCC 10.2.0, comment installer HTTPS: // cctools.info/index.php/termux_repository_with_ccctools_packages_(gcc_with_fortran_support_etc)
Ajouter des packages CCTOOLS Touche publique:
wget -O - https://cctools.info/public.key | apt-key add -
Créer un nouveau référentiel liste:
echo "deb https://cctools.info termux cctools" > $PREFIX/etc/apt/sources.list.d/cctools.list
Mettre à jour les listes de packages:
apt update
Installez le package GCC-CCTOOLS (il installera automatiquement les binutils-cctools):
apt install gcc-cctools
Installez le package NDK pour votre architecture Android, utilisez la dernière une, par exemple pour Aarch64:
apt install ndk-sysroot-cctools-api-26-aarch64
Pour afficher toutes les sysrotes NDK pour Aarch64:
apt search ndk-sysroot-cctools | grep aarch64
Ajouter un répertoire avec de nouveaux compilateurs au chemin:
export PATH=$PREFIX/../cctools-toolchain/bin:$PATH
Vérifiez-le:
gcc -v
I created termux repo with gcc 10.2.0, there how to install https://cctools.info/index.php/Termux_repository_with_cctools_packages_(gcc_with_fortran_support_etc)
Add cctools packages public key:
wget -O - https://cctools.info/public.key | apt-key add -
Create a new repository list:
echo "deb https://cctools.info termux cctools" > $PREFIX/etc/apt/sources.list.d/cctools.list
Update packages lists:
apt update
Install the package gcc-cctools(it will install binutils-cctools automatically):
apt install gcc-cctools
Install the NDK package for your android architecture, use the latest one, for example for aarch64:
apt install ndk-sysroot-cctools-api-26-aarch64
To show all ndk sysroots for aarch64:
apt search ndk-sysroot-cctools | grep aarch64
Add directory with new compilers to PATH:
export PATH=$PREFIX/../cctools-toolchain/bin:$PATH
Check it:
gcc -v
© 2022 www.demandez.top All Rights Reserved. Questions et réponses Accueil Tous les droits sont réservés