How can I upgrade to Autoconf 2.6.2 or higher on Mac OS X 10.6? - macos

My environment is Mac OS X 10.6. I have installed Autoconfig using MacPorts:
sudo port -v selfupdate
sudo port install autoconf
But the autoconf installed is 2.6.1.
My question is how can I upgrade it to 2.6.2?
The program I am trying to compile need autoconf 2.6.2
configure.ac:14: error: Autoconf version 2.62 or higher is required
/opt/local/share/aclocal-1.11/init.m4:110: AM_INIT_AUTOMAKE is expanded from...
configure.ac:14: the top level
autom4te: /Developer/usr/bin/gm4 failed with exit status: 63
aclocal-1.11: autom4te failed with exit status: 63
make[1]: *** [libmpeg2] Error 63

I usually do not bother installing any of the autotools on the system, but install them in $HOME instead. Just grab the autoconf tarball from http://ftp.gnu.org/gnu/autoconf/, unpack it and run:
./configure --prefix=$HOME
make
make install
Make sure $HOME/bin is in your PATH before the system dir, or uninstall autoconf from the system.

Related

gem install compass won't work

When I try to install compass using sudo gem install compass it show me this :
Building native extensions. This could take a while...
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -r ./siteconf20141125-86718-gjziv3-0.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_with_gvl()... no
checking for rb_thread_call_without_gvl()... no
checking for ffi_prep_cif_var()... no
creating extconf.h
creating Makefile
make clean
make
mkdir -p "/Library/Ruby/Gems/1.8/gems/ffi-1.9.6/ext/ffi_c"/libffi-i386; (if [ ! -f "/Library/Ruby/Gems/1.8/gems/ffi-1.9.6/ext/ffi_c"/libffi-i386/Makefile ]; then echo "Configuring libffi for i386"; cd "/Library/Ruby/Gems/1.8/gems/ffi-1.9.6/ext/ffi_c"/libffi-i386 && env CC=" xcrun cc" CFLAGS="-arch i386 " LDFLAGS="-arch i386" "/Library/Ruby/Gems/1.8/gems/ffi-1.9.6/ext/ffi_c/libffi"/configure --disable-static --with-pic=yes --disable-dependency-tracking --host=i386-apple-darwin > /dev/null; fi); env MACOSX_DEPLOYMENT_TARGET=10.4 make -C "/Library/Ruby/Gems/1.8/gems/ffi-1.9.6/ext/ffi_c"/libffi-i386
Configuring libffi for i386
configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
configure: error: in `/Library/Ruby/Gems/1.8/gems/ffi-1.9.6/ext/ffi_c/libffi-i386':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[1]: *** No targets specified and no makefile found. Stop.
make: *** ["/Library/Ruby/Gems/1.8/gems/ffi-1.9.6/ext/ffi_c"/libffi-i386/.libs/libffi_convenience.a] Error 2
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/ffi-1.9.6 for inspection.
Results logged to /Library/Ruby/Gems/1.8/extensions/universal-darwin-11/1.8/ffi-1.9.6/gem_make.out
I have correctly install sass and xcode' tools but nothing change. I even try to upgrade ruby. What should I do?
It happens because you want to sudo install and probably environment variables are not configured to use your installed ruby, instead it uses the system ruby which probably is not what you want to use.
The easiest way to use Ruby on Mac is to install rbenv and ruby-build using homebrew.
To install homebrew just run this command which can be found on brew homepage:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
To install rbenv and ruby-build you can run these commands which can be found on Github:
brew update
brew install rbenv ruby-build
Forgot to add that for sure, then you need to install a ruby version using rbenv and make it global.
rbenv install 2.1.5
rbenv global 2.1.5
And finally:
gem install compass
Just make sure that gem binary points to the version you've installed.
You can run gem env and checkout printed paths, if it doesn't point to newly installed ruby gem path, close the terminal and open a new one then install the gem.
Here is the first few lines of what's printed out on my machine:
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.0
- RUBY VERSION: 2.1.0 (2013-12-25 patchlevel 0) [x86_64-darwin13.0]
- INSTALLATION DIRECTORY: /Users/jani/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0
....

installing usbmuxd under Mac OS X

I installed the latest version of libusb and now I'm trying to install usbmuxd.
However, it gives this error:
configure: error: Package requirements (libusb-1.0 >= 1.0.3) were not met:
No package 'libusb-1.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
In the installation log of libusb it says
libtool: install: /usr/bin/install -c .libs/libusb-1.0.0.dylib /usr/local/lib/libusb-1.0.0.dylib
It looks like the wrong version of the library is getting installed.
How can I solve this?
You should consider installing macports, which has usbmuxd v1.0.7 available, and then:
$ sudo port selfupdate
$ sudo port install usbmuxd
(you should de-install the libusb package you installed yourself, before doing this probably).

Ruby-build giving me Autoconf version 2.67 or higher is required

Trying to install Ruby 2.2.0-dev using ruby-build gives me an error about Autoconf:
$ rbenv install 2.2.0-dev
Cloning https://github.com/ruby/ruby.git...
Installing ruby-2.2.0-dev...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/3x/y_8y8vr53ws_kxj97km79q5h0000gn/T/ruby-build.20140107115843.2294
Results logged to /var/folders/3x/y_8y8vr53ws_kxj97km79q5h0000gn/T/ruby-build.20140107115843.2294.log
Last 10 log lines:
/var/folders/3x/y_8y8vr53ws_kxj97km79q5h0000gn/T/ruby-build.20140107115843.2294 ~/bogus/path
Cloning into 'ruby-2.2.0-dev'...
/var/folders/3x/y_8y8vr53ws_kxj97km79q5h0000gn/T/ruby-build.20140107115843.2294/ruby-2.2.0-dev /var/folders/3x/y_8y8vr53ws_kxj97km79q5h0000gn/T/ruby-build.20140107115843.2294 ~/bogus/path
configure.in:6: error: Autoconf version 2.67 or higher is required
configure.in:6: the top level
autom4te: /usr/bin/gm4 failed with exit status: 63
Homebrew seems to claim that autoconf 2.69 is available. Unless it's only using autoconf for itself, without allowing it to be used by others:
$ brew list autoconf
/usr/local/Cellar/autoconf/2.69/bin/ifnames
/usr/local/Cellar/autoconf/2.69/bin/autoupdate
/usr/local/Cellar/autoconf/2.69/bin/autoscan
/usr/local/Cellar/autoconf/2.69/bin/autoreconf
/usr/local/Cellar/autoconf/2.69/bin/autom4te
/usr/local/Cellar/autoconf/2.69/bin/autoheader
/usr/local/Cellar/autoconf/2.69/bin/autoconf
/usr/local/Cellar/autoconf/2.69/share/autoconf/ (42 files)
/usr/local/Cellar/autoconf/2.69/share/emacs/ (4 files)
/usr/local/Cellar/autoconf/2.69/share/man/ (9 files)
I don't think homebrew is using autoconf for itself (keg-only?), because doing brew upgrade autoconf gave me Error: autoconf-2.69 already installed.
However, when I run autoconf, it claims that it's only version 2.61:
$ autoconf --version
autoconf (GNU Autoconf) 2.61
My $PATH:
/Users/agrimm/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin
My uname:
$ uname -a
Darwin [redacted] 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
How do I fix the error in installing 2.2.0-dev?
Does ruby-build use its own autoconf, or does it only use whatever is available to the user? If so, what is the recommended way to make autoconf 2.67 or higher available to ruby-build?
brew link --overwrite autoconf will make rbenv use homebrew autoconf version.

Cannot install ruby-1.9.2 in Mac OSX 10.8.1 due to symlink error

First, I tried the common rvm install.
rvm install 1.9.2
However, the following error was shown:
The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.
Then I run
rvm requirements
and find these following part of output useful
Right now Ruby requires gcc to compile, but Xcode 4.2 and later no longer ship with gcc. Instead they ship with llvm-gcc (to which gcc is a symlink) and clang, neither of which are supported for building Ruby. Xcode 4.1 was the last version to ship gcc, which was /usr/bin/gcc-4.2.
Xcode 4.1 and earlier:
- Ruby will build fine.
Xcode 4.2 and later (including Command Line Tools for Xcode):
- If you have gcc-4.2 (and friends) from an earlier Xcode version, Ruby will build fine.
- If you don't have gcc-4.2, you have two options to get it:
* Install apple-gcc42 from Homebrew
* Install osx-gcc-installer
Homebrew:
If you are using Homebrew, you can install the apple-gcc42 and required libraries from homebrew/dupes:
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
rvm pkg install openssl
This can live side by side with an existing Xcode 4.2+ install or Command Line Tools for Xcode.
so I tried:
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
However, I got the following error
Warning: Could not link apple-gcc42. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link apple-gcc42'
==> Summary
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3: 104 files, 75M, built in 23 seconds
kanitw:shell.venturelab.com kanitw$ brew link apple-gcc42
Linking /usr/local/Cellar/apple-gcc42/4.2.1-5666.3... Warning: Could not link apple-gcc42. Unlinking...
Error: Could not symlink file: /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/include/gcc
/usr/local/include is not writable. You should change its permissions.
What would be my best solution? I kinda remember from somewhere that I should not use sudo with brew since I will mess up the whole installation.
You can change /usr/local directory owner
sudo chown -R `whoami` /usr/local
But, if you have mysql installed, you mast fix its owner
sudo chown -R mysql:mysql /usr/local/mysql
You should run brew doctor and then change the permissions accordingly. There might be other issues.
Change the permissions of your /usr/local directory and try again.

OS X Mountain Lion: gcc-4.2 No such file or directory

Tried to install a gem on Mountain Lion and make couldn't find gcc-4.2:
kamil$ gem install posix-spawn -v '0.3.6'
Building native extensions. This could take a while...
ERROR: Error installing posix-spawn:
ERROR: Failed to build gem native extension.
/Users/kamil/.rbenv/versions/1.9.3-p0/bin/ruby extconf.rb
creating Makefile
make
compiling posix-spawn.c
make: gcc-4.2: No such file or directory
make: *** [posix-spawn.o] Error 1
If you have Xcode installed, gcc should be available. Check where it is with:
kamil$ which gcc
/usr/bin/gcc
Then make a user-land symbolic link from gcc-4.2 to plain gcc:
kamil$ sudo ln -s ~/bin/gcc /usr/bin/gcc-4.2
(Ensure the user-land bind folder is in your path via export PATH=...:$HOME/bin in your .bash_profile or .zshrc.)
Gem installed fine afterwards.
Install simply apple-gcc42 with brew. It generate gcc-4.2 .
brew install apple-gcc42
So we do not need symlinks, which apple update may remove.
Homebrew
As #Artur Bodera mentioned modern OSX will refuse to let you create the symlink in the systems /bin folder.
To avoid this simply create the symlink to your users bin folder
ln -s ~/bin/gcc /usr/bin/gcc-4.2
Don't forget to add the bin folder to your .zshrc or .bash_profile - e.g.
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$HOME/bin
I had a similar issue while installing a python pip package (building a wheel failed). I got the similar message:
unable to execute '/usr/bin/gcc-4.2': No such file or directory
error: command '/usr/bin/gcc-4.2' failed with exit status 1
Linking /usr/bin/gcc-4.2 to /usr/bin/gcc was not possible due to Apples System Integrity Protection (SIP), and linking it to /usr/local/bin/gcc-4.2 was not picked up by the wheel building process; it was still trying to use /usr/bin/gcc-4.2.
I was finally able to solve this by setting the CC variable in the terminal:
CC=/usr/bin/gcc
# Install your packages
pip install -r requirements.txt
PS : note that disabling SIP doesn't work, even with SIP disabled I wasn't able to create the /usr/bin/gcc-4.2 link.

Resources