[coreboot] [v2] r4623 - trunk/util/superiotool

svn at coreboot.org svn at coreboot.org
Tue Sep 1 11:57:55 CEST 2009


Author: stepan
Date: 2009-09-01 11:57:55 +0200 (Tue, 01 Sep 2009)
New Revision: 4623

Modified:
   trunk/util/superiotool/Makefile
   trunk/util/superiotool/superiotool.h
Log:

* Add OSX/Darwin support
* Add DESTDIR support

Signed-off-by: Stefan Reinauer <stepan at coresystems.de>
Acked-by: Peter Stuge <peter at stuge.se>



Modified: trunk/util/superiotool/Makefile
===================================================================
--- trunk/util/superiotool/Makefile	2009-09-01 09:54:21 UTC (rev 4622)
+++ trunk/util/superiotool/Makefile	2009-09-01 09:57:55 UTC (rev 4623)
@@ -34,17 +34,23 @@
 
 OBJS = superiotool.o ali.o fintek.o ite.o nsc.o smsc.o winbond.o
 
+OS_ARCH = $(shell uname)
+ifeq ($(OS_ARCH), Darwin)
+LDFLAGS = -framework IOKit -framework DirectIO -lpci -lz
+endif
+
 all: $(PROGRAM)
 
 superiotool.o: *.c superiotool.h
 
 $(PROGRAM): $(OBJS) superiotool.h
-	$(CC) $(CFLAGS) -o $(PROGRAM) $(OBJS)
+	$(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS)
 
 install: $(PROGRAM)
-	$(INSTALL) $(PROGRAM) $(PREFIX)/sbin
-	mkdir -p $(PREFIX)/share/man/man8
-	$(INSTALL) $(PROGRAM).8 $(PREFIX)/share/man/man8
+	mkdir -p $(DESTDIR)$(PREFIX)/sbin
+	$(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin
+	mkdir -p $(DESTDIR)$(PREFIX)/share/man/man8
+	$(INSTALL) $(PROGRAM).8 $(DESTDIR)$(PREFIX)/share/man/man8
 
 clean:
 	rm -f $(PROGRAM) *.o

Modified: trunk/util/superiotool/superiotool.h
===================================================================
--- trunk/util/superiotool/superiotool.h	2009-09-01 09:54:21 UTC (rev 4622)
+++ trunk/util/superiotool/superiotool.h	2009-09-01 09:57:55 UTC (rev 4623)
@@ -4,6 +4,7 @@
  * Copyright (C) 2007 Carl-Daniel Hailfinger
  * Copyright (C) 2007 Uwe Hermann <uwe at hermann-uwe.de>
  * Copyright (C) 2008 Robinson P. Tryon <bishop.robinson at gmail.com>
+ * Copyright (C) 2008-2009 coresystems GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -31,6 +32,10 @@
 #if defined(__GLIBC__)
 #include <sys/io.h>
 #endif
+#if (defined(__MACH__) && defined(__APPLE__))
+/* DirectIO is available here: http://www.coresystems.de/en/directio */
+#include <DirectIO/darwinio.h>
+#endif
 
 #if defined(__FreeBSD__)
 #include <sys/types.h>





More information about the coreboot mailing list