All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marco Trudel <mtrudel@gmx.ch>
To: bluez-users@lists.sourceforge.net
Subject: cross-compilation howto  (was "Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found")
Date: Fri, 04 Feb 2005 18:32:43 +0100	[thread overview]
Message-ID: <4203B1BB.1070006@gmx.ch> (raw)
In-Reply-To: <1107273565.8819.38.camel@justakiss>

Hello Marcel

I learned a lot of configure and make flags I didn't knew before.
So, that's the state:

For crosscompiling, it's enought to:
./configure --build=[buildArchitecture] --host=[targetArchitecture]

The cross-compiler has to be in path.
That's it. Everything else is like usual compiling.

I don't think this is worth a howto, do you?
Actually a bluetooth compilation howto with a little crosscompiling 
subsection that hints to the --build and --host switches should be more 
than enough.

Erwin: Is only using --host proper?
It works but I get a warning (I don't like warnings. So I always try to do 
things right.)


regards
Marco


Erwin Authried wrote:
> Am Die, den 01.02.2005 schrieb Marco Trudel um 16:22:
> 
>>Sorry for sending already again an email.
>>I invested another 20 minutes to the mini-howto.
>>
>>It is now fully generic but should be tested with other platforms.
>>
>>Marcel: tell me if it's ok or you'd like other changes...
>>
>>regards
>>Marco
>>
>>
>>Marco Trudel wrote:
>>
>>>>looks nice so far to me, but I like to have somekind of generic cross
>>>>compilation instruction.
>>>
>>>
>>>unfortunately I've only an arm machine here and have no experience with 
>>>other platforms.
>>>maybee the guy with the axis developer board is willing to add his 
>>>knowledge.
>>>
>>>
>>>>I also prefer using DESTDIR for install, so
>>>>that you can make an installation for /usr without overwriting your
>>>>local files.
>>>
>>>
>>>I made it a little bit more generic and used DESTDIR as term in the 
>>>description. If someone could give feedback about the toolchain, the 
>>>mini-howto would become really generic...
>>>
>>>
>>>kind regards
>>>Marco
>>
>>
>>______________________________________________________________________
>>This document shows how to cross-compile bluez for another processor.
>>
>>date/version: 01 Feb. 2005, v0.2
>>author:       Marco Trudel <mtrudel@gmx.ch>
>>
>>If you need help, please use the bluez-user list.
>>If you have improvements or hints, do not hesitate to contact the autor.
>>
>>This howto has been testet for:
>>	i686 -> arm
>>
>>------------------------------------------------------------
>>
>>Ensure that the crosscompile binaries are in $PATH.
>>For example, do: export PATH="$PATH:/thePathToYourCrossCompiler/bin"
>>
>>Please note: The term DESTDIR will be used in the following commands.
>>             This is the directory where bluez will be installed to.
>>	     Replace it, for example, with /opt/bluez or /tmp/bluez.
>>
>>########## 1. compile bluez-libs ##########
>>- extract bluez-libs and change into the directory
>>- configure the makefiles for cross-compiling:
>>        ./configure --build=i686-pc-linux-gnu  \
>>                    --host=arm-linux           \
>>                    --prefix=DESTDIR           \
>>                    [--sysconfdir=DESTDIR/etc]
>>
>>- Explanation of the switches:
>>        --build        The build platform (as example a i686).
>>	--host         The target platform (as example arm-linux).
>>	               Please change it to match your target-system.
>>	--prefix       Where bluez will be installed to.
>>	--sysconfdir   Where bluez will expect etc.
>>	               You can remove this switch if /etc is ok for you.
>>
>>- Check the output. Some interesting lines:
>>        checking for arm-linux-gcc... arm-linux-gcc
>>        checking whether the C compiler works... yes
>>        checking whether we are cross compiling... yes
>>
>>- run "make", "make install"
>>
>>########## 2. compile bluez-utils ##########
>>- extract bluez-utils and change into the directory
>>- configure the makefiles for cross-compiling. run:
>>        ./configure --build=i686-pc-linux-gnu  \
>>                    --host=arm-linux           \
>>                    --prefix=DESTDIR           \
>>                    [--sysconfdir=DESTDIR/etc  \]
>>                    LDFLAGS=-LDESTDIR/lib
>>
>>- LDFLAGS is where the bluez lib will be searched for.
>>(Please note that -L is needed. For example LDFLAGS=-L/opt/bluez/lib)
>>
>>- run "make" and "make install"
>>
>>
>>######### 3. final steps, tests ##########
>>Please note: This mini-howto assumes you have a bluetooth enabled kernel.
>>If you haven't already, install it now.
>>
>>Depending on your setup, you might be interested in every kb
>>of diskspace to save. With -s stripping and removing of unnecessary
>>files, it's possible to save ~350kb...
>>
>>copy DESTDIR to your target platform.
>>
>>on your target platform:
>>- add "DESTDIR/lib" to /etc/ld.so.conf and, run "ldconfig"
>>- run "./hcid -n" in DESTDIR/sbin
>>Check the output.
>>If everything works well, abort hcid and start it withhout "-n".
>>
>>- "DESTDIR/bin/hcitool dev" should show you your devices
>>- "DESTDIR/bin/hcitool scan" perform an inquiry scan
> 
> 
> Hi,
> somehow your usage of DESTDIR seems incorrect. With --prefix, the prefix
> for programs on the target system is specified. You seem to use it for
> the library path for linking as well. I have attached my version.
> 
> Regards,
> Erwin
> 
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> #
> # set up environment
> #
> PATH, CC, CFLAGS, LDFLAGS, TARGETARCH, TOOLS
> 
> TOOLS ... base directory for cross-compiler installation (e.g. /usr/local)
> TARGETARCH ... target architecture (e.g. arm-elf)
> 
> #
> # cross-compiling bluez-libs
> #
> ./configure --host=$TARGETARCH --prefix=\"\""
> make
> make DESTDIR="$TOOLS/$TARGETARCH" install
> 
> #
> # cross-compiling bluez-utils
> #
> # applications for /bin 
> # BLUEZ_UTILS_PROGS=dund/dund pand/pand hidd/hidd tools/ciptool tools/hcitool tools/l2ping rfcomm/rfcomm tools/sdptool
> # BLUEZ_UTILS_SPROGS=tools/hciattach tools/hciconfig hcid/hcid sdpd/sdpd
> # ROOT ... directory for target root filesystem
>  
> ./configure "--host=$TARGETARCH --prefix=\"\" --with-bluez=$TOOLS/$TARGETARCH/include --with-usb=$TOOLS/$TARGETARCH/include"
> make 
> install $BLUEZ_UTILS_PROGS $ROOT/bin
> install $BLUEZ_UTILS_SPROGS $ROOT/sbin


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

  reply	other threads:[~2005-02-04 17:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-31 19:23 [Bluez-users] Trying to compile for axis but Bluetooth library not found joe sloan
2005-01-31 20:51 ` Erwin Authried
2005-02-01 10:07   ` Joe Sloan
2005-02-01 10:36     ` Marcel Holtmann
2005-02-01 14:19       ` Marco Trudel
2005-02-01 14:36         ` [Bluez-users] cross-compilation miniHowto, first change Marco Trudel
2005-02-01 14:42         ` [Bluez-users] Trying to compile for axis but Bluetooth library not found Marcel Holtmann
2005-02-01 15:12           ` Marco Trudel
2005-02-01 15:20             ` Marcel Holtmann
2005-02-01 15:22             ` Marco Trudel
2005-02-01 15:47               ` Marcel Holtmann
2005-02-01 15:59               ` Erwin Authried
2005-02-04 17:32                 ` Marco Trudel [this message]
2005-02-04 17:38                   ` cross-compilation howto (was "Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found") Marcel Holtmann
2005-02-04 23:20                     ` Marco Trudel
2005-02-05  0:05                       ` Marcel Holtmann
2005-02-04 18:19                   ` Erwin Authried
2005-02-04 18:22                     ` Marcel Holtmann
2005-02-04 18:31                       ` Marco Trudel
2005-02-04 18:38                       ` Erwin Authried
2005-02-04 18:43                         ` Marcel Holtmann
2005-02-04 18:55                           ` Erwin Authried

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4203B1BB.1070006@gmx.ch \
    --to=mtrudel@gmx.ch \
    --cc=bluez-users@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.