File: Mksrc

package info (click to toggle)
lsof 4.91%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,984 kB
  • sloc: ansic: 68,893; sh: 6,862; makefile: 1,682; perl: 1,099; awk: 214
file content (57 lines) | stat: -rwxr-xr-x 1,319 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
#
# Mksrc - make Solaris source files
#
# WARNING: This script assumes it is running from the main directory
#	   of the lsof, version 4 distribution.
#
# One environment variable applies:
#
# LSOF_MKC	is the method for creating the source files.
#		It defaults to "ln -s".  A common alternative is "cp".
#
# $Id: Mksrc,v 1.4 2000/12/04 14:35:13 abe Exp $


D=dialects/sun
L="ddev.c dfile.c dlsof.h dmnt.c dnode.c dnode1.c dnode2.c dproc.c dproto.h dsock.c dstore.c machine.h"

for i in $L
do
  rm -f $i
  $LSOF_MKC $D/$i $i
  echo "$LSOF_MKC $D/$i $i"
done

# Assemble kernelbase.h for SunOS and Solaris < 2.5 (5.5)

NM=kernelbase.h
rm -f $NM
if test "X$1" != "Xsolaris" -o $2 -lt 20500
then
  if test "X$1" = "Xsolaris"
  then
    A=`uname -m`
    if test "$A" = "i86pc"
    then
      H=/usr/include/sys/machparam.h
    else
      H=/usr/src/uts/$A/sys/machparam.h
    fi
  else
    H=/usr/include/machine/param.h
  fi
  echo "#if	!defined(KERNELSIZE)" > $NM
  grep "^#define[ 	]*KERNELSIZE" $H >> $NM
  echo "#endif" >> $NM
  echo "#if	!defined(KERNELBASE)" >> $NM
  grep "^#define[ 	]*KERNELBASE" $H >> $NM
  echo "#endif" >> $NM
else

# To keep the dependency list for dproc.o simple in the Makefile,
# create an empty kernelbase.h for Solaris 2.5 (5.5) and above.

  touch $NM
fi
echo "$NM assembled."