cmake: When there is no stdenv.glibc, still fix search paths.

Apply all of the fixups from preConfigure as well!

For testing purposes I added the following assert:

assert (stdenv ? glibc) -> (stdenv.glibc == stdenv.cc.libc);

To ensure behavior in the case there is a 'stdenv.glibc' (linux-only?)
wasn't changed, which passes in the configurations I could think of.

Not including that since it seems like a bad requirement moving forward.
This commit is contained in:
Will Dietz
2016-10-13 08:05:37 -05:00
parent 9a668ec58b
commit 07849e749a
4 changed files with 34 additions and 32 deletions
@@ -53,7 +53,7 @@ diff -ru3 cmake-2.8.12.2/Modules/Platform/UnixPaths.cmake cmake-2.8.12.2-new/Mod
- /usr/pkg/include
- /opt/csw/include /opt/include
- /usr/openwin/include
+ @glibc_dev@/include
+ @libc_dev@/include
)
list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
@@ -67,26 +67,26 @@ diff -ru3 cmake-2.8.12.2/Modules/Platform/UnixPaths.cmake cmake-2.8.12.2-new/Mod
- /usr/pkg/lib
- /opt/csw/lib /opt/lib
- /usr/openwin/lib
+ @glibc_lib@/lib
+ @libc_lib@/lib
)
list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
- /usr/pkg/bin
+ @glibc_bin@/bin
+ @libc_bin@/bin
)
list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
- /lib /usr/lib /usr/lib32 /usr/lib64
+ @glibc_lib@/lib
+ @libc_lib@/lib
)
list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+ @glibc_dev@/include
+ @libc_dev@/include
)
list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+ @glibc_dev@/include
+ @libc_dev@/include
)
# Enable use of lib64 search path variants by default.