Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build script improvements #4

Closed
wants to merge 6 commits into from
Closed

Conversation

NicoHood
Copy link
Contributor

This is just a suggestion! Feel free to include single commits. You might also want to add this information just in the readme (like the java path).

I changed a few things to make the script more flexible. However I have not been able to compile for a 32bit system on x64.

The Java path might also differ. I used this to install java 8 on x64 and also arm:

sudo apt-get install openjdk-8-jdk openjdk-8-jre

# arm or x64, might differ on your system
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-armhf
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64

The arm build currently only works on native arm systems, no crosscompiling possible.

Partly fixes a bit of #1 and #3

Also related to #1

Then you can use to sync the submodule again:
```
git submodule sync
git submodule init
git submodule update
```
Added -x bash option
added autoconf
removed &&
@facchinm
Copy link
Member

Partially merged to master, thank you!

@facchinm facchinm closed this Jan 21, 2016
@NicoHood
Copy link
Contributor Author

I think autogen only needs to be called once. configure however does need to be called twice (because of the 32bit version).

I would still be nice if you can provide the arm build as non crosscompile version as well. Just the script I added. Then you can cross compile and compile on arm itself too. (because the x64 will not build on arm). Maybe you just need to move the arm build outside the linux script and it could work too. Will edit the results later.

Edit1:
Furthermore I'd use the java paths i suggested as default. You test if the directory exists, otherwise use your opt path. I guess the apt-get packages are more command than an installation inside opt. And if you check if the path exists, all users are happy.

@ShorTie8
Copy link

autogen needs to be called to make the Makefile, which could be different for different platforms.
so I suggest adding a check for make before hand

if [[ -f make ]]; then
    make distclean
fi
./autogen.sh
./configure

Furthermore I would not hardcode a path to Java either.
What happens if Oracles Java is being used instead of open-Java ??
from my googling, the way to set it is

JAVA_HOME=`readlink -f /usr/bin/javac | sed "s:bin/javac::"`

now if you want to throw a check in to make sure it a specific version of Java it gets more complicated. to get the Java version it's.

Java_Version=`java -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q'`

which returns like 18 for Java 8.
and then you can put a double check in also with grep to get

if [[ $Java_Version != "18" ]]; then
    echo -e "\n\nOops, you need Java 1.8\n\n"
    exit -1
elif [ `uname -s` == "Linux" ]; then
    if [ `readlink -f /usr/bin/javac | sed "s:bin/javac::" | grep 8` ]; then
        JAVA_HOME=`readlink -f /usr/bin/javac | sed "s:bin/javac::"`
        export JAVA_HOME
    else
        echo -e "\n\nSo, So, Sorry, Could not set JAVA_HOME\n\n"
        exit -1
    fi
fi

But thats all just food for thought, or how I do it in Arduino_IDE_builder.bash

@ShorTie8
Copy link

the only thing that i think would be nice is having VERSION defined some how/way.
like in a file you could grep or something .. :/~

Oops, me bad, guess that is what 'git tag' is for .. :/~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants