diff options
author | obrien <obrien@FreeBSD.org> | 2001-09-05 16:54:20 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2001-09-05 16:54:20 +0000 |
commit | a561987dd6caa921f2dae7bb9a5a4570e1042c8e (patch) | |
tree | 3e6aa81e060ea60dceaa95b17de72cdd2d261d61 /usr.sbin/amd | |
parent | 9d8a805762329a53d281cceb6a882df9f8f81326 (diff) | |
download | FreeBSD-src-a561987dd6caa921f2dae7bb9a5a4570e1042c8e.zip FreeBSD-src-a561987dd6caa921f2dae7bb9a5a4570e1042c8e.tar.gz |
Try to determine the OS version and architecture for what is being built
vs. the building machine.
PR: 14040
Diffstat (limited to 'usr.sbin/amd')
-rw-r--r-- | usr.sbin/amd/Makefile.inc | 3 | ||||
-rw-r--r-- | usr.sbin/amd/include/newvers.sh | 25 |
2 files changed, 19 insertions, 9 deletions
diff --git a/usr.sbin/amd/Makefile.inc b/usr.sbin/amd/Makefile.inc index 186b508..3ded149 100644 --- a/usr.sbin/amd/Makefile.inc +++ b/usr.sbin/amd/Makefile.inc @@ -18,6 +18,9 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/amd/include CFLAGS+= -I${.CURDIR}/../../../contrib/amd CFLAGS+= -DHAVE_CONFIG_H +TARGET_ARCH?= ${MACHINE_ARCH} +CFLAGS+= -DHOST_CPU=\"${TARGET_ARCH}\" -DHOST_ARCH=\"${TARGET_ARCH}\" + .if exists(${.OBJDIR}/../libamu) LIBAMUDIR= ${.OBJDIR}/../libamu .else diff --git a/usr.sbin/amd/include/newvers.sh b/usr.sbin/amd/include/newvers.sh index 09068b0..bc7c49b 100644 --- a/usr.sbin/amd/include/newvers.sh +++ b/usr.sbin/amd/include/newvers.sh @@ -3,14 +3,19 @@ # mkconf # Generate local configuration parameters for amd # -cat << __EOF - -/* Define name of host machine's cpu (eg. sparc) */ -/* #define HOST_CPU "`uname -p`" */ -#define HOST_CPU "`uname -m`" -/* Define name of host machine's architecture (eg. sun4) */ -#define HOST_ARCH "`uname -m`" +if [ -e ../../../sys/conf/newvers.sh ]; then + eval `egrep '^[A-Z]+=' ../../../sys/conf/newvers.sh | grep -v COPYRIGHT` + OS=`echo ${TYPE} | tr '[A-Z]' '[a-z]'` + echo '/* Define name and version of host machine (eg. solaris2.5.1) */' + echo "#define HOST_OS \"${OS}${REVISION}\"" + echo '/* Define only name of host machine OS (eg. solaris2) */' + echo "#define HOST_OS_NAME \"${OS}${REVISION}\"" \ + | sed -e 's/\.[-._0-9]*//' + echo '/* Define only version of host machine (eg. 2.5.1) */' + echo "#define HOST_OS_VERSION \"${REVISION}\"" +else +cat << __NO_newvers_sh /* Define name and version of host machine (eg. solaris2.5.1) */ #define HOST_OS "`uname -s | tr '[A-Z]' '[a-z]'``uname -r`" @@ -18,8 +23,10 @@ cat << __EOF /* Define only name of host machine OS (eg. solaris2) */ #define HOST_OS_NAME "`uname -s | tr '[A-Z]' '[a-z]'``uname -r | sed -e 's/\..*$//'`" -/* Define only version of host machine (eg. 2.5.1) */ -#define HOST_OS_VERSION "`uname -r`" +__NO_newvers_sh +fi + +cat << __EOF /* Define name of host */ #define HOST_NAME "`hostname`" |