kylehuff / libwebpg

libwebpg is a C library that provides an abstracted GnuPG interface. libwebpg is used by webpg-npapi and webpg-ctypes to interface with GnuPG.
4 stars 0 forks source link

Build libwebpg for OS X #1

Open rklyujkov opened 10 years ago

rklyujkov commented 10 years ago

How can build the library for os x on clang (not gcc)?

kylehuff commented 10 years ago

The Makefile should allow you to simply execute:

CC=clang make

I can't say that I've tested clang compilation in OSX, so let me know if you run into any issues with that.

rklyujkov commented 10 years ago

make ends with:

clang: error: unsupported option '-static-libgcc'

Without this option make generates swarm of undefined symbols like:

Undefined symbols for architecture i386: "_CyaSSL_CTX_free", referenced from: _cyassl_connect_common in libcurl.a(libcurl_la-cyassl.o) _Curl_cyassl_close in libcurl.a(libcurl_la-cyassl.o) "_CyaSSL_CTX_load_verify_locations", referenced from: _cyassl_connect_common in libcurl.a(libcurl_la-cyassl.o) "_CyaSSL_CTX_new", referenced from: _cyassl_connect_common in libcurl.a(libcurl_la-cyassl.o) ...

... even for STL symbols:

"std::string::find_last_of(char, unsigned long) const", referenced from: mimetic::utils::extractFilename(std::string const&) in libmimetic.a(utils.o) "std::string::find_firstof(char const, unsigned long) const", referenced from: mimetic::operator<<(std::ostream&, mimetic::FieldParam const&) in libmimetic.a(fieldparam.o) "std::string::end() const", referenced from: mimetic::AddressList::set(std::string const&) in libmimetic.a(addresslist.o) mimetic::ContTokenizerstd::string::setSource(std::string const) in libmimetic.a(contenttype.o) mimetic::IsDelim::setDelimList(std::string const&) in libmimetic.a(contenttype.o) mimetic::ContTokenizerstd::string::ContTokenizer<char [2]>(std::string const, char const (&) [2]) in libmimetic.a(contenttype.o) mimetic::MailboxList::set(std::string const&) in libmimetic.a(mailboxlist.o) mimetic::IsDelim::setDelimList(std::string const&) in libmimetic.a(contentdisposition.o) mimetic::ContTokenizerstd::string::ContTokenizer<char [2]>(std::string const_, char const (&) [2]) in libmimetic.a(contentdisposition.o) ...

kylehuff commented 10 years ago

clang: error: unsupported option '-static-libgcc'

Yes, I will have to fix the Makefile

Regarding the other issues, I just tested in OSX kernel 10.8 using clang version 3.0 (tags/Apple/clang-211.10.1) and I have no issue with either of the below:

CC=clang make

and

CC=clang++ make

It is also building fine with clang on Linux, as tracked here: https://travis-ci.org/kylehuff/libwebpg

Unfortunately, I don't have any advice for you at the moment; perhaps when I get off work I might be able to find the reason. At first guess, it appears to indicate something is different with your build environment.

kylehuff commented 10 years ago

@rklyujkov

This shouldn't be an issue anymore.

To compile using clang, simply execute CXX=clang++ make