This is how I went about changing the python make file. There is still 
an issue with the permissions for libpython2.4.so.1.0

# 
----------------------------------------------------------------------------
# Target-Install
# 
----------------------------------------------------------------------------

PYTHON24_INST_TMP := $(PYTHON24_DIR)/install_temp

python24_targetinstall: $(STATEDIR)/python24.targetinstall

$(STATEDIR)/python24.targetinstall: $(python24_targetinstall_deps_default)
    @$(call targetinfo, $@)

    @$(call install_init, python24)
    @$(call install_fixup, python24,PACKAGE,python24)
    @$(call install_fixup, python24,PRIORITY,optional)
    @$(call install_fixup, python24,VERSION,$(PYTHON24_VERSION))
    @$(call install_fixup, python24,SECTION,base)
    @$(call install_fixup, python24,AUTHOR,"Robert Schwebel 
<[EMAIL PROTECTED]>")
    @$(call install_fixup, python24,DEPENDS,)
    @$(call install_fixup, python24,DESCRIPTION,missing)

    @rm -rf $(PYTHON24_INST_TMP)
    @mkdir -p $(PYTHON24_INST_TMP)
    @mkdir -p "$(PYTHON24_INST_TMP)/stripped"
    @mkdir -p "$(PYTHON24_INST_TMP)/notStripped"


    $(PYTHON24_PATH) make -C $(PYTHON24_DIR) $(PYTHON24_MAKEVARS) \
        altbininstall DESTDIR="$(PYTHON24_INST_TMP)/stripped"

    umask 022 && \
        $(PYTHON24_PATH) make -C $(PYTHON24_DIR) $(PYTHON24_MAKEVARS) \
        libinstall DESTDIR="$(PYTHON24_INST_TMP)/notStripped"

    $(PYTHON24_PATH) make -C $(PYTHON24_DIR) $(PYTHON24_MAKEVARS) \
        libainstall DESTDIR="$(PYTHON24_INST_TMP)/notStripped"

    $(PYTHON24_PATH) make -C $(PYTHON24_DIR) $(PYTHON24_MAKEVARS) \
        sharedinstall DESTDIR="$(PYTHON24_INST_TMP)/stripped"

    $(PYTHON24_PATH) make -C $(PYTHON24_DIR) $(PYTHON24_MAKEVARS) \
        oldsharedinstall DESTDIR="$(PYTHON24_INST_TMP)/notStripped"

    @$(call install_copy, python24, 0, 0, 755, 
$(PYTHON24_INST_TMP)/stripped/usr/bin/python2.4, /usr/bin/python2.4, y)
    @$(call install_copy, python24, 0, 0, 755, 
$(PYTHON24_INST_TMP)/stripped/usr/bin/idle, /usr/bin/idle, n)
    @$(call install_copy, python24, 0, 0, 755, 
$(PYTHON24_INST_TMP)/stripped/usr/bin/smtpd.py, /usr/bin/smtpd.py, n)
    @$(call install_copy, python24, 0, 0, 755, 
$(PYTHON24_INST_TMP)/stripped/usr/bin/pydoc, /usr/bin/pydoc, n)

    @chmod u+w $(PYTHON24_INST_TMP)/stripped/usr/lib/libpython2.4.so.1.0
    @files=$$(cd "$(PYTHON24_INST_TMP)/stripped/usr/lib" && find -type f 
| sed "s/^\./\/usr\/lib/"); \
    for i in $$files; do \
        access=$$(stat -c "%a" $(PYTHON24_INST_TMP)/stripped$$i); \
        $(call install_copy, python24, 0, 0, $$access, 
$(PYTHON24_INST_TMP)/stripped$$i, $$i, y); \
    done
    @$(call install_link, python24, libpython2.4.so.1.0, 
/usr/lib/libpython2.4.so)

    # remove redundant files
    @find $(PYTHON24_INST_TMP)/notStripped/usr/lib/python2.4 -name 
"*.py"  | xargs rm -f
    @find $(PYTHON24_INST_TMP)/notStripped/usr/lib/python2.4 -name 
"*.pyo" | xargs rm -f
    @rm -fr $(PYTHON24_INST_TMP)/notStripped/usr/lib/python2.4/config
    @rm -fr $(PYTHON24_INST_TMP)/notStripped/usr/lib/python2.4/test

    @files=$$(cd "$(PYTHON24_INST_TMP)/notStripped" && find -type f | 
sed "s/^\.//"); \
    for i in $$files; do \
        access=$$(stat -c "%a" $(PYTHON24_INST_TMP)/notStripped$$i); \
        $(call install_copy, python24, 0, 0, $$access, 
$(PYTHON24_INST_TMP)/notStripped$$i, $$i, n); \
    done

    @$(call install_finish, python24)
    @$(call touch, $@)

[EMAIL PROTECTED] wrote:
>
> Hi List
>
> I have found a bug in python24.make for the targetinstall  target.
>
> Here is some output from whilst trying to compile for an ARM  target
>
> $ /home/wrap/ptxdist-svn-rev7259/bin/ptxdist targetinstall python24
>
> ------------------------------
> target: python24.targetinstall
> ------------------------------
>
> install_init: preparing for image creation...
> install_init:   @ARCH@ -> arm ... done
> install_fixup:  @PACKAGE@ -> python24 ... done.
> install_fixup:  @PRIORITY@ -> optional ... done.
> install_fixup:  @VERSION@ -> 2.4.2 ... done.
> install_fixup:  @SECTION@ -> base ... done.
> install_fixup:  @AUTHOR@ -> Robert Schwebel 
> <[EMAIL PROTECTED]> ... done.
> install_fixup:  @DEPENDS@ ->  ... done.
> install_fixup:  @DESCRIPTION@ -> missing ... done.
> rm -rf /home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp
> mkdir -p /home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp
> PATH=/home/wrap/pxaproj1/local-cross/bin:/home/wrap/pxaproj1/local-cross/sbin:/home/wrap/pxaproj1/local-host/bin:/home/wrap/pxaproj1/local-host/sbin:$PATH
>  
> make -C /home/wrap/pxaproj1/build-target/Python-2.4.2 
> HOSTPYTHON=""/home/wrap/pxaproj1/local"-host"/bin/python 
> HOSTPGEN=/Parser/pgen CROSS_COMPILE=yes \
>
>                 altbininstall 
> DESTDIR=/home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp
> make[1]: Entering directory 
> `/home/wrap/pxaproj1/build-target/Python-2.4.2'
> /Parser/pgen 
> /home/wrap/pxaproj1/build-target/Python-2.4.2/Grammar/Grammar 
> /home/wrap/pxaproj1/build-target/Python-2.4.2/Include/graminit.h 
> /home/wrap/pxaproj1/build-target/Python-2.4.2/Python/graminit.c
>
> make[1]: /Parser/pgen: Command not found
> make[1]: 
> [/home/wrap/pxaproj1/build-target/Python-2.4.2/Include/graminit.h] 
> Error 127 (ignored)
> Creating directory /usr/bin
> Creating directory /usr/lib
> /usr/bin/install -c python 
> /home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp/usr/bin/python2.4 
>
> if test -f libpython2.4.so; then \
>                 if test ".so" = .dll; then \
>                         /usr/bin/install -c -m 555 libpython2.4.so 
> /home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp/usr/bin; \
>
>                 else \
>                         /usr/bin/install -c -m 555 libpython2.4.so 
> /home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp/usr/lib/libpython2.4.so.1.0;
>  
> \
>
>                         if test libpython2.4.so != 
> libpython2.4.so.1.0; then \
>                                 (cd 
> /home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp/usr/lib; ln 
> -sf libpython2.4.so.1.0 libpython2.4.so); \
>
>                         fi \
>                 fi; \
>         else    true; \
>         fi
> make[1]: Leaving directory 
> `/home/wrap/pxaproj1/build-target/Python-2.4.2'
> umask 022 && \
>                 
> PATH=/home/wrap/pxaproj1/local-cross/bin:/home/wrap/pxaproj1/local-cross/sbin:/home/wrap/pxaproj1/local-host/bin:/home/wrap/pxaproj1/local-host/sbin:$PATH
>  
> make -C /home/wrap/pxaproj1/build-target/Python-2.4.2 
> HOSTPYTHON=""/home/wrap/pxaproj1/local"-host"/bin/python 
> HOSTPGEN=/Parser/pgen CROSS_COMPILE=yes \
>
>                 libinstall 
> DESTDIR=/home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp
> make[1]: Entering directory 
> `/home/wrap/pxaproj1/build-target/Python-2.4.2'
> /Parser/pgen 
> /home/wrap/pxaproj1/build-target/Python-2.4.2/Grammar/Grammar 
> /home/wrap/pxaproj1/build-target/Python-2.4.2/Include/graminit.h 
> /home/wrap/pxaproj1/build-target/Python-2.4.2/Python/graminit.c
>
> *<SNIP>---*
>
>  Leaving directory `/home/wrap/pxaproj1/build-target/Python-2.4.2'
> PATH=/home/wrap/pxaproj1/local-cross/bin:/home/wrap/pxaproj1/local-cross/sbin:/home/wrap/pxaproj1/local-host/bin:/home/wrap/pxaproj1/local-host/sbin:$PATH
>  
> make -C /home/wrap/pxaproj1/build-target/Python-2.4.2 
> HOSTPYTHON=""/home/wrap/pxaproj1/local"-host"/bin/python 
> HOSTPGEN=/Parser/pgen CROSS_COMPILE=yes \
>
>                 oldsharedinstall 
> DESTDIR=/home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp
> make[1]: Entering directory 
> `/home/wrap/pxaproj1/build-target/Python-2.4.2'
> make[1]: Leaving directory 
> `/home/wrap/pxaproj1/build-target/Python-2.4.2'
> # remove redundant files
> find 
> /home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp/usr/lib/python2.4 
> -name "*.py"  | xargs rm -f
> find 
> /home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp/usr/lib/python2.4 
> -name "*.pyo" | xargs rm -f
> rm -fr 
> /home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp/usr/lib/python2.4/config
>  
>
> rm -fr 
> /home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp/usr/lib/python2.4/test
>  
>
> files=$(cd /home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp 
> && find -type f | sed "s/^\.//"); \
>         for i in $files; do \
>                 access=$(stat -c "%a" 
> /home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp$i); \
>         PACKET=python24; OWN=0; GRP=0; PER=$access; 
> SRC=/home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp$i; 
> DST=$i; STRIP=""; if [ -z " $i" ]; then echo "install_copy:"; echo "  
> dir=$SRC"; echo "  owner=$OWN"; echo "  group=$GRP"; echo "  
> permissions=$PER"; install -d 
> /home/wrap/pxaproj1/images/$PACKET/ipkg/$SRC; if [ $? -ne 0 ]; then 
> echo "Error: install_copy failed!"; exit 1; fi; install -m $PER -d 
> /home/wrap/pxaproj1/root/$SRC; if [ $? -ne 0 ]; then echo "Error: 
> install_copy failed!"; exit 1; fi; install -m $PER -d 
> /home/wrap/pxaproj1/root-debug/$SRC; if [ $? -ne 0 ]; then echo 
> "Error: install_copy failed!"; exit 1; fi; mkdir -p 
> /home/wrap/pxaproj1/images/$PACKET; echo "f:$SRC:$OWN:$GRP:$PER" >> 
> /home/wrap/pxaproj1/state/$PACKET.perms; else echo "install_copy:"; 
> echo "  src=$SRC"; echo "  dst=$DST"; echo "  owner=$OWN"; echo "  
> group=$GRP"; echo "  permissions=$PER"; rm -fr 
> /home/wrap/pxaproj1/images/$PACKET/ipkg/$DST; install -D $SRC 
> /home/wrap/pxaproj1/images/$PACKET/ipkg/$DST; if [ $? -ne 0 ]; then 
> echo "Error: install_copy failed!"; exit 1; fi; install -m $PER -D 
> $SRC /home/wrap/pxaproj1/root$DST; if [ $? -ne 0 ]; then echo "Error: 
> install_copy failed!"; exit 1; fi; install -m $PER -D $SRC 
> /home/wrap/pxaproj1/root-debug$DST; if [ $? -ne 0 ]; then echo "Error: 
> install_copy failed!"; exit 1; fi; case "$STRIP" in (0 | n | no) ;; 
> (*) arm-linux-strip -R .note -R .comment 
> /home/wrap/pxaproj1/images/$PACKET/ipkg/$DST; if [ $? -ne 0 ]; then 
> echo "Error: install_copy failed!"; exit 1; fi; arm-linux-strip -R 
> .note -R .comment /home/wrap/pxaproj1/root$DST; if [ $? -ne 0 ]; then 
> echo "Error: install_copy failed!"; exit 1; fi; ;; esac; mkdir -p 
> /home/wrap/pxaproj1/images/$PACKET; echo "f:$DST:$OWN:$GRP:$PER" >> 
> /home/wrap/pxaproj1/state/$PACKET.perms; fi; \
>
>         done
> install_copy:
>   
> src=/home/wrap/pxaproj1/build-target/Python-2.4.2/install_temp/usr/bin/idle 
>
>   dst=/usr/bin/idle
>   owner=0
>   group=0
>   permissions=755
> arm-linux-strip: 
> /home/wrap/pxaproj1/images/python24/ipkg//usr/bin/idle: File format 
> not recognized
> Error: install_copy failed!
> make: *** [/home/wrap/pxaproj1/state/python24.targetinstall] Error 1
>
> error: a command in the pipe returned 2, bailing out
>
>
> *Here is an extract from rules/python24.make (targetinstall section) -*
>
> --------------------rules/python24.make-----------------
> <SNIP>...
> PYTHON24_INST_TMP := $(PYTHON24_DIR)/install_temp
>
> python24_targetinstall: $(STATEDIR)/python24.targetinstall
>
> $(STATEDIR)/python24.targetinstall: 
> $(python24_targetinstall_deps_default)
>         @$(call targetinfo, $@)
>
>         @$(call install_init, python24)
>         @$(call install_fixup, python24,PACKAGE,python24)
>         @$(call install_fixup, python24,PRIORITY,optional)
>         @$(call install_fixup, python24,VERSION,$(PYTHON24_VERSION))
>         @$(call install_fixup, python24,SECTION,base)
>         @$(call install_fixup, python24,AUTHOR,"Robert Schwebel 
> <[EMAIL PROTECTED]>")
>         @$(call install_fixup, python24,DEPENDS,)
>         @$(call install_fixup, python24,DESCRIPTION,missing)
>
>         rm -rf $(PYTHON24_INST_TMP)
>         mkdir -p $(PYTHON24_INST_TMP)
>
>         $(PYTHON24_PATH) make -C $(PYTHON24_DIR) $(PYTHON24_MAKEVARS) \
>                 altbininstall DESTDIR=$(PYTHON24_INST_TMP)
>
>         umask 022 && \
>                 $(PYTHON24_PATH) make -C $(PYTHON24_DIR) 
> $(PYTHON24_MAKEVARS) \
>                 libinstall DESTDIR=$(PYTHON24_INST_TMP)
>
>         $(PYTHON24_PATH) make -C $(PYTHON24_DIR) $(PYTHON24_MAKEVARS) \
>                 libainstall DESTDIR=$(PYTHON24_INST_TMP)
>
>         $(PYTHON24_PATH) make -C $(PYTHON24_DIR) $(PYTHON24_MAKEVARS) \
>                 sharedinstall DESTDIR=$(PYTHON24_INST_TMP)
>
>         $(PYTHON24_PATH) make -C $(PYTHON24_DIR) $(PYTHON24_MAKEVARS) \
>                 oldsharedinstall DESTDIR=$(PYTHON24_INST_TMP)
>
>         # remove redundant files
>         find $(PYTHON24_INST_TMP)/usr/lib/python2.4 -name "*.py"  | 
> xargs rm -f
>         find $(PYTHON24_INST_TMP)/usr/lib/python2.4 -name "*.pyo" | 
> xargs rm -f
>         rm -fr $(PYTHON24_INST_TMP)/usr/lib/python2.4/config
>         rm -fr $(PYTHON24_INST_TMP)/usr/lib/python2.4/test
>         files=$$(cd $(PYTHON24_INST_TMP) && find -type f | sed 
> "s/^\.//"); \
>         for i in $$files; do \
>                 access=$$(stat -c "%a" $(PYTHON24_INST_TMP)$$i); \
>        * BUG =>* $(call install_copy, python24, 0, 0, $$access, 
> $(PYTHON24_INST_TMP)$$i, $$i); \
>         done
>
>         @$(call install_finish, python24)
>         @$(call touch, $@)
>
> *<SNIP>*
> The problem comes in the indicated line in the for loop. Some of the 
> $$files are not genuine binaries
> which strip can recognizes(for example some compiled Python byte-code 
> files) so strip [arm-linux-strip
> in my run] bails out with an error.
>
> for i in $$files; do \
>                 access=$$(stat -c "%a" $(PYTHON24_INST_TMP)$$i); \
>        * BUG =>* $(call install_copy, python24, 0, 0, $$access, 
> $(PYTHON24_INST_TMP)$$i, $$i); \
> done
>
> So can some suggest how I can add some test/logic so that install_copy 
> macro is called with strip option (last argument) suppressed
>
> When $$file is not a genuine executable binary which strip can handle ?
>
> Thanks
> Graeme
>
> Dr Graeme N Brown
> Mobility Research R & V
>
> BT Group Chief Technology Office
> B28 pp 2B
> Adastral Park
> Ipswich
> Suffolk
> United Kingdom
> IP5 3RE
> ___________________________
> Office:     +44 (0) 1473 646931
> Fax :       +44 (0) 1473 646885
> Email:     [EMAIL PROTECTED]
>
> British Telecommunications plc
> Registered office: 81 Newgate Street London EC1A 7AJ
> Registered in England no. 1800000
> This electronic message contains information from British 
> Telecommunications plc which may be privileged or confidential. The 
> information is intended to be for the use of the individual(s) or 
> entity named above. If you are not the intended recipient be aware 
> that any disclosure, copying, distribution or use of the contents of 
> this information is prohibited. If you have received this electronic 
> message in error, please notify us by telephone or email (to the 
> numbers or address above) immediately.
>
> Activity and use of the British Telecommunications plc email system is 
> monitored to secure its effective operation and for other lawful 
> business purposes. Communications using this system will also be 
> monitored and may be recorded to secure effective operation and for 
> other lawful business purposes.
>
>



This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information.  If you have
received it in error, please notify the sender immediately and delete
the original.  Any other use of the email by you is prohibited.


This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information.  If you have
received it in error, please notify the sender immediately and delete
the original.  Any other use of the email by you is prohibited.

-- 
ptxdist mailing list
[email protected]

Reply via email to