Skip to contentSkip to conversation

svn commit: trunk/buildroot: package

Buildroot ninevoltz at uclibc.org 4 participants 9 messages Mar 10, 2008 – Mar 11, 2008

lore
Share & tools
lore
#0 lore raw

Author: ninevoltz
Date: 2008-03-10 08:22:43 -0700 (Mon, 10 Mar 2008) New Revision: 21282

Log:
added dev files in target option

Modified:
trunk/buildroot/Config.in
trunk/buildroot/Makefile
trunk/buildroot/package/Makefile.autotools.in

Changeset:
Modified: trunk/buildroot/Config.in
===================================================================

buildroot/Config.in +7 -0
@@ -239,6 +239,13 @@
 	  If you say n here, your target will not contain any
 	  infopage.
 
+config BR2_TARGET_DEV_FILES
+	bool "Development files in target filesystem"
+	default n
+	help
+	  Install headers and static libraries in the
+	  target filesystem
+
 source package/gnuconfig/Config.in
 
 endmenu

Modified: trunk/buildroot/Makefile
===================================================================

buildroot/Makefile +16 -1
@@ -245,7 +245,7 @@
 # target stuff is last so it can override anything else
 include target/Makefile.in
 
-TARGETS+=erase-fakeroots
+TARGETS+=erase-fakeroots target-devfiles
 
 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
 TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS))
@@ -317,6 +317,21 @@
 erase-fakeroots:
 	rm -f $(PROJECT_BUILD_DIR)/.fakeroot*
 
