Browse Source

libaio: initial package

Steven Barth 10 years ago
parent
commit
b07194e5a8

+ 62
- 0
libs/libaio/Makefile View File

@@ -0,0 +1,62 @@
1
+#
2
+# Copyright (C) 2007-2010 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=libaio
11
+PKG_VERSION:=0.3.109
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
15
+PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/liba/libaio/
16
+PKG_MD5SUM:=435a5b16ca6198eaf01155263d855756
17
+PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
18
+
19
+PKG_USE_MIPS16:=0
20
+
21
+include $(INCLUDE_DIR)/package.mk
22
+
23
+define Package/libaio
24
+  SECTION:=libs
25
+  CATEGORY:=Libraries
26
+  TITLE:=Linux kernel AIO interface access library
27
+  URL:=http://lse.sourceforge.net/io/aio.html
28
+endef
29
+
30
+define Build/Configure
31
+endef
32
+
33
+LIBAIO_CFLAGS:=-nostdlib -nostartfiles -I. $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)
34
+
35
+TARGET_CFLAGS += $(FPIC)
36
+
37
+define Build/Compile
38
+	$(MAKE) -C $(PKG_BUILD_DIR) \
39
+		$(TARGET_CONFIGURE_OPTS) \
40
+		ARCH="$(ARCH)" \
41
+		CC="$(TARGET_CROSS)gcc" \
42
+		LD="$(TARGET_CROSS)ld" \
43
+		CFLAGS="$(LIBAIO_CFLAGS)" \
44
+		all
45
+	$(MAKE) -C $(PKG_BUILD_DIR) \
46
+		prefix="$(PKG_INSTALL_DIR)/usr" \
47
+		install
48
+endef
49
+
50
+define Build/InstallDev
51
+	$(INSTALL_DIR) $(1)/usr/include
52
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/libaio.h $(1)/usr/include/
53
+	$(INSTALL_DIR) $(1)/usr/lib
54
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libaio.{a,so*} $(1)/usr/lib/
55
+endef
56
+
57
+define Package/libaio/install
58
+	$(INSTALL_DIR) $(1)/usr/lib
59
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libaio.so.* $(1)/usr/lib/
60
+endef
61
+
62
+$(eval $(call BuildPackage,libaio))

+ 1098
- 0
libs/libaio/patches/001-arches_from_debian_package_0.3.109-4.patch
File diff suppressed because it is too large
View File


+ 124
- 0
libs/libaio/patches/002-avr32_support.patch View File

