source: rtems/tools/update/cipolish @ c73b8ac2

4.104.114.84.95
Last change on this file since c73b8ac2 was c73b8ac2, checked in by Joel Sherrill <joel.sherrill@…>, on 11/09/99 at 22:18:43

This patch adds the basic framework for the ITRON 3.0 API implementation
for RTEMS.

  • Property mode set to 100755
File size: 2.3 KB
Line 
1#!/usr/bin/perl
2
3#
4# Perl script to beautify and enhance RTEMS configure.in
5#
6# Reads from stdin and writes to stdout
7#
8# usage:
9# acpolish <configure.in >configure.in~
10# mv configure.in~ configure.in
11#
12# ATTENTION: This file contains embedded tabs
13
14my $nl_seen = 0 ;
15
16# find a relative up-path to a file $file, starting at directory $pre
17sub find_file
18{
19  my $pre = $_[0] ;
20  my $file= $_[1] ;
21
22  my $top = "." ;
23  if (not "$pre") { $pre = "." ; }
24
25  for ( $str = "$pre" . "/" . "$top" ;
26    ( -d "$str" ) ;
27    $str = "$pre" . "/" . "$top" )
28  {
29    if ( -f "${str}/${file}" ) 
30    {
31      return $top ;
32    }
33    if ( "$top" eq "." )
34    {
35      $top = ".." ;
36    }
37    else
38    {
39      $top .= "/.." ;
40    }
41  } ;
42  die "Can't find file ${file}\n" ;
43}
44
45# find relative up-path to configure.in
46my $rtems_cfg = find_file(".","VERSION");
47
48
49while( <> )
50{
51  if ( /^[      ]*$/o )
52  {
53    $nl_seen = $nl_seen+1;
54  }
55
56  if ( /^[      ]*AC_CONFIG_AUX_DIR\(.*\)[      ]*$/o )
57  {
58    print "AC_CONFIG_AUX_DIR($rtems_cfg)\n" ;
59  }
60  elsif ( /^[   ]*RTEMS_TOP\(.*\)[      ]*$/o )
61  {
62    print "RTEMS_TOP($rtems_cfg)\n" ;
63  }
64  elsif ( /^[   ]*AC_SUBST\(RTEMS_HAS_POSIX_API\)[      ]*$/o )
65  {
66    #remove the line
67  }
68  elsif ( /^[   ]*AC_SUBST\(RTEMS_HAS_ITRON_API\)[      ]*$/o )
69  {
70    #remove the line
71  }
72  elsif ( /^[   ]*AC_SUBST\(RTEMS_HAS_HWAPI\)[  ]*$/o )
73  {
74    #remove the line
75  }
76  elsif ( /^[   ]*AC_SUBST\(RTEMS_USE_MACROS\)[         ]*$/o )
77  {
78    #remove the line
79  }
80  elsif ( /^[   ]*AC_SUBST\(RTEMS_HAS_MULTIPROCESSING\)[        ]*$/o )
81  {
82    #remove the line
83  }
84  elsif ( /^[   ]*AC_SUBST\(RTEMS_HAS_RDBG\)[   ]*$/o )
85  {
86    #remove the line
87  }
88  elsif ( /^[\s\t]*AC_SUBST\(RTEMS_USE_OWN_PDIR\)[      ]*$/o )
89  { # obsolete option
90    #remove the line
91  }
92  elsif ( /^[\s\t]*RTEMS_ENABLE_GMAKE_PRINT[     ]*$/o )
93  { # obsolete macro
94    #remove the line
95  }
96  elsif ( /^[   ]*AC_SUBST\(RTEMS_HAS_NETWORKING\)[     ]*$/o )
97  {
98    #remove the line
99  }
100  elsif ( /^[   ]*AC_SUBST\(RTEMS_LIBC_DIR\)[   ]*$/o )
101  {
102    #remove the line
103  }
104  elsif ( /^[   ]*AC_SUBST\(PROJECT_ROOT\)[     ]*$/o )
105  {
106    #remove the line
107  }
108  elsif ( /^[   ]*AC_SUBST\(RTEMS_GAS_CODE16\)[         ]*$/o )
109  {
110    #remove the line
111  }
112  elsif ( /^[   ]*PROJECT_ROOT[         ]*=.*$/o )
113  {
114    #remove the line
115  }
116  elsif ( /^[   ]*$/o )
117  {
118    print "$_" if $nl_seen < 2 ;
119  }
120  else
121  {
122    print "$_" ;
123    $nl_seen = 0;
124  }
125} # while
126
127;1
Note: See TracBrowser for help on using the repository browser.