* [Buildroot] buildroot - python problem @ 2008-05-07 9:48 Richard Hardy 2008-05-07 14:34 ` Andrew Dyer 0 siblings, 1 reply; 6+ messages in thread From: Richard Hardy @ 2008-05-07 9:48 UTC (permalink / raw) To: buildroot Hi, I am new to the whole buildroot system, and I have been playing around with it trying to build the at91sam9263ek configuration on a Fedora 8 Linux system. I am using the buildroot tar from 30th April 2008. I get a long way through the process (selecting mostly the default options), and then I get an error as follows: Make[1] Leaving directory '/home/richardh/AT91SAM9263/buildroot/build_arm/Python-2.4.2' /bin/sh: line 8 -/usr/bin/make No such file or directory Make: *** [/home/richardh/AT91SAM9263/buildroot/build_arm/Python-2.4.2/.hostpython ] Error 127 Can anyone help me as to why this is happening and what I might do about it? Thanks in advance, Richard. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/buildroot/attachments/20080507/a931794e/attachment.htm ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] buildroot - python problem 2008-05-07 9:48 [Buildroot] buildroot - python problem Richard Hardy @ 2008-05-07 14:34 ` Andrew Dyer 2008-05-07 15:07 ` Ulf Samuelsson 0 siblings, 1 reply; 6+ messages in thread From: Andrew Dyer @ 2008-05-07 14:34 UTC (permalink / raw) To: buildroot On Wed, May 7, 2008 at 4:48 AM, Richard Hardy <richardh@oakleafconsultancy.com> wrote: > I get a long way through the process (selecting mostly the default options), > and then I get an error as follows: > > > > Make[1] Leaving directory > '/home/richardh/AT91SAM9263/buildroot/build_arm/Python-2.4.2' > > /bin/sh: line 8 -/usr/bin/make No such file or directory > > Make: *** > [/home/richardh/AT91SAM9263/buildroot/build_arm/Python-2.4.2/.hostpython] > Error 127 > > > > Can anyone help me as to why this is happening and what I might do about it? I found this as well. I was able to get around it by making the change it the patch below (beware line wrap as I just pasted it in). As I understand it a - at the beginning of a command is legal in make, but since this is a continuation of one long command line I don't think it's okay there. Index: package/python/python.mk =================================================================== --- package/python/python.mk (revision 21884) +++ package/python/python.mk (working copy) @@ -89,7 +89,7 @@ $(MAKE) python Parser/pgen && \ mv python hostpython && \ mv Parser/pgen Parser/hostpgen && \ - -$(MAKE) distclean \ + $(MAKE) distclean \ ) && \ touch $@ -- Hardware, n.: The parts of a computer system that can be kicked. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] buildroot - python problem 2008-05-07 14:34 ` Andrew Dyer @ 2008-05-07 15:07 ` Ulf Samuelsson 2008-05-08 0:27 ` Hamish Moffatt 0 siblings, 1 reply; 6+ messages in thread From: Ulf Samuelsson @ 2008-05-07 15:07 UTC (permalink / raw) To: buildroot > On Wed, May 7, 2008 at 4:48 AM, Richard Hardy > <richardh@oakleafconsultancy.com> wrote: >> I get a long way through the process (selecting mostly the default options), >> and then I get an error as follows: >> >> >> >> Make[1] Leaving directory >> '/home/richardh/AT91SAM9263/buildroot/build_arm/Python-2.4.2' >> >> /bin/sh: line 8 -/usr/bin/make No such file or directory >> >> Make: *** >> [/home/richardh/AT91SAM9263/buildroot/build_arm/Python-2.4.2/.hostpython] >> Error 127 >> >> >> >> Can anyone help me as to why this is happening and what I might do about it? > > I found this as well. I was able to get around it by making the > change it the patch below (beware line wrap as I just pasted it in). > As I understand it a - at the beginning of a command is legal in make, > but since this is a continuation of one long command line I don't > think it's okay there. > > Index: package/python/python.mk > =================================================================== > --- package/python/python.mk (revision 21884) > +++ package/python/python.mk (working copy) > @@ -89,7 +89,7 @@ > $(MAKE) python Parser/pgen && \ > mv python hostpython && \ > mv Parser/pgen Parser/hostpgen && \ > - -$(MAKE) distclean \ > + $(MAKE) distclean \ > ) && \ > touch $@ > The python.mk looks pretty unclean to me. Should not the host python be built in the toolchain directory, and the result moved to STAGING_DIR? Then it could be easily be used for other stuff as well. Best Regards Ulf Samuelsson ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] buildroot - python problem 2008-05-07 15:07 ` Ulf Samuelsson @ 2008-05-08 0:27 ` Hamish Moffatt 2008-05-08 0:31 ` Ulf Samuelsson 0 siblings, 1 reply; 6+ messages in thread From: Hamish Moffatt @ 2008-05-08 0:27 UTC (permalink / raw) To: buildroot On Wed, May 07, 2008 at 05:07:18PM +0200, Ulf Samuelsson wrote: > The python.mk looks pretty unclean to me. > Should not the host python be built in the toolchain directory, > and the result moved to STAGING_DIR? > Then it could be easily be used for other stuff as well. I'm using the python package here and never saw the problem reported in this thread. Your suggestion of installing properly into $STAGING_DIR seems reasonable though. I am planning to update the package for Python 2.5 soon so I will fix that up at the same time. Next week hopefully. Changing versions might break some people's code, so it may be necessary to support multiple versions and allow the user to choose. Do you other Python users have any comments on this? Hamish -- Hamish Moffatt VK3SB <hamish@debian.org> <hamish@cloud.net.au> ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] buildroot - python problem 2008-05-08 0:27 ` Hamish Moffatt @ 2008-05-08 0:31 ` Ulf Samuelsson 2008-05-08 0:58 ` Hamish Moffatt 0 siblings, 1 reply; 6+ messages in thread From: Ulf Samuelsson @ 2008-05-08 0:31 UTC (permalink / raw) To: buildroot tor 2008-05-08 klockan 10:27 +1000 skrev Hamish Moffatt: > On Wed, May 07, 2008 at 05:07:18PM +0200, Ulf Samuelsson wrote: > > The python.mk looks pretty unclean to me. > > Should not the host python be built in the toolchain directory, > > and the result moved to STAGING_DIR? > > Then it could be easily be used for other stuff as well. > > I'm using the python package here and never saw the problem reported in > this thread. Your suggestion of installing properly into $STAGING_DIR > seems reasonable though. > > I am planning to update the package for Python 2.5 soon so I will fix > that up at the same time. Next week hopefully. > > Changing versions might break some people's code, so it may be necessary > to support multiple versions and allow the user to choose. Do you other > Python users have any comments on this? > > Hamish Here is a start, not tested yet... Index: package/python/python.mk =================================================================== --- package/python/python.mk (revision 21945) +++ package/python/python.mk (arbetskopia) @@ -8,6 +8,10 @@ PYTHON_SOURCE:=Python-$(PYTHON_VERSION).tar.bz2 PYTHON_SITE:=http://python.org/ftp/python/$(PYTHON_VERSION) PYTHON_DIR:=$(BUILD_DIR)/Python-$(PYTHON_VERSION) +HOST_PYTHON_DIR:=$(TOOL_BUILD_DIR)/Python-$(PYTHON_VERSION) +HOST_PYTHON:=$(STAGING_DIR)/bin/python +HOST_PYTHON_PGEN:=$(HOST_PYTHON_DIR)/Parser/pgen + PYTHON_CAT:=$(BZCAT) PYTHON_BINARY:=python PYTHON_TARGET_BINARY:=usr/bin/python @@ -70,30 +74,39 @@ $(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) - $(PYTHON_CAT) $(DL_DIR)/$(PYTHON_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - +$(HOST_PYTHON_DIR)/.unpacked: $(DL_DIR)/$(PYTHON_SOURCE) + $(PYTHON_CAT) $(DL_DIR)/$(PYTHON_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) - touch $@ -$(PYTHON_DIR)/.patched: $(PYTHON_DIR)/.unpacked - toolchain/patch-kernel.sh $(PYTHON_DIR) package/python/ python\*.patch +$(HOST_PYTHON_DIR)/.patched: $(HOST_PYTHON_DIR)/.unpacked + toolchain/patch-kernel.sh $(HOST_PYTHON_DIR) package/python/ python \*.patch touch $@ -$(PYTHON_DIR)/.hostpython: $(PYTHON_DIR)/.patched +$(HOST_PYTHON_DIR)/.configured: $(HOST_PYTHON_DIR)/.patched (cd $(PYTHON_DIR); rm -rf config.cache; \ CC="$(HOSTCC)" OPT="-O2" \ ./configure \ --with-cxx=no \ - $(DISABLE_NLS) && \ - $(MAKE) python Parser/pgen && \ - mv python hostpython && \ - mv Parser/pgen Parser/hostpgen && \ - -$(MAKE) distclean \ - ) && \ + $(DISABLE_NLS) + ) touch $@ -$(PYTHON_DIR)/.configured: $(PYTHON_DIR)/.hostpython +$(HOST_PYTHON_DIR)/python: $(HOST_PYTHON_DIR)/.configured + $(MAKE) -C $(HOST_PYTHON_DIR) python Parser/pgen + +$(HOST_PYTHON): $(HOST_PYTHON_DIR)/python + cp $(HOST_PYTHON_DIR)/python $(HOST_PYTHON) +# --------------------------- + +$(PYTHON_DIR)/.unpacked: $(DL_DIR)/$(PYTHON_SOURCE) + $(PYTHON_CAT) $(DL_DIR)/$(PYTHON_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + touch $@ + +$(PYTHON_DIR)/.patched: $(PYTHON_DIR)/.unpacked + toolchain/patch-kernel.sh $(PYTHON_DIR) package/python/ python\*.patch + touch $@ + +$(PYTHON_DIR)/.configured: $(PYTHON_DIR)/.patched (cd $(PYTHON_DIR); rm -rf config.cache; \ $(TARGET_CONFIGURE_OPTS) \ $(TARGET_CONFIGURE_ARGS) \ @@ -118,7 +131,7 @@ PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/usr/include \ PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \ PYTHON_DISABLE_MODULES="$(BR2_PYTHON_DISABLED_MODULES)" \ - HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen + HOSTPYTHON=$(HOST_PYTHON) HOSTPGEN=$(HOST_PYTHON_PGEN) $(TARGET_DIR)/$(PYTHON_TARGET_BINARY): $(PYTHON_DIR)/$(PYTHON_BINARY) ifneq ($(BR2_PACKAGE_PYTHON_SSL),y) @@ -130,11 +143,13 @@ PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/usr/include \ PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \ 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 '*.pyo' -exec rm {} \; && \ + HOSTPYTHON=$(HOST_PYTHON) HOSTPGEN=$(HOST_PYTHON_PGEN) + +python_cleanup: $(TARGET_DIR)/$(PYTHON_TARGET_BINARY) + rm $(TARGET_DIR)/usr/bin/python?.? + rm $(TARGET_DIR)/usr/bin/idle + rm $(TARGET_DIR)/usr/bin/pydoc + find $(TARGET_DIR)/usr/lib/ -name '*.pyo' -exec rm {} \; rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \ $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc \ $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_SHORT)/test @@ -163,8 +178,10 @@ rm -rf $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_SHORT)/lib-tk endif -python: uclibc $(PYTHON_DEPS) $(TARGET_DIR)/$(PYTHON_TARGET_BINARY) +python-source: $(DL_DIR)/$(PYTHON_SOURCE) +python: uclibc $(PYTHON_DEPS) $(HOST_PYTHON) $(TARGET_DIR)/$(PYTHON_TARGET_BINARY) python-cleanup + python-clean: -$(MAKE) -C $(PYTHON_DIR) distclean rm -f $(PYTHON_DIR)/.configured $(TARGET_DIR)/$(PYTHON_TARGET_BINARY) -- Best Regards Ulf Samuelsson Atmel Nordic AB Mail: Box 2033, 174 50 Sundbyberg Visit:Kavalleriv?gen 24, 174 58 Sundbyberg Phone: +46 8 441 54 22, GSM: +46 706 22 44 57 eMail: ulf at atmel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: python.patch Type: text/x-patch Size: 4174 bytes Desc: not available Url : http://busybox.net/lists/buildroot/attachments/20080508/9d0d01f0/attachment-0001.bin ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] buildroot - python problem 2008-05-08 0:31 ` Ulf Samuelsson @ 2008-05-08 0:58 ` Hamish Moffatt 0 siblings, 0 replies; 6+ messages in thread From: Hamish Moffatt @ 2008-05-08 0:58 UTC (permalink / raw) To: buildroot On Thu, May 08, 2008 at 02:31:26AM +0200, Ulf Samuelsson wrote: > tor 2008-05-08 klockan 10:27 +1000 skrev Hamish Moffatt: > > On Wed, May 07, 2008 at 05:07:18PM +0200, Ulf Samuelsson wrote: > > > The python.mk looks pretty unclean to me. > > > Should not the host python be built in the toolchain directory, > > > and the result moved to STAGING_DIR? > > > Then it could be easily be used for other stuff as well. > > > > I'm using the python package here and never saw the problem reported in > > this thread. Your suggestion of installing properly into $STAGING_DIR > > seems reasonable though. > > > > I am planning to update the package for Python 2.5 soon so I will fix > > that up at the same time. Next week hopefully. > > > > Changing versions might break some people's code, so it may be necessary > > to support multiple versions and allow the user to choose. Do you other > > Python users have any comments on this? > > Here is a start, not tested yet... Thanks. I think that for a host-python in $STAGING_DIR to be useful for more than just building target-python, you need to build/install more than just the python and pgen binaries. It needs to install the standard library (some of which has to be compiled). I don't think "make install" installs the host pgen (required to cross-compile python) though so we can't just replace the copy of the host python/pgen binaries with "make install". Hamish -- Hamish Moffatt VK3SB <hamish@debian.org> <hamish@cloud.net.au> ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-05-08 0:58 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-05-07 9:48 [Buildroot] buildroot - python problem Richard Hardy 2008-05-07 14:34 ` Andrew Dyer 2008-05-07 15:07 ` Ulf Samuelsson 2008-05-08 0:27 ` Hamish Moffatt 2008-05-08 0:31 ` Ulf Samuelsson 2008-05-08 0:58 ` Hamish Moffatt
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox