diff options
author | obrien <obrien@FreeBSD.org> | 1999-10-16 06:09:09 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 1999-10-16 06:09:09 +0000 |
commit | cae8fa8120c70195f34a2456f18c4c848a2d3e0c (patch) | |
tree | f7d3a3ab9c32694206552e767626366f016f2062 /contrib/gcc/fixproto | |
parent | 84656b55b6e25e30322dc903a05de53706361d3d (diff) | |
download | FreeBSD-src-cae8fa8120c70195f34a2456f18c4c848a2d3e0c.zip FreeBSD-src-cae8fa8120c70195f34a2456f18c4c848a2d3e0c.tar.gz |
Virgin import of the GCC 2.95.1 compilers
Diffstat (limited to 'contrib/gcc/fixproto')
-rwxr-xr-x | contrib/gcc/fixproto | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/contrib/gcc/fixproto b/contrib/gcc/fixproto index cd495e6..9e02211 100755 --- a/contrib/gcc/fixproto +++ b/contrib/gcc/fixproto @@ -4,7 +4,7 @@ # fixproto TARGET-DIR SOURCE-DIR-ALL SOURCE-DIR-STD # # COPYRIGHT -# Copyright (C) 1993, 1994 Free Software Foundation, Inc. +# Copyright (C) 1993, 1994, 1997, 1998 Free Software Foundation, Inc. # This file is part of GNU CC. # # GNU CC is free software; you can redistribute it and/or modify @@ -54,12 +54,27 @@ # Ron Guilmette (rfg@netcom.com) (original idea and code) # Per Bothner (bothner@cygnus.com) (major re-write) -progname=$0 -progname=`basename $progname` +dirname=`echo "$0" | sed 's,^[^/]*$,.,;s,//*[^/]*$,,'` +progname=`echo "$0" | sed 's,.*/,,'` original_dir=`pwd` FIX_HEADER=${FIX_HEADER-$original_dir/fix-header} DEFINES="-D__STDC__=0 -D__cplusplus ${FIXPROTO_DEFINES}" +if mkdir -p . 2> /dev/null; then + # Great, mkdir accepts -p + mkinstalldirs="mkdir -p" +else + # We expect mkinstalldirs to be passed in the environment. + # If it is not, assume it is in the directory that contains this script. + mkinstalldirs=${mkinstalldirs-"/bin/sh $dirname/mkinstalldirs"} + if $mkinstalldirs . 2> /dev/null; then + : + else + # But, in case of failure, fallback to plain mkdir, and hope it works + mkinstalldirs=mkdir + fi +fi + if [ `echo $1 | wc -w` = 0 ] ; then echo $progname\: usage\: $progname target-dir \[ source-dir \.\.\. \] exit 1 @@ -94,7 +109,7 @@ fi if [ \! -d $abs_target_dir ] ; then echo $progname\: creating directory $rel_target_dir - mkdir $abs_target_dir + $mkinstalldirs $abs_target_dir fi echo $progname\: populating \`$rel_target_dir\' @@ -175,7 +190,7 @@ for code in ALL STD ; do abs_target_subdir=${abs_target_dir}/${rel_source_subdir} if [ \! -d $abs_target_subdir ] ; then - if mkdir $abs_target_subdir ; then + if $mkinstalldirs $abs_target_subdir ; then subdirs_made="$abs_target_subdir $subdirs_made" fi fi @@ -202,7 +217,7 @@ for code in ALL STD ; do # Create the dir where this file will go when fixed. xxdir=`echo ./$file | sed -e 's|/[^/]*$||'` if [ \! -d $abs_target_subdir/$xxdir ] ; then - if mkdir $abs_target_subdir/$xxdir ; then + if $mkinstalldirs $abs_target_subdir/$xxdir ; then subdirs_made="$abs_target_subdir/$xxdir $subdirs_made" fi fi |