OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [fixincludes/] [fixincl.tpl] - Diff between revs 154 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 154 Rev 816
[= AutoGen5 Template -*- Mode: C -*-
[= AutoGen5 Template -*- Mode: C -*-
x=fixincl.x =]
x=fixincl.x =]
[= (dne " * " "/* ")=]
[= (dne " * " "/* ")=]
 */
 */
/* DO NOT CVS-MERGE THIS FILE, EITHER [=`date`=]
/* DO NOT CVS-MERGE THIS FILE, EITHER [=`date`=]
 *
 *
 * You must regenerate it.  Use the ./genfixes script.
 * You must regenerate it.  Use the ./genfixes script.
 *
 *
 *
 *
 * This is part of the fixincl program used to install modified versions of
 * This is part of the fixincl program used to install modified versions of
 * certain ANSI-incompatible system header files which are fixed to work
 * certain ANSI-incompatible system header files which are fixed to work
 * correctly with ANSI C and placed in a directory that GNU C will search.
 * correctly with ANSI C and placed in a directory that GNU C will search.
 *
 *
 * This file contains [=(count "fix")=] fixup descriptions.
 * This file contains [=(count "fix")=] fixup descriptions.
 *
 *
 * See README for more information.
 * See README for more information.
 *
 *
 *  inclhack copyright (c) 1998, 1999, 2000, 2001
 *  inclhack copyright (c) 1998, 1999, 2000, 2001
 *  The Free Software Foundation, Inc.
 *  The Free Software Foundation, Inc.
 *
 *
 [=(define re-ct 0) (define max-mach 0) (define ct 0)
 [=(define re-ct 0) (define max-mach 0) (define ct 0)
   (define HACK "") (define Hack "")    (define tmp "")
   (define HACK "") (define Hack "")    (define tmp "")
   (gpl "inclhack" " *  ")=]
   (gpl "inclhack" " *  ")=]
 */
 */
[=
[=
FOR fix =]
FOR fix =]
/* * * * * * * * * * * * * * * * * * * * * * * * * *
/* * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 *
 *  Description of [=
 *  Description of [=
    (set! Hack (string-capitalize! (get "hackname")))
    (set! Hack (string-capitalize! (get "hackname")))
    (set! HACK (string-upcase!     (get "hackname")))
    (set! HACK (string-upcase!     (get "hackname")))
    (if (and (not (exist? "test_text")) (not (exist? "replace")))
    (if (and (not (exist? "test_text")) (not (exist? "replace")))
        (error (sprintf "include fix '%s' has no test text" Hack )) )
        (error (sprintf "include fix '%s' has no test text" Hack )) )
    (. Hack)=] fix
    (. Hack)=] fix
 */[=
 */[=
# Note that this is not just for debugging purposes, but in case
# Note that this is not just for debugging purposes, but in case
  some C fix wishes to refer to the regexps it is paired with.
  some C fix wishes to refer to the regexps it is paired with.
  See commentary at the top of fixfixes.c.
  See commentary at the top of fixfixes.c.
=]
=]
tSCC z[=(. Hack)=]Name[] =
tSCC z[=(. Hack)=]Name[] =
     "[=hackname=]";
     "[=hackname=]";
/*
/*
 *  File name selection pattern
 *  File name selection pattern
 */[=
 */[=
  IF (exist? "files")=]
  IF (exist? "files")=]
tSCC z[=(. Hack)=]List[] =
tSCC z[=(. Hack)=]List[] =
  "[=FOR files =]|[=files=][=ENDFOR=]|";[=
  "[=FOR files =]|[=files=][=ENDFOR=]|";[=
  ELSE =]
  ELSE =]
#define z[=(. Hack)=]List (char*)NULL[=
#define z[=(. Hack)=]List (char*)NULL[=
  ENDIF (exist? "files") =]
  ENDIF (exist? "files") =]
/*
/*
 *  Machine/OS name selection pattern
 *  Machine/OS name selection pattern
 */[=
 */[=
  IF (exist? "mach")=]
  IF (exist? "mach")=]
tSCC* apz[=(. Hack)=]Machs[] = {[=
tSCC* apz[=(. Hack)=]Machs[] = {[=
    (set! ct 0) =][=
    (set! ct 0) =][=
    FOR mach =]
    FOR mach =]
        [=
        [=
      (set! tmp (get "mach"))
      (set! tmp (get "mach"))
      (set! ct (+ ct (string-length tmp) 5))
      (set! ct (+ ct (string-length tmp) 5))
      (kr-string tmp)=],[=
      (kr-string tmp)=],[=
    ENDFOR=]
    ENDFOR=]
        (const char*)NULL };[=
        (const char*)NULL };[=
    (if (> ct max-mach) (set! max-mach ct)) =][=
    (if (> ct max-mach) (set! max-mach ct)) =][=
  ELSE =]
  ELSE =]
#define apz[=(. Hack)=]Machs (const char**)NULL[=
#define apz[=(. Hack)=]Machs (const char**)NULL[=
  ENDIF (exist? "files") =][=
  ENDIF (exist? "files") =][=
  IF (exist? "select")=]
  IF (exist? "select")=]
/*
/*
 *  content selection pattern - do fix if pattern found
 *  content selection pattern - do fix if pattern found
 */[=
 */[=
    FOR select =]
    FOR select =]
tSCC z[=(. Hack)=]Select[=(for-index)=][] =
tSCC z[=(. Hack)=]Select[=(for-index)=][] =
       [=(kr-string (get "select"))=];[=
       [=(kr-string (get "select"))=];[=
    ENDFOR select =][=
    ENDFOR select =][=
  ENDIF =][=
  ENDIF =][=
  IF (exist? "bypass")=]
  IF (exist? "bypass")=]
/*
/*
 *  content bypass pattern - skip fix if pattern found
 *  content bypass pattern - skip fix if pattern found
 */[=
 */[=
    FOR bypass =]
    FOR bypass =]
tSCC z[=(. Hack)=]Bypass[=(for-index)=][] =
tSCC z[=(. Hack)=]Bypass[=(for-index)=][] =
       [=(kr-string (get "bypass"))=];[=
       [=(kr-string (get "bypass"))=];[=
    ENDFOR bypass =][=
    ENDFOR bypass =][=
  ENDIF =][=
  ENDIF =][=
  IF (exist? "test")=]
  IF (exist? "test")=]
/*
/*
 *  perform the 'test' shell command - do fix on success
 *  perform the 'test' shell command - do fix on success
 */[=
 */[=
    FOR test =]
    FOR test =]
tSCC z[=(. Hack)=]Test[=(for-index)=][] =
tSCC z[=(. Hack)=]Test[=(for-index)=][] =
       [=(kr-string (get "test"))=];[=
       [=(kr-string (get "test"))=];[=
    ENDFOR  =][=
    ENDFOR  =][=
  ENDIF     =][=
  ENDIF     =][=
  IF (exist? "c_test")=]
  IF (exist? "c_test")=]
/*
/*
 *  perform the C function call test
 *  perform the C function call test
 */[=
 */[=
    FOR c_test =]
    FOR c_test =]
tSCC z[=(. Hack)=]FTst[=(for-index)=][] = "[=c_test=]";[=
tSCC z[=(. Hack)=]FTst[=(for-index)=][] = "[=c_test=]";[=
    ENDFOR c_test =][=
    ENDFOR c_test =][=
  ENDIF =][=
  ENDIF =][=
  IF (set! ct (+ (count "select") (count "bypass")
  IF (set! ct (+ (count "select") (count "bypass")
              (count "test") (count "c_test")))
              (count "test") (count "c_test")))
     (= ct 0)
     (= ct 0)
=]
=]
#define [=(. HACK)=]_TEST_CT  0
#define [=(. HACK)=]_TEST_CT  0
#define a[=(. Hack)=]Tests   (tTestDesc*)NULL[=
#define a[=(. Hack)=]Tests   (tTestDesc*)NULL[=
  ELSE =]
  ELSE =]
#define    [=(. HACK)=]_TEST_CT  [=(. ct)=][=
#define    [=(. HACK)=]_TEST_CT  [=(. ct)=][=
        (set! re-ct (+ re-ct (count "select") (count "bypass"))) =]
        (set! re-ct (+ re-ct (count "select") (count "bypass"))) =]
static tTestDesc a[=(. Hack)=]Tests[] = {[=
static tTestDesc a[=(. Hack)=]Tests[] = {[=
    FOR test =]
    FOR test =]
  { TT_TEST,     z[=(. Hack)=]Test[=(for-index)=],   0 /* unused */ },[=
  { TT_TEST,     z[=(. Hack)=]Test[=(for-index)=],   0 /* unused */ },[=
    ENDFOR test =][=
    ENDFOR test =][=
    FOR c_test =]
    FOR c_test =]
  { TT_FUNCTION, z[=(. Hack)=]FTst[=(for-index)=],   0 /* unused */ },[=
  { TT_FUNCTION, z[=(. Hack)=]FTst[=(for-index)=],   0 /* unused */ },[=
    ENDFOR c_test =][=
    ENDFOR c_test =][=
    FOR bypass =]
    FOR bypass =]
  { TT_NEGREP,   z[=(. Hack)=]Bypass[=(for-index)=], (regex_t*)NULL },[=
  { TT_NEGREP,   z[=(. Hack)=]Bypass[=(for-index)=], (regex_t*)NULL },[=
    ENDFOR bypass =][=
    ENDFOR bypass =][=
    FOR select =]
    FOR select =]
  { TT_EGREP,    z[=(. Hack)=]Select[=(for-index)=], (regex_t*)NULL },[=
  { TT_EGREP,    z[=(. Hack)=]Select[=(for-index)=], (regex_t*)NULL },[=
    ENDFOR select =] };[=
    ENDFOR select =] };[=
  ENDIF =]
  ENDIF =]
/*
/*
 *  Fix Command Arguments for [=(. Hack)=]
 *  Fix Command Arguments for [=(. Hack)=]
 */
 */
static const char* apz[=(. Hack)=]Patch[] = {[=
static const char* apz[=(. Hack)=]Patch[] = {[=
    IF   (exist? "sed")=] "sed"[=
    IF   (exist? "sed")=] "sed"[=
      FOR sed=],
      FOR sed=],
    "-e", [=(kr-string (get "sed"))=][=
    "-e", [=(kr-string (get "sed"))=][=
      ENDFOR sed=],[=
      ENDFOR sed=],[=
    ELIF (exist? "shell")=] "sh", "-c",
    ELIF (exist? "shell")=] "sh", "-c",
    [=(kr-string (get "shell"))=],[=
    [=(kr-string (get "shell"))=],[=
    ELIF (exist? "c_fix")=]
    ELIF (exist? "c_fix")=]
    [=(kr-string (get "c_fix"))=],[=
    [=(kr-string (get "c_fix"))=],[=
      FOR c_fix_arg =]
      FOR c_fix_arg =]
    [=(kr-string (get "c_fix_arg"))=],[=
    [=(kr-string (get "c_fix_arg"))=],[=
      ENDFOR c_fix_arg =][=
      ENDFOR c_fix_arg =][=
    ELIF (> (len "replace") 0) =]
    ELIF (> (len "replace") 0) =]
[=(kr-string (get "replace"))=],[=
[=(kr-string (get "replace"))=],[=
    ENDIF=]
    ENDIF=]
    (char*)NULL };
    (char*)NULL };
[=ENDFOR fix=]
[=ENDFOR fix=]
/* * * * * * * * * * * * * * * * * * * * * * * * * *
/* * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 *
 *  List of all fixes
 *  List of all fixes
 */[=
 */[=
#  as of this writing, 49 bytes are needed by the case statement format.
#  as of this writing, 49 bytes are needed by the case statement format.
   We also must allow for the size of the target machine machine name.
   We also must allow for the size of the target machine machine name.
   This allows for a 79 byte machine name.  Better be enough.
   This allows for a 79 byte machine name.  Better be enough.
=]
=]
#define REGEX_COUNT          [= (. re-ct) =]
#define REGEX_COUNT          [= (. re-ct) =]
#define MACH_LIST_SIZE_LIMIT [= (+ 128 max-mach) =]
#define MACH_LIST_SIZE_LIMIT [= (+ 128 max-mach) =]
#define FIX_COUNT            [= (count "fix") =]
#define FIX_COUNT            [= (count "fix") =]
/*
/*
 *  Enumerate the fixes[= # in a way that minimizes diffs :-) =]
 *  Enumerate the fixes[= # in a way that minimizes diffs :-) =]
 */
 */
typedef enum {[=
typedef enum {[=
FOR fix "," =]
FOR fix "," =]
    [=(string-upcase! (get "hackname"))=]_FIXIDX[=
    [=(string-upcase! (get "hackname"))=]_FIXIDX[=
ENDFOR
ENDFOR
=]
=]
} t_fixinc_idx;
} t_fixinc_idx;
tFixDesc fixDescList[ FIX_COUNT ] = {[=
tFixDesc fixDescList[ FIX_COUNT ] = {[=
FOR fix ",\n" =][=
FOR fix ",\n" =][=
    (set! Hack (string-capitalize! (get "hackname")))
    (set! Hack (string-capitalize! (get "hackname")))
    (set! HACK (string-upcase!     (get "hackname"))) =]
    (set! HACK (string-upcase!     (get "hackname"))) =]
  {  z[=(. Hack)=]Name,    z[=(. Hack)=]List,
  {  z[=(. Hack)=]Name,    z[=(. Hack)=]List,
     apz[=(. Hack)=]Machs,
     apz[=(. Hack)=]Machs,
     [=(. HACK)=]_TEST_CT, [=
     [=(. HACK)=]_TEST_CT, [=
       IF (exist? "not_machine") =]FD_MACH_IFNOT[=
       IF (exist? "not_machine") =]FD_MACH_IFNOT[=
       ELSE                      =]FD_MACH_ONLY[=
       ELSE                      =]FD_MACH_ONLY[=
       ENDIF =][=
       ENDIF =][=
       IF    (exist? "shell")    =] | FD_SHELL_SCRIPT[=
       IF    (exist? "shell")    =] | FD_SHELL_SCRIPT[=
       ELIF  (exist? "c_fix")    =] | FD_SUBROUTINE[=
       ELIF  (exist? "c_fix")    =] | FD_SUBROUTINE[=
       ELIF  (exist? "replace")  =] | FD_REPLACEMENT[=
       ELIF  (exist? "replace")  =] | FD_REPLACEMENT[=
       ENDIF =],
       ENDIF =],
     a[=(. Hack)=]Tests,   apz[=(. Hack)=]Patch, 0 }[=
     a[=(. Hack)=]Tests,   apz[=(. Hack)=]Patch, 0 }[=
ENDFOR =]
ENDFOR =]
};
};
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.