aboutsummaryrefslogtreecommitdiffstats
path: root/package/libs/libubox/Makefile
blob: ac160bfb92179bcdbe6a166533a6a793fbebc078 (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
include $(TOPDIR)/rules.mk

PKG_NAME:=libubox
PKG_VERSION:=2014-08-04
PKG_RELEASE=$(PKG_SOURCE_VERSION)

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=http://git.openwrt.org/project/libubox.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=dffbc09baf71b294185a36048166d00066d433b5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_MD5SUM:=
CMAKE_INSTALL:=1

PKG_LICENSE:=ISC BSD-3c
PKG_LICENSE_FILES:=

PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>

PKG_BUILD_DEPENDS:=lua

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

define Package/libubox
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=Basic utility library
  ABI_VERSION:=$(PKG_VERSION)
  DEPENDS:=
endef

define Package/libblobmsg-json
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=blobmsg <-> json conversion library
  DEPENDS:=+libjson-c +libubox
endef

define Package/jshn
  SECTION:=utils
  CATEGORY:=Utilities
  DEPENDS:=+libjson-c +libubox +libblobmsg-json
  TITLE:=JSON SHell Notation
endef

define Package/jshn/description
  Library for parsing and generating JSON from shell scripts
endef

define Package/libjson-script
  SECTION:=utils
  CATEGORY:=Utilities
  DEPENDS:=+libubox
  TITLE:=Minimalistic JSON based scripting engine
endef

define Package/libubox-lua
  SECTION:=libs
  CATEGORY:=Libraries
  DEPENDS:=+libubox +liblua
  TITLE:=Lua binding for the OpenWrt Basic utility library
endef

TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
CMAKE_OPTIONS = \
	-DLUAPATH=/usr/lib/lua

define Package/libubox/install
	$(INSTALL_DIR) $(1)/lib/
	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libubox.so $(1)/lib/
endef

define Package/libblobmsg-json/install
	$(INSTALL_DIR) $(1)/lib/
	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblobmsg_json.so $(1)/lib/
endef

define Package/jshn/install
	$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/share/libubox
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/jshn $(1)/usr/bin
	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libubox/jshn.sh $(1)/usr/share/libubox
endef

define Package/libjson-script/install
	$(INSTALL_DIR) $(1)/lib/
	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libjson_script.so $(1)/lib/
endef

define Package/libubox-lua/install
	$(INSTALL_DIR) $(1)/usr/lib/lua
	$(CP) $(PKG_BUILD_DIR)/lua/uloop.so $(1)/usr/lib/lua/
endef

$(eval $(call BuildPackage,libubox))
$(eval $(call BuildPackage,libblobmsg-json))
$(eval $(call BuildPackage,jshn))
$(eval $(call BuildPackage,libjson-script))
$(eval $(call BuildPackage,libubox-lua))
ass="p">, // 08 ABC_OPER_CONST_X, // 09 ABC_OPER_CONST_Z, // 10 ABC_OPER_BIT_BUF, // 11 ABC_OPER_BIT_INV, // 12 ABC_OPER_BIT_AND, // 13 ABC_OPER_BIT_NAND, // 14 ABC_OPER_BIT_OR, // 15 ABC_OPER_BIT_NOR, // 16 ABC_OPER_BIT_XOR, // 17 ABC_OPER_BIT_NXOR, // 18 ABC_OPER_BIT_SHARP, // 19 ABC_OPER_BIT_SHARPL, // 20 ABC_OPER_BIT_MUX, // 21 ABC_OPER_BIT_MAJ, // 22 ABC_OPER_ABC, // 23 ABC_OPER_BA, // 24 ABC_OPER_BO, // 25 ABC_OPER_BX, // 26 ABC_OPER_BN, // 27 ABC_OPER_BAO, // 28 ABC_OPER_BOA, // 29 ABC_OPER_RED_AND, // 30 ABC_OPER_RED_NAND, // 31 ABC_OPER_RED_OR, // 32 ABC_OPER_RED_NOR, // 33 ABC_OPER_RED_XOR, // 34 ABC_OPER_RED_NXOR, // 35 ABC_OPER_LOGIC_NOT, // 36 ABC_OPER_LOGIC_AND, // 37 ABC_OPER_LOGIC_NAND, // 38 ABC_OPER_LOGIC_OR, // 39 ABC_OPER_LOGIC_NOR, // 40 ABC_OPER_LOGIC_XOR, // 41 ABC_OPER_LOGIC_XNOR, // 42 ABC_OPER_SEL_NMUX, // 43 ABC_OPER_SEL_SEL, // 44 ABC_OPER_SEL_PSEL, // 45 ABC_OPER_SEL_ENC, // 46 ABC_OPER_SEL_PENC, // 47 ABC_OPER_SEL_DEC, // 48 ABC_OPER_SEL_EDEC, // 49 ABC_OPER_ARI_ADD, // 50 ABC_OPER_ARI_SUB, // 51 ABC_OPER_ARI_MUL, // 52 ABC_OPER_ARI_SMUL, // 53 ABC_OPER_ARI_DIV, // 54 ABC_OPER_ARI_MOD, // 55 ABC_OPER_ARI_REM, // 56 ABC_OPER_ARI_POW, // 57 ABC_OPER_ARI_MIN, // 58 ABC_OPER_ARI_SQRT, // 59 ABC_OPER_ARI_ABS, // 60 ABC_OPER_COMP_SLESS, // 61 ABC_OPER_COMP_LESS, // 62 ABC_OPER_COMP_LESSEQU, // 63 ABC_OPER_COMP_MOREEQU, // 64 ABC_OPER_COMP_MORE, // 65 ABC_OPER_COMP_EQU, // 66 ABC_OPER_COMP_NOTEQU, // 67 ABC_OPER_SHIFT_L, // 68 ABC_OPER_SHIFT_R, // 69 ABC_OPER_SHIFT_LA, // 70 ABC_OPER_SHIFT_RA, // 71 ABC_OPER_SHIFT_ROTL, // 72 ABC_OPER_SHIFT_ROTR, // 73 ABC_OPER_NODE, // 74 ABC_OPER_LUT, // 75 ABC_OPER_GATE, // 76 ABC_OPER_TABLE, // 77 ABC_OPER_TRI, // 78 ABC_OPER_RAM, // 79 ABC_OPER_RAMR, // 80 ABC_OPER_RAMW, // 81 ABC_OPER_RAMWC, // 82 ABC_OPER_RAML, // 83 ABC_OPER_RAMS, // 84 ABC_OPER_RAMBOX, // 85 ABC_OPER_LATCH, // 86 ABC_OPER_LATCHRS, // 87 ABC_OPER_DFF, // 88 ABC_OPER_DFFCPL, // 89 ABC_OPER_DFFRS, // 90 ABC_OPER_SLICE, // 91 ABC_OPER_CONCAT, // 92 ABC_OPER_ZEROPAD, // 93 ABC_OPER_SIGNEXT, // 94 ABC_OPER_LOGIC_IMPL, // 95 ABC_OPER_ARI_SQUARE, // 96 ABC_OPER_CONST, // 97 ABC_OPER_ARI_ADDSUB, // 98 ABC_OPER_LAST // 99 } Acb_ObjType_t; // printing operator types static inline char * Abc_OperName( int Type ) { if ( Type == ABC_OPER_NONE ) return NULL; if ( Type == ABC_OPER_PI ) return "pi"; if ( Type == ABC_OPER_PO ) return "po"; if ( Type == ABC_OPER_CI ) return "ci"; if ( Type == ABC_OPER_CO ) return "co"; if ( Type == ABC_OPER_FON ) return "fon"; if ( Type == ABC_OPER_BOX ) return "box"; if ( Type == ABC_OPER_BIT_BUF ) return "buf"; if ( Type == ABC_OPER_BIT_INV ) return "~"; if ( Type == ABC_OPER_BIT_MUX ) return "mux"; if ( Type == ABC_OPER_BIT_MAJ ) return "maj"; if ( Type == ABC_OPER_BIT_AND ) return "&"; if ( Type == ABC_OPER_BIT_OR ) return "|"; if ( Type == ABC_OPER_BIT_XOR ) return "^"; if ( Type == ABC_OPER_BIT_NAND ) return "~&"; if ( Type == ABC_OPER_BIT_NOR ) return "~|"; if ( Type == ABC_OPER_BIT_NXOR ) return "~^"; if ( Type == ABC_OPER_RED_AND ) return "&"; if ( Type == ABC_OPER_RED_OR ) return "|"; if ( Type == ABC_OPER_RED_XOR ) return "^"; if ( Type == ABC_OPER_RED_NAND ) return "~&"; if ( Type == ABC_OPER_RED_NOR ) return "~|"; if ( Type == ABC_OPER_RED_NXOR ) return "~^"; if ( Type == ABC_OPER_LOGIC_NOT ) return "!"; if ( Type == ABC_OPER_LOGIC_IMPL ) return "=>"; if ( Type == ABC_OPER_LOGIC_AND ) return "&&"; if ( Type == ABC_OPER_LOGIC_OR ) return "||"; if ( Type == ABC_OPER_LOGIC_XOR ) return "^^"; if ( Type == ABC_OPER_ARI_ADD ) return "+"; if ( Type == ABC_OPER_ARI_SUB ) return "-"; if ( Type == ABC_OPER_ARI_MUL ) return "*"; if ( Type == ABC_OPER_ARI_DIV ) return "/"; if ( Type == ABC_OPER_ARI_REM ) return "%"; if ( Type == ABC_OPER_ARI_MOD ) return "mod"; if ( Type == ABC_OPER_ARI_POW ) return "**"; if ( Type == ABC_OPER_ARI_MIN ) return "-"; if ( Type == ABC_OPER_ARI_SQRT ) return "sqrt"; if ( Type == ABC_OPER_ARI_SQUARE ) return "squar"; if ( Type == ABC_OPER_COMP_EQU ) return "=="; if ( Type == ABC_OPER_COMP_NOTEQU ) return "!="; if ( Type == ABC_OPER_COMP_LESS ) return "<"; if ( Type == ABC_OPER_COMP_MORE ) return ">"; if ( Type == ABC_OPER_COMP_LESSEQU ) return "<="; if ( Type == ABC_OPER_COMP_MOREEQU ) return ">="; if ( Type == ABC_OPER_SHIFT_L ) return "<<"; if ( Type == ABC_OPER_SHIFT_R ) return ">>"; if ( Type == ABC_OPER_SHIFT_LA ) return "<<<"; if ( Type == ABC_OPER_SHIFT_RA ) return ">>>"; if ( Type == ABC_OPER_SHIFT_ROTL ) return "rotL"; if ( Type == ABC_OPER_SHIFT_ROTR ) return "rotR"; if ( Type == ABC_OPER_SLICE ) return "[:]"; if ( Type == ABC_OPER_CONCAT ) return "{}"; if ( Type == ABC_OPER_ZEROPAD ) return "zPad"; if ( Type == ABC_OPER_SIGNEXT ) return "sExt"; if ( Type == ABC_OPER_TABLE ) return "table"; if ( Type == ABC_OPER_LAST ) return NULL; assert( 0 ); return NULL; } //////////////////////////////////////////////////////////////////////// /// MACRO DEFINITIONS /// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /// ITERATORS /// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /// FUNCTION DECLARATIONS /// //////////////////////////////////////////////////////////////////////// ABC_NAMESPACE_HEADER_END #endif //////////////////////////////////////////////////////////////////////// /// END OF FILE /// ////////////////////////////////////////////////////////////////////////