grep=path/to/gnu/grep make STANDALONE=n and it worked
grep=path/to/gnu/grep make STANDALONE=n and it worked
Explore... Chat... Share...
#!/bin/bash
set -e -u
InstallBase=`pwd`
BrewHome=/brew2/local
BrewTools="gnu-sed binutils gawk automake libtool bash"
BrewToolsExtra="https://raw.github.com/Homebrew/homebrew-dupes/master/grep.rb"
ImageName=CrossToolNG
ImageNameExt=${ImageName}.sparseimage
CrossToolVersion=crosstool-NG
ToolChainName=xtensa-lx106-elf
function buildBrewDepends(){
if [ ! -d "$BrewHome" ]
then
echo "If asked, enter your sudo password to create the $BrewHome folder"
sudo mkdir -p "$BrewHome"
sudo chown -R $USER "$BrewHome"
curl -Lsf http://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C$BrewHome
fi
echo "Updating HomeBrew tools..."
$BrewHome/bin/brew update
$BrewHome/bin/brew upgrade
set +e
$BrewHome/bin/brew install $BrewTools && true
$BrewHome/bin/brew install $BrewToolsExtra && true
set -e
}
function createCaseSensitiveVolume(){
echo "Creating sparse volume mounted on /Volumes/${ImageName}..."
ImageNameExt=${ImageName}.sparseimage
diskutil umount force /Volumes/${ImageName} && true
rm -f ${ImageNameExt} && true
hdiutil create ${ImageName} -volname ${ImageName} -type SPARSE -size 8g -fs HFSX
hdiutil mount ${ImageNameExt}
cd /Volumes/$ImageName
}
function downloadCrossTool(){
echo "Downloading crosstool-ng..."
git clone -b lx106-g++ git://github.com/jcmvbkbc/crosstool-NG.git
}
function patchCrosstool(){
cd $CrossToolVersion
echo "Patching crosstool-ng..."
sed -i .bak '6i\
#include <stddef.h>' kconfig/zconf.y
}
function buildCrosstool(){
echo "Configuring crosstool-ng..."
./bootstrap && ./configure --prefix=`pwd` --enable-local \
--with-objcopy=$BrewHome/bin/gobjcopyi \
--with-objdump=$BrewHome/bin/gobjdump \
--with-ranlib=$BrewHome/bin/granlib \
--with-readelf=$BrewHome/bin/greadelf \
--with-libtool=$BrewHome/bin/glibtool \
--with-libtoolize=$BrewHome/bin/glibtoolize \
--with-sed=$BrewHome/bin/gsed \
--with-awk=$BrewHome/bin/gawk \
--with-grep=$BrewHome/bin/ggrep \
--with-automake=$BrewHome/bin/automake \
--with-bash=$BrewHome/bin/bash \
CFLAGS="-std=c99 -Doffsetof=__builtin_offsetof" && make && make install
}
function buildToolchain(){
echo "Selecting $ToolChainName..."
ulimit -n 1024
PATH=$BrewHome/bin:$PATH ./ct-ng $ToolChainName
echo "Building $ToolChainName..."
PATH=$BrewHome/bin:$PATH ./ct-ng build && cp -r builds/$ToolChainName $InstallBase/$ToolChainName
cd $InstallBase
diskutil umount force /Volumes/${ImageName} && true
rm -f ${ImageNameExt} && true
echo "DONE! Check for folder called $ToolChainName containing the toolchain"
}
buildBrewDepends
createCaseSensitiveVolume
downloadCrossTool
patchCrosstool
buildCrosstool
buildToolchain
#!/bin/bash
set -e -u
InstallBase=~/Desktop
BrewHome=/usr/local
BrewToolsExtra="https://raw.github.com/Homebrew/homebrew-dupes/master/grep.rb"
ImageName=ESPDISK
ImageNameDMG=${InstallBase}/${ImageName}.dmg
# --------------------------
# Install Homebrew tarball
# and obtain required tools
# --------------------------
function createHomeBrew(){
if [ ! -d "$BrewHome" ]
then
echo "If asked, enter your sudo password to create the $BrewHome folder"
sudo mkdir -p "$BrewHome"
sudo chown -R $USER "$BrewHome"
curl -Lsf http://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C$BrewHome
fi
echo "+--------------------------------------------------------+"
echo "| Updating HomeBrew tools |"
echo "+--------------------------------------------------------+"
$BrewHome/bin/brew update
$BrewHome/bin/brew upgrade
set +e
$BrewHome/bin/brew install gnu-sed --with-default-names && true
$BrewHome/bin/brew tap homebrew/dupes && true
$BrewHome/bin/brew install gperf && true
$BrewHome/bin/brew install grep && true
$BrewHome/bin/brew install autoconf && true
$BrewHome/bin/brew install binutils && true
$BrewHome/bin/brew install gawk && true
$BrewHome/bin/brew install libtool && true
$BrewHome/bin/brew install $BrewToolsExtra && true
$BrewHome/bin/brew link --overwrite gawk
$BrewHome/bin/brew doctor && true
set -e
}
# ------------------------------------
# Create a Case Sensitive Volume
# Necessary for the esp sdk toolchain
# to work properly in OSX
# ------------------------------------
function createCaseSensitiveVolume(){
echo "+--------------------------------------------------------+"
echo "| Creating volume mounted on /Volumes/$ImageName |"
echo "+--------------------------------------------------------+"
cd ${InstallBase}
diskutil umount force /Volumes/${ImageName} && true
rm -f ${ImageNameDMG}
hdiutil create ${ImageNameDMG} -volname ${ImageName} -size 10g -fs "Case-sensitive HFS+"
hdiutil mount ${ImageNameDMG}
cd /Volumes/${ImageName}
}
# -------------------------------
# Download esp-open-sdk from GIT
# and place it inside the Volume
# -------------------------------
function downloadEspOpenSdk(){
echo "+--------------------------------------------------------+"
echo "| Downloading ESP-open-sdk... |"
echo "+--------------------------------------------------------+"
cd /Volumes/${ImageName}
git clone https://github.com/pfalcon/esp-open-sdk.git
cd esp-open-sdk
}
# ------------------------------------
# Patching config file to use AR tool
# from the toolchain and not from OSX
# ------------------------------------
function patchXtensaConfigFile(){
echo "+--------------------------------------------------------+"
echo "| Patching ESP-open-sdk... |"
echo "+--------------------------------------------------------+"
sed -i.bak '19i\
AM_PROG_AR' lx106-hal/configure.ac
}
# ---------------------------------------
# Just build the Xtensa Cross toolchain
# so it will generate all configure file
# ---------------------------------------
function buildCrosstoolNG(){
echo "+--------------------------------------------------------+"
echo "| Configuring ESP-open-sdk... |"
echo "+--------------------------------------------------------+"
make toolchain && true
}
# ----------------------------------
# Final build to merge ESP sdk with
# Xtensa cross toolchain
# ----------------------------------
function buildEspSdk(){
echo "+--------------------------------------------------------+"
echo "| Building ESP Open SDK |"
echo "+--------------------------------------------------------+"
ulimit -n 1024
make STANDALONE=y
cd /Volumes
export PATH=/Volumes/${ImageName}/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
echo "+--------------------------------------------------------+"
echo "| DONE! Check for folder called $ImageName |"
echo "+--------------------------------------------------------+"
}
createHomeBrew
createCaseSensitiveVolume
downloadEspOpenSdk
buildCrosstoolNG
patchXtensaConfigFile
buildEspSdk
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]