<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">IMHO you don't have to set $(ARCH) for
      building rtems binaries if you have toolchain properly set.<br>
      Most of examples provided and all my application so far work ok
      with standard makefile (well, at least compilation succeeded and
      applications send some outputs to stdout) <br>
      ( so far I tried: i386-rtems4.11/pc386 and sparc-rtems4.11/sis in
      sis simulator, in qemu and on real cortex-m4 hardware)<br>
      <br>
      I can send you some C++ "hello world" application with makefile if
      you want<br>
      <br>
      Jiri<br>
      <br>
      On 30/10/12 11:01, Luca Cinquepalmi wrote:<br>
    </div>
    <blockquote cite="mid:508FB381.1040302@planetek.it" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">Jiri only one question:<br>
        where $(ARCH) is set? which file? thanks<br>
        <br>
            Luca<br>
        <br>
        On 10/30/2012 10:43 AM, Jiri Freyvald wrote:<br>
      </div>
      <blockquote cite="mid:508FA12E.7000702@gmail.com" type="cite">
        <meta content="text/html; charset=ISO-8859-1"
          http-equiv="Content-Type">
        <div class="moz-cite-prefix">Hi,<br>
          as I suggested in my previous reply - use existing C++ example
          (with its makefile) as a c++ template for your project.<br>
          Anyway,<br>
          here is the output of my makefile (c++ example):<br>
          <br>
          $ export PATH=/opt/rtems-4.11/bin:$PATH<br>
          $ export
          RTEMS_MAKEFILE_PATH=/opt/rtems-fw/sparc-rtems4.11/sis/<br>
          <br>
          $make clean all<br>
          rm -f a.out core mon.out gmon.out<br>
          rm -f -r <br>
          rm -f -r  a.out *.o *.BAK Depends-o-optimize.tmp<br>
          rm -f -r o-optimize o-debug<br>
          test -d o-optimize || mkdir o-optimize<br>
          sparc-rtems4.11-gcc --pipe
          -B/opt/rtems-fw/sparc-rtems4.11/sis/lib/ -specs bsp_specs
          -qrtems   -g -Wall  -O2 -g -g    -mcpu=cypress     -c   -o
          o-optimize/init.o init.c<br>
          sparc-rtems4.11-g++ -B/opt/rtems-fw/sparc-rtems4.11/sis/lib/
          -specs bsp_specs -qrtems   -g -Wall  -g    -mcpu=cypress    
          -c   -o o-optimize/main.o main.cc<br>
          sparc-rtems4.11-g++ -B/opt/rtems-fw/sparc-rtems4.11/sis/lib/
          -specs bsp_specs -qrtems   -g -Wall  -g    -mcpu=cypress      
          -mcpu=cypress   -o o-optimize/cxx_throw.exe  o-optimize/init.o
          o-optimize/main.o      <br>
          sparc-rtems4.11-nm -g -n o-optimize/cxx_throw.exe >
          o-optimize/cxx_throw.num<br>
          sparc-rtems4.11-size o-optimize/cxx_throw.exe<br>
             text       data        bss        dec        hex   
          filename<br>
           212608       2740      22960     238308      3a2e4   
          o-optimize/cxx_throw.exe<br>
          cp o-optimize/cxx_throw.exe o-optimize/cxx_throw.ralf<br>
          <br>
          it should help you<br>
          <br>
          Jiri<br>
          <br>
          <br>
          On 30/10/12 08:47, Luca Cinquepalmi wrote:<br>
        </div>
        <blockquote cite="mid:508F9404.3050201@planetek.it" type="cite">
          <meta content="text/html; charset=ISO-8859-1"
            http-equiv="Content-Type">
          <div class="moz-cite-prefix">Here I post a simple rtems C++
            code (template.cc) which works if<br>
            compiled as a C source file but not as a C++ file.<br>
            I'm using sparc-rtems4.11-g++ compiler. Are there particular
            compilation<br>
            flags I have to use? Is C++ template different from C one?
            Thanks a lot<br>
            <br>
                 Luca<br>
-------------------------------------------------------------------------------------------------------------------------<br>
          </div>
          <small>#define CONFIGURE_INIT<br>
            #include "system.h"<br>
            #include <cstdlib><br>
            <br>
            <br>
            extern "C" {<br>
              rtems_task Init(<br>
                rtems_task_argument arg<br>
              );<br>
            };<br>
            <br>
            /* Declare rtems tasks */<br>
            rtems_task Init (rtems_task_argument argument);            
                /* Declare entry point */<br>
            <br>
            #include "define.h"<br>
            #include "leon.h"<br>
            #include "utils.h"<br>
            #include "printSerial.h"<br>
            <br>
            rtems_task Init (rtems_task_argument argument)<br>
            {<br>
                printf("MY NAME IS LUCA!\n\r");<br>
                rtems_task_delete(RTEMS_SELF);<br>
            }</small><br>
-------------------------------------------------------------------------------------------------------------------------<br>
          My Makefile flags:<br>
          <br>
          CXX = sparc-rtems4.11-g++<br>
          BSP_PATH = /opt/$(INSTALL_POINT)/sparc-$(CCOMP)/leon2/lib<br>
          SPECS_PATH = $(BSP_PATH)/bsp_specs <br>
          <br>
          LD_LIBS += -lgcc -lm -msoft-float -lrtems++ -lstdc++<br>
          LD_PATH += -I../../include/leon -I../include -B$(BSP_PATH)
          -specs $(SPECS_PATH)<br>
          LDFLAGS += -mcpu=v8 -qrtems<br>
          CXXFLAGS += -msoft-float -mcpu=v8 $(LD_PATH)
          -Wno-write-strings<br>
          <br>
          <fieldset class="mimeAttachmentHeader"></fieldset>
          <br>
          <pre wrap="">_______________________________________________
rtems-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.rtems.org/mailman/listinfo/rtems-users">http://www.rtems.org/mailman/listinfo/rtems-users</a>
</pre>
        </blockquote>
        <br>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>