Question

I would like to build and install libconfig as 64-bit on my Mac OS X (v10.8.3). Which are the commands that I could use inside the terminal? If I simply use ./configure and sudo make install the library will be installed as 32-bit.

Otherwise... How can I correctly remove the library from my system after installation process (library is in /usr/local/ path)?

Kind regards, Vi.

Was it helpful?

Solution

You probably need to pass CFLAGS='-arch x86_64' on the configure command line to set the architecture correctly:

./configure CFLAGS='-arch x86_64'

Update:

Adding CFLAGS doesn't change how configure detects the system, it just changes what gets passed to gcc. But it will build as a 64-bit executable:

$ file lib/.libs/libconfig.*.dylib
lib/.libs/libconfig.9.dylib: Mach-O 64-bit dynamically linked shared library x86_64

If you really want the configure output to be correct, then you need to pass in a --build parameter:

$ ./configure --build=x86_64-apple-darwin10.8.0
checking build system type... x86_64-apple-darwin10.8.0
checking host system type... x86_64-apple-darwin10.8.0
checking target system type... x86_64-apple-darwin10.8.0
...

The resultant library is also 64-bit:

$ file lib/.libs/libconfig.*.dylib
lib/.libs/libconfig.9.dylib: Mach-O 64-bit dynamically linked shared library x86_64

Admittedly, using the --build option is the better choice here. However, since gcc on Mac OS X can build "fat" binaries, it kind of blurs the line a little about what machine you're building for, since it can build for both i386 and x86_64.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top