How to build libusb in mac i386?

Discussion in 'Mac Programming' started by MayPeng, May 16, 2011.

  1. MayPeng macrumors member

    Nov 21, 2010
    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.
  2. jiminaus macrumors 65816


    Dec 16, 2010
    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.

    [b]$[/b] export CFLAGS='-arch i386'
    [b]$[/b] ./configure
  3. larkost macrumors 6502a

    Oct 13, 2007
    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.
  4. MayPeng thread starter macrumors member

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

Share This Page