2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-30 22:05:23 +00:00

- For Linux, compute major and minor version instead of doing pattern

matching, and substitute it in the Makefile.
This commit is contained in:
Ted Lemon
1999-07-13 17:58:43 +00:00
parent 498eae9150
commit 6057415f79
2 changed files with 29 additions and 10 deletions

View File

@@ -43,6 +43,13 @@ COPTS = $(BINDDEF)
#BINDDEF = -DNSUPDATE
##--nsupdate--
##--majver
MAJORVERSION=MajorVersion
##--majver
##--minver
MINORVERSION=MinorVersion
##--minver
## Porting::
#
# For each supported operating system, there is a block of text below
@@ -183,7 +190,7 @@ COPTS = $(BINDDEF)
## Linux 1.x
##--linux-1--
#COPTS = -DLINUX_MAJOR=1 -DLINUX_MINOR=0 $(BINDDEF)
#COPTS = -DLINUX_MAJOR=$(MAJORVERSION) -DLINUX_MINOR=$(MINORVERSION) $(BINDDEF)
#CF = cf/linux.h
#ADMMANDIR = /usr/man/man8
#ADMMANEXT = .8
@@ -197,7 +204,7 @@ COPTS = $(BINDDEF)
## Linux 2.0
##--linux-2.0--
#COPTS = -DLINUX_MAJOR=2 -DLINUX_MINOR=0 $(BINDDEF)
#COPTS = -DLINUX_MAJOR=$(MAJORVERSION) -DLINUX_MINOR=$(MINORVERSION) $(BINDDEF)
#CF = cf/linux.h
#ADMMANDIR = /usr/man/man8
#ADMMANEXT = .8
@@ -211,7 +218,7 @@ COPTS = $(BINDDEF)
## Linux 2.1
##--linux-2.1--
#COPTS = -DLINUX_MAJOR=2 -DLINUX_MINOR=1 $(BINDDEF)
#COPTS = -DLINUX_MAJOR=$(MAJORVERSION) -DLINUX_MINOR=$(MINORVERSION) $(BINDDEF)
#CF = cf/linux.h
#ADMMANDIR = /usr/man/man8
#ADMMANEXT = .8
@@ -225,7 +232,7 @@ COPTS = $(BINDDEF)
## Linux 2.2
##--linux-2.2--
#COPTS = -DLINUX_MAJOR=2 -DLINUX_MINOR=2 $(BINDDEF)
#COPTS = -DLINUX_MAJOR=$(MAJORVERSION) -DLINUX_MINOR=$(MINORVERSION) $(BINDDEF)
#CF = cf/linux.h
#ADMMANDIR = /usr/man/man8
#ADMMANEXT = .8

24
configure vendored
View File

@@ -31,11 +31,18 @@ if [ "$sysname" = "" ]; then
sysname=alphaosf
fi;;
Linux)
case `uname -r` in
1*) sysname=linux-1 ;;
2.1*) sysname=linux-2.1 ;;
2.2*) sysname=linux-2.2 ;;
2*) sysname=linux-2.0 ;;
release=`uname -r`
minor=`echo $release |sed -e 's/[0-9]*\.\([0-9][0-9]*\)$/\1/'`
major=`echo $release |sed -e 's/\([0-9][0-9]*\)\.[0-9]*$/\1/'`
case $major in
1) sysname=linux-1 ;;
2) case $minor in
0) sysname=linux-2.0 ;;
1) sysname=linux-2.1 ;;
2) sysname=linux-2.2 ;;
*) sysname=linux-2.2 ;;
esac;;
esac;;
SunOS)
case `uname -r` in
@@ -88,9 +95,14 @@ if [ "$sysname" = "" ]; then
fi
echo "System Type: $sysname"
if [ x$major != x ] && [ x$minor != x ]; then
majversubst="-e /^##--majver--/,/^##--majver--/s/MajorVersion/$major/"
majversubst="-e /^##--minver--/,/^##--minver--/s/MinorVersion/$minor/"
fi
for foo in . client server relay common; do
(sed $nsupdate -e "/^##--${sysname}--/,/^##--${sysname}--/s/^#//" \
(sed $nsupdate $majversubst $minversubst \
-e "/^##--${sysname}--/,/^##--${sysname}--/s/^#//" \
<Makefile.conf; cat site.conf; cat $foo/Makefile.dist) \
>$foo/Makefile
done