Hello,

I just bought my fx-cg20 calculator, and immediatly wanted to start coding for it. I found PrizmSDK and used this script to install it:

Code:

#!/bin/sh
TARGET=sh3eb-elf
SRC="/usr/src"
PREFIX="/home/the_true_potato/casio-gcc"
PARALLEL="-j"
SDKDIR="/home/the_true_potato"

BINUTILS=binutils-2.22 # http://www.gnu.org/software/binutils/
GCC=gcc-4.6.3 # http://gcc.gnu.org/
MKG3A=mkg3a-0.2a #https://bitbucket.org/tari/mkg3a/downloads/mkg3a-0.2a.tar.gz

chmod a+rw $SRC
mkdir $PREFIX $SRC/$MKG3A $SRC/build-binutils $SRC/build-gcc
cd $SRC

(wget -c http://ftpmirror.gnu.org/binutils/$BINUTILS.tar.bz2 && tar -xvjf $BINUTILS.tar.bz2 && cd $SRC/build-binutils && ../$BINUTILS/./configure --target=$TARGET --prefix=$PREFIX --disable-nls --disable-werror && make $PARALLEL && make install && cd .. && rm -r build-binutils) || exit 1

export PATH=$PATH:$PREFIX/bin #This is CRUCIAL. Do NOT remove this or build will FAIL!

(cd $SRC && wget -c http://ftpmirror.gnu.org/gcc/$GCC/$GCC.tar.bz2 && tar -xvjf $GCC.tar.bz2 && cd build-gcc && ../$GCC/./configure --target=$TARGET --prefix=$PREFIX --disable-nls --enable-languages=c,c++ --without-headers --disable-werror && make $PARALLEL all-gcc && make install-gcc && make $PARALLEL all-target-libgcc && make install-target-libgcc && cd .. && rm -r build-gcc) || exit 1

(cd $SRC && wget -c https://bitbucket.org/tari/mkg3a/downloads/mkg3a-0.2a.tar.gz && tar -xvzf $MKG3A.tar.gz && cd $MKG3A && cmake . && make $PARALLEL && make install && cd .. && rm -r $MKG3A) || exit 1

(cd $SDKDIR && mkdir PrizmSDK && chmod a+rw PrizmSDK && sudo -u $SUDO_USER git clone https://github.com/Jonimoose/libfxcg.git PrizmSDK && cd PrizmSDK && make $PARALLEL && cd toolchain && cp prizm_rules prizm_rules.bak && head -17 prizm_rules.bak > prizm_rules && echo "PREFIX   :=   $PREFIX/bin/sh3eb-elf-" >> prizm_rules && tail -59 prizm_rules.bak >> prizm_rules) || exit 1



binutils compiles normally, but when it reaches gcc it fails saying:

Code:
 
/home/the_true_potato/casio-gcc/sh3eb-elf/bin/as: unrecognized option '--64'
Makefile:3838: recipe for target 'build/version.o' failed
make[1]: *** [build/version.o] Error 1
make[1]: *** Waiting for unfinished jobs....
mv tmp-sysroot-suffix.h sysroot-suffix.h
make[1]: *** wait: No child processes.  Stop.
Makefile:5264: recipe for target 'all-gcc' failed
make: *** [all-gcc] Error 2


I would appreciate any help since I really want to get to programming for the calculator.

Thanks in advance
Try this bash script

Code:

#!/bin/bash
TMPDIR=/tmp
tar -xf binutils* -C $TMPDIR
tar -xf gcc* -C $TMPDIR
cd $TMPDIR
export PREFIX=$HOME/casio-gcc && export PATH=$PATH:$PREFIX/bin && export TARGET=sh3eb-elf && export CFLAGS="-O2 -pipe -s -fomit-frame-pointer -ffunction-sections -fdata-sections" && export CXXFLAGS=$CFLAGS && export LDFLAGS="-Wl,--gc-sections" && mkdir build-binutils && cd build-binutils && ../binutils-2.*/configure --disable-werror --target=$TARGET --prefix=$PREFIX --disable-nls --disable-tls --disable-libssp --enable-plugin --enable-plugins --enable-gold=yes && make && make install && cd .. && mkdir build-gcc && cd build-gcc && ../gcc-5.*/configure --target=$TARGET --prefix=$PREFIX  --without-headers --enable-plugin --enable-plugins --enable-gold=yes --enable-sjlj-exceptions --disable-hosted-libstdcxx --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --disable-nls --disable-tls --disable-libssp --disable-threads --disable-shared --disable-__cxa_atexit --disable-libvtv --disable-libada --with-endian=big && make all-gcc && make install-gcc && make all-target-libgcc && make install-target-libgcc

You might want to replace TMPDIR if you are on windows. Also have the gcc and binutils tar in the directory in which you run the script.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement