Skip to content

Commit

Permalink
[ANDROID] Fix Most Library Names (#868)
Browse files Browse the repository at this point in the history
  • Loading branch information
KreitinnSoftware authored Sep 30, 2023
1 parent a1091a9 commit 38b8d9b
Show file tree
Hide file tree
Showing 48 changed files with 489 additions and 109 deletions.
42 changes: 42 additions & 0 deletions src/library_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,48 @@ GO("libX11.so", libx11)
GO("libXext.so", libxext)
GO("libxcb.so", libxcb)
GO("libXau.so", libxau)
GO("libXxf86vm.so", libxxf86vm)
GO("libXinerama.so", xinerama)
GO("libXrandr.so", libxrandr)
GO("libXfixes.so", libxfixes)
GO("libXcursor.so", libxcursor)
GO("libXrender.so", libxrender)
GO("libXpresent.so", libxpresent)
GO("libXft.so", libxft)
GO("libXi.so", libxi)
GO("libXss.so", libxss)
GO("libXpm.so", libxpm)
GO("libXdmcp.so", libxdmcp)
GO("libX11-xcb.so", libx11xcb)
GO("libxcb-xfixes.so", libxcbxfixes)
GO("libxcb-shape.so", libxcbshape)
GO("libxcb-shm.so", libxcbshm)
GO("libxcb-randr.so", libxcbrandr)
GO("libxcb-image.so", libxcbimage)
GO("libxcb-keysyms.so", libxcbkeysyms)
GO("libxcb-xtest.so", libxcbxtest)
GO("libxcb-dri2.so", libxcbdri2)
GO("libxcb-dri3.so", libxcbdri3)
GO("libxcb-present.so", libxcbpresent)
GO("libXtst.so", libxtst)
GO("libXt.so", libxt)
GO("libXcomposite.so", libxcomposite)
GO("libXdamage.so", libxdamage)
GO("libXmu.so", libxmu)
GO("libpulse-simple.so", pulsesimple)
GO("libpulse.so", pulse)
GO("libsndfile.so", libsndfile)
GO("libusb-1.0.so", libusb1)
GO("libgstapp-1.0.so", gstapp)
GO("libgstaudio-1.0.so", gstaudio)
GO("libgstbase-1.0.so", gstbase)
GO("libgstreamer-1.0.so", gstreamer)
GO("libgsttag-1.0.so", gsttag)
GO("libgstvideo-1.0.so", gstvideo)
GO("libvorbisfile.so", vorbisfile)
GO("libvorbis.so", libvorbis)
GO("libogg.so", libogg)
GO("libz.so", libz)
GO("libandroid-shmem.so", androidshmem)
#else
GO("libc.so.6", libc)
Expand Down
6 changes: 5 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,11 @@ int main(int argc, const char **argv, char **env)
else
++prgname;
if(box86_wine) {
AddPath("libdl.so.2", &ld_preload, 0);
#ifdef ANDROID
AddPath("libdl.so", &ld_preload, 0);
#else
AddPath("libdl.so.2", &ld_preload, 0);
#endif
}
// special case for steam that somehow seems to alter libudev opaque pointer (udev_monitor)
if(strstr(prgname, "steam")==prgname) {
Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedbz2.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
#include "emu/x86emu_private.h"
#include "myalign.h"

const char* bz2Name = "libbz2.so.1";
#ifdef ANDROID
const char* bz2Name = "libbz2.so";
#else
const char* bz2Name = "libbz2.so.1";
#endif

#define LIBNAME bz2

#include "generated/wrappedbz2types.h"
Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedcurl.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
#include "emu/x86emu_private.h"
#include "callback.h"

const char* curlName = "libcurl.so.4";
#ifdef ANDROID
const char* curlName = "libcurl.so";
#else
const char* curlName = "libcurl.so.4";
#endif

#define ALTNAME "libcurl-gnutls.so.4"
#define LIBNAME curl

Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedgstapp.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
#include "librarian/library_private.h"
#include "x86emu.h"

const char* gstappName = "libgstapp-1.0.so.0";
#ifdef ANDROID
const char* gstappName = "libgstapp-1.0.so";
#else
const char* gstappName = "libgstapp-1.0.so.0";
#endif

#define LIBNAME gstapp

#define PRE_INIT \
Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedgstaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
#include "librarian/library_private.h"
#include "x86emu.h"

const char* gstaudioName = "libgstaudio-1.0.so.0";
#ifdef ANDROID
const char* gstaudioName = "libgstaudio-1.0.so";
#else
const char* gstaudioName = "libgstaudio-1.0.so.0";
#endif

#define LIBNAME gstaudio

#define PRE_INIT \
Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedgstbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
#include "librarian/library_private.h"
#include "x86emu.h"

const char* gstbaseName = "libgstbase-1.0.so.0";
#ifdef ANDROID
const char* gstbaseName = "libgstbase-1.0.so";
#else
const char* gstbaseName = "libgstbase-1.0.so.0";
#endif

#define LIBNAME gstbase

#define PRE_INIT \
Expand Down
25 changes: 19 additions & 6 deletions src/wrapped/wrappedgstreamer.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
#include "myalign.h"
#include "gtkclass.h"

const char* gstreamerName = "libgstreamer-1.0.so.0";
#ifdef ANDROID
const char* gstreamerName = "libgstreamer-1.0.so";
#else
const char* gstreamerName = "libgstreamer-1.0.so.0";
#endif

#define LIBNAME gstreamer

typedef size_t (*LFv_t)();
Expand Down Expand Up @@ -346,11 +351,19 @@ EXPORT int my_gst_caps_foreach(x86emu_t* emu, void* caps, void* f, void* data)
if(box86_nogtk) \
return -1;

#define CUSTOM_INIT \
getMy(lib); \
SetGstObjectID(my->gst_object_get_type()); \
SetGstAllocatorID(my->gst_allocator_get_type()); \
setNeededLibs(lib, 1, "libgtk-3.so.0");
#ifdef ANDROID
#define CUSTOM_INIT \
getMy(lib); \
SetGstObjectID(my->gst_object_get_type()); \
SetGstAllocatorID(my->gst_allocator_get_type()); \
setNeededLibs(lib, 1, "libgtk-3.so");
#else
#define CUSTOM_INIT \
getMy(lib); \
SetGstObjectID(my->gst_object_get_type()); \
SetGstAllocatorID(my->gst_allocator_get_type()); \
setNeededLibs(lib, 1, "libgtk-3.so.0");
#endif

#define CUSTOM_FINI \
freeMy();
Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedgsttag.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
#include "librarian/library_private.h"
#include "x86emu.h"

const char* gsttagName = "libgsttag-1.0.so.0";
#ifdef ANDROID
const char* gsttagName = "libgsttag-1.0.so";
#else
const char* gsttagName = "libgsttag-1.0.so.0";
#endif

#define LIBNAME gsttag

#define PRE_INIT \
Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedgstvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
#include "librarian/library_private.h"
#include "x86emu.h"

const char* gstvideoName = "libgstvideo-1.0.so.0";
#ifdef ANDROID
const char* gstvideoName = "libgstvideo-1.0.so";
#else
const char* gstvideoName = "libgstvideo-1.0.so.0";
#endif

#define LIBNAME gstvideo

#define PRE_INIT \
Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedgtk3.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
#include "myalign.h"
#include "gtkclass.h"

const char* gtk3Name = "libgtk-3.so.0";
#ifdef ANDROID
const char* gtk3Name = "libgtk-3.so";
#else
const char* gtk3Name = "libgtk-3.so.0";
#endif

static char* libname = NULL;
#define LIBNAME gtk3

Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedkrb5.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
#include "librarian.h"
#include "callback.h"

const char* krb5Name = "libkrb5.so.3";
#ifdef ANDROID
const char* krb5Name = "libkrb5.so";
#else
const char* krb5Name = "libkrb5.so.3";
#endif

#define LIBNAME krb5

#define ADDED_FUNCTIONS() \
Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedlibsndfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
#include "box86context.h"
#include "emu/x86emu_private.h"

const char* libsndfileName = "libsndfile.so.1";
#ifdef ANDROID
const char* libsndfileName = "libsndfile.so";
#else
const char* libsndfileName = "libsndfile.so.1";
#endif

#define LIBNAME libsndfile

#define ADDED_FUNCTIONS() \
Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedlibusb1.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
#include "emu/x86emu_private.h"
#include "myalign.h"

const char* libusb1Name = "libusb-1.0.so.0";
#ifdef ANDROID
const char* libusb1Name = "libusb-1.0.so";
#else
const char* libusb1Name = "libusb-1.0.so.0";
#endif

#define LIBNAME libusb1

#define ADDED_FUNCTIONS() \
Expand Down
6 changes: 5 additions & 1 deletion src/wrapped/wrappedlibvorbis.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
#include "librarian.h"
#include "myalign.h"

#ifdef ANDROID
const char* libvorbisName = "libvorbis.so";
#else
const char* libvorbisName = "libvorbis.so.0";
#endif

const char* libvorbisName = "libvorbis.so.0";
#define LIBNAME libvorbis

#define ADDED_FUNCTIONS() \
Expand Down
22 changes: 17 additions & 5 deletions src/wrapped/wrappedlibx11.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
#include "box86context.h"
#include "emu/x86emu_private.h"

const char* libx11Name = "libX11.so.6";
#ifdef ANDROID
const char* libx11Name = "libX11.so";
#else
const char* libx11Name = "libX11.so.6";
#endif

#define LIBNAME libx11

typedef int (*XErrorHandler)(void *, void *);
Expand Down Expand Up @@ -1337,10 +1342,17 @@ EXPORT void my_XFreeEventData(x86emu_t* emu, void* dpy, my_XGenericEventCookie_t
my->XFreeEventData(dpy, cookie);
}

#define CUSTOM_INIT \
getMy(lib); \
setNeededLibs(lib, 1, "libdl.so.2"); \
if(box86_x11threads) my->XInitThreads();
#ifdef ANDROID
#define CUSTOM_INIT \
getMy(lib); \
setNeededLibs(lib, 1, "libdl.so"); \
if(box86_x11threads) my->XInitThreads();
#else
#define CUSTOM_INIT \
getMy(lib); \
setNeededLibs(lib, 1, "libdl.so.2"); \
if(box86_x11threads) my->XInitThreads();
#endif

#define CUSTOM_FINI \
freeMy();
Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedlibx11xcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
#include "x86emu.h"
#include "debug.h"

const char* libx11xcbName = "libX11-xcb.so.1";
#ifdef ANDROID
const char* libx11xcbName = "libX11-xcb.so";
#else
const char* libx11xcbName = "libX11-xcb.so.1";
#endif

#define LIBNAME libx11xcb

#include "wrappedlib_init.h"
Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedlibxau.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
#include "librarian/library_private.h"
#include "x86emu.h"

const char* libxauName = "libXau.so.6";
#ifdef ANDROID
const char* libxauName = "libXau.so";
#else
const char* libxauName = "libXau.so.6";
#endif

#define LIBNAME libxau

#include "wrappedlib_init.h"
7 changes: 6 additions & 1 deletion src/wrapped/wrappedlibxcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
#include "box86context.h"
#include "emu/x86emu_private.h"

const char* libxcbName = "libxcb.so.1";
#ifdef ANDROID
const char* libxcbName = "libxcb.so";
#else
const char* libxcbName = "libxcb.so.1";
#endif

#define LIBNAME libxcb

typedef struct my_xcb_XXX_iterator_s {
Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedlibxcbdri2.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
#include "box86context.h"
#include "emu/x86emu_private.h"

const char* libxcbdri2Name = "libxcb-dri2.so.0";
#ifdef ANDROID
const char* libxcbdri2Name = "libxcb-dri2.so";
#else
const char* libxcbdri2Name = "libxcb-dri2.so.0";
#endif

#define LIBNAME libxcbdri2

typedef struct my_xcb_cookie_s {
Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedlibxcbdri3.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
#include "box86context.h"
#include "emu/x86emu_private.h"

const char* libxcbdri3Name = "libxcb-dri3.so.0";
#ifdef ANDROID
const char* libxcbdri3Name = "libxcb-dri3.so";
#else
const char* libxcbdri3Name = "libxcb-dri3.so.0";
#endif

#define LIBNAME libxcbdri3

typedef struct my_xcb_cookie_s {
Expand Down
7 changes: 6 additions & 1 deletion src/wrapped/wrappedlibxcbimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
#include "box86context.h"
#include "emu/x86emu_private.h"

const char* libxcbimageName = "libxcb-image.so.0";
#ifdef ANDROID
const char* libxcbimageName = "libxcb-image.so";
#else
const char* libxcbimageName = "libxcb-image.so.0";
#endif

#define LIBNAME libxcbimage

typedef struct my_xcb_cookie_s {
Expand Down
Loading

0 comments on commit 38b8d9b

Please sign in to comment.