<p>This happens because <code>/usr/local/bin/glibtoolize:</code> is pointing to the wrong directory</p>

<p><code>line  49 : ${SED="/usr/local/Library/ENV/4.3/sed"}</code></p>

<p>This was changed when homebrew decided to move their paths. See this stackoverflow <a href="https://stackoverflow.com/questions/38440350/sed-directory-not-found-when-running-r-with-e-flag#38471855">post</a> </p>

<p>What worked for me was</p>

<p><code>brew reinstall libtool</code></p>

CC BY-SA 3.0
2018-03-11T22:11:04.530Z
2018-03-11T22:31:02.847Z
2018-03-11T22:31:02.847Z
cvu
<p>Easier appraoch:</p>

<pre><code>brew install bitcoin
</code></pre>

<p>However, as Jonas points out, you should be careful with trusting 3rd party package managers. Specifically, you should verify the SHA1 of the package you're getting from Homebrew matches that of the <a href="https://bitcoincore.org/bin/" rel="nofollow noreferrer">official release of Bitcoin</a> from either GitHub or the Bitcoin Core website.</p>

<p>More reading:</p>

<p><a href="https://apple.stackexchange.com/a/241768">Is Homebrew safe?</a></p>

<p>Example of using GPG to verify a package's signature (in this case the <code>SHA256SUMS.asc</code> signature file in <a href="https://bitcoincore.org/bin/bitcoin-core-0.15.1/" rel="nofollow noreferrer">https://bitcoincore.org/bin/bitcoin-core-0.15.1/</a>):</p>

<p><img src="https://user-images.githubusercontent.com/2043821/36104465-1d2cf4f6-0fe0-11e8-8a0a-943871c49ba1.png" alt="image"></p>

CC BY-SA 3.0
2018-02-10T21:41:16.567Z
Using a package manager to install a security critical application is not recommended IMO. What if they deliver a different package, how can the binary be verified by the user?
Jonas Schnelli
CC BY-SA 3.0
2018-01-10T19:54:34.517Z
2018-02-12T15:33:28.943Z
2018-02-12T15:33:28.943Z
mecampbellsoup
<p>I'm working on installing Bitcoin Core for the <a href="https://github.com/bitcoin/bitcoin/blob/v0.15.1/doc/build-osx.md" rel="nofollow noreferrer">mac</a>. I've cloned the repo and installed the dependencies via brew. I'm trying to run <code>autogen.sh</code> but it is failing:</p>

<pre><code>$ ./autogen.sh
/usr/local/bin/glibtoolize: line 406: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/bin/glibtoolize: line 2513: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/bin/glibtoolize: line 2513: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/bin/glibtoolize: line 3601: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/bin/glibtoolize: line 3845: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/bin/glibtoolize: line 861: /usr/local/Library/ENV/4.3/sed: No such file or directory
: putting auxiliary files in '.'.
: copying file './ltmain.sh'
/usr/local/bin/glibtoolize: line 3771: /usr/local/Library/ENV/4.3/sed: No such file or directory
configure.ac:45: error: required file 'build-aux/ltmain.sh' not found
autoreconf: automake failed with exit status: 1
</code></pre>

<p>I'm not sure what is failing. <code>brew doctor</code> is clean. <code>glibtoolize</code> and <code>sed</code> can both be found. There is no <code>.../Library/ENV</code> directory, so I'm not sure why that isn't automatically getting created.</p>

<p>Any help would be greatly appreciated.</p>

<pre><code>Mac 10.12.6
Bitcoin (7b57bc9) - v0.15.1
</code></pre>

