Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    cross_compile and static linking


    Hi.
    I have cross_compiled a few different things for Android over the last year. Now I'm trying to do the same with samba, but this gives me some problems. The configure part ignores everything I tell it to do.

    I have a arm cross compiler installed that is set in the CC variable. But when i tell ./configure to use --prefix, --enable-static, --host and --disable-shared it makes no difference. The binaries that comes out of 'make' is not statically linked, they are not cross_compiled for arm and the installation dir is still set to /usr/local/samba although I changed it.

    How do I compile samba for Android?
    And I know there are a samba android package, but that is not what i am looking for. I don't want the app, just the binaries.

  2. #2
    Just Joined!
    Join Date
    Jan 2011
    Location
    Fairfax, Virginia, USA
    Posts
    94
    Hi, have you seen this link?
    Samba/Compiling Samba from Source - Wikibooks, open books for an open world

    Here is an except from the link:
    Code:
    After you have downloaded the Samba sources from Samba.org, unpack these sources and enter the samba-<version>/source/ directory. Then you need to set the CC environment:
    # export LD_LIBRARY_PATH=/<path_to_compiler>/lib
    # export LDFLAGS=-L/<path_to_compiler>/lib
    # export CPPFLAGS=-I/<path_to_compiler>/include
    # export CC=<path_to_compiler>/bin/<your_compiler>
    [...] clipped [...]
    # ./configure --host=i686 --target=mips-linux-uclibc
    As far as ./configure, its just a script and as a result, things are different amount different vendors. In SAMBAs' case, they don't seem to support those options based on this page:
    http://www.samba.org/samba/docs/using_samba/appe.html

    I've never cross compiled SAMBA, but I have run into issues like you are describing ... try following the above instructions, set the LDFLAGS to include "-static" and experiment with "-static-libgcc" also.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •