nps: Makefile, poci/Makefile, poci/nws_mc.c, poci/nws_poci.c - cle...
baggins
baggins at pld-linux.org
Mon Aug 1 23:24:29 CEST 2005
Author: baggins Date: Mon Aug 1 21:24:29 2005 GMT
Module: nps Tag: HEAD
---- Log message:
- cleaned up build conditions (made them meaningful)
---- Files affected:
nps:
Makefile (1.5 -> 1.6)
nps/poci:
Makefile (1.2 -> 1.3) , nws_mc.c (1.1.1.1 -> 1.2) , nws_poci.c (1.1.1.1 -> 1.2)
---- Diffs:
================================================================
Index: nps/Makefile
diff -u nps/Makefile:1.5 nps/Makefile:1.6
--- nps/Makefile:1.5 Mon Aug 1 19:52:35 2005
+++ nps/Makefile Mon Aug 1 23:24:24 2005
@@ -2,16 +2,15 @@
TOPDIR=$(shell pwd)
KERNEL_VERSION := $(shell grep UTS_RELEASE $(KERNEL_DIR)/include/linux/version.h | sed -e 's/.*UTS_RELEASE "\([0-9]*\.[0-9]*\)\..*"/\1/')
+BUILD_ARCH := $(shell uname -m | sed 'y/-/_/')
-export PLATFORM_X86_64 := $(shell uname -m | awk '{ if ($$0 ~ /x86[-_]64/) print "1"; else print "0"}')
-
-SED_PWD=$(shell echo `pwd` | sed -e 's/\//\\\//g')
+SED_PWD := $(shell echo `pwd` | sed -e 's/\//\\\//g')
.PHONY: copy_files
all: copy_files
@make -C jnet
- @if [ "$(KERNEL_VERSION)" = "2.6" ] && [ $(PLATFORM_X86_64) -eq 1 ] ; then \
+ @if [ "$(KERNEL_VERSION)" = "2.6" ] && [ "$(BUILD_ARCH)" = "x86_64" ] ; then \
echo "skipping nws_mc" ;\
else \
make -C nws_mc ;\
@@ -20,7 +19,7 @@
install: copy_files
make install -C jnet
- @if [ "$(KERNEL_VERSION)" = "2.6" ] && [ $(PLATFORM_X86_64) -eq 1 ] ; then \
+ @if [ "$(KERNEL_VERSION)" = "2.6" ] && [ "$(BUILD_ARCH)" = "x86_64" ] ; then \
echo "skipping nws_mc" ;\
else \
make install -C nws_mc ;\
================================================================
Index: nps/poci/Makefile
diff -u nps/poci/Makefile:1.2 nps/poci/Makefile:1.3
--- nps/poci/Makefile:1.2 Mon Aug 1 19:52:35 2005
+++ nps/poci/Makefile Mon Aug 1 23:24:24 2005
@@ -20,22 +20,24 @@
KERNEL_DIR=/usr/src/linux
KERNEL_VERSION := $(shell grep UTS_RELEASE $(KERNEL_DIR)/include/linux/version.h | sed -e 's/.*UTS_RELEASE "\([0-9]*\.[0-9]*\)\..*"/\1/')
-ARCH_VERSION ?= $(shell uname -m)
-
-ifeq ($(KERNEL_VERSION),2.6)
-MC_CFLAGS_EXTRA += -DLINUX_2_6_KERNEL=1
-POCI_CFLAGS_EXTRA += -DLINUX_2_6_KERNEL=1 -L/usr/lib -L/usr/lib64 -lpci
-endif
+BUILD_ARCH := $(shell uname -m | sed 'y/-/_/')
OPTFLAGS = -O2
CFLAGS = $(OPTFLAGS) -I../common
+ifeq ($(KERNEL_VERSION),2.6)
+ifeq ($(BUILD_ARCH),x86_64)
+CFLAGS += -DKERNEL_HAS_MCE=1
+POCI_LDFLAGS = -L/usr/lib -L/usr/lib64 -lpci
+endif
+endif
+
.PHONY: all install uninstall postinstall preuninstall postuninstall clean
all:
- gcc $(CFLAGS) -o nws_mc nws_mc.c $(MC_CFLAGS_EXTRA)
+ gcc $(CFLAGS) -o nws_mc nws_mc.c
gcc $(CFLAGS) -o nws_hb nws_hb.c
- gcc $(CFLAGS) -o nws_poci nws_poci.c $(POCI_CFLAGS_EXTRA)
+ gcc $(CFLAGS) -o nws_poci nws_poci.c $(POCI_LDFLAGS)
clean:
rm -f nws_mc nws_hb nws_poci
================================================================
Index: nps/poci/nws_mc.c
diff -u nps/poci/nws_mc.c:1.1.1.1 nps/poci/nws_mc.c:1.2
--- nps/poci/nws_mc.c:1.1.1.1 Mon Jul 25 21:42:58 2005
+++ nps/poci/nws_mc.c Mon Aug 1 23:24:24 2005
@@ -40,7 +40,7 @@
#include <syslog.h>
#include <linux/errno.h>
-#if LINUX_2_6_KERNEL
+#if KERNEL_HAS_MCE
#include <asm/mce.h>
#endif
@@ -84,7 +84,7 @@
fclose(pidFile);
}
-#if LINUX_2_6_KERNEL
+#if KERNEL_HAS_MCE
if( stat( MCE_LOG, &stat_buf ) == 0 )
{
// We are running on a 2.6 kernel which supports it's own MCE
@@ -151,7 +151,7 @@
return;
}
-#if LINUX_2_6_KERNEL
+#if KERNEL_HAS_MCE
/**********************************************
Function: mcelogHandler
Arguments: none
================================================================
Index: nps/poci/nws_poci.c
diff -u nps/poci/nws_poci.c:1.1.1.1 nps/poci/nws_poci.c:1.2
--- nps/poci/nws_poci.c:1.1.1.1 Mon Jul 25 21:43:01 2005
+++ nps/poci/nws_poci.c Mon Aug 1 23:24:24 2005
@@ -55,7 +55,7 @@
#include <resolv.h> //contains path for /etc/resolv.conf
#include <signal.h>
-#if LINUX_2_6_KERNEL
+#if KERNEL_HAS_MCE
#include <pci/pci.h>
#endif
@@ -1775,7 +1775,7 @@
return;
}
-#if LINUX_2_6_KERNEL
+#if KERNEL_HAS_MCE
/*********************************************************************
Function: get_dimmmap
@@ -1875,7 +1875,7 @@
#endif
-#if LINUX_2_6_KERNEL
+#if KERNEL_HAS_MCE
/*********************************************************************
Function: cpuid_eax
@@ -2106,7 +2106,7 @@
return val;
}
-#if LINUX_2_6_KERNEL
+#if KERNEL_HAS_MCE
int read_pci( int bus, int dev, int func, int reg, uint32_t *val )
{
================================================================
---- CVS-web:
http://cvs.pld-linux.org/nps/Makefile?r1=1.5&r2=1.6&f=u
http://cvs.pld-linux.org/nps/poci/Makefile?r1=1.2&r2=1.3&f=u
http://cvs.pld-linux.org/nps/poci/nws_mc.c?r1=1.1.1.1&r2=1.2&f=u
http://cvs.pld-linux.org/nps/poci/nws_poci.c?r1=1.1.1.1&r2=1.2&f=u
More information about the pld-cvs-commit
mailing list