CC BY-SA 3.0
2017-12-17T08:41:07.013Z
one observations: normally, capital variables indicate environment/shell vars, so it looks like if a "$" sign is missing, so it is incorrectly interpreted. Also: looking in the forum for "OSX compile" reveals many hits. And lastly: you have installed the command line tools from Xcode, and surely a call to "sed" is ok? (which sed)
pebwindkraft
CC BY-SA 3.0
2017-12-17T14:14:01.417Z
I do have `sed` (`/usr/bin/sed`) and I do have command line tools installed. Any idea where a `$` might be missing? I'll look around at the OSX compile issues. Thanks.
RyanJM
CC BY-SA 3.0
2017-12-17T23:27:46.710Z
hmm, just gave it a try, and it works on a clean machine. I followed this instruction:https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md. A "uname -a" returns:
Darwin lulu.local 16.7.0 Darwin Kernel Version 16.7.0: Mon Nov 13 21:56:25 PST 2017; root:xnu-3789.72.11~1/RELEASE_X86_64 x86_64 - I have used a non privileged user, and in his home directory did the brew install. Then downloaded bitcoin core (git clone https://github.com/bitcoin/bitcoin), and then cd to bitcoin and calling ./autogen.sh - no errors ... can you setup a new user, and try the steps in his home dir?
pebwindkraft
<bitcoin-core><compiling>
Bitcoin Core - autogen.sh failing on Mac
RyanJM
# Bitcoin Core - autogen.sh failing on Mac

(Asked by: username_0 on 2017-12-17)

I'm working on installing Bitcoin Core for the [mac](https://github.com/bitcoin/bitcoin/blob/v0.15.1/doc/build-osx.md). I've cloned the repo and installed the dependencies via brew. I'm trying to run `autogen.sh` but it is failing:

```
$ ./autogen.sh
/usr/local/bin/glibtoolize: line 406: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/bin/glibtoolize: line 2513: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/bin/glibtoolize: line 2513: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/bin/glibtoolize: line 3601: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/bin/glibtoolize: line 3845: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/bin/glibtoolize: line 861: /usr/local/Library/ENV/4.3/sed: No such file or directory
: putting auxiliary files in '.'.
: copying file './ltmain.sh'
/usr/local/bin/glibtoolize: line 3771: /usr/local/Library/ENV/4.3/sed: No such file or directory
configure.ac:45: error: required file 'build-aux/ltmain.sh' not found
autoreconf: automake failed with exit status: 1

```

I'm not sure what is failing. `brew doctor` is clean. `glibtoolize` and `sed` can both be found. There is no `.../Library/ENV` directory, so I'm not sure why that isn't automatically getting created.

Any help would be greatly appreciated.

```
Mac 10.12.6
Bitcoin (7b57bc9) - v0.15.1

```

**Tags:** bitcoin-core, compiling

> **Comments:**
> **username_1**: one observations: normally, capital variables indicate environment/shell vars, so it looks like if a "$" sign is missing, so it is incorrectly interpreted. Also: looking in the forum for "OSX compile" reveals many hits. And lastly: you have installed the command line tools from Xcode, and surely a call to "sed" is ok? (which sed)  
> **username_0**: I do have `sed` (`/usr/bin/sed`) and I do have command line tools installed. Any idea where a `$` might be missing? I'll look around at the OSX compile issues. Thanks.  
> **username_1**: hmm, just gave it a try, and it works on a clean machine. I followed this instruction:https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md. A "uname -a" returns: Darwin lulu.local 16.7.0 Darwin Kernel Version 16.7.0: Mon Nov 13 21:56:25 PST 2017; root:xnu-3789.72.11~1/RELEASE_X86_64 x86_64 - I have used a non privileged user, and in his home directory did the brew install. Then downloaded bitcoin core (git clone https://github.com/bitcoin/bitcoin), and then cd to bitcoin and calling ./autogen.sh - no errors ... can you setup a new user, and try the steps in his home dir?  

---

## 2 answers

### Answer by username_2 on 2018-03-11. Score: 2

This happens because `/usr/local/bin/glibtoolize:` is pointing to the wrong directory

`line 49 : ${SED="/usr/local/Library/ENV/4.3/sed"}`

This was changed when homebrew decided to move their paths. See this stackoverflow [post](https://stackoverflow.com/questions/38440350/sed-directory-not-found-when-running-r-with-e-flag#38471855)

What worked for me was

`brew reinstall libtool`


---

### Answer by username_3 on 2018-01-10. Score: -1

Easier appraoch:

```
brew install bitcoin

```

However, as username_4 points out, you should be careful with trusting 3rd party package managers. Specifically, you should verify the SHA1 of the package you're getting from Homebrew matches that of the [official release of Bitcoin](https://bitcoincore.org/bin/) from either GitHub or the Bitcoin Core website.

More reading:

[Is Homebrew safe?](https://apple.stackexchange.com/a/241768)

Example of using GPG to verify a package's signature (in this case the `SHA256SUMS.asc` signature file in <https://bitcoincore.org/bin/bitcoin-core-0.15.1/>):

![image](https://user-images.githubusercontent.com/2043821/36104465-1d2cf4f6-0fe0-11e8-8a0a-943871c49ba1.png)

> **Comments:**
> **username_4**: Using a package manager to install a security critical application is not recommended IMO. What if they deliver a different package, how can the binary be verified by the user?  

---

