[cfe-dev] Building libc++ RPMs on RHEL 6.x 64bit

David Irvine david.irvine at maidsafe.net
Tue Jun 17 07:20:31 PDT 2014


Possible easier to spot if you post the whole CMakeLists.txt file.


On Sat, Jul 27, 2013 at 7:29 AM, Zack Perry <zack.perry at sbcglobal.net>
wrote:

> I have been trying to build RPM packages for libc++ 3.3 on a RHEL 6.4 box.
> I need both static and shared libraries. So, I learned some basics of cmake
> and then modified the bundled CMakeList.txt. Got that part to work.
>
> But since in RHEL 6.x, all 64-bit libraries should go to /usr/lib64
> instead of /usr/lib,  I have been attempting to use the following to get
> the job done:
>
> (A) During building, I use
> SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX})
> to have all library files (*.so* and *.a) located in lib64 rather than lib.
>
> (B) Using a ADD_LIBRARY... command as shown below
> ADD_LIBRARY(c++ STATIC ...
> together with
> set_target_properties(c++ PROPERTIES
> ARCHIVE_OUTPUT_DIRECTORY${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX})
> INSTALL(TARGETS c++  ARCHIVE DESTINATION lib${LIB_SUFFIX})
> to get the static library installed in /usr/lib64.
>
> (C) In addition, with
> INSTALL(FILES ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX}/libc++.so DESTINATION
> lib${LIB_SUFFIX})
> INSTALL(FILES ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX}/libc++.so.1
> DESTINATION lib${LIB_SUFFIX})
> INSTALL(FILES ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX}/libc++.so.1.0
> DESTINATION lib${LIB_SUFFIX})
> to have shared libary also installed in /usr/lib64 too.
>
> But a copy of the shared library is still installed in /usr/lib in the
> resulting RPM; see below:
>
> $ rpm -qlp libcxx-3-3-0.el6.x86_64.rpm
> [...]
> /usr/lib
> /usr/lib/libc++.so
> /usr/lib/libc++.so.1
> /usr/lib/libc++.so.1.0
> /usr/lib64
> /usr/lib64/libc++.a
>
> /usr/lib64/libc++.so
> /usr/lib64/libc++.so.1
> /usr/lib64/libc++.so.1.0
>
>
>
> If I were to write a RPM spec file, the _libdir macro automatically
> handles this. With cmake, given the fact that I am still new to it, I would
> appreciate a hint/pointer as to the right directive to use.
>
> -- Zack
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>



-- 

David Irvine
twitter: @metaquestions
blog:  http://metaquestions.me
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140617/a3091c91/attachment.html>


More information about the cfe-dev mailing list