2005-01-31 19:23:12

by joe sloan

[permalink] [raw]
Subject: [Bluez-users] Trying to compile for axis but Bluetooth library not found

Hi,

I have compiled bluez-libs-2.14 but having problems with bluez-utils-2.14.

I'm working on a PC with SUSE 9.1, and the target is devboard_82 with
linux-2.4.26.

I've tried almost every option at this stage and I keep getting the
error related to /lib/libc.so.6 I cannot figure out where it is getting
this from - my guess is that it should be pointing to
../../target/cris-axis-linux-gnu/lib/libc.so.6 but cannot.

I'd appreciate some help or pointers with this (having searched the web
and this newgroup - and tried loads of combinations of commands).

thanks

Joe

------------------------------------------------------------------------------------------------

The error I see is.....

checking for hci_open_dev in -lbluetooth... no
configure: error: Bluetooth library not found

and in config.log I have the entry

configure:3992: gcc-cris -mlinux -o conftest -Wall -O2
-I/usr/include -L/usr/lib conftest.c -lbluetooth >&5
/lib/libc.so.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
configure:3998: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "bluez-utils"
| #define VERSION "2.14"
| #define CONFIGDIR "/usr/etc/bluetooth"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
|
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char hci_open_dev ();
| int
| main ()
| {
| hci_open_dev ();
| ;
| return 0;
| }
configure:4023: result: no
configure:4028: error: Bluetooth library not found


Here's how I compiled it all



cd bluez-libs-2.14/
linux:/axis/devboard_82/apps/bluez-libs-2.14 # ./configure CC="gcc-cris
-mlinux" LD="cris-ld" --target=cris-axis-linux --host=i686-pc-linux
--prefix=/usr
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for i686-pc-linux-strip... no
checking for strip... strip
checking whether to enable maintainer-specific portions of Makefiles... no
checking for i686-pc-linux-gcc... gcc-cris -mlinux
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc-cris -mlinux accepts -g... yes
checking for gcc-cris -mlinux option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc-cris -mlinux... none
checking for a BSD-compatible install... /usr/bin/install -c
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a sed that does not truncate output... /usr/bin/sed
checking for egrep... grep -E
checking for ld used by gcc-cris -mlinux... cris-ld
checking if the linker (cris-ld) is GNU ld... yes
checking for cris-ld option to reload object files... -r
checking for BSD-compatible nm... nm
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc-cris -mlinux -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 32768
checking command to parse nm output from gcc-cris -mlinux object... ok
checking for objdir... .libs
checking for i686-pc-linux-ar... no
checking for ar... ar
checking for i686-pc-linux-ranlib... no
checking for ranlib... ranlib
checking for i686-pc-linux-strip... strip
checking if gcc-cris -mlinux static flag works... yes
checking if gcc-cris -mlinux supports -fno-rtti -fno-exceptions... yes
checking for gcc-cris -mlinux option to produce PIC... -fPIC
checking if gcc-cris -mlinux PIC flag -fPIC works... yes
checking if gcc-cris -mlinux supports -c -o file.o... yes
checking whether the gcc-cris -mlinux linker (cris-ld) supports shared
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating src/Makefile
config.status: creating bluez.pc
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands

make install

linux:/axis/devboard_82/apps/bluez-libs-2.14 # make install
Making install in include
make[1]: Entering directory `/axis/devboard_82/apps/bluez-libs-2.14/include'
make[2]: Entering directory `/axis/devboard_82/apps/bluez-libs-2.14/include'
make[2]: Nothing to be done for `install-exec-am'.
/bin/sh ../mkinstalldirs /usr/include/bluetooth
/usr/bin/install -c -m 644 bluetooth.h /usr/include/bluetooth/bluetooth.h
/usr/bin/install -c -m 644 hci.h /usr/include/bluetooth/hci.h
/usr/bin/install -c -m 644 hci_lib.h /usr/include/bluetooth/hci_lib.h
/usr/bin/install -c -m 644 hci_uart.h /usr/include/bluetooth/hci_uart.h
/usr/bin/install -c -m 644 hci_vhci.h /usr/include/bluetooth/hci_vhci.h
/usr/bin/install -c -m 644 l2cap.h /usr/include/bluetooth/l2cap.h
/usr/bin/install -c -m 644 sco.h /usr/include/bluetooth/sco.h
/usr/bin/install -c -m 644 rfcomm.h /usr/include/bluetooth/rfcomm.h
/usr/bin/install -c -m 644 sdp.h /usr/include/bluetooth/sdp.h
/usr/bin/install -c -m 644 sdp_lib.h /usr/include/bluetooth/sdp_lib.h
/usr/bin/install -c -m 644 bnep.h /usr/include/bluetooth/bnep.h
/usr/bin/install -c -m 644 cmtp.h /usr/include/bluetooth/cmtp.h
/usr/bin/install -c -m 644 hidp.h /usr/include/bluetooth/hidp.h
make[2]: Leaving directory `/axis/devboard_82/apps/bluez-libs-2.14/include'
make[1]: Leaving directory `/axis/devboard_82/apps/bluez-libs-2.14/include'
Making install in src
make[1]: Entering directory `/axis/devboard_82/apps/bluez-libs-2.14/src'
/bin/sh ../libtool --mode=compile gcc-cris -mlinux -DHAVE_CONFIG_H -I.
-I. -I.. -I../include -Wall -O2 -c -o bluetooth.lo `test -f
'bluetooth.c' || echo './'`bluetooth.c
mkdir .libs
gcc-cris -mlinux -DHAVE_CONFIG_H -I. -I. -I.. -I../include -Wall -O2 -c
bluetooth.c -fPIC -DPIC -o .libs/bluetooth.o
gcc-cris -mlinux -DHAVE_CONFIG_H -I. -I. -I.. -I../include -Wall -O2 -c
bluetooth.c -o bluetooth.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile gcc-cris -mlinux -DHAVE_CONFIG_H -I.
-I. -I.. -I../include -Wall -O2 -c -o hci.lo `test -f 'hci.c' || echo
'./'`hci.c
gcc-cris -mlinux -DHAVE_CONFIG_H -I. -I. -I.. -I../include -Wall -O2 -c
hci.c -fPIC -DPIC -o .libs/hci.o
gcc-cris -mlinux -DHAVE_CONFIG_H -I. -I. -I.. -I../include -Wall -O2 -c
hci.c -o hci.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile gcc-cris -mlinux -DHAVE_CONFIG_H -I.
-I. -I.. -I../include -Wall -O2 -c -o sdp.lo `test -f 'sdp.c' || echo
'./'`sdp.c
gcc-cris -mlinux -DHAVE_CONFIG_H -I. -I. -I.. -I../include -Wall -O2 -c
sdp.c -fPIC -DPIC -o .libs/sdp.o
gcc-cris -mlinux -DHAVE_CONFIG_H -I. -I. -I.. -I../include -Wall -O2 -c
sdp.c -o sdp.o >/dev/null 2>&1
/bin/sh ../libtool --mode=link gcc-cris -mlinux -Wall -O2 -o
libbluetooth.la -rpath /usr/lib -version-info 1:14:0 bluetooth.lo hci.lo
sdp.lo
gcc-cris -mlinux -shared .libs/bluetooth.o .libs/hci.o .libs/sdp.o
-mlinux -Wl,-soname -Wl,libbluetooth.so.1 -o .libs/libbluetooth.so.1.0.14
(cd .libs && rm -f libbluetooth.so.1 && ln -s libbluetooth.so.1.0.14
libbluetooth.so.1)
(cd .libs && rm -f libbluetooth.so && ln -s libbluetooth.so.1.0.14
libbluetooth.so)
ar cru .libs/libbluetooth.a bluetooth.o hci.o sdp.o
ranlib .libs/libbluetooth.a
creating libbluetooth.la
(cd .libs && rm -f libbluetooth.la && ln -s ../libbluetooth.la
libbluetooth.la)
make[2]: Entering directory `/axis/devboard_82/apps/bluez-libs-2.14/src'
/bin/sh ../mkinstalldirs /usr/lib
/bin/sh ../libtool --mode=install /usr/bin/install -c libbluetooth.la
/usr/lib/libbluetooth.la
/usr/bin/install -c .libs/libbluetooth.so.1.0.14
/usr/lib/libbluetooth.so.1.0.14
(cd /usr/lib && rm -f libbluetooth.so.1 && ln -s libbluetooth.so.1.0.14
libbluetooth.so.1)
(cd /usr/lib && rm -f libbluetooth.so && ln -s libbluetooth.so.1.0.14
libbluetooth.so)
/usr/bin/install -c .libs/libbluetooth.lai /usr/lib/libbluetooth.la
/usr/bin/install -c .libs/libbluetooth.a /usr/lib/libbluetooth.a
ranlib /usr/lib/libbluetooth.a
chmod 644 /usr/lib/libbluetooth.a
PATH="$PATH:/sbin" ldconfig -n /usr/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/axis/devboard_82/apps/bluez-libs-2.14/src'
make[1]: Leaving directory `/axis/devboard_82/apps/bluez-libs-2.14/src'
make[1]: Entering directory `/axis/devboard_82/apps/bluez-libs-2.14'
make[2]: Entering directory `/axis/devboard_82/apps/bluez-libs-2.14'
make[2]: Nothing to be done for `install-exec-am'.
/bin/sh ./mkinstalldirs /usr/share/aclocal
/usr/bin/install -c -m 644 bluez.m4 /usr/share/aclocal/bluez.m4
/bin/sh ./mkinstalldirs /usr/lib/pkgconfig
/usr/bin/install -c -m 644 bluez.pc /usr/lib/pkgconfig/bluez.pc
make[2]: Leaving directory `/axis/devboard_82/apps/bluez-libs-2.14'
make[1]: Leaving directory `/axis/devboard_82/apps/bluez-libs-2.14'
linux:/axis/devboard_82/apps/bluez-libs-2.14 #


cd ../bluez-utils-2.14/
linux:/axis/devboard_82/apps/bluez-utils-2.14 # ./configure CC="gcc-cris
-mlinux" LD="cris-ld" --target=cris-axis-linux --host=i686-pc-linux
--prefix=/usr
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for i686-pc-linux-strip... no
checking for strip... strip
checking whether to enable maintainer-specific portions of Makefiles... no
checking for i686-pc-linux-gcc... gcc-cris -mlinux
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc-cris -mlinux accepts -g... yes
checking for gcc-cris -mlinux option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc-cris -mlinux... none
checking whether gcc-cris -mlinux accepts -fPIE... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for bison... bison -y
checking for flex... flex
checking for yywrap in -lfl... no
checking for yywrap in -ll... no
checking lex output file root... lex.yy
checking whether yytext is a pointer... no
checking how to run the C preprocessor... gcc-cris -mlinux -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking bluetooth/bluetooth.h usability... yes
checking bluetooth/bluetooth.h presence... yes
checking for bluetooth/bluetooth.h... yes
checking for hci_open_dev in -lbluetooth... no
configure: error: Bluetooth library not found
linux:/axis/devboard_82/apps/bluez-utils-2.14 #







-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users


2005-01-31 20:51:52

by Erwin Authried

[permalink] [raw]
Subject: Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found

Am Mon, den 31.01.2005 schrieb joe sloan um 20:23:
> Hi,
>
> I have compiled bluez-libs-2.14 but having problems with bluez-utils-2.14.
>
> I'm working on a PC with SUSE 9.1, and the target is devboard_82 with
> linux-2.4.26.
>
> I've tried almost every option at this stage and I keep getting the
> error related to /lib/libc.so.6 I cannot figure out where it is getting
> this from - my guess is that it should be pointing to
> ../../target/cris-axis-linux-gnu/lib/libc.so.6 but cannot.
>
> I'd appreciate some help or pointers with this (having searched the web
> and this newgroup - and tried loads of combinations of commands).
>
> thanks
>
> Joe
...
>
> cd bluez-libs-2.14/
> linux:/axis/devboard_82/apps/bluez-libs-2.14 # ./configure CC="gcc-cris
> -mlinux" LD="cris-ld" --target=cris-axis-linux --host=i686-pc-linux
> --prefix=/usr

Hi,
it seems that your options for configure are wrong for cross
compilation. --host specifies the system where the package will run.
This should be cris-axis-linux in your case, I guess.

As a general hint for cross compiling:
* Set CC,CFLAGS and LDFLAGS that you need for cross compiling in the
environment.
* use "./configure --host=<your target architecture>" (and special
options that are required, but don't use --target or --build !!)

For bluez-utils-2.10, I had to specify --with-bluez=.. and --with-usb=..
with the path were the bluez-libs includes were installed.

Hope that helps
Erwin






-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-05 00:05:55

by Marcel Holtmann

[permalink] [raw]
Subject: Re: cross-compilation howto (was "Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found")

Hi Marco,

> > please start writing a small howto about
> > compiling/cross-compiling the BlueZ
>
> suggestion: set up a wiki (or something similar to it)
> then i'll invest a couple of hours to fill in my knowledge.
>
> then you can add/change things and other people can as well...

I personally don't like wiki and so I will not be the person who is
going to set this up. Someone else maybe and I am happy to link then.

Regards

Marcel




-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-04 23:20:03

by Marco Trudel

[permalink] [raw]
Subject: Re: cross-compilation howto (was "Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found")

> please start writing a small howto about
> compiling/cross-compiling the BlueZ

suggestion: set up a wiki (or something similar to it)
then i'll invest a couple of hours to fill in my knowledge.

then you can add/change things and other people can as well...

regards
Marco


Marcel Holtmann wrote:
> Hi Marco,
>
>
>>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.
>
>
> please start writing a small howto about compiling/cross-compiling the
> BlueZ. I really want something like that on the webpage. This would help
> people to get a start into it.
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>
>


-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-04 18:55:32

by Erwin Authried

[permalink] [raw]
Subject: Re: cross-compilation howto (was "Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found")

Am Fre, den 04.02.2005 schrieb Marcel Holtmann um 19:43:
> Hi Erwin,
>
> > finding a quick workaround usually consumes much less time than fixing
> > the configure scripts. Once it's working, most times I'm not in the mood
> > to look how the autoconf stuff can be fixed. The bluez configure scripts
> > are quite nice compared to other packages, but there are still some
> > small problems where I didn't find a nice solution. For example, is it
> > possible to specify only a subset of the applications to be installed
> > for the target system, by specifying that in enviroment variables?
>
> what do you wanna select or better de-select. Lets discuss this what is
> needed by default and what not and we can add such an option very easy.
>
> Regards
>
> Marcel
Hi Marcel,

in my uClinux Midori distribution, I have a web based configuration
where I have a checkbox for every binary from bluez-utils that should be
installed on the target. Right now, I'm not using the install: target,
instead I just copy the selected applications to the target.
(See http://cvs.home.at/midori/sources/bluez-utils-2.10)

Regards,
Erwin
-------------------------
# Name: BLUEZ_UTILS_PROGS
# Description: BlueZ programs to install in /bin
# Type: LIST CHECKBOX (dund/dund,pand/pand,hidd/hidd,tools/ciptool,tools/hcitool,tools/l2ping,rfcomm/rfcomm,tools/sdptool)
# Default: ""
BLUEZ_UTILS_PROGS=""

# Name: BLUEZ_UTILS_SPROGS
# Description: BlueZ programs to install in /sbin
# Type: LIST CHECKBOX (tools/hciattach,tools/hciconfig,hcid/hcid,sdpd/sdpd)
# Default: ""
BLUEZ_UTILS_SPROGS=""
-------------------------




-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-04 18:43:09

by Marcel Holtmann

[permalink] [raw]
Subject: Re: cross-compilation howto (was "Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found")

Hi Erwin,

> finding a quick workaround usually consumes much less time than fixing
> the configure scripts. Once it's working, most times I'm not in the mood
> to look how the autoconf stuff can be fixed. The bluez configure scripts
> are quite nice compared to other packages, but there are still some
> small problems where I didn't find a nice solution. For example, is it
> possible to specify only a subset of the applications to be installed
> for the target system, by specifying that in enviroment variables?

what do you wanna select or better de-select. Lets discuss this what is
needed by default and what not and we can add such an option very easy.

Regards

Marcel




-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-04 18:38:01

by Erwin Authried

[permalink] [raw]
Subject: Re: cross-compilation howto (was "Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found")

Am Fre, den 04.02.2005 schrieb Marcel Holtmann um 19:22:
> Hi Erwin,
>
> > you are almost right. In practice, almost every configure script has
> > some problems with cross-compiling. For example, configure scripts that
> > do runtime tests for the target system will obviously fail. You can work
> > around that by supplying a hand-crafted config.guess that substitutes
> > missing values. In other cases, you have to play with configure options
> > and environment variables.
>
> if we have such problems with that, then lets fix them.
>
> Regards
>
> Marcel
>
Hi Marcel,
finding a quick workaround usually consumes much less time than fixing
the configure scripts. Once it's working, most times I'm not in the mood
to look how the autoconf stuff can be fixed. The bluez configure scripts
are quite nice compared to other packages, but there are still some
small problems where I didn't find a nice solution. For example, is it
possible to specify only a subset of the applications to be installed
for the target system, by specifying that in enviroment variables?

Regards,
Erwin




-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-04 18:31:46

by Marco Trudel

[permalink] [raw]
Subject: Re: cross-compilation howto (was "Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found")

> if we have such problems with that, then lets fix them.

do we? I don't think so...
At least I didn't had...
Wow, that was a quick fix :-)


regards
Marco


Marcel Holtmann wrote:
> Hi Erwin,
>
>
>>you are almost right. In practice, almost every configure script has
>>some problems with cross-compiling. For example, configure scripts that
>>do runtime tests for the target system will obviously fail. You can work
>>around that by supplying a hand-crafted config.guess that substitutes
>>missing values. In other cases, you have to play with configure options
>>and environment variables.
>
>
> if we have such problems with that, then lets fix them.
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>
>


-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-04 18:22:10

by Marcel Holtmann

[permalink] [raw]
Subject: Re: cross-compilation howto (was "Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found")

Hi Erwin,

> you are almost right. In practice, almost every configure script has
> some problems with cross-compiling. For example, configure scripts that
> do runtime tests for the target system will obviously fail. You can work
> around that by supplying a hand-crafted config.guess that substitutes
> missing values. In other cases, you have to play with configure options
> and environment variables.

if we have such problems with that, then lets fix them.

Regards

Marcel




-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-04 18:19:03

by Erwin Authried

[permalink] [raw]
Subject: Re: cross-compilation howto (was "Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found")

Am Fre, den 04.02.2005 schrieb Marco Trudel um 18:32:
> 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.
>
Hi,
you are almost right. In practice, almost every configure script has
some problems with cross-compiling. For example, configure scripts that
do runtime tests for the target system will obviously fail. You can work
around that by supplying a hand-crafted config.guess that substitutes
missing values. In other cases, you have to play with configure options
and environment variables.

> 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.
It's definitely worth to have a howto, because if you search the web or
mailinglists, there are a lot of misleading or wrong hints regarding
this topic. I don't have time right now to write a howto, but I think
that the recent postings are already some help to get started for
somebody who is in trouble with cross-compiling.

>
> 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.)
>
I have cross-compiled a lot of packages, and --host was always
sufficient (I tried to use the possible minimum of options) . The
warning says:

"WARNING: If you wanted to set the --build type, don't use --host."

that applies to something that you don't want to do anyway in our case.

Regards,
Erwin




-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-04 17:38:30

by Marcel Holtmann

[permalink] [raw]
Subject: Re: cross-compilation howto (was "Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found")

Hi Marco,

> 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.

please start writing a small howto about compiling/cross-compiling the
BlueZ. I really want something like that on the webpage. This would help
people to get a start into it.

Regards

Marcel




-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-04 17:32:43

by Marco Trudel

[permalink] [raw]
Subject: cross-compilation howto (was "Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found")

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 <[email protected]>
>>
>>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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-01 15:59:25

by Erwin Authried

[permalink] [raw]
Subject: Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found

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 <[email protected]>
>
> 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





Attachments:
cross-compile (832.00 B)

2005-02-01 15:47:31

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found

Hi Marco,

> 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...

see my comment about the DESTDIR, because your interpretation is wrong.

Regards

Marcel




-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-01 15:22:10

by Marco Trudel

[permalink] [raw]
Subject: Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found

This document shows how to cross-compile bluez for another processor.

date/version: 01 Feb. 2005, v0.2
author: Marco Trudel <[email protected]>

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


Attachments:
bluezCrossCompiling-miniHowto (2.81 kB)

2005-02-01 15:20:05

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found

Hi Marco,

> > 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...

this is actually not what I meant with DESTDIR, because DESTDIR is not
the prefix. See for yourself what I mean:

./configure
make
make install DESTDIR=$PWD/dir

Regards

Marcel




-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-01 15:12:02

by Marco Trudel

[permalink] [raw]
Subject: Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found

This document shows how to cross-compile bluez for an arm-processor on an i686 processor.
It can be used as starting point if you have to cross-compile bluez yourself.

date/version: 01 Feb. 2005, v0.1.2
author: Marco Trudel <[email protected]>

If you need help, please use the bluez-user list.

------------------------------------------------------------

This document assumes you have the toolchain installed in /usr/local/arm.
Version 2.95.3 is used in this description.
That means a directory called "/usr/local/arm/2.95.3/arm-linux" exists.
Bluez will be installed into /opt/bluez (feel free to choose another location).

Ensure that the crosscompile binaries are in $PATH.
For example, do: export PATH="$PATH:/usr/local/arm/2.95.3/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


Attachments:
bluezCrossCompiling-miniHowto (3.05 kB)

2005-02-01 14:42:18

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found

Hi Marco,

> Is this ok?
> Any improvement suggestions? Anyone?

looks nice so far to me, but I like to have somekind of generic cross
compilation instruction. I also prefer using DESTDIR for install, so
that you can make an installation for /usr without overwriting your
local files.

Regards

Marcel




-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-01 14:36:38

by Marco Trudel

[permalink] [raw]
Subject: [Bluez-users] cross-compilation miniHowto, first change

This document shows how to cross-compile bluez for an arm-processor on an i686 processor.
It can be used as starting point if you have to cross-compile bluez yourself.

date/version: 01 Feb. 2005, v0.1.1
author: Marco Trudel <[email protected]>

If you need help, please use the bluez-user list.

------------------------------------------------------------

This document assumes you have the toolchain installed in /usr/local/arm.
Version 2.95.3 is used in this description.
That means a directory called "/usr/local/arm/2.95.3/arm-linux" exists.
Bluez will be installed into /opt/bluez (feel free to choose another location).

Ensure that the crosscompile binaries are in $PATH.
For example, do: export PATH="$PATH:/usr/local/arm/2.95.3/bin"

########## 1. compile bluez-libs ##########
- extract bluez-libs and change into the directory
- configure the makefiles for cross-compiling. run:
./configure --build=i686-pc-linux-gnu \
--host=arm-linux \
--sysconfdir=/opt/bluez/etc \
--prefix=/opt/bluez

- 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

- Explanation of the switches:
--build the build platform
--host the target platform
--sysconfdir where bluez will expect etc (feel free to use /etc)
--prefix where bluez will be installed to

- 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 \
--sysconfdir=/opt/bluez/etc \
--prefix=/opt/bluez \
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 /opt/bluez to your target platform.
- add "/opt/bluez/lib" to /etc/ld.so.conf and, run "ldconfig"
- run "./hcid -n" in /opt/bluez/sbin
Check the output.
If everything works well, abort hcid and start it withhout "-n".

- "/opt/bluez/bin/hcitool dev" should show you your devices
- "/opt/bluez/bin/hcitool scan" perform an inquiry scan


Attachments:
bluezCrossCompiling-miniHowto (2.59 kB)

2005-02-01 14:19:12

by Marco Trudel

[permalink] [raw]
Subject: Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found

This document shows how to cross-compile bluez for an arm-processor on an i686 processor.
It can be used as starting point if you have to cross-compile bluez yourself.

date/version: 01 Feb. 2005, v0.1
author: Marco Trudel <[email protected]>

If you need help, please use the bluez-user list.

------------------------------------------------------------

This document assumes you have the toolchain installed in /usr/local/arm.
Version 2.95.3 is used in this description.
That means a directory called "/usr/local/arm/2.95.3/arm-linux" exists.
Bluez will be installed into /opt/bluez (feel free to choose another location).

Ensure that the crosscompile binaries are in $PATH.
For example, do: export PATH="$PATH:/usr/local/arm/2.95.3/bin"

########## 1. compile bluez-libs ##########
- extract bluez-libs and change into the directory
- configure the makefiles for cross-compiling. run:
./configure --build=i686-pc-linux-gnu \
--host=arm-linux \
--sysconfdir=/opt/bluez/etc \
--prefix=/opt/bluez

- 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"

The bluez libs are now intalled in /opt/bluez.
At this point, compiling the bluez-utils still fails because it doesn't
find the library (--with-bluez=/opt/bluez dosn't work for me, the error is:
/usr/local/arm/2.95.3/arm-linux/bin/ld: cannot find -lbluetooth)
To make it work, we install the bluez-libs in the arm-linux directory.
To keep that directory clean, we'll remove bluez from it later again.
If someone knows why --with-bluez doesn't work, please inform me.

Run:
./configure --build=i686-pc-linux-gnu \
--host=arm-linux \
--sysconfdir=/opt/bluez/etc \
--prefix=/usr/local/arm/2.95.3/arm-linux
make install # do not run "make"


########## 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 \
--sysconfdir=/opt/bluez/etc \
--prefix=/opt/bluez
- run "make" and "make install"


########## 3. clean up ##########
As promised in the first step, we keep our arm-linux directory clean.
So change back into the bluez-libs folder and run:
make uninstall


######### 4. 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 /opt/bluez to your target platform.
- add "/opt/bluez/lib" to /etc/ld.so.conf and, run "ldconfig"
- run "./hcid -n" in /opt/bluez/sbin
Check the output.
If everything works well, abort hcid and start it withhout "-n".

- "/opt/bluez/bin/hcitool dev" should show you your devices
- "/opt/bluez/bin/hcitool scan" perform an inquiry scan


Attachments:
bluezCrossCompiling-miniHowto (3.19 kB)

2005-02-01 10:36:49

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found

Hi,

> Thanks Erwin. I also used --libdir= too and I can compile the utils.
> (Haven't tested them yet - trying to get the kernel up and running).
>
> I wasn't sure about using --host as the script gave some kind of error
> about not using it.

may someone write a small BlueZ cross-compilation howto that I can add
to the website?

Regards

Marcel




-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2005-02-01 10:07:22

by Joe Sloan

[permalink] [raw]
Subject: Re: [Bluez-users] Trying to compile for axis but Bluetooth library not found


>Hi,
>it seems that your options for configure are wrong for cross
>compilation. --host specifies the system where the package will run.
>This should be cris-axis-linux in your case, I guess.
>
>As a general hint for cross compiling:
>* Set CC,CFLAGS and LDFLAGS that you need for cross compiling in the
>environment.
>* use "./configure --host=<your target architecture>" (and special
>options that are required, but don't use --target or --build !!)
>
>For bluez-utils-2.10, I had to specify --with-bluez=.. and --with-usb=..
>with the path were the bluez-libs includes were installed.
>
>Hope that helps
>Erwin
>
>
Thanks Erwin. I also used --libdir= too and I can compile the utils.
(Haven't tested them yet - trying to get the kernel up and running).

I wasn't sure about using --host as the script gave some kind of error
about not using it.







-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users