Как установить Autoconf, Automake и связанные инструменты на Mac OS X из исходных текстов?

32947
chacham15

Я хочу установить autoconf, automake, m4и т.д. ... от источника на 10.7.2 машине Mac OS X работает Xcode 4.2.1. Проблема в том, что я пытаюсь установить все, на что я должен положиться autoconf. Поэтому я пытаюсь установить, autoconfя получаю:

configure.ac:30: require Automake 1.11, but have 1.10 

Я пытаюсь установить automake, загрузчик сообщает:

configure.ac:20: error: Autoconf version 2.68 or higher is required configure.ac:20: the top level autom4te: /usr/bin/gm4 failed with exit status: 63 aclocal.tmp: error: autom4te failed with exit status: 63 

Текущая установленная autoconfверсия:autoconf (GNU Autoconf) 2.61

Текущая установленная automakeверсия:automake (GNU automake) 1.10

19
Не для того, чтобы быть ворчанием, и я знаю, что этот вопрос 6 лет, но не могли бы вы принять любой из этих ответов, если он сработал для вас? juniorRubyist 6 лет назад 0

3 ответа на вопрос

21
JakeGould

Update: Just use Homebrew to install these packages and move on with life.

Install Homebrew and just install the autoconf, automake and libtool packages like this:

brew install autoconf automake libtool 

When I wrote this answer about 3+ years ago, it was to correct a previous answer that was outdated, link-only and vague in explanation. At that time I preferred to use raw source compilation on macOS for a task like this rather than a package manager like Homebrew because I simply found Homebrew and MacPorts to be a tad immature back then.

Now I use Homebrew (aka brew) on macOS as regularly as I use apt-get on Ubuntu and yum on CentOS. I would recommend avoiding compiling anything from raw source code on macOS unless you really have no choice.

Old answer content below for reference purposes.


I realize this question is about 3+ years old, but the accepted answer is a link only answer and that link is now dead. And the other answer is technically correct, but it still does not explain the actual hands-on process required to install the GNU versions of autoconf, automake and libtool in Mac OS X.

First, Xcode—since at least version 4.3 I believe—no longer includes the GNU versions of autoconf, automake and libtool. This doesn’t mean you can’t install GNU tools on your own. And here is how.

I’ve used this process on Mac OS X 10.6 (Snow Leopard), 10.7 (Lion), 10.8 (Mountain Lion) and 10.9 (Mavericks) without issue.

Install Xcode and Xcode command line tools.

The first prerequisite is to have Xcode installed along with the Xcode command line tools as well. Chances are if you need autoconf, automake and libtool installed, you already have Xcode and the command line tools installed, but just pointing that out for those who don’t have that setup yet.

Now, onto the show! Just note that version numbers of downloads are based on what is current (as of April 2015) and works well as of the time of this post. Adjust to other versions if you need to:


Install autoconf 2.69.

Set the working directory to your home directory:

cd 

Get the source code and decompress it:

curl -O -L http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz tar -xzf autoconf-2.69.tar.gz 

Go into the uncompressed source code directory:

cd autoconf-* 

Run the configure script on the source code:

./configure 

Now run make to compile it:

make 

Now install it:

sudo make install 

Check the newly installed autoconf version to confirm all went well:

autoconf --version 

Response should be something like this:

autoconf 2.69


Install automake 1.15.

Set the working directory to your home directory:

cd 

Get the source code and decompress it:

curl -O -L http://ftpmirror.gnu.org/automake/automake-1.15.tar.gz tar -xzf automake-1.15.tar.gz 

Go into the uncompressed source code directory:

cd automake-* 

Run the configure script on the source code:

./configure 

Now run make to compile it:

make 

Now install it:

sudo make install 

Check the newly installed automake version to confirm all went well:

automake --version 

Response should be something like this:

automake 1.15


Install libtool 2.4.6.

Set the working directory to your home directory:

cd 

Get the source code and decompress it:

curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.gz tar -xzf libtool-2.4.6.tar.gz 

Go into the uncompressed source code directory:

cd libtool-* 

Run the configure script on the source code:

./configure 

Now run make to compile it:

make 

Now install it:

sudo make install 

Check the newly installed libtool version—via the man page—to confirm all went well:

man libtool 

On the first page of the man page there should be something like this:

libtool - manual page for libtool 2.4.6

17
juniorRubyist

Просто используйте Homebrew . Он собирает все для вас. Это сработало как обаяние для меня.

brew install autoconf automake libtool 
MacOSX (по крайней мере, Sierra) уже имеет libtool. Также в Sierra, «brew install autoconf automake» действительно устанавливает autoconf, но затем выдает ошибку: «Не удалось вставить символическую ссылку bin / autoconf / usr / local / bin». Эта проблема решена с помощью ответа SethMMorton на [StackOverflow: ошибка при попытке «brew link autoconf»] (https://stackoverflow.com/questions/16844826/error-when-tring-to-brew-link-autoconf). По сути, вам нужен chmod / usr / local, чтобы он был доступен для записи вами, пользователем. Elise van Looij 6 лет назад 0
@ElisevanLooij У меня не было этой проблемы с Сьеррой. Успешно установлены autoconf-2.69 и automake-1.15.1. Но вы правы, что libtool не нужен. Cœur 6 лет назад 0
1
William Pursell

Если вы устанавливаете autoconf из репозитория git, вам понадобится automake. Однако, если вы вместо этого загрузите архив дистрибутива для autoconf, у вас не будет этой зависимости. Вы всегда должны устанавливать из дистрибутива дистрибутива, а не из vcs. Другими словами, если вы хотите установить autoconf из исходного кода, просто установите его из исходного кода! Но поймите, что «установить из исходного кода» означает «установить из дистрибутива»; это не означает «установить из git».