config/libc.in
author Oron Peled <oron@actcom.co.il>
Mon Aug 03 00:49:25 2009 +0200 (2009-08-03)
changeset 1449 8ad2773e7ae3
parent 1178 41a84f7d3b4f
child 1371 802c132f1f71
permissions -rw-r--r--
[complib:mpfr] Fix building MPFR in some weird cases

The tmul test uses a compiled-in input file in $(srcdir).
The problem is that the Makefile passes it unquoted. The C code
tries to stringify it using clever macros, which may *usually* work.

In my case the source directory was named:
.../toolchain-powerpc-e500v2-linux-gnuspe-1.0-2.fc10/.../tests
And guess what? During testing I found out the program fails because
it tries to open:
.../toolchain-powerpc-e500v2-1-gnuspe-1.0-2.fc10/.../tests

Yes, CPP tokenized the macro before stringifying it and not surprisingly
the 'linux' part was converted to 1.
[on Fedora-10: cpp (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7)]

So the attached patch simplify the macros and pass the path as string
from the Makefile.
     1 # C library options
     2 
     3 config LIBC
     4     string
     5     default "none" if BARE_METAL
     6 
     7 menu "C-library"
     8 
     9 config LIBC_VERSION
    10     string
    11     help
    12       Enter the date of the snapshot you want to use in the form: YYYYMMDD
    13       where YYYY is the 4-digit year, MM the 2-digit month and DD the 2-digit
    14       day in the month.
    15       
    16       Please note:
    17       - glibc has snapshots done every monday, and only the last ten are kept.
    18       - uClibc has daily snapshots, and only the last 30-or-so are kept.
    19       
    20       So if you want to be able to re-build your toolchain later, you will
    21       have to save your C library tarball by yourself.
    22 
    23 source config.gen/libc.in
    24 
    25 comment "Common C library options"
    26 
    27 config LIBC_SUPPORT_NPTL
    28     bool
    29     default n
    30 
    31 config LIBC_SUPPORT_LINUXTHREADS
    32     bool
    33     default n
    34 
    35 config THREADS
    36     string
    37     default "nptl"          if THREADS_NPTL
    38     default "linuxthreads"  if THREADS_LINUXTHREADS
    39     default "none"          if THREADS_NONE
    40 
    41 choice
    42     bool
    43     prompt "Threading implementation to use:"
    44     default THREADS_NPTL           if LIBC_SUPPORT_NPTL
    45     default THREADS_LINUXTHREADS   if LIBC_SUPPORT_LINUXTHREADS && ! LIBC_SUPPORT_NPTL
    46     default THREADS_NONE           if ! LIBC_SUPPORT_LINUXTHREADS && ! LIBC_SUPPORT_NPTL
    47 
    48 config THREADS_NPTL
    49     bool
    50     prompt "nptl"
    51     depends on LIBC_SUPPORT_NPTL
    52 
    53 config THREADS_LINUXTHREADS
    54     bool
    55     prompt "linuxthreads"
    56     depends on LIBC_SUPPORT_LINUXTHREADS
    57 
    58 config THREADS_NONE
    59     bool
    60     prompt "none"
    61 
    62 endchoice
    63 
    64 endmenu