Giter Site home page Giter Site logo

Static build fails about usbmuxd HOT 4 CLOSED

libimobiledevice avatar libimobiledevice commented on July 24, 2024
Static build fails

from usbmuxd.

Comments (4)

nikias avatar nikias commented on July 24, 2024

Why are you building static? This project and all of its dependencies are not supposed to be built statically.

from usbmuxd.

MarSoft avatar MarSoft commented on July 24, 2024

Static building is sometimes useful, especially when you want to make an easily redistributable cross-platform tool.
Here is my current approach in achieving it. Did not yet test for runtime errors, but linking succeeds:
You'll need to make several changes to libimobiledevice sources:

  1. In common/thread.c, remove all contents;
  2. In common/thread.h, prepend each function definition with extern keyword;
  3. This will break building binary tools, so disable them: in Makefile.am, remove tools and docs from SUBDIRS, and remove EXTRA_DIST line.
  4. Now run ./autogen.sh --enable-shared=no and other flags you may need (probably you'll want to use custom --prefix).

from usbmuxd.

voltagex avatar voltagex commented on July 24, 2024

@MarSoft are you able to provide a patch for this?

from usbmuxd.

MarSoft avatar MarSoft commented on July 24, 2024

@voltagex, here is the script I use on libimobiledevice/libimobiledevice@798601d to prepare it for static build:

	# remove code for thread funcs which is duplcated with usbmuxd
	cat /dev/null > common/thread.c
	# convert thread funcs to extern ones
	sed -i common/thread.h -e 's/^\([iv][no][ti]\)/extern \1/'
	# don't build tools (and docs), only lib itself
	sed -i Makefile.am -e 's/ tools docs$$//; s/^EXTRA_DIST =.*//'
	# apply fix from libplist#114
	sed -i src/idevice.c -e 's/WIN32/DLL_EXPORT/'

Newer commits don't work for me because of socket stuff change introduced in libimobiledevice/libimobiledevice@2c83cae.

from usbmuxd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.