Libtool search path on MacOS

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Libtool search path on MacOS

Xin Wang via cfe-dev
Hi All,

When invoking a libtool like this:

$ mylibtool -extra-arg="-v" test.cpp

the libtool spits out its #include search paths. As I understand, the libtool is automatically configured to establish the search paths via the following:

1) Look for a candidate gcc installation. If found, add its headers to the search path
2) Use the standard include paths (e.g. /usr/include, /usr/local/include, etc.)
3) Use the path "../lib/clang/x.y.z/include" relative to where the libtool binary is located, which only works when the libtool is located at the same hierarchy level as the other clang binaries.

When I build my libtool on Ubuntu, it finds my Ubuntu gcc installation, and adds the C/C++ headers to the search path automatically. But when I build it on MacOS, it doesn't find any gcc installation (though I do have it installed with homebrew). Since I'm building out-of-tree, the "../lib/clang/x.y.z/include" path is invalid. So the tool cannot locate C/C++ header files. My current workaround is to use the C_INCLUDE_PATH and CPLUS_INCLUDE_PATH environment variables to point to my C/C++ installations. Is there a better way of doing this on Mac?

Thanks,

Scott Constable

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Libtool search path on MacOS

Xin Wang via cfe-dev
On 2017-06-26 16:35, scott constable via cfe-dev wrote:

> But when I build it on MacOS, it doesn't find any gcc installation (though I do
> have it installed with homebrew). Since I'm building out-of-tree, the
> "../lib/clang/x.y.z/include" path is invalid. So the tool cannot locate
> C/C++ header files. My current workaround is to use the C_INCLUDE_PATH
> and CPLUS_INCLUDE_PATH environment variables to point to my C/C++
> installations. Is there a better way of doing this on Mac?

I don't think that homebrew installs anything in any of the default
paths. I would recommend installing Xcode and the command line tools. Or
alternatively only the command line tools.

--
/Jacob Carlborg

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Libtool search path on MacOS

Scott Constable
This post has NOT been accepted by the mailing list yet.
Hi Jacob,

I have already installed Xcode and the CLI tools, but it looks like my libtool cannot find them automatically, as it did on Ubuntu.

Thanks,

Scott
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Libtool search path on MacOS

Scott Constable
This post has NOT been accepted by the mailing list yet.
In reply to this post by Xin Wang via cfe-dev
Hi Jacob,

I had already installed Xcode and the CLI tools. Even so, I don't see how this would help.

Scott
Loading...