Commit 2fa6b2d2 by Jeffrey A Law Committed by Jeff Law

* fixinc/*: Delete obsolete files.

From-SVN: r26131
parent 4f71d8e4
Fri Apr 2 16:09:02 1999 Jeffrey A Law (law@cygnus.com)
* fixinc/*: Delete obsolete files.
1999-02-04 Robert Lipe <robertlipe@usa.net> 1999-02-04 Robert Lipe <robertlipe@usa.net>
* egcs_update: Test return values of 'cvs update'. Propogate * egcs_update: Test return values of 'cvs update'. Propogate
......
## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
##
## Makefile for constructing the "best" include fixer we can
##
## $Id: Makefile,v 1.4 1998/08/05 10:20:10 korbb Exp $
##
## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
OBJ = fixincl.o server.o regex.o
HDR = server.h regex.h
## LIB = -lgen
SH_TARGET = inclhack.sh fixincl.sh
BIN_TARGET = fixincl
AG_TEXT = $(SH_TARGET) fixincl.x \
inclhack.def inclhack.tpl hackshell.tpl fixincl.tpl
TARGETS = $(SH_TARGET) $(BIN_TARGET)
default : gen
all : $(TARGETS)
sh : $(SH_TARGET)
gen : $(SH_TARGET) fixincl.x
$(OBJ): $(HDR)
fixincl: $(OBJ)
@echo $(CC) -o $@ $(OBJ) $(LIB) ; \
if $(CC) -o $@ $(OBJ) $(LIB) ; then : ; else \
rm -f $@ ; (echo "#! /bin/sh" ; echo exit 1 ) > $@ ; \
chmod 777 $@ ; fi
regex.o: regex.c
-$(CC) -g -DSTDC_HEADERS=1 -c regex.c
fixincl.o : fixincl.x fixincl.c
-$(CC) $(CFLAGS) '-DTARGET_MACHINE="$(TARGET)"' -o $@ -c fixincl.c
server.o : server.c server.h
-$(CC) $(CFLAGS) -o $@ -c server.c
fixincl.x: fixincl.tpl inclhack.def
@if ( autogen --help > /dev/null 2>&1 ) ; then \
echo autogen -T fixincl.tpl -b fixincl inclhack.def ; \
autogen -T fixincl.tpl -b fixincl inclhack.def ; \
else echo You need to install autogen ; touch $@ ; fi
inclhack.sh: inclhack.def inclhack.tpl hackshell.tpl
@if ( autogen --help > /dev/null 2>&1 ) ; then \
echo autogen inclhack.def ; \
autogen inclhack.def ; \
else echo You need to install autogen ; touch $@ ; fi
fixincl.sh: inclhack.def inclhack.tpl
@if ( autogen --help > /dev/null 2>&1 ) ; then \
echo autogen -DPROGRAM=1 -b fixincl inclhack.def ; \
autogen -DPROGRAM=1 -b fixincl inclhack.def ; touch $@ ; \
else echo You need to install autogen ; touch $@ ; fi ; \
clean:
rm -f *.o $(TARGETS) fixincl.x
# Ensure all the targets are built. If the program "fixincl"
# failed to compile, link or load, then we install the
# "inclhack.sh" script. Otherwise, we install that program
# plus the wrapper script, "fixincl.sh".
#
install: $(TARGETS)
@rm -f $(DESTDIR)/fixinc.sh ; \
if ( ./fixincl -v > /dev/null 2>&1 ) ; then \
echo cp fixincl.sh $(DESTDIR)/fixinc.sh ; \
cp fixincl.sh $(DESTDIR)/fixinc.sh ; \
chmod 555 $(DESTDIR)/fixinc.sh ; \
rm -f $(DESTDIR)/fixincl ; \
echo cp fixincl $(DESTDIR) ; \
cp fixincl $(DESTDIR) ; \
chmod 555 $(DESTDIR)/fixincl ; \
else \
echo cp inclhack.sh $(DESTDIR)/fixinc.sh ; \
cp inclhack.sh $(DESTDIR)/fixinc.sh ; \
fi
[= autogen template -*- Mode: C -*-
x =]
/*
[= _eval "# * " _DNE =]
*
* Install modified versions of 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.
*
* This script contains [=_eval fix _hilim 1 +=] fixup scripts.
*
* See README-fixinc for more information.
*
[=_eval inclhack "# * " _gpl=]
*[=
_FOR fix =]
*
* Description [=_eval _index 1 + "#%3d -" _printf=] [=hackname _Cap=] fix
*/
tSCC z[=hackname _cap=]Name[] =
[=hackname _cap _str=];
/*
* File name selection pattern
*/[=
_IF files _exist=]
tSCC z[=hackname _cap=]List[] =[=
_FOR files=]
"|" [=files _str=][=
/files=] "|";[=
_ELSE =]
#define z[=hackname _cap=]List (char*)NULL[=
_ENDIF "files _exist" =]
/*
* Machine/OS name selection pattern
*/[=
_IF mach _exist=]
tSCC* apz[=hackname _cap=]Machs[] = {[=
_FOR mach =]
[=mach _str=],[=
/mach=]
(const char*)NULL };[=
_ELSE =]
#define apz[=hackname _cap=]Machs (const char**)NULL[=
_ENDIF "files _exist" =][=
_IF exesel _exist=]
/*
* content selection pattern
*/[=
_FOR exesel =]
tSCC z[=hackname _cap=]Select[=_eval _index=][] =
[=exesel _str=];[=
/exesel =][=
_ELIF select _exist=]
/*
* content selection pattern
*/[=
_FOR select =]
tSCC z[=hackname _cap=]Select[=_eval _index=][] =
[=select _str=];[=
/select =][=
_ENDIF =][=
_IF bypass _exist=]
/*
* content bypass pattern
*/[=
_FOR bypass =]
tSCC z[=hackname _cap=]Bypass[=_eval _index=][] =
[=bypass _str=];[=
/bypass =][=
_ENDIF =][=
_IF test _exist=]
/*
* content test pattern. A shell will deal with it later.
*/[=
_FOR test =]
tSCC z[=hackname _cap=]Test[=_eval _index=][] =
[=test _str=];[=
/test =][=
_ENDIF =][=
_IF exesel _exist select _exist bypass _exist test _exist | | |
=]
#define [=hackname _up =]_TEST_CT [=
_IF exesel _exist =][=
_eval test _count bypass _count exesel _count + + =][=
_ELSE =][=
_eval test _count bypass _count select _count + + =][=
_ENDIF =]
tTestDesc a[=hackname _cap=]Tests[] = {[=
_IF test _exist =][=
_FOR test=]
{ TT_TEST, z[=hackname _cap=]Test[=_eval _index=], 0 /* unused */ },[=
/test =][=
_ENDIF =][=
_IF bypass _exist =][=
_FOR bypass=]
{ TT_NEGREP, z[=hackname _cap=]Bypass[=_eval _index=], (regex_t*)NULL },[=
/bypass =][=
_ENDIF =][=
_IF exesel _exist =][=
_FOR exesel ,=]
{ TT_EGREP, z[=hackname _cap=]Select[=_eval _index=], (regex_t*)NULL }[=
/exesel =][=
_ELIF select _exist =][=
_FOR select ,=]
{ TT_EGREP, z[=hackname _cap=]Select[=_eval _index=], (regex_t*)NULL }[=
/select =][=
_ENDIF =] };[=
_ELSE =]
#define [=hackname _up=]_TEST_CT 0
#define a[=hackname _cap=]Tests (tTestDesc*)NULL[=
_ENDIF =]
/*
* Fix Command Arguments for [=hackname _cap=]
*/
const char* apz[=hackname _cap=]Patch[] = {[=
_IF sed _exist =] "sed"[=_FOR sed=],
"-e" [=sed _str=][=/sed=][=
_ELIF replacement _exist =] "sed",
"s@[=select[]=]@[=replacement=]@"[=
_ELIF shell _exist =] "sh", "-c",
[=shell _str=][=
_ELSE =][=_ERROR hackname _get "Error: %s has two fixup specifications"
_printf =][=
_ENDIF=],
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *[=
/fix=]
*
* List of all fixes
*/
#define REGEX_COUNT [=_eval fix.select _count
fix.bypass _count + =]
#define FIX_COUNT [=_eval fix _count =]
tFixDesc fixDescList[ [=_eval fix _count =] ] = {[=
_FOR fix ",\n" =]
{ z[=hackname _cap=]Name, z[=hackname _cap=]List,
apz[=hackname _cap=]Machs, (regex_t*)NULL,
[=hackname _up=]_TEST_CT, [=
_IF not_machine _exist =]FD_MACH_IFNOT[=
_ELSE =]FD_MACH_ONLY[=
_ENDIF =],
a[=hackname _cap=]Tests, apz[=hackname _cap=]Patch }[=
/fix=]
};
This source diff could not be displayed because it is too large. You can view the blob instead.
[= autogen include
=]
[=
# $Id: hackshell.tpl,v 1.1 1998/03/20 16:19:41 korbb Exp $
#
# This file contanes the shell template replacement for the
# fixincl program. It is the repetitive guts of the fixincludes logic.
#
=]
if $LINKS; then
files=`find . -name '*.h' \( -type f -o -type l \) -print`
else
files=`find . -name '*.h' -type f -print`
fi
echo Checking header files
for file in $files; do
if ( test ! -r $file -o \
-n "`fgrep 'This file is part of the GNU C Library' $file`" )
then continue ; fi
fixlist=""
[=
#
# FOR every fix description,
# DO: emit the shell text to apply the fix to the current file
#
# =][=
_FOR fix "\n\n" =]
#
# Fix [=_eval _index 1 + #%3d _printf=]: [=hackname _Cap=]
#[=
_IF files _exist=]
case "$file" in [=_FOR files " | \\\n\t"=]./[=files=][=/files=] )[=
_ENDIF=][=
_IF mach _exist=]
case "$target_canonical" in [=
_FOR mach " | \\\n\t" =][=
mach =][=
/mach =] )[=
_IF mach_unmatched _exist =] : ;;
* )[=
_ENDIF =][=
_ENDIF=][=
# There are three conditional tests: select, bypass and test.
They may appear as often as desired. They must all pass for
the fix to be applied. "select" and "bypass" are egrep expressions
that must each appear (or not appear) in the target file.
"test" is an arbitrary test program expression that must yield
true or false. It is enclosed in parenthesis to avoid
precedence problems. The output looks like this:
if ( test -n "`egrep 'find-expr' $file`" -a
-z "`egrep 'not-find' $file`" -a
'(' <some-test-expression> ')'
) > /dev/null 2>&1 ; then
# =][=
_IF select _exist =]
if ( test [=
_FOR select " -a \\\n "
=]-n [=select _shrstr "#`egrep %s $file`"
_printf _shstr =][=
/select=][=
_IF bypass _exist =][=
_FOR bypass=] -a \
-z [=bypass _shrstr "#`egrep %s $file`"
_printf _shstr =][=
/bypass=][=
_ENDIF=][=
_IF test _exist=][=
_FOR test=] -a \
'(' [=test=] ')'[=
/test=][=
_ENDIF=]
) > /dev/null 2>&1 ; then[=
_ELIF test _exist =]
if ( test [=
_FOR test " -a \\\n "
=]'(' [=test=] ')'[=
/test=][=
_IF bypass _exist=][=
_FOR bypass=] -a \
-z [=bypass _shrstr "#`egrep %s $file`"
_printf _shstr=][=
/bypass=][=
_ENDIF=]
) > /dev/null 2>&1 ; then[=
_ELIF bypass _exist =]
if ( test [=_FOR bypass " -a \\\n "
=]-z [=bypass _shrstr "#`egrep %s $file`"
_printf _shstr=][=/bypass=]
) > /dev/null 2>&1 ; then[=
_ENDIF=]
fixlist="${fixlist}
[=hackname=]"
if [ ! -r ${DESTDIR}/$file ]
then infile=$file
else infile=${DESTDIR}/$file ; fi [=
_IF sed _exist=][=
_IF shell _exist =][=
_ERROR hackname _get
"fixincludes Error: %s fix has multiple fixups" _printf=][=
_ENDIF=]
sed [=
_FOR sed =]-e [=sed _shrstr=] \
[=
/sed=] < $infile > ${DESTDIR}/$file.[=
_ELIF shell _exist =]
( [=shell=] ) < $infile > ${DESTDIR}/$file.
# Shell scripts have the potential of removing the output
# We interpret that to mean the file is not to be altered
#
if test ! -f ${DESTDIR}/$file.
then continue ; fi [=
_ELSE=][=
_ERROR hackname _get "ERROR: %s has no fixup" _printf=][=
_ENDIF=]
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file[=
# Close off any opened "if" or "case" statements in reverse order
# =][=
_IF select _exist test _exist | bypass _exist | =]
fi # end of selection 'if'[=
_ENDIF =][=
_IF mach _exist=]
;; # case end for machine type test
esac[=
_ENDIF =][=
_IF files _exist=]
;; # case end for file name test
esac[=
_ENDIF =][=
/fix =][=
#
# DONE with every fix for the current file
#
#=]
# IF the output has been removed OR it is unchanged,
# THEN ensure the output is gone
# ELSE look for local directory include syntax
#
if ( test ! -f ${DESTDIR}/$file || \
cmp $file ${DESTDIR}/$file ) > /dev/null 2>&1
then
rm -f ${DESTDIR}/$file
else
echo "Fixed $file:${fixlist}"
# Find any include directives that use "file".
#
for include in `
egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${DESTDIR}/$file |
sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`
do
dir=`echo $file | sed -e s'|/[^/]*$||'`
required="$required ${SRCDIR} $dir/$include ${DESTDIR}/$dir/$include"
done
fi
done # for file in $files
#! /bin/sh
machine=$1
dest=$2
if test -z "$dest"
then
echo "No destination directory specified"
exit 1
fi
echo constructing $dest for $machine
case $machine in
alpha*-dec-vms* | \
arm-semi-aout | \
armel-semi-aout | \
arm-semi-aof | \
armel-semi-aof | \
c1-convex-* | \
c2-convex-* | \
c32-convex-* | \
c34-convex-* | \
c38-convex-* | \
hppa1.[01]-*-osf* | \
hppa1.[01]-*-bsd* | \
hppa*-*-lites* | \
i[34567]86-moss-msdos* | \
i[34567]86-*-moss* | \
i[34567]86-*-sysv5* | \
i[34567]86-*-osf1* | \
i[34567]86-*-pe | \
i[34567]86-*-cygwin32 | \
i[34567]86-*-mingw32* | \
mips-sgi-irix5cross64 | \
mips-dec-bsd* | \
powerpc-*-eabi* | \
powerpc-*-rtems* | \
powerpcle-*-eabi* | \
powerpcle-*-winnt* | \
powerpcle-*-pe | \
powerpcle-*-cygwin32 | \
*-*-linux-* | \
*-*-gnu* )
fixincludes=`basename $dest`
;;
i[34567]86-dg-dgux* | \
m88k-dg-dgux*)
fixincludes=fixinc.dgux
;;
mips-sgi-irix[56]* )
fixincludes=fixinc.irix
;;
i[34567]86-sequent-ptx1* | \
i[34567]86-sequent-ptx2* | \
i[34567]86-sequent-ptx4* | \
i[34567]86-sequent-sysv3* | \
i[34567]86-sequent-sysv4*)
fixincludes=fixinc.ptx
;;
i[34567]86-*-sco3.2v[45]*)
fixincludes=fixinc.sco
;;
i[34567]86-*-solaris2.[0-4]* | \
*-*-solaris2.[0-4]* | \
*-*-sysv4*)
fixincludes=fixinc.svr4
;;
alpha*-*-winnt* | \
i[34567]86-*-winnt3*)
fixincludes=fixinc.winnt
;;
alpha*-*-netbsd* | \
arm-*-netbsd* | \
i[34567]86-*-freebsdelf* | \
i[34567]86-*-freebsd* | \
i[34567]86-*-netbsd* | \
i[34567]86-*-solaris2* | \
m68k-*-netbsd* | \
mips-dec-netbsd* | \
ns32k-pc532-netbsd* | \
*-*-solaris2* | \
sparc-*-netbsd* | \
vax-*-netbsd*)
fixincludes=fixinc.wrap
;;
*)
fixincludes=`basename $dest`
;;
esac
if test -z "$fixincludes"
then
cat > $dest <<- _EOF_
#! /bin/sh
exit 0
_EOF_
exit 0
fi
if test -f "$fixincludes"
then
echo copying $fixincludes to $dest
cp $fixincludes $dest
exit 0
fi
echo $MAKE install DESTDIR=`dirname $dest` TARGET=$machine
$MAKE install DESTDIR=`dirname $dest` TARGET=$machine
exit 1
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* $Id: server.h,v 1.1 1998/03/20 16:19:41 korbb Exp $
*
* Server Handling copyright 1992-1998 Bruce Korb
*
* Server Handling is free software.
* You may redistribute it and/or modify it under the terms of the
* GNU General Public License, as published by the Free Software
* Foundation; either version 2, or (at your option) any later version.
*
* Server Handling is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Server Handling. See the file "COPYING". If not,
* write to: The Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* As a special exception, Bruce Korb gives permission for additional
* uses of the text contained in his release of ServerHandler.
*
* The exception is that, if you link the ServerHandler library with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the ServerHandler library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by Bruce Korb under
* the name ServerHandler. If you copy code from other sources under the
* General Public License into a copy of ServerHandler, as the General Public
* License permits, the exception does not apply to the code that you add
* in this way. To avoid misleading anyone as to the status of such
* modified files, you must delete this exception notice from them.
*
* If you write modifications of your own for ServerHandler, it is your
* choice whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*/
#ifndef FIXINC_SERVER_H
#define FIXINC_SERVER_H
#include <stdio.h>
#include <unistd.h>
/*
* Dual pipe opening of a child process
*/
typedef struct
{
int readFd;
int writeFd;
}
tFdPair;
typedef struct
{
FILE *pfRead; /* parent read fp */
FILE *pfWrite; /* parent write fp */
}
tpfPair;
typedef char *tpChar;
#define NOPROCESS ((pid_t)-1)
#define NULLPROCESS ((pid_t)0)
#define EXIT_PANIC 99
typedef enum
{
BOOL_FALSE, BOOL_TRUE
}
bool;
#define _P_(p) ()
char *runShell _P_ ((const char *pzCmd));
pid_t p2fopen _P_ ((tpfPair * pfPair, tpChar * ppArgs));
pid_t p2open _P_ ((tFdPair * pPair, tpChar * ppArgs));
int
chainOpen _P_ ((int stdinFd,
tpChar * ppArgs,
pid_t * pChild));
#endif /* FIXINC_SERVER_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment