diff options
author | joerg <joerg@pkgsrc.org> | 2008-08-25 15:11:47 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2008-08-25 15:11:47 +0000 |
commit | a2c26cad6f2517c31e702ab493e33ec3cf2a4887 (patch) | |
tree | 27ba920d971d898fc156344b31b713e0bd5a5ecb /sysutils | |
parent | a592bf0f35352ef57e051fc2700bf3017309a582 (diff) | |
download | pkgsrc-a2c26cad6f2517c31e702ab493e33ec3cf2a4887.tar.gz |
Fix build on amd64, add destdir support.
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/915resolution/Makefile | 9 | ||||
-rw-r--r-- | sysutils/915resolution/distinfo | 6 | ||||
-rw-r--r-- | sysutils/915resolution/patches/patch-aa | 114 | ||||
-rw-r--r-- | sysutils/915resolution/patches/patch-ab | 4 |
4 files changed, 53 insertions, 80 deletions
diff --git a/sysutils/915resolution/Makefile b/sysutils/915resolution/Makefile index 653cde34332..7d058e11750 100644 --- a/sysutils/915resolution/Makefile +++ b/sysutils/915resolution/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2006/11/13 04:15:02 obache Exp $ +# $NetBSD: Makefile,v 1.3 2008/08/25 15:11:47 joerg Exp $ # DISTNAME= 915resolution-0.5.2 @@ -9,6 +9,8 @@ MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= http://www.geocities.com/stomljen/ COMMENT= BIOS VESA resolution utility for 8XX/9XX Intel chips +PKG_DESTDIR_SUPPORT= user-destdir + ONLY_FOR_PLATFORM= NetBSD-*-i386 NetBSD-*-x86_64 Linux-*-i386 USE_TOOLS+= gmake @@ -19,8 +21,9 @@ USE_TOOLS+= gmake MAKE_ENV+= LDLIBS=-l${MACHINE_ARCH} .endif +INSTALLATION_DIRS= sbin share/doc/915resolution + post-install: - ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/915resolution - ${INSTALL_DATA} ${WRKSRC}/README.txt ${PREFIX}/share/doc/915resolution + ${INSTALL_DATA} ${WRKSRC}/README.txt ${DESTDIR}${PREFIX}/share/doc/915resolution .include "../../mk/bsd.pkg.mk" diff --git a/sysutils/915resolution/distinfo b/sysutils/915resolution/distinfo index 3ff576a5e4d..f1b6b32923f 100644 --- a/sysutils/915resolution/distinfo +++ b/sysutils/915resolution/distinfo @@ -1,7 +1,7 @@ -$NetBSD: distinfo,v 1.2 2006/11/13 04:15:02 obache Exp $ +$NetBSD: distinfo,v 1.3 2008/08/25 15:11:47 joerg Exp $ SHA1 (915resolution-0.5.2.tar.gz) = 9f26eb1b728ca0b2d28c948207b034a49b477089 RMD160 (915resolution-0.5.2.tar.gz) = 722b352a83f41f0e9822ed4e096e8064f239dcc1 Size (915resolution-0.5.2.tar.gz) = 21183 bytes -SHA1 (patch-aa) = 8556275046ccc2a9ebabe03b422b2b764bacbc9d -SHA1 (patch-ab) = b65a38c9c7edd95f295619c9cdedc26449b3f177 +SHA1 (patch-aa) = a37e71ef741cc5c981376db8bcc1eff60c32e2db +SHA1 (patch-ab) = 5e6a865e4f0707390bf0c602aed9f7fc3c2284b4 diff --git a/sysutils/915resolution/patches/patch-aa b/sysutils/915resolution/patches/patch-aa index 1f663978182..f40626f99e4 100644 --- a/sysutils/915resolution/patches/patch-aa +++ b/sysutils/915resolution/patches/patch-aa @@ -1,15 +1,13 @@ -$NetBSD: patch-aa,v 1.2 2006/11/13 04:15:02 obache Exp $ +$NetBSD: patch-aa,v 1.3 2008/08/25 15:11:47 joerg Exp $ ---- 915resolution.c.orig 2006-02-02 23:28:34.000000000 +0900 +--- 915resolution.c.orig 2006-02-02 15:28:34.000000000 +0100 +++ 915resolution.c -@@ -22,7 +22,22 @@ +@@ -22,11 +22,57 @@ #include <string.h> #include <sys/mman.h> #include <fcntl.h> +#ifdef __linux__ #include <sys/io.h> -+#define OUTL(a, b) outl(a, b) -+#define OUTB(a, b) outb(a, b) +#endif +#ifdef __NetBSD__ +#include <machine/pio.h> @@ -19,75 +17,47 @@ $NetBSD: patch-aa,v 1.2 2006/11/13 04:15:02 obache Exp $ +# elif defined(__x86_64__) +#define iopl(a) x86_64_iopl(a) +# endif -+#define OUTL(a, b) outl(b, a) -+#define OUTB(a, b) outb(b, a) +#endif #include <unistd.h> #include <assert.h> -@@ -169,7 +184,7 @@ void initialize_system(char * filename) - } +- ++static uint8_t ++asm_inb(unsigned port) ++{ ++ uint8_t data; ++ __asm volatile("inb %w1,%0" : "=a" (data) : "d" (port)); ++ return data; ++} ++ ++static __inline void ++asm_outb(uint8_t data, unsigned port) ++{ ++ __asm volatile("outb %0,%w1" : : "a" (data), "d" (port)); ++} ++ ++static uint32_t ++asm_inl(unsigned port) ++{ ++ uint32_t data; ++ __asm volatile("inl %w1,%0" : "=a" (data) : "d" (port)); ++ return data; ++} ++ ++static __inline void ++asm_outl(uint32_t data, unsigned port) ++{ ++ __asm volatile("outl %0,%w1" : : "a" (data), "d" (port)); ++} ++ ++#undef inb ++#undef outb ++#define inb asm_inb ++#define outb asm_outb ++#undef inl ++#undef outl ++#define inl asm_inl ++#define outl asm_outl - cardinal get_chipset_id(void) { -- outl(0x80000000, 0xcf8); -+ OUTL(0x80000000, 0xcf8); - return inl(0xcfc); - } - -@@ -476,11 +491,11 @@ void unlock_vbios(vbios_map * map) { - case CT_UNKWN: - break; - case CT_855GM: -- outl(0x8000005a, 0xcf8); -+ OUTL(0x8000005a, 0xcf8); - map->b1 = inb(0xcfe); - -- outl(0x8000005a, 0xcf8); -- outb(0x33, 0xcfe); -+ OUTL(0x8000005a, 0xcf8); -+ OUTB(0x33, 0xcfe); - break; - case CT_845G: - case CT_865G: -@@ -488,13 +503,13 @@ void unlock_vbios(vbios_map * map) { - case CT_915GM: - case CT_945G: - case CT_945GM: -- outl(0x80000090, 0xcf8); -+ OUTL(0x80000090, 0xcf8); - map->b1 = inb(0xcfd); - map->b2 = inb(0xcfe); - -- outl(0x80000090, 0xcf8); -- outb(0x33, 0xcfd); -- outb(0x33, 0xcfe); -+ OUTL(0x80000090, 0xcf8); -+ OUTB(0x33, 0xcfd); -+ OUTB(0x33, 0xcfe); - break; - } - } -@@ -526,8 +541,8 @@ void relock_vbios(vbios_map * map) { - case CT_UNKWN: - break; - case CT_855GM: -- outl(0x8000005a, 0xcf8); -- outb(map->b1, 0xcfe); -+ OUTL(0x8000005a, 0xcf8); -+ OUTB(map->b1, 0xcfe); - break; - case CT_845G: - case CT_865G: -@@ -535,9 +550,9 @@ void relock_vbios(vbios_map * map) { - case CT_915GM: - case CT_945G: - case CT_945GM: -- outl(0x80000090, 0xcf8); -- outb(map->b1, 0xcfd); -- outb(map->b2, 0xcfe); -+ OUTL(0x80000090, 0xcf8); -+ OUTB(map->b1, 0xcfd); -+ OUTB(map->b2, 0xcfe); - break; - } - } + #define NEW(a) ((a *)(calloc(1, sizeof(a)))) + #define FREE(a) (free(a)) diff --git a/sysutils/915resolution/patches/patch-ab b/sysutils/915resolution/patches/patch-ab index 9ed72db7337..77183f337bb 100644 --- a/sysutils/915resolution/patches/patch-ab +++ b/sysutils/915resolution/patches/patch-ab @@ -1,4 +1,4 @@ -$NetBSD: patch-ab,v 1.2 2006/11/13 04:15:02 obache Exp $ +$NetBSD: patch-ab,v 1.3 2008/08/25 15:11:47 joerg Exp $ --- Makefile.orig 2006-02-02 23:01:38.000000000 +0900 +++ Makefile @@ -19,5 +19,5 @@ $NetBSD: patch-ab,v 1.2 2006/11/13 04:15:02 obache Exp $ install: ${PRG} - cp ${PRG} /usr/sbin -+ ${BSD_INSTALL_PROGRAM} ${PRG} ${PREFIX}/sbin ++ ${BSD_INSTALL_PROGRAM} ${PRG} ${DESTDIR}${PREFIX}/sbin |