diff options
author | Chris Packham <judge.packham@gmail.com> | 2015-10-26 20:25:32 +1300 |
---|---|---|
committer | Chris Packham <judge.packham@gmail.com> | 2015-10-26 20:25:59 +1300 |
commit | d3ee55fe1b6d09795c419f12a3ad6f7d0b5df6b4 (patch) | |
tree | 8dccdb7cf77b4d8abfa3ec23f053c064a6f7ca74 | |
parent | 937c10bbe64a36579bc8bafcd29554e786143c86 (diff) | |
download | rabbitmq-c-d3ee55fe1b6d09795c419f12a3ad6f7d0b5df6b4.tar.gz |
build: Add check for posix_spawn functions
These are usually found in librt. On some systems clock_gettime is also
in librt so checking for it was implicitly satisfying the requirement
for the posix_spawn functions. On newer systems (glibc >2.17 for
example) clock_gettime is also found in libc so AC_SEARCH_LIBS() decides
that it is not necessary to add -lrt to LIBS.
Add an explicit check for posix_spawnp() to decide if -lrt is necessary.
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | configure.ac | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 899d142..179630e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,7 +144,8 @@ endif() cmake_pop_check_state() check_library_exists(rt clock_gettime "time.h" CLOCK_GETTIME_NEEDS_LIBRT) -if (CLOCK_GETTIME_NEEDS_LIBRT) +check_library_exists(rt posix_spawnp "spawn.h" POSIX_SPAWNP_NEEDS_LIBRT) +if (CLOCK_GETTIME_NEEDS_LIBRT OR POSIX_SPAWNP_NEEDS_LIBRT) set(LIBRT rt) endif() diff --git a/configure.ac b/configure.ac index 2c0eda8..ce094b8 100644 --- a/configure.ac +++ b/configure.ac @@ -102,6 +102,7 @@ AC_SEARCH_LIBS([socket], [socket], [], [AC_MSG_ERROR([cannot find socket library (library with socket symbol)])], [-lnsl])]) AC_SEARCH_LIBS([clock_gettime], [rt]) +AC_SEARCH_LIBS([posix_spawnp], [rt]) AC_MSG_CHECKING([if htonll is defined]) dnl # Check for htonll |