Re: [Xenomai-core] Patches: README.install examples/common for cross-compiling

2006-12-23 Thread Niklaus Giger
Am Freitag, 22. Dezember 2006 08:45 schrieb Wolfgang Grandegger:
 Hi Niklaus,

 Niklaus Giger wrote:
  Hi
 
  After switching my development environment to a MacMini and using the
  ELDK 4.0 I discovered that my examples for building using a
  cross-compiler for my PPC405 target were not correct. (Maybe a few of my
  previous problems were caused by not correctly specifying the target
  ARCH.)
 
  Also I would like to adapt and document the examples/common/Makefile to
  the needs for cross-compiling (KSRC/XENOCONFIG/DESTDIR useage). Also I
  added a target install to copy the generated application to
  $(DESTDIR)/usr/xenomai.

 Hm, I don't have examples/common/Makefile in my SVN Xenomai tree. And
Added by revision 1970 only. Makefile came from Jan for my example 
hw_direct_io.
 /usr/xenomai should be the configurable.
Does the attached patch look better for you (using EXEC_PREFIX) ?

Best regards

-- 
Niklaus Giger
Index: examples/common/Makefile
===
--- examples/common/Makefile	(Revision 1980)
+++ examples/common/Makefile	(Arbeitskopie)
@@ -3,9 +3,9 @@
 ### List of applications to be build
 APPLICATIONS = hw_direct_io
 
-### Note: to override the search path for the xeno-config script, use make XENO=...
+### Note: to override the search path for the xeno-config script, use make XENOCONFIG=...
+### Note: if you installed it into a non standard place add DESTDIR=/path/to/installed/xenomai
 
-
 ### List of modules to be build
 MODULES =
 
@@ -14,6 +14,8 @@
 
 ### Note: to override the kernel source path, use make KSRC=...
 
+# default place to install the resulting binaries
+EXEC_PREFIX := $(DESTDIR)/usr/xenomai/bin
 
 
 ## USER SPACE BUILD (no change required normally) ##
@@ -24,7 +26,9 @@
 ### Sanity check
 ifeq ($(XENOCONFIG),)
 all::
-	@echo  Invoke make like this: \make XENO=/path/to/xeno-config\ 
+	@echo  Invoke make like this: \make XENOCONFIG=/path/to/xeno-config\ 
+	@echo  add KSRC=.. to override the default kernel source at /lib/modules/$(shell uname -r)/build 
+	@echo  add DESTDIR=/path/to/installed/xenomai if you installed it into a non standard place 
 	@echo
 endif
 
@@ -40,6 +44,9 @@
 clean::
 	$(RM) $(APPLICATIONS) *.o
 
+install::   $(APPLICATIONS)
+	cp $(APPLICATIONS) $(EXEC_PREFIX)/
+
 endif
 
 
@@ -80,3 +87,4 @@
 	$(RM) -R .tmp*
 
 endif
+
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] Patches: README.install examples/common for cross-compiling

2006-12-21 Thread Wolfgang Denk
Dear Niklaus,

in message [EMAIL PROTECTED] you wrote:

 -PowerPC-405-based system:
 +PowerPC-405-based system (assuming an ELDK cross-compiler and a 2.6.14 
 kernel)
 ^^^
 This...

 +$ build_root /path/to/build-powerpc-405-2.6.14
 +$ mkdir $build_root
 +$ make ARCH=ppc CROSS_COMPILE=powerpc-405-linux-gnu- O=$build_root 
 xconfig/gconfig/menuconfig 
   
...
 +$ make ARCH=ppc CROSS_COMPILE=powerpc-405-linux-gnu- O=$build_root bzImage 
 modules 
   
...
 +$ $xenomai_root/configure --build=i686-linux --host=powerpc-405-linux-gnu 
 CC=ppc_4xx-gcc CXX=ppc_4xx-g++ LD=ppc_4xx-ld
   

...and this seems contradictory to me. If you use the ELDK, then it's
CROSS_COMPILE=ppc_4xx-;  also,  I  would  expect   that   you   set
--target=powerpc-linux.  I mean, with ELDK, powerpc-405-linux-gnu
will neither work as CROSS_COMPILE prefix, nor as  a  host  /  target
name.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
People are always a lot more complicated than you  think.  It's  very
important to remember that. - Terry Pratchett, _Truckers_

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] Patches: README.install examples/common for cross-compiling

2006-12-21 Thread Wolfgang Grandegger

Hi Niklaus,

Niklaus Giger wrote:

