PDA

View Full Version : How to build libusb in mac i386?




MayPeng
May 16, 2011, 04:23 AM
I download libusb-1.0.8 from sourceForge net. It is installed as x86_64 by default. But I need it to install as i386 .How can i do?
ps. My mac doesn't support 64bit kernel and Extensions.



jiminaus
May 16, 2011, 08:36 AM
The -arch command-line switch to GCC selects which architectures are to be targeted when compiling. -arch x86_64 will compile 64-bit. -arch i386 will compile 32-bit.

Try exporting a CFLAGS environment variable before running configure.


$ export CFLAGS='-arch i386'
$ ./configure

larkost
May 16, 2011, 09:58 PM
There is a good chance you will need LDFLAGS set to the same thing. And depending on the makefile you might need other flags for C++ sources.

MayPeng
May 16, 2011, 10:58 PM
The -arch command-line switch to GCC selects which architectures are to be targeted when compiling. -arch x86_64 will compile 64-bit. -arch i386 will compile 32-bit.

Try exporting a CFLAGS environment variable before running configure.


$ export CFLAGS='-arch i386'
$ ./configure


Resolve the problem.Thank you!
But mac pc must support '64bit kernel and extensions', or set CFLAGS = i386 ,it still installs as x86_64.