top level build problem c instead of "TARGET/c"

Frank Szczerba frank at
Wed May 31 13:20:55 UTC 2000

The Solaris sed does not understand the '\+' construct. The translation
could be done with sed under Solaris as either:
> echo c x xyzzy | /bin/sed -e 's%\([^ ]*\)%sparc-rtems/\1%g'
sparc-rtems/x sparc-rtems/x sparc-rtems/xyzzy

or (probably more correctly):
> echo c x xyzzy | /bin/sed -e 's%\([^ ]\{1,\}\)%sparc-rtems/\1%g'
sparc-rtems/x sparc-rtems/x sparc-rtems/xyzzy

Also, on the topic of top level build problems, the 'bit' script in
c_build_scripts-4.5.0-beta3.tgz does not check for success when it builds
the binutils. If the binutils make fails bit removes the build directory and
goes on to building gcc, which will of course fail without the binutils. My
fix was:

*** orig/bit    Mon May  8 14:43:20 2000
--- tools/bit   Tue May 16 14:57:41 2000
*** 163,168 ****
--- 163,169 ----
        echo "**** SKIPPING BUILD OF BINUTILS  ****"
        ${MAKE} all ${MAKE_DOCS} install
+       check_fatal $?  "**** FAILED **** base build (binutils)"

      cd ..

This seems to make things better. I also ran into a problem building gcc. At
some point it wants to do a fix-includes or something similar in the target
directory, but there are no include files there so it fails. It seems that
creating an empty $(INSTALL_POINT)/mips64orion-rtems/include directoy fixes
it. Perhaps this should be done in the bit script?

Last point (I promise): in
rtems-4.5.0-beta3/c/src/exec/sapi/include/confdefs.h it seems the console.h

*** orig/rtems-4.5.0-beta3/c/src/exec/sapi/include/confdefs.h   Fri May  5
08:57:14 2000
--- tools/rtems-4.5.0-beta3/c/src/exec/sapi/include/confdefs.h  Wed May 24
16:08:50 2000
*** 216,221 ****
--- 216,228 ----
  #include <stubdrv.h>

+ #include <console.h>
+ #endif
+ #include <clockdrv.h>
+ #endif


Frank Szczerba
Development Engineer
Woodward McCoach Inc
frank at

-----Original Message-----
From: Joel Sherrill <joel.sherrill at>
To: rtems-users at <rtems-users at>; Ralf Corsepius
<corsepiu at>
Date: Thursday, May 25, 2000 3:33 PM
Subject: top level build problem c instead of "TARGET/c"

>I have finally reproduced a problem reported multiple times
>on the list with beta's.  I have tracked down the
>cause to a specific spot and wanted some feedback on
>my proposed fix.
>Does this look familiar to you?
>make[1]: Leaving directory `/home/joel/b-rtems/tools'
>Making all in c
>/bin/bash: c: No such file or directory
>I got this on Solaris with CONFIG_SHELL settings of
>/bin/sh, ksh, and an old bash. It is because of this
>substitution in the top level Makefile:
>target_subdirs = c
>SUBDIRS = doc make tools c
>The "c" subdirectory should be "sparc-rtems/c" in
>both cases.  This is what is produced there when this
>works.  I tracked this down to the following
>sed in the top level
>TARGET_SUBDIRS=`echo "$target_subdirs" | \
> sed -e "s%\([^ ]\+\)%$target_alias/\1%g"`
>Basically sed on some OSes (Solaris in this case is broken).
>Look at the output of the following:
>$ echo c | /usr2/tools/bin/sed -e "s%\([^ ]\+\)%sparc-rtems/\1%g"
>$ echo c | /bin/sed -e "s%\([^ ]\+\)%sparc-rtems/\1%g"
>If you tripped this problem and the default sed in your
>path fails the above test, then I have explained the failure. :)
>My fix is to avoid sed.  This is what I ended up with:
>RCS file: /usr1/CVS/rtems/,v
>retrieving revision
>diff -u -r1.101.2.2
>--- 2000/05/08 18:59:18
>+++ 2000/05/25 19:21:50
>@@ -45,10 +45,10 @@
> if test "$target_alias" != "$host_alias"; then
>-TARGET_SUBDIRS=`echo "$target_subdirs" | \
>- sed -e "s%\([^ ]\+\)%$target_alias/\1%g"`
>+for t in $target_subdirs ; do
>+  TARGET_SUBDIRS="${TARGET_SUBDIRS} ${target_alias}/${t}"
> else
> TARGET_SUBDIRS="$target_subdirs"
> fi
>After applying this patch, you will need to run bootstrap.
>[Or edit the generated configure by hand to make the above
>Joel Sherrill, Ph.D.             Director of Research & Development
>joel at                 On-Line Applications Research
>Ask me about RTEMS: a free RTOS  Huntsville AL 35805
>   Support Available             (256) 722-9985

More information about the users mailing list