This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall_cc_avrdude.sh
executable file
·67 lines (44 loc) · 2.18 KB
/
install_cc_avrdude.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
show_current_task
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
exportdefvar avrdude_GITURL "https://github.com/kcuzner"
exportdefvar avrdude_GITREPO "avrdude"
exportdefvar avrdude_BRANCH "master"
exportdefvar avrdude_REVISION ""
exportdefvar avrdude_RECOMPILE n
exportdefvar avrdude_LINUXGPIO y
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
# GET PACKAGES --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ----
if ! ( get_git_pkg "${avrdude_GITURL}" "${avrdude_GITREPO}" "${avrdude_BRANCH}" "${avrdude_REVISION}" ) ; then goto_exit 1 ; fi
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
# INSTALL PACKAGES - --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
if ! pushd "${CACHE}/${avrdude_GITREPO}-${avrdude_BRANCH}/avrdude" ; then goto_exit 2 ; fi
if [ "${avrdude_RECOMPILE}" != "n" ] ; then
rm ".compiled"
rm -rf "bin"
make clean
fi
if ! [ -f ".compiled" ] ; then
if [ -d "bin" ] ; then rm -rf "bin"/*
else mkdir "bin"
fi
transformFsToHost
if ! ( ./bootstrap ) ; then goto_exit 3 ; fi
if [ "${avrdude_LINUXGPIO}" == "y" ] ; then export ENABLE_LINUXGPIO="--enable-linuxgpio"
else unset ENABLE_LINUXGPIO
fi
if ! ( ./configure --host=${ARCH}-linux --prefix="/" ${ENABLE_LINUXGPIO} ) ; then goto_exit 4 ; fi
if ! ( make $NJ ) ; then goto_exit 5 ; fi
if ! ( DESTDIR="bin" make install ) ; then goto_exit 6 ; fi
transformFsToDevice
echo "1" > ".compiled"
fi
if ! (
( preAuthRoot && sudo cp -R "bin/bin" "${SYSROOT}${HOST_PREFIX}"/ ) &&
( preAuthRoot && sudo cp -R "bin/etc" "${SYSROOT}"/ ) &&
( preAuthRoot && sudo cp -R "bin/share" "${SYSROOT}${HOST_PREFIX}"/ )
)
then goto_exit 6 ; fi
popd
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -
show_message "AVRDUDE WAS SUCCESSFULLY INSTALLED!"