@@ -0,0 +1,124 @@
1
+Index: libaio-0.3.109/src/libaio.h
2
+===================================================================
3
+--- libaio-0.3.109.orig/src/libaio.h	2014-06-11 10:41:12.537824814 +0200
4
++++ libaio-0.3.109/src/libaio.h	2014-06-11 10:41:12.537824814 +0200
5
+@@ -134,6 +134,10 @@
6
+ #define PADDEDptr(x, y) x
7
+ #define PADDEDul(x, y)  unsigned long x
8
+ #  endif
9
++#elif defined(__avr32__) /* big endian, 32 bits */
10
++#define PADDED(x, y)	unsigned y; x
11
++#define PADDEDptr(x, y)	unsigned y; x
12
++#define PADDEDul(x, y)	unsigned y; unsigned long x;
13
+ #else
14
+ #error	endian?
15
+ #endif
16
+Index: libaio-0.3.109/src/syscall-avr32.h
17
+===================================================================
18
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
19
++++ libaio-0.3.109/src/syscall-avr32.h	2014-06-11 10:41:12.537824814 +0200
20
+@@ -0,0 +1,91 @@
21
++/*
22
++ * Copyright (C) 2007 Atmel Corporation
23
++ *
24
++ * This program is free software; you can redistribute it and/or modify
25
++ * it under the terms of the GNU General Public License version 2 as
26
++ * published by the Free Software Foundation.
27
++ */
28
++
29
++#define __NR_io_setup		197
30
++#define __NR_io_destroy		198
31
++#define __NR_io_getevents	199
32
++#define __NR_io_submit		200
33
++#define __NR_io_cancel		201
34
++
35
++#define io_syscall1(type,fname,sname,type1,arg1)			\
36
++type fname(type1 arg1)							\
37
++{									\
38
++	register long __r12 __asm__("r12") = (long)arg1;		\
39
++	register long __res_r12 __asm__("r12");				\
40
++	register long __scno __asm__("r8") = __NR_##sname;		\
41
++	__asm__ __volatile__("scall"					\
42
++			     : "=r"(__res_r12)				\
43
++			     : "0"(__r12), "r"(__scno)			\
44
++			     : "memory");				\
45
++	return (type) __res_r12;					\
46
++}
47
++
48
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2)		\
49
++type fname(type1 arg1, type2 arg2)					\
50
++{									\
51
++	register long __r12 __asm__("r12") = (long)arg1;		\
52
++	register long __r11 __asm__("r11") = (long)arg2;		\
53
++	register long __res_r12 __asm__("r12");				\
54
++	register long __scno __asm__("r8") = __NR_##sname;		\
55
++	__asm__ __volatile__("scall"					\
56
++			     : "=r"(__res_r12)				\
57
++			     : "0"(__r12), "r"(__r11), "r"(__scno)	\
58
++			     : "memory");				\
59
++	return (type) __res_r12;					\
60
++}
61
++
62
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3)	\
63
++type fname(type1 arg1, type2 arg2, type3 arg3)				\
64
++{									\
65
++	register long __r12 __asm__("r12") = (long)arg1;		\
66
++	register long __r11 __asm__("r11") = (long)arg2;		\
67
++	register long __r10 __asm__("r10") = (long)arg3;		\
68
++	register long __res_r12 __asm__("r12");				\
69
++	register long __scno __asm__("r8") = __NR_##sname;		\
70
++	__asm__ __volatile__("scall"					\
71
++			     : "=r"(__res_r12)				\
72
++			     : "0"(__r12), "r"(__r11), "r"(__r10),	\
73
++			       "r"(__scno)				\
74
++			     : "memory");				\
75
++	return (type) __res_r12;					\
76
++}
77
++
78
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
79
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4)		\
80
++{									\
81
++	register long __r12 __asm__("r12") = (long)arg1;		\
82
++	register long __r11 __asm__("r11") = (long)arg2;		\
83
++	register long __r10 __asm__("r10") = (long)arg3;		\
84
++	register long __r9 __asm__("r9") = (long)arg4;			\
85
++	register long __res_r12 __asm__("r12");				\
86
++	register long __scno __asm__("r8") = __NR_##sname;		\
87
++	__asm__ __volatile__("scall"					\
88
++			     : "=r"(__res_r12)				\
89
++			     : "0"(__r12), "r"(__r11), "r"(__r10),	\
90
++			       "r"(__r9), "r"(__scno)			\
91
++			     : "memory");				\
92
++	return (type) __res_r12;					\
93
++}
94
++
95
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
96
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5)	\
97
++{									\
98
++	register long __r12 __asm__("r12") = (long)arg1;		\
99
++	register long __r11 __asm__("r11") = (long)arg2;		\
100
++	register long __r10 __asm__("r10") = (long)arg3;		\
101
++	register long __r9 __asm__("r9") = (long)arg4;			\
102
++	register long __r5 __asm__("r5") = (long)arg5;			\
103
++	register long __res_r12 __asm__("r12");				\
104
++	register long __scno __asm__("r8") = __NR_##sname;		\
105
++	__asm__ __volatile__("scall"					\
106
++			     : "=r"(__res_r12)				\
107
++			     : "0"(__r12), "r"(__r11), "r"(__r10),	\
108
++			       "r"(__r9), "r"(__r5), "r"(__scno)	\
109
++			     : "memory");				\
110
++	return (type) __res_r12;					\
111
++}
112
+Index: libaio-0.3.109/src/syscall.h
113
+===================================================================
114
+--- libaio-0.3.109.orig/src/syscall.h	2014-06-11 10:41:12.537824814 +0200
115
++++ libaio-0.3.109/src/syscall.h	2014-06-11 10:41:12.537824814 +0200
116
+@@ -38,6 +38,8 @@
117
+ #include "syscall-sh.h"
118
+ #elif defined(__aarch64__)
119
+ #include "syscall-arm64.h"
120
++#elif defined(__avr32__)
121
++#include "syscall-avr32.h"
122
+ #else
123
+ #error "add syscall-arch.h"
124
+ #endif