Re: [OpenWrt-Devel] [PATCH] Add CMake host tool support

2010-11-18 Thread Bas Mevissen
On Thu, 18 Nov 2010 13:37:25 +0100, Jan Willies j...@willies.info
wrote:
 Hi Bas,
 
 2010/11/17 Bas Mevissen 
  The attached patch against trunk adds CMake host tool support.
 
 Thanks for your patch, I hope we can finally update Weechat (which
 kinda depends on cmake) to something recent.
 
 I applied your patch but building fails however:
 

It looks you are trying to cross compile something that needs to be
compiled for the host. Is there something defined in your environment
for cross compiling? 
-- 
Bas
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Add CMake host tool support

2010-11-18 Thread Jan Willies
2010/11/18 Bas Mevissen ab...@basmevissen.nl

 On Thu, 18 Nov 2010 13:49:46 +0100, Bas Mevissen ab...@basmevissen.nl
 wrote:
  It looks you are trying to cross compile something that needs to be
  compiled for the host. Is there something defined in your environment
  for cross compiling?

The mail escaped before being finished...

 The text

 Line: gcc -Os -pipe -march=armv5te -mtune=marvell-f -funit-at-a-time
 cmake_bootstrap_22734_test.c -o cmake_bootstrap_22734_test

 in the output you posted lets me suspect that you exported a CFLAGS
 define like

 export CFLAGS=-march=armv5te -mtune=marvell-f -funit-at-a-time

 somewhere.


This is a fresh checkout from trunk and I am trying to build for Marvell
Kirkwood ('Seagate Dockstar).

The CFLAGS from target/linux/kirkwood/Makefile are overriding include/
host-build.mk. So removing include $(INCLUDE_DIR)/target.mk from
tools/cmake/Makefile did it for me. Did you include it on purpose?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Add CMake host tool support

2010-11-18 Thread Bas Mevissen
On Thu, 18 Nov 2010 14:32:36 +0100, Jan Willies j...@willies.info
wrote:

 The CFLAGS from target/linux/kirkwood/Makefile are
 overriding include/host-build.mk [3]. So removing include
 $(INCLUDE_DIR)/target.mk [4] from tools/cmake/Makefile did it for me.
 Did you include it on purpose? 
 

Ah, great. That is plain wrong. I just took the ccache Makefile as a
template for cmake. So I was quite lucky that it compiled for me. Thanks
for pointing out. I'll update my patch and check if ccache can/should do
without target.mk too.

Sorry for wasting your time.

Regards,

-- 
Bas
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Add CMake host tool support

2010-11-18 Thread Jan Willies
Hi Bas,

2010/11/18 Bas Mevissen ab...@basmevissen.nl

 On Thu, 18 Nov 2010 14:32:36 +0100, Jan Willies j...@willies.info
 wrote:

  The CFLAGS from target/linux/kirkwood/Makefile are
  overriding include/host-build.mk [3]. So removing include
  $(INCLUDE_DIR)/target.mk [4] from tools/cmake/Makefile did it for me.
  Did you include it on purpose?
 

 Ah, great. That is plain wrong. I just took the ccache Makefile as a
 template for cmake. So I was quite lucky that it compiled for me. Thanks
 for pointing out. I'll update my patch and check if ccache can/should do
 without target.mk too.

 Sorry for wasting your time.


Heh, no problem. Thats what's posting patches is good for :)

So, how does a packages configure section look like?

define Build/Configure
cd $(PKG_BUILD_DIR)
$(STAGING_DIR)/../host/bin/cmake .
endef

This quick'n'dirty thing results in:

if [ -f
/var/tmp/swjawill/openwrt-dockstar/build_dir/target-arm_v5te_uClibc-0.9.30.1_eabi/weechat-0.3.3/./configure
]; then /var/tmp/swjawill/openwrt-dockstar/staging_dir/host/bin/sed -i -e
's,\(gentoo\|pardus\)_ltmain_version=.*,\1_ltmain_version=$\1_lt_version,'
/var/tmp/swjawill/openwrt-dockstar/build_dir/target-arm_v5te_uClibc-0.9.30.1_eabi/weechat-0.3.3/./configure;
fi
cd
/var/tmp/swjawill/openwrt-dockstar/build_dir/target-arm_v5te_uClibc-0.9.30.1_eabi/weechat-0.3.3
/var/tmp/swjawill/openwrt-dockstar/staging_dir/target-arm_v5te_uClibc-0.9.30.1_eabi/../host/bin/cmake
.
CMake Error: The source directory
/var/tmp/swjawill/openwrt-dockstar/feeds/packages/net/weechat does not
appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

$(STAGING_DIR)/../host/bin/cmake $(PKG_BUILD_DIR) works, but puts the
stuff in feeds/packages/net/weechat which is completely wrong.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] Add CMake host tool support [V2]

2010-11-18 Thread Bas Mevissen

Hi all,

The attached patch against trunk adds CMake host tool support. When
CONFIG_CMAKE is set in .config, the CMake tools will be build and
installed in staging_dir/host/bin.

To enable CONFIG_CMAKE, select Advanced configuration options (for
developers) in the main menu and select Build CMake tool. When a
package needs CMake to build, it just needs to have the line

DEPENDS:=...@cmake

in the Makefile.

Please review this patch and add it to trunk. I'm working on creating 
an

OpenWRT package of Gammu (http://wammu.eu/gammu/) that needs cmake to
build, see https://dev.openwrt.org/ticket/7649

Can this patch please be added to backfire too? I'm working on a
customer project based upon backfire that needs Gammu for 
communication

with a GSM modem. It would be very nice to use backfire unmodified in
the project.

Revision history:
V1: first attempt
V2: remove target compiler flags inclusion for native build

Thanks a lot in advance,

Regards,

--
Bas


cmake.diff
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Add CMake host tool support

2010-11-18 Thread Bas Mevissen
On 11/18/2010 06:53 PM, Jan Willies wrote:


 Unfortunately cmake picks up the host-gcc:
 
 (cd
 /var/tmp/swjawill/openwrt-dockstar/build_dir/target-arm_v5te_uClibc-0.9.30.1_eabi/weechat-0.3.3;
 /var/tmp/swjawill/openwrt-dockstar/staging_dir/host/bin/cmake . || exit 1 );
 -- The C compiler identification is GNU
 -- Check for working C compiler: /usr/bin/gcc
 [...]
 
 Am I supposed to call it with some options or something?
 

Now the fishy part begins. :-)

We need to tell cmake that we are cross compiling. Here is a good start:

http://www.cmake.org/Wiki/CMake_Cross_Compiling

I guess we need a toolchain file. I'm wondering if we can provide one
for all packages that use cmake (it should be). So that is something
that tools/cmake/Makefile could generate.

Package should than simply call

cmake -DCMAKE_TOOLCHAIN_FILE=.../staging_dir/somewhere/tc_file.cmake

I'll take a look at it over the weekend. Hopefully, I can get the gammu
package working as well.

Thanks for your feedback so far!

Regards,

Bas.

-- 
Bas.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel