diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-10-04 20:01:07 +0100 |
---|---|---|
committer | Daniel Drake <dan@reactivated.net> | 2010-10-04 20:01:07 +0100 |
commit | a6fb54e2eef4e393bd06829bc3bdc746ea9d41a6 (patch) | |
tree | dac3cd587a06a3ac60ab1e7ed071d01c246750aa /configure.ac | |
parent | a9b4065f048e750b7317f6434406fd528b69bf33 (diff) | |
download | libusb-a6fb54e2eef4e393bd06829bc3bdc746ea9d41a6.tar.gz |
Populate the pkg-config Libs.private field
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 38e9ce7..1d74b72 100644 --- a/configure.ac +++ b/configure.ac @@ -35,6 +35,7 @@ AC_DEFINE([_GNU_SOURCE], [], [Use GNU extensions]) AM_MAINTAINER_MODE AC_MSG_CHECKING([operating system]) +PC_LIBS_PRIVATE= case $host in *-linux*) AC_DEFINE(OS_LINUX, [], [Linux backend]) @@ -42,9 +43,11 @@ case $host in AC_DEFINE([THREADS_POSIX], [], [Use Posix Threads]) AC_MSG_RESULT([Linux]) backend="linux" - AC_CHECK_LIB(rt, clock_gettime) + AC_CHECK_LIB(rt, clock_gettime, PC_LIBS_PRIVATE="-lrt") + LIBS="${LIBS} ${PC_LIBS_PRIVATE}" threads="posix" THREAD_CFLAGS="-pthread" + PC_LIBS_PRIVATE="${PC_LIBS_PRIVATE} -pthread" AM_LDFLAGS="" ;; *-darwin*) @@ -56,15 +59,17 @@ case $host in backend="darwin" threads="posix" THREAD_CFLAGS="-pthread" - AM_LDFLAGS="-Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation -Wl,-prebind -no-undefined" - ;; + PC_LIBS_PRIVATE="-Wl,-framework,IOKit -Wl,-framework,CoreFoundation -Wl,-prebind -no-undefined -pthread" + AM_LDFLAGS=${PC_LIBS_PRIVATE} +;; *-mingw*) AC_DEFINE(OS_WINDOWS, [], [Windows backend]) AC_SUBST(OS_WINDOWS) AC_MSG_RESULT([Windows]) backend="windows" threads="windows" - LIBS="-lsetupapi -lole32 -ladvapi32" + PC_LIBS_PRIVATE="-lsetupapi -lole32 -ladvapi32" + LIBS="${LIBS} ${PC_LIBS_PRIVATE}" # -avoid-version to avoid a naming scheme such as libusb-0.dll AM_LDFLAGS="-no-undefined -avoid-version --add-stdcall-alias" AC_CHECK_TOOL(RC, windres, no) @@ -76,13 +81,15 @@ case $host in AC_MSG_RESULT([Windows]) backend="windows" threads="posix" - LIBS="-lsetupapi -lole32 -ladvapi32" + PC_LIBS_PRIVATE="-lsetupapi -lole32 -ladvapi32" + LIBS="${LIBS} ${PC_LIBS_PRIVATE}" AM_LDFLAGS="-no-undefined -avoid-version" AC_CHECK_TOOL(RC, windres, no) ;; *) AC_MSG_ERROR([unsupported operating system]) esac +AC_SUBST(PC_LIBS_PRIVATE) AM_CONDITIONAL([OS_LINUX], [test "x$backend" = "xlinux"]) AM_CONDITIONAL([OS_DARWIN], [test "x$backend" = "xdarwin"]) |