Browse Source

Fix driver compilation on Ubuntu 14.04

Suren A. Chilingaryan 8 years ago
parent
commit
5f13a1941a
2 changed files with 9 additions and 2 deletions
  1. 7 2
      driver/Makefile.in
  2. 2 0
      driver/umem.c

+ 7 - 2
driver/Makefile.in

@@ -62,8 +62,13 @@ default:
 	    revision="Revision $$build_revision from $$build_branch by $$build_author at $$build_path, last modification from $$build_lastmod" ;\
 	    /bin/echo -e "#define PCIDRIVER_BUILD \"$$build\"\\n#define PCIDRIVER_REVISION \"$$revision\"\\n#define PCIDRIVER_CHANGES \"$$build_changes\"\\n" > build.h ;\
 	else \
-	    grep "#define PCILIB_RELEASE" ../pcilib/build.h &> /dev/null ;\
-	    if [ $$? -eq 0 ]; then \
+	    if [ -f ../pcilib/build.h ]; then \
+		grep "#define PCILIB_RELEASE" ../pcilib/build.h &> /dev/null ;\
+		res=$$? ;\
+	    else \
+		res=-1 ;\
+	    fi ;\
+	    if [ $$res -eq 0 ]; then \
 		revision="Release \" PCILIB_RELEASE \" (r\" PCILIB_REVISION \") from \" PCILIB_REVISION_BRANCH \" by \" PCILIB_REVISION_AUTHOR \" at $$build_path, last modification from $$build_lastmod" ;\
 		/bin/echo -e "#include \"pcilib/build.h\"\\n#define PCIDRIVER_BUILD \"$$build\"\\n#define PCIDRIVER_REVISION \"$$revision\"\\n#define PCIDRIVER_CHANGES PCILIB_REVISION_MODIFICATIONS\n" > build.h ;\
 	    else \

+ 2 - 0
driver/umem.c

@@ -17,6 +17,8 @@
 #include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/sched.h>
+#include <linux/vmalloc.h>
+
 
 #include "base.h"