Lower dependency to glib 2.32.

By avoiding g_slist_copy_deep() for now, we can easily allow libsigrok
to build against glib 2.32 (less hassle for users of stable/older
distros or OSes).
This commit is contained in:
Uwe Hermann 2015-01-29 08:51:31 +01:00
parent 8656a71790
commit 5801d558e7
3 changed files with 7 additions and 7 deletions

2
README
View File

@ -36,7 +36,7 @@ Requirements for the C library:
- automake >= 1.11 (only needed when building from git) - automake >= 1.11 (only needed when building from git)
- libtool (only needed when building from git) - libtool (only needed when building from git)
- pkg-config >= 0.22 - pkg-config >= 0.22
- libglib >= 2.34.0 - libglib >= 2.32.0
- libzip >= 0.10 - libzip >= 0.10
- libserialport >= 0.1.0 (optional, used by some drivers) - libserialport >= 0.1.0 (optional, used by some drivers)
- librevisa >= 0.0.20130412 (optional, used by some drivers) - librevisa >= 0.0.20130412 (optional, used by some drivers)

View File

@ -260,8 +260,8 @@ AM_CONDITIONAL(NEED_RPC, test "x$have_rpc" != "x0")
# libglib-2.0 is always needed. Abort if it's not found. # libglib-2.0 is always needed. Abort if it's not found.
# Note: glib-2.0 is part of the libsigrok API (hard pkg-config requirement). # Note: glib-2.0 is part of the libsigrok API (hard pkg-config requirement).
# We require at least 2.34.0 due to e.g. g_slist_deep_copy(). # We require at least 2.32.0 due to e.g. g_variant_new_fixed_array().
AM_PATH_GLIB_2_0([2.34.0], AM_PATH_GLIB_2_0([2.32.0],
[LIB_CFLAGS="$LIB_CFLAGS $GLIB_CFLAGS"; LIBS="$LIBS $GLIB_LIBS"]) [LIB_CFLAGS="$LIB_CFLAGS $GLIB_CFLAGS"; LIBS="$LIBS $GLIB_LIBS"])
# libzip is always needed. Abort if it's not found. # libzip is always needed. Abort if it's not found.
@ -554,13 +554,13 @@ echo "Detected libraries:"
echo echo
# Note: This only works for libs with pkg-config integration. # Note: This only works for libs with pkg-config integration.
for lib in "glib-2.0 >= 2.34.0" "libzip >= 0.10" "libserialport >= 0.2.0" \ for lib in "glib-2.0 >= 2.32.0" "libzip >= 0.10" "libserialport >= 0.2.0" \
"librevisa >= 0.0.20130412" "libusb-1.0 >= 1.0.16" "libftdi >= 0.16" \ "librevisa >= 0.0.20130412" "libusb-1.0 >= 1.0.16" "libftdi >= 0.16" \
"libftdi1 >= 1.0" "libgpib" "glibmm-2.4 >= 2.32.0" \ "libftdi1 >= 1.0" "libgpib" "glibmm-2.4 >= 2.32.0" \
"pygobject-3.0 >= 3.0.0" "check >= 0.9.4" "pygobject-3.0 >= 3.0.0" "check >= 0.9.4"
do do
optional="OPTIONAL" optional="OPTIONAL"
if test "x$lib" = "xglib-2.0 >= 2.34.0"; then optional="REQUIRED"; fi if test "x$lib" = "xglib-2.0 >= 2.32.0"; then optional="REQUIRED"; fi
if test "x$lib" = "xlibzip >= 0.10"; then optional="REQUIRED"; fi if test "x$lib" = "xlibzip >= 0.10"; then optional="REQUIRED"; fi
if `$PKG_CONFIG --exists $lib`; then if `$PKG_CONFIG --exists $lib`; then
ver=`$PKG_CONFIG --modversion $lib` ver=`$PKG_CONFIG --modversion $lib`

View File

@ -984,8 +984,8 @@ SR_PRIV int sr_packet_copy(const struct sr_datafeed_packet *packet,
case SR_DF_META: case SR_DF_META:
meta = packet->payload; meta = packet->payload;
meta_copy = g_malloc(sizeof(struct sr_datafeed_meta)); meta_copy = g_malloc(sizeof(struct sr_datafeed_meta));
meta_copy->config = g_slist_copy_deep(meta->config, meta_copy->config = g_slist_copy(meta->config);
(GCopyFunc)copy_src, NULL); g_slist_foreach(meta_copy->config, (GCopyFunc)copy_src, NULL);
(*copy)->payload = meta_copy; (*copy)->payload = meta_copy;
break; break;
case SR_DF_LOGIC: case SR_DF_LOGIC: