Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to cross-compile libgphoto2 (to aarch64 on Ubuntu/Debian)? #1032

Open
axxel opened this issue Sep 27, 2024 · 3 comments
Open

How to cross-compile libgphoto2 (to aarch64 on Ubuntu/Debian)? #1032

axxel opened this issue Sep 27, 2024 · 3 comments

Comments

@axxel
Copy link
Contributor

axxel commented Sep 27, 2024

I'm trying to cross-compile to aarch64. I installed crossbuild-essential-arm64 and now have a working compiler and toolchain, meaning I can compile a hello-world program and run it happily.

Next step was

configure --build x86_64-pc-linux-gnu --host aarch64-linux-gnu --enable-mpers=check
    --disable-nls --without-jpeg --with-libxml-2.0=no --with-libexif=no --with-libcurl=no --with-gdlib=no
    --disable-serial --with-camlibs=ptp2
    --disable-shared --enable-static  CFLAGS="-g"

trying to make it as easy as possible by removing all unnecessary dependencies. configure fails with the following error:

configure: error: 
libgphoto2 requires libltdl (a part of libtool)

Why is libltdl still required if I --disable-shared?

I'd appreciate any hints towards either:

  • get configure find the missing libltdl
  • compile libgphoto2/libgphoto_port with statically linked ptp2 camlib and libusb driver, to remove the libltdl dependency

Maybe @ndim or @hfiguiere have some relevant insights?

@ndim
Copy link
Member

ndim commented Sep 27, 2024

Whether you build libgphoto2 and libgphoto2_port as a static or as a dynamic library makes no difference here. They both unconditionally use libltdl to dynamically load camlibs (camera drivers) or iolibs (port drivers), respectively.

@axxel
Copy link
Contributor Author

axxel commented Sep 27, 2024

Thanks for the clarification. Maybe the real question is: why? What is the use case for having a static build that still loads dlls at runtime?

Is there maybe some "hack" that could be applied to the build system to link those symbols statically into the library?

@ndim
Copy link
Member

ndim commented Sep 27, 2024

The variables to set for building with your custom libltdl:

$ ./configure --help | grep -i ltdl
  LTDLINCL    CFLAGS for compiling with libltdl
  LIBLTDL     LIBS to add for linking against libltdl
$ _

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants