How to build libusb in mac i386?

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

  1. macrumors member

    Joined:
    Nov 21, 2010
    #1
    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. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #2
    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.

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

    Joined:
    Oct 13, 2007
    #3
    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. thread starter macrumors member

    Joined:
    Nov 21, 2010
    #4
    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