Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Customize package makefile seems broken
@ 2010-01-07 21:22 Grant Edwards
  2010-01-08  7:59 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Grant Edwards @ 2010-01-07 21:22 UTC (permalink / raw)
  To: buildroot

I'm attempting to use the "customize" package to get
libgcc_s.so files into my target filesystem, and it doesn't
seem to work.  I put files into the package like so:

   $ tree customize
   customize
   |-- Config.in
   |-- customize.mk
   `-- source
       |-- asdf
       `-- lib
           |-- foobar
           |-- libgcc.a
           |-- libgcc_eh.a
           |-- libgcc_s.so
           `-- libgcc_s.so.1
        
But what ends up on my target filesystem is

  /asdf
  /lib/lib/libgcc_s.so
  /lib/lib/libgcc_s.so.1
  /lib/lib/foobar

The two .a files vanish, and the other files that I expect to
find in /lib end up in /lib/lib.  I haven't figured out why two
of the 6 files aren't getting copied, but the mislocation
appears to be due to a bug in customize.mk:

     1	#############################################################
     2	#
     3	# Any custom stuff you feel like doing....
     4	#
     5	#############################################################
     6	CUST_DIR:=package/customize/source
     7	
     8	$(BUILD_DIR)/.customize:
     9		rm -f $(BUILD_DIR)/series
    10		(cd $(CUST_DIR); \
    11		 /bin/ls -d * > $(BUILD_DIR)/series || \
    12		 touch $(BUILD_DIR)/series )
    13		for f in `cat $(BUILD_DIR)/series`; do \
    14			cp -af $(CUST_DIR)/$$f $(TARGET_DIR)/$$f; \
    15		done
    16		rm -f $(BUILD_DIR)/series
    17		touch $@

Line 14 doesn't work right if there are any pre-existing
directories in the target directory.  In my case it ends up
doing:

   cp -af package/custom/source/lib output/target/lib

That results in files ending up in /lib/lib instead of /lib

Shouldn't line 14 specify the bare target_dir (and not
specify a target filename)?  Copy a file will still work the
same (since the destination is known to be a directory), and
now copying a directory will work when it didn't used to:

    14                  cp -af $(CUST_DIR)/$$f $(TARGET_DIR)/; \

Or an I not understanding how the customize package is supposed
to be used?    

-- 
Grant Edwards                   grante             Yow! I wish I was a
                                  at               sex-starved manicurist
                               visi.com            found dead in the Bronx!!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] Customize package makefile seems broken
  2010-01-07 21:22 [Buildroot] Customize package makefile seems broken Grant Edwards
@ 2010-01-08  7:59 ` Thomas Petazzoni
  2010-01-08 15:38   ` Grant Edwards
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2010-01-08  7:59 UTC (permalink / raw)
  To: buildroot

Le Thu, 7 Jan 2010 21:22:42 +0000 (UTC),
Grant Edwards <grant.b.edwards@gmail.com> a ?crit :

> I haven't figured out why two of the 6 files aren't getting copied,
> but the mislocation appears to be due to a bug in customize.mk:

Because *.a files are removed from $(TARGET_DIR) as a final cleanup.

See target-finalize: in the main Makefile:

target-finalize:
ifeq ($(BR2_HAVE_DEVFILES),y)
        ( scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) )
else
        rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib/pkgconfig
        find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
        find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
endif

Sincerly,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] Customize package makefile seems broken
  2010-01-08  7:59 ` Thomas Petazzoni
@ 2010-01-08 15:38   ` Grant Edwards
  0 siblings, 0 replies; 3+ messages in thread
From: Grant Edwards @ 2010-01-08 15:38 UTC (permalink / raw)
  To: buildroot

On 2010-01-08, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:
> Le Thu, 7 Jan 2010 21:22:42 +0000 (UTC),
> Grant Edwards <grant.b.edwards@gmail.com> a ??crit :
>
>> I haven't figured out why two of the 6 files aren't getting
>> copied, but the mislocation appears to be due to a bug in
>> customize.mk:
>
> Because *.a files are removed from $(TARGET_DIR) as a final
> cleanup.
>
> See target-finalize: in the main Makefile:

Thanks, that's what I had decided after adding some debuging
"echos" to the customize makefile.  I hadn't tracked down
exactly where it was done (since it turns out I didn't actually
need the .a files in question).

The mtd utilities and u-boot env utilities are now building
cleaning and will run on the target.  [They don't actually
work, but I think that's a kernel problem with mtd support.]

-- 
Grant Edwards                   grante             Yow! My mind is a potato
                                  at               field ...
                               visi.com            

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-08 15:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-07 21:22 [Buildroot] Customize package makefile seems broken Grant Edwards
2010-01-08  7:59 ` Thomas Petazzoni
2010-01-08 15:38   ` Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox