blob: a612e56d17c2a1feb26471ba171ce191675a52cf [file] [log] [blame]
LuK133752a81d52025-07-08 18:07:20 -04001#! /bin/sh
2# This shell script is generated by the 'configure' script. It is invoked in a
3# subdirectory of the build tree. It generates a sed-script in the parent
4# directory that is used to adjust includes for header files that reside in a
5# subdirectory of /usr/include, etc.
6PRG=""
7while test $# != 3
8do
9PRG="$PRG $1"; shift
10done
11DST=$1
12REF=$2
13SRC=$3
14TMPSRC=${TMPDIR:-/tmp}/`basename $SRC`$$
15TMPSED=${TMPDIR:-/tmp}/headers.sed$$
16echo installing $SRC in $DST
17case $DST in
18(/*/include/*)
19 END=`basename $DST`
20 for i in `cat $REF/../*/headers |grep -F -v "#"`
21 do
22 NAME=`basename $i`
23 echo "s/<$NAME>/<$END\/$NAME>/" >> $TMPSED
24 done
25 ;;
26(*)
27 echo "" >> $TMPSED
28 ;;
29esac
30rm -f $TMPSRC
31sed -f $TMPSED $SRC > $TMPSRC
32NAME=`basename $SRC`
33# Just in case someone gzip'd manpages, remove the conflicting copy.
34test -f $DST/$NAME.gz && rm -f $DST/$NAME.gz
35
36eval $PRG $TMPSRC $DST/$NAME
37rm -f $TMPSRC $TMPSED