diff --git a/.gitlab-ci/test-msys2.sh b/.gitlab-ci/test-msys2.sh index d8891e35b..48e18e92c 100755 --- a/.gitlab-ci/test-msys2.sh +++ b/.gitlab-ci/test-msys2.sh @@ -21,7 +21,8 @@ pacman --noconfirm -S --needed \ mingw-w64-$MSYS2_ARCH-python3 \ mingw-w64-$MSYS2_ARCH-python3-pip \ mingw-w64-$MSYS2_ARCH-toolchain \ - mingw-w64-$MSYS2_ARCH-zlib + mingw-w64-$MSYS2_ARCH-zlib \ + mingw-w64-$MSYS2_ARCH-libelf curl -O -J -L "https://github.com/linux-test-project/lcov/releases/download/v1.13/lcov-1.13.tar.gz" echo "44972c878482cc06a05fe78eaa3645cbfcbad6634615c3309858b207965d8a23 lcov-1.13.tar.gz" | sha256sum -c diff --git a/gio/gresource-tool.c b/gio/gresource-tool.c index b25eebf3d..d1de02631 100644 --- a/gio/gresource-tool.c +++ b/gio/gresource-tool.c @@ -31,6 +31,9 @@ #ifdef HAVE_LIBELF #include #include +#endif + +#ifdef HAVE_MMAP #include #endif @@ -42,6 +45,10 @@ #include "glib/glib-private.h" #endif +#if defined(HAVE_LIBELF) && defined(HAVE_MMAP) +#define USE_LIBELF +#endif + /* GResource functions {{{1 */ static GResource * get_resource (const gchar *file) @@ -133,7 +140,7 @@ extract_resource (GResource *resource, /* Elf functions {{{1 */ -#ifdef HAVE_LIBELF +#ifdef USE_LIBELF static Elf * get_elf (const gchar *file, @@ -353,7 +360,7 @@ print_section_name (GElf_Shdr *shdr, return TRUE; } -#endif /* HAVE_LIBELF */ +#endif /* USE_LIBELF */ /* Toplevel commands {{{1 */ @@ -365,7 +372,7 @@ cmd_sections (const gchar *file, { GResource *resource; -#ifdef HAVE_LIBELF +#ifdef USE_LIBELF Elf *elf; gint fd; @@ -388,7 +395,7 @@ cmd_sections (const gchar *file, else { g_printerr ("Don't know how to handle %s\n", file); -#ifndef HAVE_LIBELF +#ifndef USE_LIBELF g_printerr ("gresource is built without elf support\n"); #endif } @@ -402,7 +409,7 @@ cmd_list (const gchar *file, { GResource *resource; -#ifdef HAVE_LIBELF +#ifdef USE_LIBELF Elf *elf; int fd; @@ -424,7 +431,7 @@ cmd_list (const gchar *file, else { g_printerr ("Don't know how to handle %s\n", file); -#ifndef HAVE_LIBELF +#ifndef USE_LIBELF g_printerr ("gresource is built without elf support\n"); #endif } @@ -438,7 +445,7 @@ cmd_extract (const gchar *file, { GResource *resource; -#ifdef HAVE_LIBELF +#ifdef USE_LIBELF Elf *elf; int fd; @@ -461,7 +468,7 @@ cmd_extract (const gchar *file, else { g_printerr ("Don't know how to handle %s\n", file); -#ifndef HAVE_LIBELF +#ifndef USE_LIBELF g_printerr ("gresource is built without elf support\n"); #endif }