Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] svn commit: trunk/buildroot:  package/config
@ 2007-07-08  0:00 aldot at uclibc.org
  2007-07-08  0:10 ` [Buildroot] improved deps [was Re: svn commit: trunk/buildroot: package/config] Bernhard Fischer
  0 siblings, 1 reply; 3+ messages in thread
From: aldot at uclibc.org @ 2007-07-08  0:00 UTC (permalink / raw)
  To: buildroot

Author: aldot
Date: 2007-07-07 17:00:17 -0700 (Sat, 07 Jul 2007)
New Revision: 19025

Log:
- silence a cosmetic warning (closes several issues in mantis).
  This also provides a nice up-to-date filestamp if something got reconfigured (e.g. c++ support got toggled) that can be used in the future to depend accordingly.


Modified:
   trunk/buildroot/Makefile
   trunk/buildroot/package/config/confdata.c
   trunk/buildroot/package/config/kconfig-to-buildroot2.patch


Changeset:
Modified: trunk/buildroot/Makefile
===================================================================
--- trunk/buildroot/Makefile	2007-07-07 23:55:19 UTC (rev 19024)
+++ trunk/buildroot/Makefile	2007-07-08 00:00:17 UTC (rev 19025)
@@ -84,7 +84,7 @@
 HOSTCXX:=$(shell $(CONFIG_SHELL) which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++)
 HOSTLD:=$(shell $(CONFIG_SHELL) which $(HOSTLD) || type -p $(HOSTLD) || echo ld)
 ifndef CFLAGS_FOR_BUILD
-CFLAGS_FOR_BUILD:="-g -O2"
+CFLAGS_FOR_BUILD:=-g -O2
 endif
 export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD
 
@@ -264,40 +264,61 @@
 # ---------------------------------------------------------------------------
 
 $(CONFIG)/conf:
-	$(MAKE) CC="$(HOSTCC)" CFLAGS=$(CFLAGS_FOR_BUILD) MAKECMDGOALS="$(MAKECMDGOALS)" \
+	$(MAKE) CC="$(HOSTCC)" HOSTCFLAGS="$(CFLAGS_FOR_BUILD)" MAKECMDGOALS="$(MAKECMDGOALS)" \
 		-C $(CONFIG) conf
 	- at if [ ! -f .config ] ; then \
 		cp $(CONFIG_DEFCONFIG) .config; \
 	fi
 $(CONFIG)/mconf:
-	$(MAKE) CC="$(HOSTCC)" CFLAGS=$(CFLAGS_FOR_BUILD) MAKECMDGOALS="$(MAKECMDGOALS)" \
+	$(MAKE) CC="$(HOSTCC)" HOSTCFLAGS="$(CFLAGS_FOR_BUILD)" MAKECMDGOALS="$(MAKECMDGOALS)" \
 		-C $(CONFIG) conf mconf
 	- at if [ ! -f .config ] ; then \
 		cp $(CONFIG_DEFCONFIG) .config; \
 	fi
 
 menuconfig: $(CONFIG)/mconf
-	@$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
+	@-mkdir -p include/config
+	@KCONFIG_AUTOCONFIG=include/config/auto.conf \
+		KCONFIG_AUTOHEADER=include/autoconf.h \
+		$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
 
 config: $(CONFIG)/conf
-	@$(CONFIG)/conf $(CONFIG_CONFIG_IN)
+	@-mkdir -p include/config
+	@KCONFIG_AUTOCONFIG=include/config/auto.conf \
+		KCONFIG_AUTOHEADER=include/autoconf.h \
+		$(CONFIG)/conf $(CONFIG_CONFIG_IN)
 
 oldconfig: $(CONFIG)/conf
-	@$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
+	@-mkdir -p include/config
+	@KCONFIG_AUTOCONFIG=include/config/auto.conf \
+		KCONFIG_AUTOHEADER=include/autoconf.h \
+		$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
 
 randconfig: $(CONFIG)/conf
-	@$(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
+	@-mkdir -p include/config
+	@KCONFIG_AUTOCONFIG=include/config/auto.conf \
+		KCONFIG_AUTOHEADER=include/autoconf.h \
+		$(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
 
 allyesconfig: $(CONFIG)/conf
-	cp $(CONFIG_DEFCONFIG) .config
-	@$(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
+	cat $(CONFIG_DEFCONFIG) > .config
+	@-mkdir -p include/config
+	@KCONFIG_AUTOCONFIG=include/config/auto.conf \
+		KCONFIG_AUTOHEADER=include/autoconf.h \
+		$(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
 	#sed -i -e "s/^CONFIG_DEBUG.*/# CONFIG_DEBUG is not set/" .config
 
 allnoconfig: $(CONFIG)/conf
-	@$(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
+	@-mkdir -p include/config
+	@KCONFIG_AUTOCONFIG=include/config/auto.conf \
+		KCONFIG_AUTOHEADER=include/autoconf.h \
+		$(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
 
 defconfig: $(CONFIG)/conf
-	@$(CONFIG)/conf -d $(CONFIG_CONFIG_IN)
+	@-mkdir -p include/config
+	@KCONFIG_AUTOCONFIG=include/config/auto.conf \
+		KCONFIG_AUTOHEADER=include/autoconf.h \
+		$(CONFIG)/conf -d $(CONFIG_CONFIG_IN)
 
 # check if download URLs are outdated 
 source-check: allyesconfig

Modified: trunk/buildroot/package/config/confdata.c
===================================================================
--- trunk/buildroot/package/config/confdata.c	2007-07-07 23:55:19 UTC (rev 19024)
+++ trunk/buildroot/package/config/confdata.c	2007-07-08 00:00:17 UTC (rev 19025)
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
+#include <libgen.h>
 
 #define LKC_DIRECT_LINK
 #include "lkc.h"
@@ -529,7 +530,7 @@
 
 int conf_split_config(void)
 {
-	char *name, path[128];
+	char *name, path[128], *opwd, *dir, *_name;
 	char *s, *d, c;
 	struct symbol *sym;
 	struct stat sb;
@@ -540,8 +541,20 @@
 		name = "include/config/auto.conf";
 	conf_read_simple(name, S_DEF_AUTO);
 
-	if (chdir("include/config"))
+	opwd = malloc(256);
+	_name = strdup(name);
+	if (opwd == NULL || _name == NULL)
 		return 1;
+	opwd = getcwd(opwd, 256);
+	dir = dirname(_name);
+	if (dir == NULL) {
+		res = 1;
+		goto err;
+	}
+	if (chdir(dir)) {
+		res = 1;
+		goto err;
+	}
 
 	res = 0;
 	for_all_symbols(i, sym) {
@@ -634,9 +647,11 @@
 		close(fd);
 	}
 out:
-	if (chdir("../.."))
-		return 1;
-
+	if (chdir(opwd))
+		res = 1;
+err:
+	free(opwd);
+	free(_name);
 	return res;
 }
 

Modified: trunk/buildroot/package/config/kconfig-to-buildroot2.patch
===================================================================
--- trunk/buildroot/package/config/kconfig-to-buildroot2.patch	2007-07-07 23:55:19 UTC (rev 19024)
+++ trunk/buildroot/package/config/kconfig-to-buildroot2.patch	2007-07-08 00:00:17 UTC (rev 19025)
@@ -667,3 +667,60 @@
  
  	if (conf_split_config())
  		return 1;
+diff -rdup x/config/confdata.c package/config/confdata.c
+--- x/config/confdata.c	2007-07-07 11:13:12.000000000 +0200
++++ package/config/confdata.c	2007-07-08 01:30:44.000000000 +0200
+@@ -11,6 +11,7 @@
+ #include <string.h>
+ #include <time.h>
+ #include <unistd.h>
++#include <libgen.h>
+ 
+ #define LKC_DIRECT_LINK
+ #include "lkc.h"
+@@ -529,7 +530,7 @@ int conf_write(const char *name)
+ 
+ int conf_split_config(void)
+ {
+-	char *name, path[128];
++	char *name, path[128], *opwd, *dir, *_name;
+ 	char *s, *d, c;
+ 	struct symbol *sym;
+ 	struct stat sb;
+@@ -540,8 +541,20 @@ int conf_split_config(void)
+ 		name = "include/config/auto.conf";
+ 	conf_read_simple(name, S_DEF_AUTO);
+ 
+-	if (chdir("include/config"))
++	opwd = malloc(256);
++	_name = strdup(name);
++	if (opwd == NULL || _name == NULL)
+ 		return 1;
++	opwd = getcwd(opwd, 256);
++	dir = dirname(_name);
++	if (dir == NULL) {
++		res = 1;
++		goto err;
++	}
++	if (chdir(dir)) {
++		res = 1;
++		goto err;
++	}
+ 
+ 	res = 0;
+ 	for_all_symbols(i, sym) {
+@@ -634,9 +647,11 @@ int conf_split_config(void)
+ 		close(fd);
+ 	}
+ out:
+-	if (chdir("../.."))
+-		return 1;
+-
++	if (chdir(opwd))
++		res = 1;
++err:
++	free(opwd);
++	free(_name);
+ 	return res;
+ }
+ 

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

* [Buildroot] improved deps [was Re: svn commit: trunk/buildroot: package/config]
  2007-07-08  0:00 [Buildroot] svn commit: trunk/buildroot: package/config aldot at uclibc.org
@ 2007-07-08  0:10 ` Bernhard Fischer
  2007-07-08 12:59   ` Bernhard Fischer
  0 siblings, 1 reply; 3+ messages in thread
From: Bernhard Fischer @ 2007-07-08  0:10 UTC (permalink / raw)
  To: buildroot

On Sat, Jul 07, 2007 at 05:00:18PM -0700, aldot at uclibc.org wrote:
>Author: aldot
>Date: 2007-07-07 17:00:17 -0700 (Sat, 07 Jul 2007)
>New Revision: 19025
>
>Log:
>- silence a cosmetic warning (closes several issues in mantis).
>  This also provides a nice up-to-date filestamp if something got reconfigured (e.g. c++ support got toggled) that can be used in the future to depend accordingly.

e.g.:
Index: toolchain/gcc/gcc-uclibc-4.x.mk
===================================================================
--- toolchain/gcc/gcc-uclibc-4.x.mk	(revision 19022)
+++ toolchain/gcc/gcc-uclibc-4.x.mk	(working copy)
@@ -48,10 +48,14 @@ endif
 #
 #############################################################
 
+GCC_TARGET_PREREQ =
+GCC_STAGING_PREREQ= $(STAGING_DIR)/usr/lib/libc.a
+
 GCC_TARGET_LANGUAGES:=c
 
 ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
 GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),c++
+GCC_TARGET_PREREQ += $(BASE_DIR)/include/config/br2/install/libstdcpp.h
 endif
 
 ifeq ($(BR2_INSTALL_LIBGCJ),y)
@@ -62,9 +66,6 @@ ifeq ($(BR2_INSTALL_OBJC),y)
 GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),objc
 endif
 
-GCC_TARGET_PREREQ =
-GCC_STAGING_PREREQ= $(STAGING_DIR)/usr/lib/libc.a
-
 ifndef GCC_NO_MPFR
 GCC_WITH_HOST_GMP=--with-gmp=$(GMP_HOST_DIR)
 GCC_WITH_HOST_MPFR=--with-mpfr=$(MPFR_HOST_DIR)
@@ -75,6 +76,7 @@ GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGU
 #GCC_STAGING_PREREQ+= $(TOOL_BUILD_DIR)/mpfr/lib/libmpfr.so
 GCC_WITH_TARGET_GMP=--with-gmp="$(GMP_TARGET_DIR)"
 GCC_WITH_TARGET_MPFR=--with-mpfr="$(MPFR_TARGET_DIR)"
+GCC_TARGET_PREREQ += $(BASE_DIR)/include/config/br2/install/fortran.h
 endif
 endif # ifndef GCC_NO_MPFR

or the like. This potentially fixes the situation where you previously
could not really do a full build, then turn e.g. c++ support on and
execute make again. Patches welcome.

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

* [Buildroot] improved deps [was Re: svn commit: trunk/buildroot: package/config]
  2007-07-08  0:10 ` [Buildroot] improved deps [was Re: svn commit: trunk/buildroot: package/config] Bernhard Fischer
@ 2007-07-08 12:59   ` Bernhard Fischer
  0 siblings, 0 replies; 3+ messages in thread
From: Bernhard Fischer @ 2007-07-08 12:59 UTC (permalink / raw)
  To: buildroot

On Sun, Jul 08, 2007 at 02:10:49AM +0200, Bernhard Fischer wrote:
>On Sat, Jul 07, 2007 at 05:00:18PM -0700, aldot at uclibc.org wrote:
>>Author: aldot
>>Date: 2007-07-07 17:00:17 -0700 (Sat, 07 Jul 2007)
>>New Revision: 19025
>>
>>Log:
>>- silence a cosmetic warning (closes several issues in mantis).
>>  This also provides a nice up-to-date filestamp if something got reconfigured (e.g. c++ support got toggled) that can be used in the future to depend accordingly.
>
>e.g.:

I have applied this as an example for gcc as r19034.
A more generic way would be in order, e.g. emit a file that can be
pulled in that looks like (pseudo pathes):

/obj/buildroot/toolchain_build_i386/gcc-4.2.0-final/.configured: \
	/obj/buildroot/build_i386/include/config/br2/install/fortran.h

/obj/buildroot/toolchain_build_i386/uClibc/.configured: \
	/obj/buildroot/build_i386/include/config/br2/uclibc/feature1.h \
	/obj/buildroot/build_i386/include/config/br2/uclibc/feature2.h \
	/obj/buildroot/build_i386/include/config/br2/uclibc/feature3.h

I leave the impl of the above to the curious reader :P

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

end of thread, other threads:[~2007-07-08 12:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-08  0:00 [Buildroot] svn commit: trunk/buildroot: package/config aldot at uclibc.org
2007-07-08  0:10 ` [Buildroot] improved deps [was Re: svn commit: trunk/buildroot: package/config] Bernhard Fischer
2007-07-08 12:59   ` Bernhard Fischer

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