0

Does anyone know how to build Leptonica library under pnacl-clang++.

I can build the library using clang++ compiler.

cd leptonica-1.71
./configure CC="clang" CXX="clang++" --enable-shared
make

I don't know how to configure pnacl-clang++ to build Leptonica library.

Per Google documentation, This is how every file is compiled separately.

e.g.
nacl_sdk/pepper_<version>/toolchain/win_pnacl/bin/pnacl-clang++ \
      hello_world.cc -Inacl_sdk/pepper_<version>/include -c \
      -o hello_world.o -g -O0

But, I don't want to run pnacl-clang++ separately on every individual file in the library folder. I must configure it.

Thanks.

user1
  • 4,031
  • 8
  • 37
  • 66

1 Answers1

2

PNaCl expects everything to be build as static libraries, not shared, though that's being worked on. For most projects the effort of targeting PNaCl will involve creating a static library build, and setting CC/CXX to pnacl-clang/pnacl-clang++.

Open source projects are often already ported on naclports (and regression-tested), but it looks like leptonica isn't one of these. I suggest looking at other projects' diff to understand what goes into building for PNaCl, and contributing your port of leptonica.

There's a bit more documentation on building.

I hope this is useful in building any project, not just leptonica :-)

JF Bastien
  • 6,673
  • 2
  • 26
  • 34
  • This is kind of off-topic, but it would be really nice if you could explain the current state of Embedded Mono on Native Client. [This question](http://stackoverflow.com/questions/7922214/are-there-any-examples-of-compiling-c-sharp-code-using-mono-so-that-the-exe-can) has been marked as a favorite question by several people. Thank you. – Janus Troelsen Jan 12 '15 at 23:37
  • 1
    @JanusTroelsen: the answer on that post is unfortunately still the state of things, Elija's github repo isn't fully upstreamed at the moment. – JF Bastien Jan 13 '15 at 18:13