blob: db6e7b56f9e5465f0f0eb76a453fa215e5fcc820 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001--- a/devtools/bin/Build
2+++ b/devtools/bin/Build
3@@ -320,6 +320,16 @@ then
4 rel=`/usr/apollo/bin/bldt | grep Domain | awk '{ print $4 }' | sed -e 's/,//g'`
5 fi
6
7+#
8+# LEDE/OpenWrt build system
9+#
10+if [ -n "$STAGING_DIR" -a -n "$OPENWRT_BUILD" ]
11+then
12+ os="OpenWrt"
13+ rel="any"
14+ arch="any"
15+fi
16+
17 if [ ! "$arch" -a ! "$os" -a ! "$rel" ]
18 then
19 arch=`uname -m | sed -e 's/ //g' -e 's/\//-/g'`
20--- a/include/sm/conf.h
21+++ b/include/sm/conf.h
22@@ -57,7 +57,7 @@
23 # endif
24
25 # ifndef HASRRESVPORT
26-# define HASRRESVPORT 1 /* has rrsevport(3) call */
27+# define HASRRESVPORT 0 /* has rrsevport(3) call */
28 # endif
29
30 /**********************************************************************
31@@ -1484,7 +1484,9 @@ extern void *malloc();
32 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
33 # define HASUNAME 1 /* use System V uname(2) system call */
34 # define HASUNSETENV 1 /* has unsetenv(3) call */
35-# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
36+# ifdef __GLIBC__
37+# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
38+# endif
39 # define GIDSET_T gid_t /* from <linux/types.h> */
40 # ifndef HASGETUSERSHELL
41 # define HASGETUSERSHELL 0 /* getusershell(3) broken in Slackware 2.0 */
42@@ -1522,6 +1524,7 @@ extern void *malloc();
43 # if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
44 # define HASSTRERROR 1 /* has strerror(3) */
45 # endif
46+# define HASSTRERROR 1 /* Patch for LEDE/OpenWRT: has strerror(3) */
47 # ifndef TZ_TYPE
48 # define TZ_TYPE TZ_NONE /* no standard for Linux */
49 # endif