2003-12-03 23:58:26 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# python
|
|
|
|
#
|
|
|
|
#############################################################
|
2005-11-10 03:52:42 +01:00
|
|
|
PYTHON_VERSION=2.4.2
|
2004-10-08 23:48:43 +02:00
|
|
|
PYTHON_SOURCE:=Python-$(PYTHON_VERSION).tar.bz2
|
2003-12-03 23:58:26 +01:00
|
|
|
PYTHON_SITE:=http://python.org/ftp/python/$(PYTHON_VERSION)
|
|
|
|
PYTHON_DIR:=$(BUILD_DIR)/Python-$(PYTHON_VERSION)
|
2006-11-17 16:43:51 +01:00
|
|
|
PYTHON_CAT:=$(BZCAT)
|
2003-12-03 23:58:26 +01:00
|
|
|
PYTHON_BINARY:=python
|
2004-10-08 23:48:43 +02:00
|
|
|
PYTHON_TARGET_BINARY:=usr/bin/python
|
2003-12-03 23:58:26 +01:00
|
|
|
|
2007-01-23 18:18:54 +01:00
|
|
|
# these could use checks for some BR2_PACKAGE_foo,y
|
|
|
|
BR2_PYTHON_DISABLED_MODULES=readline pyexpat dbm gdbm bsddb \
|
|
|
|
_curses _curses_panel _tkinter nis zipfile
|
|
|
|
|
2003-12-03 23:58:26 +01:00
|
|
|
$(DL_DIR)/$(PYTHON_SOURCE):
|
|
|
|
$(WGET) -P $(DL_DIR) $(PYTHON_SITE)/$(PYTHON_SOURCE)
|
|
|
|
|
|
|
|
python-source: $(DL_DIR)/$(PYTHON_SOURCE)
|
|
|
|
|
|
|
|
$(PYTHON_DIR)/.unpacked: $(DL_DIR)/$(PYTHON_SOURCE)
|
2004-10-09 23:19:47 +02:00
|
|
|
$(PYTHON_CAT) $(DL_DIR)/$(PYTHON_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
2007-01-23 18:18:54 +01:00
|
|
|
touch $@
|
2003-12-03 23:58:26 +01:00
|
|
|
|
2004-10-08 23:48:43 +02:00
|
|
|
$(PYTHON_DIR)/.patched: $(PYTHON_DIR)/.unpacked
|
2005-06-24 10:36:13 +02:00
|
|
|
toolchain/patch-kernel.sh $(PYTHON_DIR) package/python/ python\*.patch
|
2007-01-23 18:18:54 +01:00
|
|
|
touch $@
|
2004-10-08 23:48:43 +02:00
|
|
|
|
|
|
|
$(PYTHON_DIR)/.hostpython: $(PYTHON_DIR)/.patched
|
|
|
|
(cd $(PYTHON_DIR); rm -rf config.cache; \
|
2007-01-23 18:18:54 +01:00
|
|
|
CC="$(HOSTCC)" OPT="-O2" \
|
2004-10-08 23:48:43 +02:00
|
|
|
./configure \
|
|
|
|
--with-cxx=no \
|
2007-01-23 18:18:54 +01:00
|
|
|
$(DISABLE_NLS) && \
|
|
|
|
$(MAKE) python Parser/pgen && \
|
|
|
|
mv python hostpython && \
|
|
|
|
mv Parser/pgen Parser/hostpgen && \
|
2007-01-21 22:32:49 +01:00
|
|
|
$(MAKE) distclean \
|
2007-01-23 18:18:54 +01:00
|
|
|
) && \
|
|
|
|
touch $@
|
2004-10-08 23:48:43 +02:00
|
|
|
|
|
|
|
$(PYTHON_DIR)/.configured: $(PYTHON_DIR)/.hostpython
|
2003-12-03 23:58:26 +01:00
|
|
|
(cd $(PYTHON_DIR); rm -rf config.cache; \
|
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2007-06-27 14:01:27 +02:00
|
|
|
$(TARGET_CONFIGURE_ARGS) \
|
2007-01-23 18:18:54 +01:00
|
|
|
OPT="$(TARGET_CFLAGS)" \
|
2003-12-03 23:58:26 +01:00
|
|
|
./configure \
|
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--prefix=/usr \
|
|
|
|
--sysconfdir=/etc \
|
2004-10-08 23:48:43 +02:00
|
|
|
--with-cxx=no \
|
2007-06-26 19:45:08 +02:00
|
|
|
$(DISABLE_IPV6) \
|
2003-12-03 23:58:26 +01:00
|
|
|
$(DISABLE_NLS) \
|
|
|
|
);
|
2007-01-23 18:18:54 +01:00
|
|
|
touch $@
|
2003-12-03 23:58:26 +01:00
|
|
|
|
|
|
|
$(PYTHON_DIR)/$(PYTHON_BINARY): $(PYTHON_DIR)/.configured
|
2004-10-12 02:06:48 +02:00
|
|
|
export PYTHON_DISABLE_SSL=1
|
2004-10-08 23:48:43 +02:00
|
|
|
$(MAKE) CC=$(TARGET_CC) -C $(PYTHON_DIR) DESTDIR=$(TARGET_DIR) \
|
2007-08-12 00:26:56 +02:00
|
|
|
PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/usr/include \
|
2007-01-22 19:48:48 +01:00
|
|
|
PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \
|
2007-01-23 18:18:54 +01:00
|
|
|
PYTHON_DISABLE_MODULES="$(BR2_PYTHON_DISABLED_MODULES)" \
|
2004-10-08 23:48:43 +02:00
|
|
|
HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen
|
2003-12-03 23:58:26 +01:00
|
|
|
|
|
|
|
$(TARGET_DIR)/$(PYTHON_TARGET_BINARY): $(PYTHON_DIR)/$(PYTHON_BINARY)
|
2004-10-12 02:06:48 +02:00
|
|
|
export PYTHON_DISABLE_SSL=1
|
2004-10-08 23:48:43 +02:00
|
|
|
LD_LIBRARY_PATH=$(STAGING_DIR)/lib
|
|
|
|
$(MAKE) CC=$(TARGET_CC) -C $(PYTHON_DIR) install \
|
|
|
|
DESTDIR=$(TARGET_DIR) CROSS_COMPILE=yes \
|
2007-08-12 00:26:56 +02:00
|
|
|
PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/usr/include \
|
2007-01-22 19:48:48 +01:00
|
|
|
PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \
|
2007-01-23 18:18:54 +01:00
|
|
|
PYTHON_DISABLE_MODULES="$(BR2_PYTHON_DISABLED_MODULES)" \
|
|
|
|
HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen && \
|
|
|
|
rm $(TARGET_DIR)/usr/bin/python?.? && \
|
|
|
|
rm $(TARGET_DIR)/usr/bin/idle && \
|
|
|
|
rm $(TARGET_DIR)/usr/bin/pydoc && \
|
|
|
|
find $(TARGET_DIR)/usr/lib/ -name '*.pyc' -exec rm {} \; && \
|
|
|
|
find $(TARGET_DIR)/usr/lib/ -name '*.pyo' -exec rm {} \; && \
|
2003-12-03 23:58:26 +01:00
|
|
|
rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
|
2004-10-09 21:48:32 +02:00
|
|
|
$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc \
|
|
|
|
$(TARGET_DIR)/usr/lib/python*/test
|
2003-12-03 23:58:26 +01:00
|
|
|
|
2004-10-08 23:48:43 +02:00
|
|
|
python: uclibc $(TARGET_DIR)/$(PYTHON_TARGET_BINARY)
|
|
|
|
|
2003-12-03 23:58:26 +01:00
|
|
|
python-clean:
|
|
|
|
-$(MAKE) -C $(PYTHON_DIR) distclean
|
2007-01-23 18:18:54 +01:00
|
|
|
rm $(PYTHON_DIR)/.configured $(TARGET_DIR)/$(PYTHON_TARGET_BINARY)
|
2003-12-03 23:58:26 +01:00
|
|
|
|
|
|
|
python-dirclean:
|
|
|
|
rm -rf $(PYTHON_DIR)
|
2005-02-10 04:06:39 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
ifeq ($(strip $(BR2_PACKAGE_PYTHON)),y)
|
|
|
|
TARGETS+=python
|
|
|
|
endif
|