summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/amd/Makefile.inc3
-rw-r--r--usr.sbin/amd/include/newvers.sh25
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`"
OpenPOWER on IntegriCloud