libport usage and extra inclusion line

Menno Valkema menno.genode at ...9...
Wed Jun 22 10:39:38 CEST 2016


Hello Christian,

Thanks for your reply. A better example is the curl library. I've put
together an example to reproduce the behavior.

Attached a patch which includes the curl library into the hello
tutorial. It doesn't call any methods of the library, but it does
include <curl/curl.h> and shows the necessity of the extra INC_DIR
directive.

To run it I take the following steps:
$ git clone https://github.com/genodelabs/genode.git hello_curl
$ cd hello_curl

Patch the sources with the attached hello_curl.patch
$ patch -p1 < ~/tmp/hello_curl.patch
$ ./tool/create_builddir linux_x86
$ cd build/linux_x86
$ echo 'REPOSITORIES += $(GENODE_DIR)/repos/hello_tutorial' >> \
	etc/build.conf
$ echo 'REPOSITORIES += $(GENODE_DIR)/repos/libports' >> etc/build.conf
$ ../../tool/ports/prepare_port curl libc libssh openssl zlib
$ make run/hello

This compiles and runs fine (not doing anything functional).

Now remove the following line from
repos/hello_tutorial/src/hello/client/target.mk:

INC_DIR += $(REP_DIR)/../libports/src/lib/curl/spec/64bit/curl/

Running it again will give you an error about a missing "curlbuild.h".
Hence our question what are we doing wrong? Is this behavior by design,
or should we take different steps to include and use the library port?

Thanks, Menno

PS. I've tested lwip in a similar way, and you're right: the error is
not there.

-- 
Cyber Security Labs B.V. |  https://nlcsl.com
Gooimeer 6-31 | 1411 DD Naarden | The Netherlands



On 21-06-16 14:10, Christian Helmuth wrote:
> Hello Menno,
> 
> On Tue, Jun 21, 2016 at 01:01:55PM +0200, Menno Valkema wrote:
>> However in some cases this is not sufficient. For example lwip requires
>> an additional include directive:
>>
>> INC_DIR += $(REP_DIR)/src/lib/lwip/include
>> (line from repos/libports/src/test/lwip/http_srv_static/target.mk)
> 
> If I remove this line from target.mk the test component compiles
> without error.
> 
>> Leaving out this line will result in a compilation error of a local
>> include file. Looking at various library ports (mbedtls, polarssl, curl,
>> and probably more) we see similar behavior. Usually some library
>> configuration header file should be added manually to the include path
>> to make things work.
> 
> Could you please be more specific about the error message or maybe
> point out an example in the public sources that breaks if the INC_DIR
> directive is removed?
> 
> Regards
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hello_curl.patch
Type: text/x-patch
Size: 1529 bytes
Desc: not available
URL: <http://lists.genode.org/pipermail/users/attachments/20160622/9aa28042/attachment.bin>


More information about the users mailing list