[Distutils] Re: confirm c326a187aa6aaad9ba7f65132cb0d5ee4691f7fd

Andres Baravalle andres.baravalle at gmail.com
Mon Nov 15 13:54:01 CET 2004

I am quite new with python and I'm developing a package that is
including a binary file (eggtrayiconmodule.so) that is open source.

My software is developed in part under linux, and now I would like to
make it fully portable to other unix-like platforms. Therefore I need
to provide the source and integrate eggtrayicon compilation in my

I have my working Makefile for eggtrayicon and I can compile
eggtrayicon, but I would like to compile it automatically with
setup.py, if possible, so that the user runs setup.py mysoftware build
and it builds.

My Makefile is:
# Makefile for eggtrayicon

OBJECTS		= eggtrayiconmodule.so

# Compilation stuff
CC		= gcc
PYTHON_VERSION	= $(shell echo `python -c "import sys; print sys.version[0:3]"`)
PYTHON_INCLUDE	= -I/usr/include/python$(PYTHON_VERSION) \
                  -I/usr/include/pygtk-2.0 \
	          $(shell pkg-config gtk+-2.0 --cflags) \
		  $(shell pkg-config libgnomeui-2.0 --cflags)
LIBS            = $(shell pkg-config gtk+-2.0 --libs) \
                  $(shell pkg-config libgnomeui-2.0 --libs)
CFLAGS		= -Wall -g -fomit-frame-pointer $(PYTHON_INCLUDE)

all:: $(OBJECTS)	

%.o : %.c
	$(CC) -fPIC $(CFLAGS) -c -o $@ $<
%.so : %.o
	$(CC) -shared $(LIBS) -Wl,-soname,$@ $< -o $@

Any suggestions or links to the correct direction to look at?

Thanks in advance.

More information about the Distutils-SIG mailing list