Hi

After switching my development environment to a MacMini and using the ELDK 4.0 
I discovered that my examples for building using a cross-compiler for my 
PPC405 target were not correct. (Maybe a few of my previous problems were 
caused by not correctly specifying the target ARCH.)


Also I would like to adapt and document the examples/common/Makefile to the 
needs for cross-compiling (KSRC/XENOCONFIG/DESTDIR useage). Also I added a 
target install to copy the generated application to $(DESTDIR)/usr/xenomai.


Hm, I don't have examples/common/Makefile in my SVN Xenomai tree. And 
/usr/xenomai should be the configurable.



Could someone please commit these (or a improved version of it) patches?



Thanks in advance





Index: examples/common/Makefile
===
--- examples/common/Makefile(Revision 1970)
+++ examples/common/Makefile(Arbeitskopie)
@@ -3,9 +3,9 @@
 ### List of applications to be build
 APPLICATIONS = hw_direct_io
 
-### Note: to override the search path for the xeno-config script, use make XENO=...

+### Note: to override the search path for the xeno-config script, use make 
XENOCONFIG=...
+### Note: if you installed it into a non standard place add 
DESTDIR=/path/to/installed/xenomai
 
-

 ### List of modules to be build
 MODULES =
 
@@ -24,7 +24,9 @@

 ### Sanity check
 ifeq ($(XENOCONFIG),)
 all::
-   @echo  Invoke make like this: \make XENO=/path/to/xeno-config\ 

+   @echo  Invoke make like this: \make XENOCONFIG=/path/to/xeno-config\ 

+   @echo  add KSRC=.. to override the default kernel source at /lib/modules/$(shell 
uname -r)/build 
+   @echo  add DESTDIR=/path/to/installed/xenomai if you installed it into a non 
standard place 
@echo
 endif
 
@@ -40,6 +42,9 @@

 clean::
$(RM) $(APPLICATIONS) *.o
 
+install:   $(APPLICATIONS)

+   cp $(APPLICATIONS) $(DESTDIR)/usr/xenomai/bin
+
 endif
 
 
@@ -80,3 +85,4 @@

$(RM) -R .tmp*
 
 endif

+




Index: README.INSTALL
===
--- README.INSTALL  (Revision 1957)
+++ README.INSTALL  (Arbeitskopie)
@@ -276,19 +276,20 @@
 -
 
 A typical cross-compilation setup, in order to build Xenomai for a

-PowerPC-405-based system:
+PowerPC-405-based system (assuming an ELDK cross-compiler and a 2.6.14 kernel)
 
 $ $xenomai_root/scripts/prepare-kernel.sh --arch=powerpc \

   
--adeos=$xenomai_root/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.14-ppc-X.Y-ZZ.patch
 \
   --linux=$linux_tree


For the time beeing, we must distinguish between --arch=ppc (ARCH=ppc) 
and --arch=powerpc (ARCH=powerpc). The latter is not yet supported.



 $ cd $linux_tree
-$ mkdir ../build-powerpc-405-2.6.14
-$ make ARCH=ppc CROSS_COMPILE=powerpc-405-linux-gnu- O=../build-powerpc-405-2.6.14 xconfig/gconfig/menuconfig 


For the ELDK CROSS_COMPILE must be ppc_4xx- for AMCC 4xx processors.


+$ build_root /path/to/build-powerpc-405-2.6.14
+$ mkdir $build_root
+$ make ARCH=ppc CROSS_COMPILE=powerpc-405-linux-gnu- O=$build_root xconfig/gconfig/menuconfig 
 # select the kernel and Xenomai options
-$ make ARCH=ppc CROSS_COMPILE=powerpc-405-linux-gnu- O=../build-powerpc-405-2.6.14 bzImage modules 
+$ make ARCH=ppc CROSS_COMPILE=powerpc-405-linux-gnu- O=$build_root bzImage modules 
 # then install as needed

-$ mkdir $build_root  cd $build_root
-$ $xenomai_root/configure --build=i686-linux --host=powerpc-405-linux-gnu
+$ cd $build_root
+$ $xenomai_root/configure --build=i686-linux --host=powerpc-405-linux-gnu 
CC=ppc_4xx-gcc CXX=ppc_4xx-g++ LD=ppc_4xx-ld


   $ $xenomai_root/configure --host=ppc-linux

   already works fine for all ELDK tool chains. The --prefix should also
   be configurable.


 $ make install
 
 2.3 Building for the IPF





___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core



___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core