2

I want to distribute a Python application with compiled C binaries for several platforms like Windows, Linux, and MacOS X. I don't want to force the user to compile anything or install a specific version of a certain library (like PIL) to avoid compile troubles or version conflicts with Linux package management.

What is the best way to cross compile the application? Is it possible to compile for MacOS without having a Mac?

deamon
  • 89,107
  • 111
  • 320
  • 448

1 Answers1

0

As you can see here, the answer seems to be to use the package_data argument to setup.py if you're using distutils. Before calling setup(), you should build the package_data dictionary depending on the platform you detected, e.g. with platform.platform.

It is generally possible to build gcc as a cross-compiler. This specific question has been answered before.

Community
  • 1
  • 1
Roland Smith
  • 42,427
  • 3
  • 64
  • 94