diff mbox

[APPS/PATCH] cross compilation support

Message ID 1399996268-13125-1-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov May 13, 2014, 3:51 p.m. UTC
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 Makefile         | 4 +++-
 libpcap/Makefile | 8 +++++---
 openvpn/Makefile | 6 +++---
 3 files changed, 11 insertions(+), 7 deletions(-)

Comments

vkamensky May 13, 2014, 4:06 p.m. UTC | #1
Hi Maxim,

Why do you need to introduce CROSS_COMPILE? If one need to
compile this code in cross compilation mode would not it be
sufficient to be able redefine CC, CFLAGS and such externally.

Note defining CROSS_COMPILE normally is not sufficient for
user-land app build (unlike kernel). One need to have pointer to
sysroot that contains all libraries, include files, etc.

IMHO Makefile should be cross compilation friendly, with meaning
that CC, CFLAGS, and other could be defined externally. Don't we
already have OE recipe for ODP, that one does cross compilation
for sure?

Thanks,
Victor

On 13 May 2014 08:52, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> Hi VIncent,
>
> can you test this patch? Looks like you have openssl and all other req
> installed in cross env.
>
> make CROSS_COMPILE=armeb-linux-gnueabihf
>
> Thanks,
> Maxim.
>
>
> On 05/13/2014 07:51 PM, Maxim Uvarov wrote:
>>
>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>> ---
>>   Makefile         | 4 +++-
>>   libpcap/Makefile | 8 +++++---
>>   openvpn/Makefile | 6 +++---
>>   3 files changed, 11 insertions(+), 7 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index cab82f4..78e9320 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -2,6 +2,8 @@
>>     all: openvpn libpcap
>>   +export $(CROSS_COMPILE)
>> +
>>   libpcap: odp
>>         make -C libpcap ODP_DIR=$(PWD)/odp.git
>>   @@ -12,7 +14,7 @@ odp:
>>         if [ ! -d odp.git ]; \
>>                 then git clone http://git.linaro.org/git/lng/odp.git
>> odp.git; \
>>         fi
>> -       cd odp.git; make libs_install  CFLAGS="-fPIC"
>> +       cd odp.git; make libs_install  CFLAGS="-fPIC"
>> CC=$(CROSS_COMPILE)-gcc
>>     distclean:
>>         rm -rf odp.git
>> diff --git a/libpcap/Makefile b/libpcap/Makefile
>> index 5e47b4a..a00f5b7 100644
>> --- a/libpcap/Makefile
>> +++ b/libpcap/Makefile
>> @@ -15,6 +15,8 @@ WIRESHARK_VERSION=wireshark-1.8.9
>>     ODP_DIR ?= $(PWD)/../odp.git
>>   +HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
>> +
>>   .PHONY: all
>>   all: libpcap tcpdump
>>   @@ -32,7 +34,7 @@ libpcap: get_libpcap
>>         cd $(LIBPCAP_DIR) \
>>         && git checkout $(LIBPCAP_VERSION) \
>>         && git am ../patches/*.patch \
>> -       && ./configure --with-odp=$(ODP_DIR) --libdir=/usr/lib
>> +       && ac_cv_linux_vers=3.2.51 ./configure --with-pcap=linux
>> --with-odp=$(ODP_DIR) --libdir=/usr/lib --host=$(HOST)
>>         $(MAKE) -C $(LIBPCAP_DIR)
>>     .PHONY: get_libpcap
>> @@ -54,7 +56,7 @@ clean_libpcap:
>>   tcpdump: get_tcpdump libpcap
>>         cd $(TCPDUMP_DIR) \
>>         && git checkout $(TCPDUMP_VERSION) \
>> -       && ./configure LIBS="-lrt"
>> +       && ac_cv_linux_vers=3.2.51 ./configure LIBS="-lrt" --host=$(HOST)
>>         $(MAKE) -C $(TCPDUMP_DIR)
>>     .PHONY: get_tcpdump
>> @@ -76,7 +78,7 @@ clean_tcpdump:
>>   wireshark: get_wireshark libpcap
>>         cd $(WIRESHARK_DIR) \
>>         && git checkout $(WIRESHARK_VERSION) \
>> -       && ./autogen.sh && ./configure
>> +       && ./autogen.sh && ./configure --host=$(HOST)
>>         $(MAKE) -C $(WIRESHARK_DIR)
>>     .PHONY: get_wireshark
>> diff --git a/openvpn/Makefile b/openvpn/Makefile
>> index 68e4348..5117490 100644
>> --- a/openvpn/Makefile
>> +++ b/openvpn/Makefile
>> @@ -9,6 +9,8 @@ OPENVPN_VERSION=cd6555e0159987ef264789f4976053ce2aa5fc20
>>     ODP_DIR ?= $(PWD)/../odp.git
>>   +HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
>> +
>>   .PHONY: all
>>   all: openvpn odp_ipcd
>>   @@ -22,14 +24,12 @@ openvpn:
>>                 git clone $(OPENVPN_REPO) $(OPENVPN_DIR);\
>>         else\
>>                 cd $(OPENVPN_DIR);\
>> -               git fetch --all;\
>>         fi
>> -
>>         cd $(OPENVPN_DIR) \
>>         && git checkout $(OPENVPN_VERSION) \
>>         && git am ../patches/*.patch \
>>         && autoreconf -i -v -f \
>> -       && ./configure
>> +       && ./configure --host=$(HOST) --disable-snappy --disable-lzo
>>         make -C $(OPENVPN_DIR)
>>     .PHONY: clean_openvpn
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Maxim Uvarov May 13, 2014, 4:12 p.m. UTC | #2
On 05/13/2014 08:06 PM, Victor Kamensky wrote:
> Hi Maxim,
>
> Why do you need to introduce CROSS_COMPILE? If one need to
> compile this code in cross compilation mode would not it be
> sufficient to be able redefine CC, CFLAGS and such externally.
>
> Note defining CROSS_COMPILE normally is not sufficient for
> user-land app build (unlike kernel). One need to have pointer to
> sysroot that contains all libraries, include files, etc.
>
> IMHO Makefile should be cross compilation friendly, with meaning
> that CC, CFLAGS, and other could be defined externally. Don't we
> already have OE recipe for ODP, that one does cross compilation
> for sure?
>
> Thanks,
> Victor
There are number of applications. Each of them uses configure. So that I 
need to provide --host=arm there somehow.
Just setting CC and CFLAGS does not help. So that was the easiest way to 
call each configure with right options.

Maxim.
> On 13 May 2014 08:52, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>> Hi VIncent,
>>
>> can you test this patch? Looks like you have openssl and all other req
>> installed in cross env.
>>
>> make CROSS_COMPILE=armeb-linux-gnueabihf
>>
>> Thanks,
>> Maxim.
>>
>>
>> On 05/13/2014 07:51 PM, Maxim Uvarov wrote:
>>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>>> ---
>>>    Makefile         | 4 +++-
>>>    libpcap/Makefile | 8 +++++---
>>>    openvpn/Makefile | 6 +++---
>>>    3 files changed, 11 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/Makefile b/Makefile
>>> index cab82f4..78e9320 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -2,6 +2,8 @@
>>>      all: openvpn libpcap
>>>    +export $(CROSS_COMPILE)
>>> +
>>>    libpcap: odp
>>>          make -C libpcap ODP_DIR=$(PWD)/odp.git
>>>    @@ -12,7 +14,7 @@ odp:
>>>          if [ ! -d odp.git ]; \
>>>                  then git clone http://git.linaro.org/git/lng/odp.git
>>> odp.git; \
>>>          fi
>>> -       cd odp.git; make libs_install  CFLAGS="-fPIC"
>>> +       cd odp.git; make libs_install  CFLAGS="-fPIC"
>>> CC=$(CROSS_COMPILE)-gcc
>>>      distclean:
>>>          rm -rf odp.git
>>> diff --git a/libpcap/Makefile b/libpcap/Makefile
>>> index 5e47b4a..a00f5b7 100644
>>> --- a/libpcap/Makefile
>>> +++ b/libpcap/Makefile
>>> @@ -15,6 +15,8 @@ WIRESHARK_VERSION=wireshark-1.8.9
>>>      ODP_DIR ?= $(PWD)/../odp.git
>>>    +HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
>>> +
>>>    .PHONY: all
>>>    all: libpcap tcpdump
>>>    @@ -32,7 +34,7 @@ libpcap: get_libpcap
>>>          cd $(LIBPCAP_DIR) \
>>>          && git checkout $(LIBPCAP_VERSION) \
>>>          && git am ../patches/*.patch \
>>> -       && ./configure --with-odp=$(ODP_DIR) --libdir=/usr/lib
>>> +       && ac_cv_linux_vers=3.2.51 ./configure --with-pcap=linux
>>> --with-odp=$(ODP_DIR) --libdir=/usr/lib --host=$(HOST)
>>>          $(MAKE) -C $(LIBPCAP_DIR)
>>>      .PHONY: get_libpcap
>>> @@ -54,7 +56,7 @@ clean_libpcap:
>>>    tcpdump: get_tcpdump libpcap
>>>          cd $(TCPDUMP_DIR) \
>>>          && git checkout $(TCPDUMP_VERSION) \
>>> -       && ./configure LIBS="-lrt"
>>> +       && ac_cv_linux_vers=3.2.51 ./configure LIBS="-lrt" --host=$(HOST)
>>>          $(MAKE) -C $(TCPDUMP_DIR)
>>>      .PHONY: get_tcpdump
>>> @@ -76,7 +78,7 @@ clean_tcpdump:
>>>    wireshark: get_wireshark libpcap
>>>          cd $(WIRESHARK_DIR) \
>>>          && git checkout $(WIRESHARK_VERSION) \
>>> -       && ./autogen.sh && ./configure
>>> +       && ./autogen.sh && ./configure --host=$(HOST)
>>>          $(MAKE) -C $(WIRESHARK_DIR)
>>>      .PHONY: get_wireshark
>>> diff --git a/openvpn/Makefile b/openvpn/Makefile
>>> index 68e4348..5117490 100644
>>> --- a/openvpn/Makefile
>>> +++ b/openvpn/Makefile
>>> @@ -9,6 +9,8 @@ OPENVPN_VERSION=cd6555e0159987ef264789f4976053ce2aa5fc20
>>>      ODP_DIR ?= $(PWD)/../odp.git
>>>    +HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
>>> +
>>>    .PHONY: all
>>>    all: openvpn odp_ipcd
>>>    @@ -22,14 +24,12 @@ openvpn:
>>>                  git clone $(OPENVPN_REPO) $(OPENVPN_DIR);\
>>>          else\
>>>                  cd $(OPENVPN_DIR);\
>>> -               git fetch --all;\
>>>          fi
>>> -
>>>          cd $(OPENVPN_DIR) \
>>>          && git checkout $(OPENVPN_VERSION) \
>>>          && git am ../patches/*.patch \
>>>          && autoreconf -i -v -f \
>>> -       && ./configure
>>> +       && ./configure --host=$(HOST) --disable-snappy --disable-lzo
>>>          make -C $(OPENVPN_DIR)
>>>      .PHONY: clean_openvpn
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
Mike Holmes May 13, 2014, 4:21 p.m. UTC | #3
This patch currently hard wires the use of gcc but  we also build with
clang, given that this is an external application and not ODP maybe that is
ok ?


On 13 May 2014 12:12, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> On 05/13/2014 08:06 PM, Victor Kamensky wrote:
>
>> Hi Maxim,
>>
>> Why do you need to introduce CROSS_COMPILE? If one need to
>> compile this code in cross compilation mode would not it be
>> sufficient to be able redefine CC, CFLAGS and such externally.
>>
>> Note defining CROSS_COMPILE normally is not sufficient for
>> user-land app build (unlike kernel). One need to have pointer to
>> sysroot that contains all libraries, include files, etc.
>>
>> IMHO Makefile should be cross compilation friendly, with meaning
>> that CC, CFLAGS, and other could be defined externally. Don't we
>> already have OE recipe for ODP, that one does cross compilation
>> for sure?
>>
>> Thanks,
>> Victor
>>
> There are number of applications. Each of them uses configure. So that I
> need to provide --host=arm there somehow.
> Just setting CC and CFLAGS does not help. So that was the easiest way to
> call each configure with right options.
>
> Maxim.
>
>  On 13 May 2014 08:52, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>>
>>> Hi VIncent,
>>>
>>> can you test this patch? Looks like you have openssl and all other req
>>> installed in cross env.
>>>
>>> make CROSS_COMPILE=armeb-linux-gnueabihf
>>>
>>> Thanks,
>>> Maxim.
>>>
>>>
>>> On 05/13/2014 07:51 PM, Maxim Uvarov wrote:
>>>
>>>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>>>> ---
>>>>    Makefile         | 4 +++-
>>>>    libpcap/Makefile | 8 +++++---
>>>>    openvpn/Makefile | 6 +++---
>>>>    3 files changed, 11 insertions(+), 7 deletions(-)
>>>>
>>>> diff --git a/Makefile b/Makefile
>>>> index cab82f4..78e9320 100644
>>>> --- a/Makefile
>>>> +++ b/Makefile
>>>> @@ -2,6 +2,8 @@
>>>>      all: openvpn libpcap
>>>>    +export $(CROSS_COMPILE)
>>>> +
>>>>    libpcap: odp
>>>>          make -C libpcap ODP_DIR=$(PWD)/odp.git
>>>>    @@ -12,7 +14,7 @@ odp:
>>>>          if [ ! -d odp.git ]; \
>>>>                  then git clone http://git.linaro.org/git/lng/odp.git
>>>> odp.git; \
>>>>          fi
>>>> -       cd odp.git; make libs_install  CFLAGS="-fPIC"
>>>> +       cd odp.git; make libs_install  CFLAGS="-fPIC"
>>>> CC=$(CROSS_COMPILE)-gcc
>>>>      distclean:
>>>>          rm -rf odp.git
>>>> diff --git a/libpcap/Makefile b/libpcap/Makefile
>>>> index 5e47b4a..a00f5b7 100644
>>>> --- a/libpcap/Makefile
>>>> +++ b/libpcap/Makefile
>>>> @@ -15,6 +15,8 @@ WIRESHARK_VERSION=wireshark-1.8.9
>>>>      ODP_DIR ?= $(PWD)/../odp.git
>>>>    +HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
>>>> +
>>>>    .PHONY: all
>>>>    all: libpcap tcpdump
>>>>    @@ -32,7 +34,7 @@ libpcap: get_libpcap
>>>>          cd $(LIBPCAP_DIR) \
>>>>          && git checkout $(LIBPCAP_VERSION) \
>>>>          && git am ../patches/*.patch \
>>>> -       && ./configure --with-odp=$(ODP_DIR) --libdir=/usr/lib
>>>> +       && ac_cv_linux_vers=3.2.51 ./configure --with-pcap=linux
>>>> --with-odp=$(ODP_DIR) --libdir=/usr/lib --host=$(HOST)
>>>>          $(MAKE) -C $(LIBPCAP_DIR)
>>>>      .PHONY: get_libpcap
>>>> @@ -54,7 +56,7 @@ clean_libpcap:
>>>>    tcpdump: get_tcpdump libpcap
>>>>          cd $(TCPDUMP_DIR) \
>>>>          && git checkout $(TCPDUMP_VERSION) \
>>>> -       && ./configure LIBS="-lrt"
>>>> +       && ac_cv_linux_vers=3.2.51 ./configure LIBS="-lrt"
>>>> --host=$(HOST)
>>>>          $(MAKE) -C $(TCPDUMP_DIR)
>>>>      .PHONY: get_tcpdump
>>>> @@ -76,7 +78,7 @@ clean_tcpdump:
>>>>    wireshark: get_wireshark libpcap
>>>>          cd $(WIRESHARK_DIR) \
>>>>          && git checkout $(WIRESHARK_VERSION) \
>>>> -       && ./autogen.sh && ./configure
>>>> +       && ./autogen.sh && ./configure --host=$(HOST)
>>>>          $(MAKE) -C $(WIRESHARK_DIR)
>>>>      .PHONY: get_wireshark
>>>> diff --git a/openvpn/Makefile b/openvpn/Makefile
>>>> index 68e4348..5117490 100644
>>>> --- a/openvpn/Makefile
>>>> +++ b/openvpn/Makefile
>>>> @@ -9,6 +9,8 @@ OPENVPN_VERSION=cd6555e0159987ef264789f4976053
>>>> ce2aa5fc20
>>>>      ODP_DIR ?= $(PWD)/../odp.git
>>>>    +HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
>>>> +
>>>>    .PHONY: all
>>>>    all: openvpn odp_ipcd
>>>>    @@ -22,14 +24,12 @@ openvpn:
>>>>                  git clone $(OPENVPN_REPO) $(OPENVPN_DIR);\
>>>>          else\
>>>>                  cd $(OPENVPN_DIR);\
>>>> -               git fetch --all;\
>>>>          fi
>>>> -
>>>>          cd $(OPENVPN_DIR) \
>>>>          && git checkout $(OPENVPN_VERSION) \
>>>>          && git am ../patches/*.patch \
>>>>          && autoreconf -i -v -f \
>>>> -       && ./configure
>>>> +       && ./configure --host=$(HOST) --disable-snappy --disable-lzo
>>>>          make -C $(OPENVPN_DIR)
>>>>      .PHONY: clean_openvpn
>>>>
>>>
>>>
>>> _______________________________________________
>>> lng-odp mailing list
>>> lng-odp@lists.linaro.org
>>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>>
>>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
vkamensky May 13, 2014, 4:48 p.m. UTC | #4
On 13 May 2014 09:12, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> On 05/13/2014 08:06 PM, Victor Kamensky wrote:
>>
>> Hi Maxim,
>>
>> Why do you need to introduce CROSS_COMPILE? If one need to
>> compile this code in cross compilation mode would not it be
>> sufficient to be able redefine CC, CFLAGS and such externally.
>>
>> Note defining CROSS_COMPILE normally is not sufficient for
>> user-land app build (unlike kernel). One need to have pointer to
>> sysroot that contains all libraries, include files, etc.
>>
>> IMHO Makefile should be cross compilation friendly, with meaning
>> that CC, CFLAGS, and other could be defined externally. Don't we
>> already have OE recipe for ODP, that one does cross compilation
>> for sure?
>>
>> Thanks,
>> Victor
>
> There are number of applications. Each of them uses configure. So that I
> need to provide --host=arm there somehow.
> Just setting CC and CFLAGS does not help. So that was the easiest way to
> call each configure with right options.

And just setting --host is not enough in general cross compilation
case. Personally unless I see how it could be build under OE,
any other "cross-compilation" support is useless IMHO.

For this thing to be buildable under OE whole code of odp-apps
should be restructured, separate recipes for openvpn odp enabled,
and libpcap odp enabled should be provided, odp patches integrated
in regular OE in SRC_URI, OE_EXTRA config etc should be
supplied and so on.

Otherwise, If I want to try to build odp enabled openvpn in cross
compile mode for my Arndale board with OE image running, what do
I do? And how proposed below patch will help me? Note both
openvpn and libpcap can be built under OE without any problem.

Thanks,
Victor

> Maxim.
>
>> On 13 May 2014 08:52, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>>>
>>> Hi VIncent,
>>>
>>> can you test this patch? Looks like you have openssl and all other req
>>> installed in cross env.
>>>
>>> make CROSS_COMPILE=armeb-linux-gnueabihf
>>>
>>> Thanks,
>>> Maxim.
>>>
>>>
>>> On 05/13/2014 07:51 PM, Maxim Uvarov wrote:
>>>>
>>>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>>>> ---
>>>>    Makefile         | 4 +++-
>>>>    libpcap/Makefile | 8 +++++---
>>>>    openvpn/Makefile | 6 +++---
>>>>    3 files changed, 11 insertions(+), 7 deletions(-)
>>>>
>>>> diff --git a/Makefile b/Makefile
>>>> index cab82f4..78e9320 100644
>>>> --- a/Makefile
>>>> +++ b/Makefile
>>>> @@ -2,6 +2,8 @@
>>>>      all: openvpn libpcap
>>>>    +export $(CROSS_COMPILE)
>>>> +
>>>>    libpcap: odp
>>>>          make -C libpcap ODP_DIR=$(PWD)/odp.git
>>>>    @@ -12,7 +14,7 @@ odp:
>>>>          if [ ! -d odp.git ]; \
>>>>                  then git clone http://git.linaro.org/git/lng/odp.git
>>>> odp.git; \
>>>>          fi
>>>> -       cd odp.git; make libs_install  CFLAGS="-fPIC"
>>>> +       cd odp.git; make libs_install  CFLAGS="-fPIC"
>>>> CC=$(CROSS_COMPILE)-gcc
>>>>      distclean:
>>>>          rm -rf odp.git
>>>> diff --git a/libpcap/Makefile b/libpcap/Makefile
>>>> index 5e47b4a..a00f5b7 100644
>>>> --- a/libpcap/Makefile
>>>> +++ b/libpcap/Makefile
>>>> @@ -15,6 +15,8 @@ WIRESHARK_VERSION=wireshark-1.8.9
>>>>      ODP_DIR ?= $(PWD)/../odp.git
>>>>    +HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
>>>> +
>>>>    .PHONY: all
>>>>    all: libpcap tcpdump
>>>>    @@ -32,7 +34,7 @@ libpcap: get_libpcap
>>>>          cd $(LIBPCAP_DIR) \
>>>>          && git checkout $(LIBPCAP_VERSION) \
>>>>          && git am ../patches/*.patch \
>>>> -       && ./configure --with-odp=$(ODP_DIR) --libdir=/usr/lib
>>>> +       && ac_cv_linux_vers=3.2.51 ./configure --with-pcap=linux
>>>> --with-odp=$(ODP_DIR) --libdir=/usr/lib --host=$(HOST)
>>>>          $(MAKE) -C $(LIBPCAP_DIR)
>>>>      .PHONY: get_libpcap
>>>> @@ -54,7 +56,7 @@ clean_libpcap:
>>>>    tcpdump: get_tcpdump libpcap
>>>>          cd $(TCPDUMP_DIR) \
>>>>          && git checkout $(TCPDUMP_VERSION) \
>>>> -       && ./configure LIBS="-lrt"
>>>> +       && ac_cv_linux_vers=3.2.51 ./configure LIBS="-lrt"
>>>> --host=$(HOST)
>>>>          $(MAKE) -C $(TCPDUMP_DIR)
>>>>      .PHONY: get_tcpdump
>>>> @@ -76,7 +78,7 @@ clean_tcpdump:
>>>>    wireshark: get_wireshark libpcap
>>>>          cd $(WIRESHARK_DIR) \
>>>>          && git checkout $(WIRESHARK_VERSION) \
>>>> -       && ./autogen.sh && ./configure
>>>> +       && ./autogen.sh && ./configure --host=$(HOST)
>>>>          $(MAKE) -C $(WIRESHARK_DIR)
>>>>      .PHONY: get_wireshark
>>>> diff --git a/openvpn/Makefile b/openvpn/Makefile
>>>> index 68e4348..5117490 100644
>>>> --- a/openvpn/Makefile
>>>> +++ b/openvpn/Makefile
>>>> @@ -9,6 +9,8 @@ OPENVPN_VERSION=cd6555e0159987ef264789f4976053ce2aa5fc20
>>>>      ODP_DIR ?= $(PWD)/../odp.git
>>>>    +HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
>>>> +
>>>>    .PHONY: all
>>>>    all: openvpn odp_ipcd
>>>>    @@ -22,14 +24,12 @@ openvpn:
>>>>                  git clone $(OPENVPN_REPO) $(OPENVPN_DIR);\
>>>>          else\
>>>>                  cd $(OPENVPN_DIR);\
>>>> -               git fetch --all;\
>>>>          fi
>>>> -
>>>>          cd $(OPENVPN_DIR) \
>>>>          && git checkout $(OPENVPN_VERSION) \
>>>>          && git am ../patches/*.patch \
>>>>          && autoreconf -i -v -f \
>>>> -       && ./configure
>>>> +       && ./configure --host=$(HOST) --disable-snappy --disable-lzo
>>>>          make -C $(OPENVPN_DIR)
>>>>      .PHONY: clean_openvpn
>>>
>>>
>>>
>>> _______________________________________________
>>> lng-odp mailing list
>>> lng-odp@lists.linaro.org
>>> http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
Maxim Uvarov May 14, 2014, 11:01 a.m. UTC | #5
On 05/13/2014 08:48 PM, Victor Kamensky wrote:
> On 13 May 2014 09:12, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>> On 05/13/2014 08:06 PM, Victor Kamensky wrote:
>>> Hi Maxim,
>>>
>>> Why do you need to introduce CROSS_COMPILE? If one need to
>>> compile this code in cross compilation mode would not it be
>>> sufficient to be able redefine CC, CFLAGS and such externally.
>>>
>>> Note defining CROSS_COMPILE normally is not sufficient for
>>> user-land app build (unlike kernel). One need to have pointer to
>>> sysroot that contains all libraries, include files, etc.
>>>
>>> IMHO Makefile should be cross compilation friendly, with meaning
>>> that CC, CFLAGS, and other could be defined externally. Don't we
>>> already have OE recipe for ODP, that one does cross compilation
>>> for sure?
>>>
>>> Thanks,
>>> Victor
>> There are number of applications. Each of them uses configure. So that I
>> need to provide --host=arm there somehow.
>> Just setting CC and CFLAGS does not help. So that was the easiest way to
>> call each configure with right options.
> And just setting --host is not enough in general cross compilation
> case. Personally unless I see how it could be build under OE,
> any other "cross-compilation" support is useless IMHO.
I should wrote that I did it for check in CI loop. As I understand CI 
does not
use OE (I may be wrong here). So just quick check that everything still 
complies
might be enough.
>
> For this thing to be buildable under OE whole code of odp-apps
> should be restructured, separate recipes for openvpn odp enabled,
> and libpcap odp enabled should be provided, odp patches integrated
> in regular OE in SRC_URI, OE_EXTRA config etc should be
> supplied and so on.
Yes, sure. That is plan for 'stage two'.
> Otherwise, If I want to try to build odp enabled openvpn in cross
> compile mode for my Arndale board with OE image running, what do
> I do? And how proposed below patch will help me? Note both
> openvpn and libpcap can be built under OE without any problem.
OE takes care about compilation and packaging. In general you can 
compile it for
arndale, then copy binaries, then run them on arndale. I suppose that CI 
does not have OE
installed, only cross gcc. So it has to be possible to build all apps there.
> Thanks,
> Victor
>
>> Maxim.
>>
>>> On 13 May 2014 08:52, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>>>> Hi VIncent,
>>>>
>>>> can you test this patch? Looks like you have openssl and all other req
>>>> installed in cross env.
>>>>
>>>> make CROSS_COMPILE=armeb-linux-gnueabihf
>>>>
>>>> Thanks,
>>>> Maxim.
>>>>
>>>>
>>>> On 05/13/2014 07:51 PM, Maxim Uvarov wrote:
>>>>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>>>>> ---
>>>>>     Makefile         | 4 +++-
>>>>>     libpcap/Makefile | 8 +++++---
>>>>>     openvpn/Makefile | 6 +++---
>>>>>     3 files changed, 11 insertions(+), 7 deletions(-)
>>>>>
>>>>> diff --git a/Makefile b/Makefile
>>>>> index cab82f4..78e9320 100644
>>>>> --- a/Makefile
>>>>> +++ b/Makefile
>>>>> @@ -2,6 +2,8 @@
>>>>>       all: openvpn libpcap
>>>>>     +export $(CROSS_COMPILE)
>>>>> +
>>>>>     libpcap: odp
>>>>>           make -C libpcap ODP_DIR=$(PWD)/odp.git
>>>>>     @@ -12,7 +14,7 @@ odp:
>>>>>           if [ ! -d odp.git ]; \
>>>>>                   then git clone http://git.linaro.org/git/lng/odp.git
>>>>> odp.git; \
>>>>>           fi
>>>>> -       cd odp.git; make libs_install  CFLAGS="-fPIC"
>>>>> +       cd odp.git; make libs_install  CFLAGS="-fPIC"
>>>>> CC=$(CROSS_COMPILE)-gcc
>>>>>       distclean:
>>>>>           rm -rf odp.git
>>>>> diff --git a/libpcap/Makefile b/libpcap/Makefile
>>>>> index 5e47b4a..a00f5b7 100644
>>>>> --- a/libpcap/Makefile
>>>>> +++ b/libpcap/Makefile
>>>>> @@ -15,6 +15,8 @@ WIRESHARK_VERSION=wireshark-1.8.9
>>>>>       ODP_DIR ?= $(PWD)/../odp.git
>>>>>     +HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
>>>>> +
>>>>>     .PHONY: all
>>>>>     all: libpcap tcpdump
>>>>>     @@ -32,7 +34,7 @@ libpcap: get_libpcap
>>>>>           cd $(LIBPCAP_DIR) \
>>>>>           && git checkout $(LIBPCAP_VERSION) \
>>>>>           && git am ../patches/*.patch \
>>>>> -       && ./configure --with-odp=$(ODP_DIR) --libdir=/usr/lib
>>>>> +       && ac_cv_linux_vers=3.2.51 ./configure --with-pcap=linux
>>>>> --with-odp=$(ODP_DIR) --libdir=/usr/lib --host=$(HOST)
>>>>>           $(MAKE) -C $(LIBPCAP_DIR)
>>>>>       .PHONY: get_libpcap
>>>>> @@ -54,7 +56,7 @@ clean_libpcap:
>>>>>     tcpdump: get_tcpdump libpcap
>>>>>           cd $(TCPDUMP_DIR) \
>>>>>           && git checkout $(TCPDUMP_VERSION) \
>>>>> -       && ./configure LIBS="-lrt"
>>>>> +       && ac_cv_linux_vers=3.2.51 ./configure LIBS="-lrt"
>>>>> --host=$(HOST)
>>>>>           $(MAKE) -C $(TCPDUMP_DIR)
>>>>>       .PHONY: get_tcpdump
>>>>> @@ -76,7 +78,7 @@ clean_tcpdump:
>>>>>     wireshark: get_wireshark libpcap
>>>>>           cd $(WIRESHARK_DIR) \
>>>>>           && git checkout $(WIRESHARK_VERSION) \
>>>>> -       && ./autogen.sh && ./configure
>>>>> +       && ./autogen.sh && ./configure --host=$(HOST)
>>>>>           $(MAKE) -C $(WIRESHARK_DIR)
>>>>>       .PHONY: get_wireshark
>>>>> diff --git a/openvpn/Makefile b/openvpn/Makefile
>>>>> index 68e4348..5117490 100644
>>>>> --- a/openvpn/Makefile
>>>>> +++ b/openvpn/Makefile
>>>>> @@ -9,6 +9,8 @@ OPENVPN_VERSION=cd6555e0159987ef264789f4976053ce2aa5fc20
>>>>>       ODP_DIR ?= $(PWD)/../odp.git
>>>>>     +HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
>>>>> +
>>>>>     .PHONY: all
>>>>>     all: openvpn odp_ipcd
>>>>>     @@ -22,14 +24,12 @@ openvpn:
>>>>>                   git clone $(OPENVPN_REPO) $(OPENVPN_DIR);\
>>>>>           else\
>>>>>                   cd $(OPENVPN_DIR);\
>>>>> -               git fetch --all;\
>>>>>           fi
>>>>> -
>>>>>           cd $(OPENVPN_DIR) \
>>>>>           && git checkout $(OPENVPN_VERSION) \
>>>>>           && git am ../patches/*.patch \
>>>>>           && autoreconf -i -v -f \
>>>>> -       && ./configure
>>>>> +       && ./configure --host=$(HOST) --disable-snappy --disable-lzo
>>>>>           make -C $(OPENVPN_DIR)
>>>>>       .PHONY: clean_openvpn
>>>>
>>>>
>>>> _______________________________________________
>>>> lng-odp mailing list
>>>> lng-odp@lists.linaro.org
>>>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>
Mike Holmes May 14, 2014, 6:32 p.m. UTC | #6
Maxim, you are correct the CI loop that validates that ODP and it apps
build just tries to cross compile for ARM, it is not intended to create an
image you use, it is more of an immediate spot check for the following
working

   - gcc
   - clang
   - doxygen
   - cross compile arm from X86
   - native build on X86 and ARM
   - Big endian
   - Sparse


The OE build proper is a separate build that results in the images that are
run in LAVA, it may have its own issues independent of ODP on any given
day, hence the two build paths.


On 14 May 2014 07:01, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> On 05/13/2014 08:48 PM, Victor Kamensky wrote:
>
>> On 13 May 2014 09:12, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>>
>>> On 05/13/2014 08:06 PM, Victor Kamensky wrote:
>>>
>>>> Hi Maxim,
>>>>
>>>> Why do you need to introduce CROSS_COMPILE? If one need to
>>>> compile this code in cross compilation mode would not it be
>>>> sufficient to be able redefine CC, CFLAGS and such externally.
>>>>
>>>> Note defining CROSS_COMPILE normally is not sufficient for
>>>> user-land app build (unlike kernel). One need to have pointer to
>>>> sysroot that contains all libraries, include files, etc.
>>>>
>>>> IMHO Makefile should be cross compilation friendly, with meaning
>>>> that CC, CFLAGS, and other could be defined externally. Don't we
>>>> already have OE recipe for ODP, that one does cross compilation
>>>> for sure?
>>>>
>>>> Thanks,
>>>> Victor
>>>>
>>> There are number of applications. Each of them uses configure. So that I
>>> need to provide --host=arm there somehow.
>>> Just setting CC and CFLAGS does not help. So that was the easiest way to
>>> call each configure with right options.
>>>
>> And just setting --host is not enough in general cross compilation
>> case. Personally unless I see how it could be build under OE,
>> any other "cross-compilation" support is useless IMHO.
>>
> I should wrote that I did it for check in CI loop. As I understand CI does
> not
> use OE (I may be wrong here). So just quick check that everything still
> complies
> might be enough.
>
>
>> For this thing to be buildable under OE whole code of odp-apps
>> should be restructured, separate recipes for openvpn odp enabled,
>> and libpcap odp enabled should be provided, odp patches integrated
>> in regular OE in SRC_URI, OE_EXTRA config etc should be
>> supplied and so on.
>>
> Yes, sure. That is plan for 'stage two'.
>
>  Otherwise, If I want to try to build odp enabled openvpn in cross
>> compile mode for my Arndale board with OE image running, what do
>> I do? And how proposed below patch will help me? Note both
>> openvpn and libpcap can be built under OE without any problem.
>>
> OE takes care about compilation and packaging. In general you can compile
> it for
> arndale, then copy binaries, then run them on arndale. I suppose that CI
> does not have OE
> installed, only cross gcc. So it has to be possible to build all apps
> there.
>
>  Thanks,
>> Victor
>>
>>  Maxim.
>>>
>>>  On 13 May 2014 08:52, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>>>>
>>>>> Hi VIncent,
>>>>>
>>>>> can you test this patch? Looks like you have openssl and all other req
>>>>> installed in cross env.
>>>>>
>>>>> make CROSS_COMPILE=armeb-linux-gnueabihf
>>>>>
>>>>> Thanks,
>>>>> Maxim.
>>>>>
>>>>>
>>>>> On 05/13/2014 07:51 PM, Maxim Uvarov wrote:
>>>>>
>>>>>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>>>>>> ---
>>>>>>     Makefile         | 4 +++-
>>>>>>     libpcap/Makefile | 8 +++++---
>>>>>>     openvpn/Makefile | 6 +++---
>>>>>>     3 files changed, 11 insertions(+), 7 deletions(-)
>>>>>>
>>>>>> diff --git a/Makefile b/Makefile
>>>>>> index cab82f4..78e9320 100644
>>>>>> --- a/Makefile
>>>>>> +++ b/Makefile
>>>>>> @@ -2,6 +2,8 @@
>>>>>>       all: openvpn libpcap
>>>>>>     +export $(CROSS_COMPILE)
>>>>>> +
>>>>>>     libpcap: odp
>>>>>>           make -C libpcap ODP_DIR=$(PWD)/odp.git
>>>>>>     @@ -12,7 +14,7 @@ odp:
>>>>>>           if [ ! -d odp.git ]; \
>>>>>>                   then git clone http://git.linaro.org/git/lng/
>>>>>> odp.git
>>>>>> odp.git; \
>>>>>>           fi
>>>>>> -       cd odp.git; make libs_install  CFLAGS="-fPIC"
>>>>>> +       cd odp.git; make libs_install  CFLAGS="-fPIC"
>>>>>> CC=$(CROSS_COMPILE)-gcc
>>>>>>       distclean:
>>>>>>           rm -rf odp.git
>>>>>> diff --git a/libpcap/Makefile b/libpcap/Makefile
>>>>>> index 5e47b4a..a00f5b7 100644
>>>>>> --- a/libpcap/Makefile
>>>>>> +++ b/libpcap/Makefile
>>>>>> @@ -15,6 +15,8 @@ WIRESHARK_VERSION=wireshark-1.8.9
>>>>>>       ODP_DIR ?= $(PWD)/../odp.git
>>>>>>     +HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
>>>>>> +
>>>>>>     .PHONY: all
>>>>>>     all: libpcap tcpdump
>>>>>>     @@ -32,7 +34,7 @@ libpcap: get_libpcap
>>>>>>           cd $(LIBPCAP_DIR) \
>>>>>>           && git checkout $(LIBPCAP_VERSION) \
>>>>>>           && git am ../patches/*.patch \
>>>>>> -       && ./configure --with-odp=$(ODP_DIR) --libdir=/usr/lib
>>>>>> +       && ac_cv_linux_vers=3.2.51 ./configure --with-pcap=linux
>>>>>> --with-odp=$(ODP_DIR) --libdir=/usr/lib --host=$(HOST)
>>>>>>           $(MAKE) -C $(LIBPCAP_DIR)
>>>>>>       .PHONY: get_libpcap
>>>>>> @@ -54,7 +56,7 @@ clean_libpcap:
>>>>>>     tcpdump: get_tcpdump libpcap
>>>>>>           cd $(TCPDUMP_DIR) \
>>>>>>           && git checkout $(TCPDUMP_VERSION) \
>>>>>> -       && ./configure LIBS="-lrt"
>>>>>> +       && ac_cv_linux_vers=3.2.51 ./configure LIBS="-lrt"
>>>>>> --host=$(HOST)
>>>>>>           $(MAKE) -C $(TCPDUMP_DIR)
>>>>>>       .PHONY: get_tcpdump
>>>>>> @@ -76,7 +78,7 @@ clean_tcpdump:
>>>>>>     wireshark: get_wireshark libpcap
>>>>>>           cd $(WIRESHARK_DIR) \
>>>>>>           && git checkout $(WIRESHARK_VERSION) \
>>>>>> -       && ./autogen.sh && ./configure
>>>>>> +       && ./autogen.sh && ./configure --host=$(HOST)
>>>>>>           $(MAKE) -C $(WIRESHARK_DIR)
>>>>>>       .PHONY: get_wireshark
>>>>>> diff --git a/openvpn/Makefile b/openvpn/Makefile
>>>>>> index 68e4348..5117490 100644
>>>>>> --- a/openvpn/Makefile
>>>>>> +++ b/openvpn/Makefile
>>>>>> @@ -9,6 +9,8 @@ OPENVPN_VERSION=cd6555e0159987ef264789f4976053
>>>>>> ce2aa5fc20
>>>>>>       ODP_DIR ?= $(PWD)/../odp.git
>>>>>>     +HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
>>>>>> +
>>>>>>     .PHONY: all
>>>>>>     all: openvpn odp_ipcd
>>>>>>     @@ -22,14 +24,12 @@ openvpn:
>>>>>>                   git clone $(OPENVPN_REPO) $(OPENVPN_DIR);\
>>>>>>           else\
>>>>>>                   cd $(OPENVPN_DIR);\
>>>>>> -               git fetch --all;\
>>>>>>           fi
>>>>>> -
>>>>>>           cd $(OPENVPN_DIR) \
>>>>>>           && git checkout $(OPENVPN_VERSION) \
>>>>>>           && git am ../patches/*.patch \
>>>>>>           && autoreconf -i -v -f \
>>>>>> -       && ./configure
>>>>>> +       && ./configure --host=$(HOST) --disable-snappy --disable-lzo
>>>>>>           make -C $(OPENVPN_DIR)
>>>>>>       .PHONY: clean_openvpn
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> lng-odp mailing list
>>>>> lng-odp@lists.linaro.org
>>>>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>>>>
>>>>
>>>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Mike Holmes May 14, 2014, 8:07 p.m. UTC | #7
Maxim/Vincent

Can you join the Kernel/CI/OE support scrum team meeting on Monday
<https://www.google.com/calendar/render?action=TEMPLATE&tmeid=OTdhbjk1ZG1jczJiajYwNGdhYmRndWdhbjBfMjAxNDA1MTNUMDcwMDAwWiBsaW5hcm8ub3JnXzlmdjRxYTJwaWxmYzhpbXZqbjFudXBhM3NnQGc&tmsrc=linaro.org_9fv4qa2pilfc8imvjn1nupa3sg@group.calendar.google.com&sf=true&output=xml>
so we can sync on what we might do to streamline this.

Mike


On 14 May 2014 14:32, Mike Holmes <mike.holmes@linaro.org> wrote:

> Maxim, you are correct the CI loop that validates that ODP and it apps
> build just tries to cross compile for ARM, it is not intended to create an
> image you use, it is more of an immediate spot check for the following
> working
>
>    - gcc
>    - clang
>    - doxygen
>    - cross compile arm from X86
>    - native build on X86 and ARM
>    - Big endian
>    - Sparse
>
>
> The OE build proper is a separate build that results in the images that
> are run in LAVA, it may have its own issues independent of ODP on any given
> day, hence the two build paths.
>
>
> On 14 May 2014 07:01, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>
>> On 05/13/2014 08:48 PM, Victor Kamensky wrote:
>>
>>> On 13 May 2014 09:12, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>>>
>>>> On 05/13/2014 08:06 PM, Victor Kamensky wrote:
>>>>
>>>>> Hi Maxim,
>>>>>
>>>>> Why do you need to introduce CROSS_COMPILE? If one need to
>>>>> compile this code in cross compilation mode would not it be
>>>>> sufficient to be able redefine CC, CFLAGS and such externally.
>>>>>
>>>>> Note defining CROSS_COMPILE normally is not sufficient for
>>>>> user-land app build (unlike kernel). One need to have pointer to
>>>>> sysroot that contains all libraries, include files, etc.
>>>>>
>>>>> IMHO Makefile should be cross compilation friendly, with meaning
>>>>> that CC, CFLAGS, and other could be defined externally. Don't we
>>>>> already have OE recipe for ODP, that one does cross compilation
>>>>> for sure?
>>>>>
>>>>> Thanks,
>>>>> Victor
>>>>>
>>>> There are number of applications. Each of them uses configure. So that I
>>>> need to provide --host=arm there somehow.
>>>> Just setting CC and CFLAGS does not help. So that was the easiest way to
>>>> call each configure with right options.
>>>>
>>> And just setting --host is not enough in general cross compilation
>>> case. Personally unless I see how it could be build under OE,
>>> any other "cross-compilation" support is useless IMHO.
>>>
>> I should wrote that I did it for check in CI loop. As I understand CI
>> does not
>> use OE (I may be wrong here). So just quick check that everything still
>> complies
>> might be enough.
>>
>>
>>> For this thing to be buildable under OE whole code of odp-apps
>>> should be restructured, separate recipes for openvpn odp enabled,
>>> and libpcap odp enabled should be provided, odp patches integrated
>>> in regular OE in SRC_URI, OE_EXTRA config etc should be
>>> supplied and so on.
>>>
>> Yes, sure. That is plan for 'stage two'.
>>
>>  Otherwise, If I want to try to build odp enabled openvpn in cross
>>> compile mode for my Arndale board with OE image running, what do
>>> I do? And how proposed below patch will help me? Note both
>>> openvpn and libpcap can be built under OE without any problem.
>>>
>> OE takes care about compilation and packaging. In general you can compile
>> it for
>> arndale, then copy binaries, then run them on arndale. I suppose that CI
>> does not have OE
>> installed, only cross gcc. So it has to be possible to build all apps
>> there.
>>
>>  Thanks,
>>> Victor
>>>
>>>  Maxim.
>>>>
>>>>  On 13 May 2014 08:52, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>>>>>
>>>>>> Hi VIncent,
>>>>>>
>>>>>> can you test this patch? Looks like you have openssl and all other req
>>>>>> installed in cross env.
>>>>>>
>>>>>> make CROSS_COMPILE=armeb-linux-gnueabihf
>>>>>>
>>>>>> Thanks,
>>>>>> Maxim.
>>>>>>
>>>>>>
>>>>>> On 05/13/2014 07:51 PM, Maxim Uvarov wrote:
>>>>>>
>>>>>>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>>>>>>> ---
>>>>>>>     Makefile         | 4 +++-
>>>>>>>     libpcap/Makefile | 8 +++++---
>>>>>>>     openvpn/Makefile | 6 +++---
>>>>>>>     3 files changed, 11 insertions(+), 7 deletions(-)
>>>>>>>
>>>>>>> diff --git a/Makefile b/Makefile
>>>>>>> index cab82f4..78e9320 100644
>>>>>>> --- a/Makefile
>>>>>>> +++ b/Makefile
>>>>>>> @@ -2,6 +2,8 @@
>>>>>>>       all: openvpn libpcap
>>>>>>>     +export $(CROSS_COMPILE)
>>>>>>> +
>>>>>>>     libpcap: odp
>>>>>>>           make -C libpcap ODP_DIR=$(PWD)/odp.git
>>>>>>>     @@ -12,7 +14,7 @@ odp:
>>>>>>>           if [ ! -d odp.git ]; \
>>>>>>>                   then git clone http://git.linaro.org/git/lng/
>>>>>>> odp.git
>>>>>>> odp.git; \
>>>>>>>           fi
>>>>>>> -       cd odp.git; make libs_install  CFLAGS="-fPIC"
>>>>>>> +       cd odp.git; make libs_install  CFLAGS="-fPIC"
>>>>>>> CC=$(CROSS_COMPILE)-gcc
>>>>>>>       distclean:
>>>>>>>           rm -rf odp.git
>>>>>>> diff --git a/libpcap/Makefile b/libpcap/Makefile
>>>>>>> index 5e47b4a..a00f5b7 100644
>>>>>>> --- a/libpcap/Makefile
>>>>>>> +++ b/libpcap/Makefile
>>>>>>> @@ -15,6 +15,8 @@ WIRESHARK_VERSION=wireshark-1.8.9
>>>>>>>       ODP_DIR ?= $(PWD)/../odp.git
>>>>>>>     +HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
>>>>>>> +
>>>>>>>     .PHONY: all
>>>>>>>     all: libpcap tcpdump
>>>>>>>     @@ -32,7 +34,7 @@ libpcap: get_libpcap
>>>>>>>           cd $(LIBPCAP_DIR) \
>>>>>>>           && git checkout $(LIBPCAP_VERSION) \
>>>>>>>           && git am ../patches/*.patch \
>>>>>>> -       && ./configure --with-odp=$(ODP_DIR) --libdir=/usr/lib
>>>>>>> +       && ac_cv_linux_vers=3.2.51 ./configure --with-pcap=linux
>>>>>>> --with-odp=$(ODP_DIR) --libdir=/usr/lib --host=$(HOST)
>>>>>>>           $(MAKE) -C $(LIBPCAP_DIR)
>>>>>>>       .PHONY: get_libpcap
>>>>>>> @@ -54,7 +56,7 @@ clean_libpcap:
>>>>>>>     tcpdump: get_tcpdump libpcap
>>>>>>>           cd $(TCPDUMP_DIR) \
>>>>>>>           && git checkout $(TCPDUMP_VERSION) \
>>>>>>> -       && ./configure LIBS="-lrt"
>>>>>>> +       && ac_cv_linux_vers=3.2.51 ./configure LIBS="-lrt"
>>>>>>> --host=$(HOST)
>>>>>>>           $(MAKE) -C $(TCPDUMP_DIR)
>>>>>>>       .PHONY: get_tcpdump
>>>>>>> @@ -76,7 +78,7 @@ clean_tcpdump:
>>>>>>>     wireshark: get_wireshark libpcap
>>>>>>>           cd $(WIRESHARK_DIR) \
>>>>>>>           && git checkout $(WIRESHARK_VERSION) \
>>>>>>> -       && ./autogen.sh && ./configure
>>>>>>> +       && ./autogen.sh && ./configure --host=$(HOST)
>>>>>>>           $(MAKE) -C $(WIRESHARK_DIR)
>>>>>>>       .PHONY: get_wireshark
>>>>>>> diff --git a/openvpn/Makefile b/openvpn/Makefile
>>>>>>> index 68e4348..5117490 100644
>>>>>>> --- a/openvpn/Makefile
>>>>>>> +++ b/openvpn/Makefile
>>>>>>> @@ -9,6 +9,8 @@ OPENVPN_VERSION=cd6555e0159987ef264789f4976053
>>>>>>> ce2aa5fc20
>>>>>>>       ODP_DIR ?= $(PWD)/../odp.git
>>>>>>>     +HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
>>>>>>> +
>>>>>>>     .PHONY: all
>>>>>>>     all: openvpn odp_ipcd
>>>>>>>     @@ -22,14 +24,12 @@ openvpn:
>>>>>>>                   git clone $(OPENVPN_REPO) $(OPENVPN_DIR);\
>>>>>>>           else\
>>>>>>>                   cd $(OPENVPN_DIR);\
>>>>>>> -               git fetch --all;\
>>>>>>>           fi
>>>>>>> -
>>>>>>>           cd $(OPENVPN_DIR) \
>>>>>>>           && git checkout $(OPENVPN_VERSION) \
>>>>>>>           && git am ../patches/*.patch \
>>>>>>>           && autoreconf -i -v -f \
>>>>>>> -       && ./configure
>>>>>>> +       && ./configure --host=$(HOST) --disable-snappy --disable-lzo
>>>>>>>           make -C $(OPENVPN_DIR)
>>>>>>>       .PHONY: clean_openvpn
>>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> lng-odp mailing list
>>>>>> lng-odp@lists.linaro.org
>>>>>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>>>>>
>>>>>
>>>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>
>
>
>
> --
> *Mike Holmes*
> Linaro Technical Manager / Lead
> LNG - ODP
>
diff mbox

Patch

diff --git a/Makefile b/Makefile
index cab82f4..78e9320 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,8 @@ 
 
 all: openvpn libpcap
 
+export $(CROSS_COMPILE)
+
 libpcap: odp
 	make -C libpcap ODP_DIR=$(PWD)/odp.git
 
@@ -12,7 +14,7 @@  odp:
 	if [ ! -d odp.git ]; \
 		then git clone http://git.linaro.org/git/lng/odp.git odp.git; \
 	fi
-	cd odp.git; make libs_install  CFLAGS="-fPIC"
+	cd odp.git; make libs_install  CFLAGS="-fPIC" CC=$(CROSS_COMPILE)-gcc
 
 distclean:
 	rm -rf odp.git
diff --git a/libpcap/Makefile b/libpcap/Makefile
index 5e47b4a..a00f5b7 100644
--- a/libpcap/Makefile
+++ b/libpcap/Makefile
@@ -15,6 +15,8 @@  WIRESHARK_VERSION=wireshark-1.8.9
 
 ODP_DIR ?= $(PWD)/../odp.git
 
+HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
+
 .PHONY: all
 all: libpcap tcpdump
 
@@ -32,7 +34,7 @@  libpcap: get_libpcap
 	cd $(LIBPCAP_DIR) \
 	&& git checkout $(LIBPCAP_VERSION) \
 	&& git am ../patches/*.patch \
-	&& ./configure --with-odp=$(ODP_DIR) --libdir=/usr/lib
+	&& ac_cv_linux_vers=3.2.51 ./configure --with-pcap=linux --with-odp=$(ODP_DIR) --libdir=/usr/lib --host=$(HOST)
 	$(MAKE) -C $(LIBPCAP_DIR)
 
 .PHONY: get_libpcap
@@ -54,7 +56,7 @@  clean_libpcap:
 tcpdump: get_tcpdump libpcap
 	cd $(TCPDUMP_DIR) \
 	&& git checkout $(TCPDUMP_VERSION) \
-	&& ./configure LIBS="-lrt"
+	&& ac_cv_linux_vers=3.2.51 ./configure LIBS="-lrt" --host=$(HOST)
 	$(MAKE) -C $(TCPDUMP_DIR)
 
 .PHONY: get_tcpdump
@@ -76,7 +78,7 @@  clean_tcpdump:
 wireshark: get_wireshark libpcap
 	cd $(WIRESHARK_DIR) \
 	&& git checkout $(WIRESHARK_VERSION) \
-	&& ./autogen.sh && ./configure
+	&& ./autogen.sh && ./configure --host=$(HOST)
 	$(MAKE) -C $(WIRESHARK_DIR)
 
 .PHONY: get_wireshark
diff --git a/openvpn/Makefile b/openvpn/Makefile
index 68e4348..5117490 100644
--- a/openvpn/Makefile
+++ b/openvpn/Makefile
@@ -9,6 +9,8 @@  OPENVPN_VERSION=cd6555e0159987ef264789f4976053ce2aa5fc20
 
 ODP_DIR ?= $(PWD)/../odp.git
 
+HOST ?= `$(CROSS_COMPILE)-gcc -dumpmachine`
+
 .PHONY: all
 all: openvpn odp_ipcd
 
@@ -22,14 +24,12 @@  openvpn:
 		git clone $(OPENVPN_REPO) $(OPENVPN_DIR);\
 	else\
 		cd $(OPENVPN_DIR);\
-		git fetch --all;\
 	fi
-
 	cd $(OPENVPN_DIR) \
 	&& git checkout $(OPENVPN_VERSION) \
 	&& git am ../patches/*.patch \
 	&& autoreconf -i -v -f \
-	&& ./configure
+	&& ./configure --host=$(HOST) --disable-snappy --disable-lzo
 	make -C $(OPENVPN_DIR)
 
 .PHONY: clean_openvpn