summaryrefslogtreecommitdiffstats
path: root/tools/update/cipolish
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-03-29 21:08:04 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-03-29 21:08:04 +0000
commit7e03d107d780ca0e1690a7cdecfb35834832c3d5 (patch)
tree80a861661e7e88f0dedc77ba30aee4350300a9eb /tools/update/cipolish
parentRemoved an uninitialized variable. (diff)
downloadrtems-7e03d107d780ca0e1690a7cdecfb35834832c3d5.tar.bz2
Patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>:
Yet some more modifications, I would recommend to be considered before releasing a snapshot: 1. Cleanup to aclocal/ cvs rm -f aclocal/cygwin.m4 cvs rm -f aclocal/exeext.m4 They are neither used nor needed anymore, however they also don't disturb (we use autoconf-2.13's AC_EXEEXT instead, now) ---------- 2. rtems-rc-19990328-0.diff Some (minor) bug-fixes: * make/Templates/Makefile.inc.in: use the new installation directory ($(prefix)/ instead of $(prefix)/rtems/) * c/src/exec/score/tools/generic/Makefile.am: added line to include local.am * c/src/exec/score/tools/*/configure.in: added CVS Id header ---------- 3. rtems-rc-19990328-1.diff Enhancements and cleanups to autogen, rtems-polish.sh, configure.in etc. * autogen: Use the file "VERSION" to detect RTEMS toplevel directory, extended usage-message, use "find -print" * c/update-tools/cipolish: New script to beautify configure.in scripts * c/update-tools/rtems-polish.sh: Use the file "VERSION" to detect RTEMS toplevel directory, extended usage-message, added variable for perl scripts' subdirectory, use "find -print", cipolish support, new options -ac -am -ci. * aclocal/*.m4, configure.in: moved some AC_SUBST lines to aclocal/*.m4 (reduces size of configure.in scripts, eases splitting configure.in scripts). ----------
Diffstat (limited to '')
-rwxr-xr-xtools/update/cipolish119
1 files changed, 119 insertions, 0 deletions
diff --git a/tools/update/cipolish b/tools/update/cipolish
new file mode 100755
index 0000000000..61af53312c
--- /dev/null
+++ b/tools/update/cipolish
@@ -0,0 +1,119 @@
+#!/usr/bin/perl
+
+#
+# Perl script to beautify and enhance RTEMS configure.in
+#
+# Reads from stdin and writes to stdout
+#
+# usage:
+# acpolish <configure.in >configure.in~
+# mv configure.in~ configure.in
+#
+# ATTENTION: This file contains embedded tabs
+
+my $nl_seen = 0 ;
+
+# find a relative up-path to a file $file, starting at directory $pre
+sub find_file
+{
+ my $pre = $_[0] ;
+ my $file= $_[1] ;
+
+ my $top = "." ;
+ if (not "$pre") { $pre = "." ; }
+
+ for ( $str = "$pre" . "/" . "$top" ;
+ ( -d "$str" ) ;
+ $str = "$pre" . "/" . "$top" )
+ {
+ if ( -f "${str}/${file}" )
+ {
+ return $top ;
+ }
+ if ( "$top" eq "." )
+ {
+ $top = ".." ;
+ }
+ else
+ {
+ $top .= "/.." ;
+ }
+ } ;
+ die "Can't find file ${file}\n" ;
+}
+
+# find relative up-path to configure.in
+my $rtems_cfg = find_file(".","VERSION");
+
+
+while( <> )
+{
+ if ( /^[ ]*$/o )
+ {
+ $nl_seen = $nl_seen+1;
+ }
+
+ if ( /^[ ]*AC_CONFIG_AUX_DIR\(.*\)[ ]*$/o )
+ {
+ print "AC_CONFIG_AUX_DIR($rtems_cfg)\n" ;
+ }
+ elsif ( /^[ ]*RTEMS_TOP\(.*\)[ ]*$/o )
+ {
+ print "RTEMS_TOP($rtems_cfg)\n" ;
+ }
+ elsif ( /^[ ]*AC_SUBST\(RTEMS_HAS_POSIX_API\)[ ]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[ ]*AC_SUBST\(RTEMS_HAS_HWAPI\)[ ]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[ ]*AC_SUBST\(RTEMS_USE_MACROS\)[ ]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[ ]*AC_SUBST\(RTEMS_HAS_MULTIPROCESSING\)[ ]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[ ]*AC_SUBST\(RTEMS_HAS_RDBG\)[ ]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[ ]*AC_SUBST\(RTEMS_USE_OWN_PDIR\)[ ]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[ ]*AC_SUBST\(RTEMS_HAS_NETWORKING\)[ ]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[ ]*AC_SUBST\(RTEMS_LIBC_DIR\)[ ]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[ ]*AC_SUBST\(PROJECT_ROOT\)[ ]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[ ]*AC_SUBST\(RTEMS_GAS_CODE16\)[ ]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[ ]*PROJECT_ROOT[ ]*=.*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[ ]*$/o )
+ {
+ print "$_" if $nl_seen < 2 ;
+ }
+ else
+ {
+ print "$_" ;
+ $nl_seen = 0;
+ }
+} # while
+
+;1