summaryrefslogtreecommitdiff
path: root/recipes/dvd+rw-tools/files/04-kfreebsd.dpatch
blob: acc76b39f17fc3220c6bdf7558dfedc4dbd8be58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh /usr/share/dpatch/dpatch-run
## 03-kfreebsd.dpatch by Petr Salinger <Petr.Salinger@seznam.cz>
##
## DP: FTBFS on GNU/kFreeBSD (Closes: #374841).

@DPATCH@

diff -Naurp dvd+rw-tools-7.1.orig/Makefile.m4 dvd+rw-tools-7.1/Makefile.m4
--- dvd+rw-tools-7.1.orig/Makefile.m4	2008-03-02 17:17:09.000000000 +0000
+++ dvd+rw-tools-7.1/Makefile.m4	2008-04-01 09:03:41.000000000 +0000
@@ -14,6 +14,7 @@ ifelse(substr(OS,0,7),[MINGW32],[define(
 ifelse(OS,NetBSD,[define([OS],[BSD])CXXFLAGS+=-D__unix])
 ifelse(OS,OpenBSD,[define([OS],[BSD])])
 ifelse(OS,FreeBSD,[define([OS],[BSD])LDLIBS=-lcam])
+ifelse(OS,GNU/kFreeBSD,[define([OS],[Linux])LDLIBS=-lcam])
 ifelse(OS,IRIX64,[define([OS],[IRIX])])
 
 ifelse(OS,Darwin,[
@@ -188,7 +189,7 @@ CC	=gcc
 CFLAGS	+=$(WARN) -O2 -D_REENTRANT
 CXX	=g++
 CXXFLAGS+=$(WARN) -O2 -fno-exceptions -D_REENTRANT
-LDLIBS	=-lpthread
+LDLIBS	+=-lpthread
 LINK.o	=$(LINK.cc)
 
 prefix?=/usr/local
diff -Naurp dvd+rw-tools-7.1.orig/growisofs.c dvd+rw-tools-7.1/growisofs.c
--- dvd+rw-tools-7.1.orig/growisofs.c	2008-03-04 09:15:03.000000000 +0000
+++ dvd+rw-tools-7.1/growisofs.c	2008-04-01 09:03:41.000000000 +0000
@@ -403,7 +403,7 @@
 #define _LARGEFILE64_SOURCE
 #define _FILE_OFFSET_BITS 64
 
-#if defined(__linux)
+#if defined(__linux) || defined(__GLIBC__)
 /* ... and "engage" glibc large file support */
 # ifndef _GNU_SOURCE
 #  define _GNU_SOURCE
@@ -459,7 +459,7 @@
 # define FATAL_START(e)	(0x80|(e))
 # define FATAL_MASK	 0x7F
 
-#ifdef __FreeBSD__
+#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
 # include <sys/syscall.h>
 # ifndef SYS_mlockall
 #  define SYS_mlockall 324
@@ -995,7 +995,7 @@ char *setup_fds (char *device)
     goto open_rw;
 }
 
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined (__FreeBSD_kernel__)
 
 #include <sys/cdio.h>
 #include <camlib.h>
@@ -2937,7 +2937,7 @@ int main (int argc, char *argv[])
 	    if (setrlimit(RLIMIT_MEMLOCK,&rlim)) break;
 	}
 # endif
-# ifdef __FreeBSD__
+# if defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
 	syscall(SYS_mlockall,3);
 # else
 	mlockall(MCL_CURRENT|MCL_FUTURE);
diff -Naurp dvd+rw-tools-7.1.orig/transport.hxx dvd+rw-tools-7.1/transport.hxx
--- dvd+rw-tools-7.1.orig/transport.hxx	2008-03-01 10:34:43.000000000 +0000
+++ dvd+rw-tools-7.1/transport.hxx	2008-04-01 09:03:41.000000000 +0000
@@ -483,7 +483,7 @@ public:
     {	return 1;   }
 };
 
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 
 #include <sys/ioctl.h>
 #include <camlib.h>