+target-devfiles:
+ifeq ($(strip $(BR2_TARGET_DEV_FILES)),y)
+	cp -a $(STAGING_DIR)/usr/include $(TARGET_DIR)/usr
+	cp $(STAGING_DIR)/usr/lib/*.a $(TARGET_DIR)/usr/lib
+	cp $(STAGING_DIR)/lib/*.a $(TARGET_DIR)/lib
+	cp $(STAGING_DIR)/usr/lib/*.la $(TARGET_DIR)/usr/lib
+	cp $(STAGING_DIR)/lib/*.la $(TARGET_DIR)/lib
+else
+	rm -rf $(TARGET_DIR)/usr/include
+	find $(TARGET_DIR)/usr/lib -name '*.a' -delete
+	find $(TARGET_DIR)/lib -name '*.a' -delete
+	find $(TARGET_DIR)/usr/lib -name '*.la' -delete
+	find $(TARGET_DIR)/lib -name '*.la' -delete
+endif
+
 source: $(TARGETS_SOURCE) $(HOST_SOURCE)
 
 _source-check:

Modified: trunk/buildroot/package/Makefile.autotools.in
===================================================================

buildroot/package/Makefile.autotools.in +0 -4
@@ -230,10 +230,6 @@
 	$(if $(BR2_HAVE_INCLUDES),,for d in include; do \
 		rm -rf $(TARGET_DIR)/$$d $(TARGET_DIR)/usr/$$d; \
 	done)
-	find $(TARGET_DIR) -name '*.la' -delete
-	find $(TARGET_DIR)/lib -name '*.a' -delete
-	find $(TARGET_DIR)/usr/lib -name '*.a' -delete
-
 	touch $@
 
 $(BUILD_DIR)/%/.stamp_cleaned:
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"ninevoltz" == ninevoltz <[email protected]> writes:

ninevoltz> Author: ninevoltz
ninevoltz> Date: 2008-03-10 08:22:43 -0700 (Mon, 10 Mar 2008) ninevoltz> New Revision: 21282

ninevoltz> Log:
ninevoltz> added dev files in target option

Great! A few minor points though:

ninevoltz> +config BR2_TARGET_DEV_FILES
ninevoltz> + bool "Development files in target filesystem"

What about calling int BR2_HAVE_DEVFILES to match the info/make configs just above? Also remember to not use upper case in the bool description (E.G. bool "development files in .. ")

ninevoltz> +else
ninevoltz> + rm -rf $(TARGET_DIR)/usr/include
ninevoltz> + find $(TARGET_DIR)/usr/lib -name '*.a' -delete

Not that I really care, but is -delete supported by non-GNU find?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

----- Original Message -----
From: "Peter Korsgaard" <[email protected]>
To: <[email protected]>
Sent: Monday, March 10, 2008 5:24 PM
Subject: Re: [Buildroot] svn commit: trunk/buildroot: package

Quoted 18 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"ninevoltz" == ninevoltz <[email protected]> writes:

ninevoltz> Author: ninevoltz
ninevoltz> Date: 2008-03-10 08:22:43 -0700 (Mon, 10 Mar 2008) ninevoltz> New Revision: 21282

ninevoltz> Log:
ninevoltz> added dev files in target option

Great! A few minor points though:

ninevoltz> +config BR2_TARGET_DEV_FILES ninevoltz> + bool "Development files in target filesystem"

What about calling int BR2_HAVE_DEVFILES to match the info/make configs just above? Also remember to not use upper case in the bool description (E.G. bool "development files in .. ")

Quoted 7 lines

ninevoltz> +else
ninevoltz> + rm -rf $(TARGET_DIR)/usr/include ninevoltz> + find $(TARGET_DIR)/usr/lib -name '*.a' -delete

Not that I really care, but is -delete supported by non-GNU find?

What happens if you want *some* ".a" files in the target.
Didn't see the patch, just occured to me when I read this email.

Best Regards
Ulf Samuelsson

#3 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Ulf" == Ulf Samuelsson <[email protected]> writes:

Hi,

Ulf> What happens if you want *some* ".a" files in the target.
Ulf> Didn't see the patch, just occured to me when I read this email.

Is that a realistic situation? E.G. we also only have a global switch for man and info pages.

To me a global switch is nicer than all the per-package options we have now (and right now, certainly not all packages have dev support).

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Ulf" == Ulf Samuelsson <[email protected]> writes:

Hi,

Ulf> What happens if you want *some* ".a" files in the target.
Ulf> Didn't see the patch, just occured to me when I read this email.

Is that a realistic situation? E.G. we also only have a global switch for man and info pages.

Yes we are not perfect.

Quoted 6 lines

To me a global switch is nicer than all the per-package options we have now (and right now, certainly not all packages have dev support).

Signature · 1 line
Bye, Peter Korsgaard

I might be wrong, since I didn't look at the patch, but it looks to me that the patch will clean out the directory if unset.

If the switch is there, then the files should be copied to th target directory. If the switch was never there, then there should not be any such files in the target directory. If the switch was there and is unset then I think the directory should be cleaned out with an explicit command.

Best Regards
Ulf Samuelsson

#5 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Ulf" == Ulf Samuelsson <[email protected]> writes:

Hi,

Ulf> I might be wrong, since I didn't look at the patch, but it looks Ulf> to me that the patch will clean out the directory if unset.

Ulf> If the switch is there, then the files should be copied to th Ulf> target directory. If the switch was never there, then there Ulf> should not be any such files in the target directory. If the Ulf> switch was there and is unset then I think the directory should Ulf> be cleaned out with an explicit command.

Sure, that's the nicest approach. But it also means every package .mk needs to get fixed. This approach basically gives the same result with only 4 lines or so of code.

So the basic system is here, but it can be refined by adding HAVE_DEVFILES support to (library) packages (and the C library) one by one. Once that is done this "dirty" solution can be removed.

Or we can simply decide it isn't worth it and stick with the current solution.

Signature · 1 line
Bye, Peter Korsgaard
#6 lore raw

----- Original Message -----
From: "Peter Korsgaard" <[email protected]>
To: "Ulf Samuelsson" <[email protected]>
Cc: "Peter Korsgaard" <[email protected]>; <[email protected]>
Sent: Monday, March 10, 2008 10:26 PM
Subject: Re: [Buildroot] svn commit: trunk/buildroot: package

Quoted 17 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Ulf" == Ulf Samuelsson <[email protected]> writes:

Hi,

Ulf> I might be wrong, since I didn't look at the patch, but it looks Ulf> to me that the patch will clean out the directory if unset.

Ulf> If the switch is there, then the files should be copied to th Ulf> target directory. If the switch was never there, then there Ulf> should not be any such files in the target directory. If the Ulf> switch was there and is unset then I think the directory should Ulf> be cleaned out with an explicit command.

Sure, that's the nicest approach. But it also means every package .mk needs to get fixed. This approach basically gives the same result with only 4 lines or so of code.

Quoted 9 lines

So the basic system is here, but it can be refined by adding HAVE_DEVFILES support to (library) packages (and the C library) one by one. Once that is done this "dirty" solution can be removed.

Or we can simply decide it isn't worth it and stick with the current solution.

Signature · 1 line
Bye, Peter Korsgaard

Or add this to the Makefile:

nodevfiles:

            rm -rf $(TARGET_DIR)/usr/include
            find $(TARGET_DIR)/usr/lib -name '*.a' -delete

Then the user can make his own decisions.
The packages will not add any ".a" packages,
and none will be deleted, unless the user wishes them to be.

Best Regards
Ulf Samuelsson

#7 lore raw
Quoted 10 lines

nodevfiles:

            rm -rf $(TARGET_DIR)/usr/include

            find $(TARGET_DIR)/usr/lib -name '*.a' -delete

Then the user can make his own decisions.
The packages will not add any ".a" packages,
and none will be deleted, unless the user wishes them to be.

Provided he actually reads this mailling list. IMHO we already have too many magic targets.
Really, who, besides i386 will compile at the target?

Kind Regards,
Thiago A. Correa

#8 lore raw
Quoted 8 lines
Quoted 8 lines

nodevfiles:

            rm -rf $(TARGET_DIR)/usr/include
Quoted 8 lines
Quoted 5 lines
            find $(TARGET_DIR)/usr/lib -name '*.a' -delete

Then the user can make his own decisions.
The packages will not add any ".a" packages,
and none will be deleted, unless the user wishes them to be.

Provided he actually reads this mailling list. IMHO we already have too many magic targets.

If a separate configuration was added to clean out the directory, then that problem is solved.

Best Regards
Ulf Samuelsson