This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

seeing limits.h from newlib




Hi,

The system limits.h for RTEMS is included with newlib.  There is an
ordering problem on the build that requires a manual installation of this
file before gcc is built.  If you do not do this, then the limits.h
generated by gcc does not include the system's limits.h.  The Makefile.in
stanza in question is:

# Build the version of limits.h that we will install.
xlimits.h: glimits.h limitx.h limity.h
        if $(LIMITS_H_TEST) ; then \
          cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h >
tmp-xlimits.h; \
        else \
          cat $(srcdir)/glimits.h > tmp-xlimits.h; \
        fi
        mv tmp-xlimits.h xlimits.h

I would like to come up with a way to avoid this ordering problem.  It
trips every RTEMS user who tries to build the toolset without using my
script.  If you simply following the standard "configure/make"
instructions, then it won't work because of this wart.  Here are my ideas:

1. Move the RTEMS limits.h into gcc (out of newlib) and do something like
   this: 

  t-rtems: LIMITS_H_TEST = true
           SYSTEM_LIMITS_H = $(srcdir)/config/limits-rtems.h

  cat $(srcdir)/limitx.h $(srcdir)/glimits.h \
      $(SYSTEM_LIMITS_H) $(srcdir)/limity.h >tmp-xlimits.h;

  Honestly, I like this way because it really has minimal impact and
  reduces the number of include files at the install point.

2.  Another approach would be to reach "up and over" into newlib to get
    the file and install it at this point.  I don't like this because 
    (1) it feels wrong to install a file at this point, and
    (2) you would have to know this path:
           newlib-VERSION/newlib/libc/sys/rtems/include/limits.h
        The VERSION and OS parts of that might be tough to grab in a 
        generic way.

3.  Something different I have not thought of.

Comments appreciated.
         

--joel
Joel Sherrill                    Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985