pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
libosmocore: update to 1.0.1
Module Name: pkgsrc-wip
Committed By: Tobias Nygren <tnn%NetBSD.org@localhost>
Pushed By: tnn
Date: Sat Feb 2 10:41:47 2019 +0100
Changeset: e4567c64a30c0a254cfc9cfe823d6f9fa95e2008
Modified Files:
libosmocore/DESCR
libosmocore/Makefile
libosmocore/PLIST
libosmocore/buildlink3.mk
libosmocore/distinfo
Added Files:
libosmocore/patches/patch-include_osmocom_core_stats.h
libosmocore/patches/patch-src_gb_gprs__ns__frgre.c
libosmocore/patches/patch-src_gsm_gsm__utils.c
libosmocore/patches/patch-src_macaddr.c
libosmocore/patches/patch-src_timer__clockgettime.c
Removed Files:
libosmocore/patches/patch-src_Makefile.am
libosmocore/patches/patch-src_Makefile.in
libosmocore/patches/patch-src_gsm__utils.c
libosmocore/patches/patch-src_msgfile.c
libosmocore/patches/patch-src_talloc.c
Log Message:
libosmocore: update to 1.0.1
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=e4567c64a30c0a254cfc9cfe823d6f9fa95e2008
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
libosmocore/DESCR | 8 +-
libosmocore/Makefile | 30 +++-
libosmocore/PLIST | 187 ++++++++++++++++-----
libosmocore/buildlink3.mk | 10 +-
libosmocore/distinfo | 17 +-
.../patches/patch-include_osmocom_core_stats.h | 13 ++
libosmocore/patches/patch-src_Makefile.am | 13 --
libosmocore/patches/patch-src_Makefile.in | 13 --
libosmocore/patches/patch-src_gb_gprs__ns__frgre.c | 22 +++
libosmocore/patches/patch-src_gsm__utils.c | 16 --
libosmocore/patches/patch-src_gsm_gsm__utils.c | 22 +++
libosmocore/patches/patch-src_macaddr.c | 30 ++++
libosmocore/patches/patch-src_msgfile.c | 28 ---
libosmocore/patches/patch-src_talloc.c | 13 --
.../patches/patch-src_timer__clockgettime.c | 29 ++++
15 files changed, 308 insertions(+), 143 deletions(-)
diffs:
diff --git a/libosmocore/DESCR b/libosmocore/DESCR
index 8d37a0f7c8..2fec1b9350 100644
--- a/libosmocore/DESCR
+++ b/libosmocore/DESCR
@@ -1 +1,7 @@
-libosmocore
+This package contains a set of C-language libraries that form the core
+infrastructure of many Osmocom Open Source Mobile Communications projects.
+
+Historically, a lot of this code was developed as part of the OpenBSC project,
+but which are of a more generic nature and thus useful to (at least) other
+programs that we develop in the sphere of Free Software / Open Source mobile
+communications.
diff --git a/libosmocore/Makefile b/libosmocore/Makefile
index 3747840d96..f9973c7184 100644
--- a/libosmocore/Makefile
+++ b/libosmocore/Makefile
@@ -1,23 +1,37 @@
# $NetBSD: Makefile,v 1.5 2012/11/13 22:25:38 othyro Exp $
-#
-DISTNAME= libosmocore-0.1.30
-CATEGORIES= devel
-MASTER_SITES= http://openbsc.osmocom.org/trac/raw-attachment/wiki/Tarballs/
-EXTRACT_SUFX= .tar.bz2
+DISTNAME= libosmocore-1.0.1
+CATEGORIES= devel ham
+MASTER_SITES= ${MASTER_SITE_GITHUB:=osmocom/}
MAINTAINER= khorben%defora.org@localhost
HOMEPAGE= http://www.osmocom.org/
-COMMENT= This is the libosmocore library
+COMMENT= Utility library for Software Defined Radio
LICENSE= gnu-gpl-v2
-USE_TOOLS+= gmake
+USE_TOOLS+= autoconf automake autoreconf gmake pkg-config
PKGCONFIG_OVERRIDE+= libosmocodec.pc.in
+PKGCONFIG_OVERRIDE+= libosmocoding.pc.in
PKGCONFIG_OVERRIDE+= libosmocore.pc.in
-PKGCONFIG_OVERRIDE+= libosmocovty.pc.in
+PKGCONFIG_OVERRIDE+= libosmoctrl.pc.in
+PKGCONFIG_OVERRIDE+= libosmogb.pc.in
+PKGCONFIG_OVERRIDE+= libosmogsm.pc.in
+PKGCONFIG_OVERRIDE+= libosmosim.pc.in
+PKGCONFIG_OVERRIDE+= libosmovty.pc.in
GNU_CONFIGURE= yes
USE_LIBTOOL= yes
+CONFIGURE_ENV+= ac_cv_prog_PYTHON=${PYTHONBIN}
+# libosmocore.so: undefined reference to `__cpu_model'
+CONFIGURE_ENV.NetBSD+= osmo_cv_cc_has_builtin=false
+CONFIGURE_ARGS+= --disable-pcsc
+
+pre-configure:
+ cd ${WRKSRC} && autoreconf -if
+
+.include "../../devel/talloc/buildlink3.mk"
+.include "../../security/gnutls/buildlink3.mk"
+.include "../../lang/python/tool.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/libosmocore/PLIST b/libosmocore/PLIST
index 01918b819b..1fa08b8f26 100644
--- a/libosmocore/PLIST
+++ b/libosmocore/PLIST
@@ -1,53 +1,162 @@
-@comment $NetBSD: PLIST,v 1.1 2011/08/02 22:19:13 khorben Exp $
+@comment $NetBSD$
+bin/osmo-arfcn
+bin/osmo-auc-gen
+bin/osmo-config-merge
+bin/osmo-release.sh
+include/osmo-release.mk
include/osmocom/codec/codec.h
+include/osmocom/codec/ecu.h
+include/osmocom/codec/gsm610_bits.h
+include/osmocom/coding/gsm0503_coding.h
+include/osmocom/coding/gsm0503_interleaving.h
+include/osmocom/coding/gsm0503_mapping.h
+include/osmocom/coding/gsm0503_parity.h
+include/osmocom/coding/gsm0503_tables.h
+include/osmocom/core/application.h
+include/osmocom/core/backtrace.h
+include/osmocom/core/bit16gen.h
+include/osmocom/core/bit32gen.h
+include/osmocom/core/bit64gen.h
+include/osmocom/core/bitcomp.h
+include/osmocom/core/bits.h
+include/osmocom/core/bitvec.h
+include/osmocom/core/byteswap.h
+include/osmocom/core/conv.h
+include/osmocom/core/counter.h
+include/osmocom/core/crc16.h
+include/osmocom/core/crc16gen.h
+include/osmocom/core/crc32gen.h
+include/osmocom/core/crc64gen.h
+include/osmocom/core/crc8gen.h
+include/osmocom/core/crcgen.h
+include/osmocom/core/defs.h
+include/osmocom/core/endian.h
+include/osmocom/core/fsm.h
+include/osmocom/core/gsmtap.h
+include/osmocom/core/gsmtap_util.h
+include/osmocom/core/isdnhdlc.h
+include/osmocom/core/linuxlist.h
+include/osmocom/core/linuxrbtree.h
+include/osmocom/core/logging.h
+include/osmocom/core/loggingrb.h
+include/osmocom/core/macaddr.h
+include/osmocom/core/msgb.h
+include/osmocom/core/msgfile.h
+include/osmocom/core/panic.h
+include/osmocom/core/plugin.h
+include/osmocom/core/prbs.h
+include/osmocom/core/prim.h
+include/osmocom/core/process.h
+include/osmocom/core/rate_ctr.h
+include/osmocom/core/select.h
+include/osmocom/core/sercomm.h
+include/osmocom/core/serial.h
+include/osmocom/core/signal.h
+include/osmocom/core/socket.h
+include/osmocom/core/stat_item.h
+include/osmocom/core/statistics.h
+include/osmocom/core/stats.h
+include/osmocom/core/strrb.h
+include/osmocom/core/talloc.h
+include/osmocom/core/timer.h
+include/osmocom/core/timer_compat.h
+include/osmocom/core/utils.h
+include/osmocom/core/write_queue.h
+include/osmocom/crypt/auth.h
include/osmocom/crypt/gprs_cipher.h
+include/osmocom/ctrl/control_cmd.h
+include/osmocom/ctrl/control_if.h
+include/osmocom/ctrl/control_vty.h
+include/osmocom/ctrl/ports.h
+include/osmocom/gprs/gprs_bssgp.h
+include/osmocom/gprs/gprs_bssgp_bss.h
+include/osmocom/gprs/gprs_msgb.h
+include/osmocom/gprs/gprs_ns.h
+include/osmocom/gprs/gprs_ns_frgre.h
+include/osmocom/gprs/gprs_rlc.h
+include/osmocom/gprs/protocol/gsm_04_60.h
+include/osmocom/gprs/protocol/gsm_08_16.h
+include/osmocom/gprs/protocol/gsm_08_18.h
+include/osmocom/gsm/a5.h
+include/osmocom/gsm/abis_nm.h
+include/osmocom/gsm/apn.h
+include/osmocom/gsm/bitvec_gsm.h
+include/osmocom/gsm/bts_features.h
+include/osmocom/gsm/comp128.h
+include/osmocom/gsm/comp128v23.h
+include/osmocom/gsm/gan.h
+include/osmocom/gsm/gsm0341.h
+include/osmocom/gsm/gsm0411_smc.h
+include/osmocom/gsm/gsm0411_smr.h
+include/osmocom/gsm/gsm0411_utils.h
+include/osmocom/gsm/gsm0480.h
+include/osmocom/gsm/gsm0502.h
+include/osmocom/gsm/gsm0503.h
+include/osmocom/gsm/gsm0808.h
+include/osmocom/gsm/gsm0808_utils.h
+include/osmocom/gsm/gsm23003.h
+include/osmocom/gsm/gsm29118.h
+include/osmocom/gsm/gsm29205.h
+include/osmocom/gsm/gsm48.h
+include/osmocom/gsm/gsm48_arfcn_range_encode.h
+include/osmocom/gsm/gsm48_ie.h
+include/osmocom/gsm/gsm48_rest_octets.h
+include/osmocom/gsm/gsm_utils.h
+include/osmocom/gsm/gsup.h
+include/osmocom/gsm/gsup_sms.h
+include/osmocom/gsm/ipa.h
+include/osmocom/gsm/l1sap.h
+include/osmocom/gsm/lapd_core.h
+include/osmocom/gsm/lapdm.h
+include/osmocom/gsm/meas_rep.h
+include/osmocom/gsm/mncc.h
+include/osmocom/gsm/oap.h
+include/osmocom/gsm/oap_client.h
+include/osmocom/gsm/prim.h
+include/osmocom/gsm/protocol/gsm_03_40.h
+include/osmocom/gsm/protocol/gsm_03_41.h
+include/osmocom/gsm/protocol/gsm_04_08.h
+include/osmocom/gsm/protocol/gsm_04_08_gprs.h
+include/osmocom/gsm/protocol/gsm_04_11.h
+include/osmocom/gsm/protocol/gsm_04_12.h
+include/osmocom/gsm/protocol/gsm_04_14.h
+include/osmocom/gsm/protocol/gsm_04_80.h
+include/osmocom/gsm/protocol/gsm_08_08.h
+include/osmocom/gsm/protocol/gsm_08_58.h
+include/osmocom/gsm/protocol/gsm_09_02.h
+include/osmocom/gsm/protocol/gsm_12_21.h
+include/osmocom/gsm/protocol/gsm_23_003.h
+include/osmocom/gsm/protocol/gsm_29_118.h
+include/osmocom/gsm/protocol/gsm_44_318.h
+include/osmocom/gsm/protocol/ipaccess.h
+include/osmocom/gsm/protocol/smpp34_osmocom.h
+include/osmocom/gsm/rsl.h
+include/osmocom/gsm/rxlev_stat.h
+include/osmocom/gsm/sysinfo.h
+include/osmocom/gsm/tlv.h
+include/osmocom/sim/class_tables.h
+include/osmocom/sim/sim.h
include/osmocom/vty/buffer.h
include/osmocom/vty/command.h
include/osmocom/vty/logging.h
+include/osmocom/vty/misc.h
+include/osmocom/vty/ports.h
+include/osmocom/vty/stats.h
include/osmocom/vty/telnet_interface.h
include/osmocom/vty/vector.h
include/osmocom/vty/vty.h
-include/osmocore/bits.h
-include/osmocore/bitvec.h
-include/osmocore/comp128.h
-include/osmocore/crc16.h
-include/osmocore/gsm0480.h
-include/osmocore/gsm0808.h
-include/osmocore/gsm48.h
-include/osmocore/gsm48_ie.h
-include/osmocore/gsm_utils.h
-include/osmocore/gsmtap.h
-include/osmocore/gsmtap_util.h
-include/osmocore/linuxlist.h
-include/osmocore/logging.h
-include/osmocore/mncc.h
-include/osmocore/msgb.h
-include/osmocore/msgfile.h
-include/osmocore/panic.h
-include/osmocore/plugin.h
-include/osmocore/process.h
-include/osmocore/protocol/gsm_03_41.h
-include/osmocore/protocol/gsm_04_08.h
-include/osmocore/protocol/gsm_04_11.h
-include/osmocore/protocol/gsm_04_12.h
-include/osmocore/protocol/gsm_04_80.h
-include/osmocore/protocol/gsm_08_08.h
-include/osmocore/protocol/gsm_08_58.h
-include/osmocore/protocol/gsm_12_21.h
-include/osmocore/rate_ctr.h
-include/osmocore/rsl.h
-include/osmocore/rxlev_stat.h
-include/osmocore/select.h
-include/osmocore/signal.h
-include/osmocore/statistics.h
-include/osmocore/talloc.h
-include/osmocore/timer.h
-include/osmocore/tlv.h
-include/osmocore/utils.h
-include/osmocore/write_queue.h
lib/libosmocodec.la
+lib/libosmocoding.la
lib/libosmocore.la
+lib/libosmoctrl.la
+lib/libosmogb.la
+lib/libosmogsm.la
lib/libosmovty.la
lib/pkgconfig/libosmocodec.pc
+lib/pkgconfig/libosmocoding.pc
lib/pkgconfig/libosmocore.pc
+lib/pkgconfig/libosmoctrl.pc
+lib/pkgconfig/libosmogb.pc
+lib/pkgconfig/libosmogsm.pc
+lib/pkgconfig/libosmosim.pc
lib/pkgconfig/libosmovty.pc
diff --git a/libosmocore/buildlink3.mk b/libosmocore/buildlink3.mk
index 549e355049..2b5524a494 100644
--- a/libosmocore/buildlink3.mk
+++ b/libosmocore/buildlink3.mk
@@ -2,12 +2,14 @@
BUILDLINK_TREE+= libosmocore
-.if !defined(DEFORAOS_LIBSYSTEM_BUILDLINK3_MK)
-DEFORAOS_LIBSYSTEM_BUILDLINK3_MK:=
+.if !defined(LIBOSMOCORE_BUILDLINK3_MK)
+LIBOSMOCORE_BUILDLINK3_MK:=
-BUILDLINK_API_DEPENDS.libosmocore+= libosmocore>=0.1.30
+BUILDLINK_API_DEPENDS.libosmocore+= libosmocore>=1.0.1
BUILDLINK_PKGSRCDIR.libosmocore?= ../../wip/libosmocore
-.endif # DEFORAOS_LIBSYSTEM_BUILDLINK3_MK
+.include "../../devel/talloc/buildlink3.mk"
+
+.endif # LIBOSMOCORE_BUILDLINK3_MK
BUILDLINK_TREE+= -libosmocore
diff --git a/libosmocore/distinfo b/libosmocore/distinfo
index d352102e3e..35543b5655 100644
--- a/libosmocore/distinfo
+++ b/libosmocore/distinfo
@@ -1,10 +1,11 @@
$NetBSD: distinfo,v 1.3 2011/08/03 02:34:07 khorben Exp $
-SHA1 (libosmocore-0.1.30.tar.bz2) = 9270be144a43c07160c58ba5bd67f500c6150129
-RMD160 (libosmocore-0.1.30.tar.bz2) = 7e6c54d3b7a03403f28617555b526f59f7ddd81c
-Size (libosmocore-0.1.30.tar.bz2) = 350305 bytes
-SHA1 (patch-src_Makefile.am) = 3e909d95dd130e9ebd74a5fe0fa2c84933cb243b
-SHA1 (patch-src_Makefile.in) = 9abd36d798f4192abee8bd2c78e435187979fc39
-SHA1 (patch-src_gsm__utils.c) = 9705162ddf34e00d07a2e34df704310741443055
-SHA1 (patch-src_msgfile.c) = 64b14bced24c63731e17bf5bac3dc0f2d6edc44b
-SHA1 (patch-src_talloc.c) = 37d33156f37f5a6854cab54b4ae10003a0ce750d
+SHA1 (libosmocore-1.0.1.tar.gz) = c41da6f716f6dd31bbc472575e7e2d16e07bed18
+RMD160 (libosmocore-1.0.1.tar.gz) = e53f6fdef98687afc375f81bee4dafb1189a621b
+SHA512 (libosmocore-1.0.1.tar.gz) = 15b83cedc8cd01dbd5ac7b6b54685d527f5c94a5c77896c0ca52b2d53c2066d8421166de5fb25f0355c1f372f629a4ceba39c11a80d4582aca1d696fd1bba5c4
+Size (libosmocore-1.0.1.tar.gz) = 1120580 bytes
+SHA1 (patch-include_osmocom_core_stats.h) = 11f19b2519ce7292a95b271373b3cade8a2c45c1
+SHA1 (patch-src_gb_gprs__ns__frgre.c) = b5ac91927201d5dcdeb343d069cae2074ae84cc9
+SHA1 (patch-src_gsm_gsm__utils.c) = 95f66775d011b8320aa03e03391544fcec856cc8
+SHA1 (patch-src_macaddr.c) = ef10e2c33c68de192d972c99e07056b5433de1e5
+SHA1 (patch-src_timer__clockgettime.c) = 6680a006fc4509ec44cef2945751416bd5c328af
diff --git a/libosmocore/patches/patch-include_osmocom_core_stats.h b/libosmocore/patches/patch-include_osmocom_core_stats.h
new file mode 100644
index 0000000000..790bcbc71b
--- /dev/null
+++ b/libosmocore/patches/patch-include_osmocom_core_stats.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- include/osmocom/core/stats.h.orig 2019-01-21 13:50:43.000000000 +0000
++++ include/osmocom/core/stats.h
+@@ -28,7 +28,7 @@
+ * embedded systems. We cannot use the autoconf-defined HAVE_... macros
+ * here, as that only works at library compile time, not at application
+ * compile time */
+-#if defined(unix) || defined(__APPLE__)
++#if 1
+
+ #include <sys/socket.h>
+ #include <arpa/inet.h>
diff --git a/libosmocore/patches/patch-src_Makefile.am b/libosmocore/patches/patch-src_Makefile.am
deleted file mode 100644
index 854860f794..0000000000
--- a/libosmocore/patches/patch-src_Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-src_Makefile.am,v 1.1 2011/08/02 22:19:13 khorben Exp $
-
---- src/Makefile.am.orig 2011-02-19 15:32:48.000000000 +0000
-+++ src/Makefile.am
-@@ -18,7 +18,7 @@ libosmocore_la_SOURCES = timer.c select.
-
- if ENABLE_PLUGIN
- libosmocore_la_SOURCES += plugin.c
--libosmocore_la_LDFLAGS = -ldl
-+#libosmocore_la_LDFLAGS = -ldl
- endif
-
- if ENABLE_TALLOC
diff --git a/libosmocore/patches/patch-src_Makefile.in b/libosmocore/patches/patch-src_Makefile.in
deleted file mode 100644
index d310637d57..0000000000
--- a/libosmocore/patches/patch-src_Makefile.in
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-src_Makefile.in,v 1.1 2011/08/02 22:19:13 khorben Exp $
-
---- src/Makefile.in.orig 2011-03-02 23:28:23.000000000 +0000
-+++ src/Makefile.in
-@@ -294,7 +294,7 @@ libosmocore_la_SOURCES = timer.c select.
- logging.c logging_syslog.c gsm0808.c rate_ctr.c gsmtap_util.c \
- gprs_cipher_core.c crc16.c panic.c process.c gsm0480.c \
- $(am__append_1) $(am__append_2) $(am__append_3)
--@ENABLE_PLUGIN_TRUE@libosmocore_la_LDFLAGS = -ldl
-+#@ENABLE_PLUGIN_TRUE@libosmocore_la_LDFLAGS = -ldl
- all: all-recursive
-
- .SUFFIXES:
diff --git a/libosmocore/patches/patch-src_gb_gprs__ns__frgre.c b/libosmocore/patches/patch-src_gb_gprs__ns__frgre.c
new file mode 100644
index 0000000000..b45981a3df
--- /dev/null
+++ b/libosmocore/patches/patch-src_gb_gprs__ns__frgre.c
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/gb/gprs_ns_frgre.c.orig 2019-01-21 13:50:43.000000000 +0000
++++ src/gb/gprs_ns_frgre.c
+@@ -91,6 +91,9 @@ struct iphdr
+ #endif
+
+
++#if defined(__NetBSD__)
++#warning TODO
++#else
+ /* IPv4 messages inside the GRE tunnel might be GRE keepalives */
+ static int handle_rx_gre_ipv4(struct osmo_fd *bfd, struct msgb *msg,
+ struct iphdr *iph, struct gre_hdr *greh)
+@@ -242,6 +245,7 @@ out_err:
+ msgb_free(msg);
+ return NULL;
+ }
++#endif
+
+ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg,
+ struct sockaddr_in *saddr, enum gprs_ns_ll ll);
diff --git a/libosmocore/patches/patch-src_gsm__utils.c b/libosmocore/patches/patch-src_gsm__utils.c
deleted file mode 100644
index 37e219bd85..0000000000
--- a/libosmocore/patches/patch-src_gsm__utils.c
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-src_gsm__utils.c,v 1.1 2011/08/02 22:19:13 khorben Exp $
-
---- src/gsm_utils.c.orig 2010-11-18 22:53:43.000000000 +0000
-+++ src/gsm_utils.c
-@@ -355,6 +355,11 @@ void generate_backtrace()
-
- free(strings);
- }
-+#else
-+void generate_backtrace()
-+{
-+# warning generate_backtrace() is not implemented
-+}
- #endif
-
- enum gsm_band gsm_arfcn2band(uint16_t arfcn)
diff --git a/libosmocore/patches/patch-src_gsm_gsm__utils.c b/libosmocore/patches/patch-src_gsm_gsm__utils.c
new file mode 100644
index 0000000000..843d1415bb
--- /dev/null
+++ b/libosmocore/patches/patch-src_gsm_gsm__utils.c
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/gsm/gsm_utils.c.orig 2019-01-21 13:50:43.000000000 +0000
++++ src/gsm/gsm_utils.c
+@@ -100,7 +100,7 @@
+
+ #if (!EMBEDDED)
+ /* FIXME: this can be removed once we bump glibc requirements to 2.25: */
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,25)
++#if false // XXX defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,25)
+ #pragma message ("glibc " OSMO_STRINGIFY_VAL(__GLIBC__) "." OSMO_STRINGIFY_VAL(__GLIBC_MINOR__) " random detected")
+ #include <sys/random.h>
+ #undef USE_GNUTLS
+@@ -447,7 +447,7 @@ int osmo_get_rand_id(uint8_t *out, size_
+ if (len > OSMO_MAX_RAND_ID_LEN)
+ return -E2BIG;
+ #if (!EMBEDDED)
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,25)
++#if false // XXX defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,25)
+ rc = getrandom(out, len, GRND_NONBLOCK);
+ #elif HAVE_DECL_SYS_GETRANDOM
+ #pragma message ("Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25")
diff --git a/libosmocore/patches/patch-src_macaddr.c b/libosmocore/patches/patch-src_macaddr.c
new file mode 100644
index 0000000000..7b60f76177
--- /dev/null
+++ b/libosmocore/patches/patch-src_macaddr.c
@@ -0,0 +1,30 @@
+$NetBSD$
+
+--- src/macaddr.c.orig 2019-01-21 13:50:43.000000000 +0000
++++ src/macaddr.c
+@@ -135,6 +135,7 @@ int osmo_get_macaddr(uint8_t *mac_out, c
+
+ memset(&ifr, 0, sizeof(ifr));
+ memcpy(&ifr.ifr_name, dev_name, dev_len + 1);
++#if defined(SIOCGIFHWADDR)
+ rc = ioctl(fd, SIOCGIFHWADDR, &ifr);
+ close(fd);
+
+@@ -142,6 +143,17 @@ int osmo_get_macaddr(uint8_t *mac_out, c
+ return rc;
+
+ memcpy(mac_out, ifr.ifr_hwaddr.sa_data, 6);
++#elif defined(SIOCGENADDR)
++ rc = ioctl(fd, SIOCGENADDR, &ifr);
++ close(fd);
++
++ if (rc < 0)
++ return rc;
++
++ memcpy(mac_out, &ifr.ifr_enaddr, 6);
++#else
++ return -1;
++#endif
+
+ return 0;
+ }
diff --git a/libosmocore/patches/patch-src_msgfile.c b/libosmocore/patches/patch-src_msgfile.c
deleted file mode 100644
index c21b46dc5e..0000000000
--- a/libosmocore/patches/patch-src_msgfile.c
+++ /dev/null
@@ -1,28 +0,0 @@
-$NetBSD: patch-src_msgfile.c,v 1.1 2011/08/02 22:19:13 khorben Exp $
-
---- src/msgfile.c.orig 2010-11-01 08:36:44.000000000 +0000
-+++ src/msgfile.c
-@@ -28,6 +28,8 @@
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <unistd.h>
-+#include <stdlib.h>
-+#include <stdio.h>
- #include <string.h>
-
- static struct msg_entry *alloc_entry(struct msg_entries *entries,
-@@ -111,7 +113,14 @@ struct msg_entries *msg_entry_parse(void
-
- n = 2342;
- line = NULL;
-+#ifdef __linux__
- while (getline(&line, &n, file) != -1) {
-+#else
-+ /* XXX probably not completely equivalent */
-+ while( (line = malloc(2343)) != NULL
-+ && fgets(line, 2343, file) != NULL) {
-+ n = strlen(line);
-+#endif
- handle_line(entries, line);
- free(line);
- line = NULL;
diff --git a/libosmocore/patches/patch-src_talloc.c b/libosmocore/patches/patch-src_talloc.c
deleted file mode 100644
index c736a2d2e2..0000000000
--- a/libosmocore/patches/patch-src_talloc.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-src_talloc.c,v 1.1 2011/08/02 22:19:13 khorben Exp $
-
---- src/talloc.c.orig 2010-02-20 19:33:33.000000000 +0000
-+++ src/talloc.c
-@@ -105,7 +105,7 @@
- #endif
- #endif
-
--#ifdef __APPLE__
-+#if defined(__APPLE__) || defined(__NetBSD__)
- /* taken from http://insanecoding.blogspot.com/2007/03/methods-for-safe-string-handling.html */
- size_t strnlen(const char *s, size_t n)
- {
diff --git a/libosmocore/patches/patch-src_timer__clockgettime.c b/libosmocore/patches/patch-src_timer__clockgettime.c
new file mode 100644
index 0000000000..ba05696191
--- /dev/null
+++ b/libosmocore/patches/patch-src_timer__clockgettime.c
@@ -0,0 +1,29 @@
+$NetBSD$
+
+--- src/timer_clockgettime.c.orig 2019-01-21 13:50:43.000000000 +0000
++++ src/timer_clockgettime.c
+@@ -75,16 +75,24 @@ static struct fakeclock* clkid_to_fakecl
+ switch(clk_id) {
+ case CLOCK_REALTIME:
+ return &realtime;
++#ifdef CLOCK_REALTIME_COARSE
+ case CLOCK_REALTIME_COARSE:
+ return &realtime_coarse;
++#endif
+ case CLOCK_MONOTONIC:
+ return &mono;
++#ifdef CLOCK_REALTIME_COARSE
+ case CLOCK_MONOTONIC_COARSE:
+ return &mono_coarse;
++#endif
++#ifdef CLOCK_MONOTONIC_RAW
+ case CLOCK_MONOTONIC_RAW:
+ return &mono_raw;
++#endif
++#ifdef CLOCK_BOOTTIME
+ case CLOCK_BOOTTIME:
+ return &boottime;
++#endif
+ case CLOCK_PROCESS_CPUTIME_ID:
+ return &proc_cputime_id;
+ case CLOCK_THREAD_CPUTIME_ID:
Home |
Main Index |
Thread Index |
Old Index