mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-10 20:22:31 +00:00
Updated with AC_LANG_SOURCE directives
Please see this informative thread on bug-autoconf: http://www.mail-archive.com/bug-autoconf@gnu.org/msg03052.html
This commit is contained in:
+14
-14
@@ -3,10 +3,10 @@
|
||||
AC_DEFUN([CC_ATTRIBUTE_CONSTRUCTOR], [
|
||||
AC_CACHE_CHECK([if compiler supports __attribute__((constructor))],
|
||||
[cc_cv_attribute_constructor],
|
||||
[AC_COMPILE_IFELSE([
|
||||
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
void ctor() __attribute__((constructor));
|
||||
void ctor() { };
|
||||
],
|
||||
])],
|
||||
[cc_cv_attribute_constructor=yes],
|
||||
[cc_cv_attribute_constructor=no])
|
||||
])
|
||||
@@ -23,9 +23,9 @@ AC_DEFUN([CC_ATTRIBUTE_CONSTRUCTOR], [
|
||||
AC_DEFUN([CC_ATTRIBUTE_FORMAT], [
|
||||
AC_CACHE_CHECK([if compiler supports __attribute__((format(printf, n, n)))],
|
||||
[cc_cv_attribute_format],
|
||||
[AC_COMPILE_IFELSE([
|
||||
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
void __attribute__((format(printf, 1, 2))) printflike(const char *fmt, ...) { }
|
||||
],
|
||||
])],
|
||||
[cc_cv_attribute_format=yes],
|
||||
[cc_cv_attribute_format=no])
|
||||
])
|
||||
@@ -42,9 +42,9 @@ AC_DEFUN([CC_ATTRIBUTE_FORMAT], [
|
||||
AC_DEFUN([CC_ATTRIBUTE_INTERNAL], [
|
||||
AC_CACHE_CHECK([if compiler supports __attribute__((visibility("internal")))],
|
||||
[cc_cv_attribute_internal],
|
||||
[AC_COMPILE_IFELSE([
|
||||
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
void __attribute__((visibility("internal"))) internal_function() { }
|
||||
],
|
||||
])],
|
||||
[cc_cv_attribute_internal=yes],
|
||||
[cc_cv_attribute_internal=no])
|
||||
])
|
||||
@@ -66,9 +66,9 @@ AC_DEFUN([CC_ATTRIBUTE_VISIBILITY], [
|
||||
|
||||
AC_CACHE_CHECK([if compiler supports __attribute__((visibility("default")))],
|
||||
[cc_cv_attribute_visibility],
|
||||
[AC_COMPILE_IFELSE([
|
||||
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
void __attribute__((visibility("default"))) visibility_function() { }
|
||||
],
|
||||
])],
|
||||
[cc_cv_attribute_visibility=yes],
|
||||
[cc_cv_attribute_visibility=no])
|
||||
])
|
||||
@@ -90,10 +90,10 @@ AC_DEFUN([CC_ATTRIBUTE_VISIBILITY], [
|
||||
AC_DEFUN([CC_ATTRIBUTE_NONNULL], [
|
||||
AC_CACHE_CHECK([if compiler supports __attribute__((nonnull()))],
|
||||
[cc_cv_attribute_nonnull],
|
||||
[AC_COMPILE_IFELSE([
|
||||
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
void some_function(void *foo, void *bar) __attribute__((nonnull()));
|
||||
void some_function(void *foo, void *bar) { }
|
||||
],
|
||||
])],
|
||||
[cc_cv_attribute_nonnull=yes],
|
||||
[cc_cv_attribute_nonnull=no])
|
||||
])
|
||||
@@ -110,9 +110,9 @@ AC_DEFUN([CC_ATTRIBUTE_NONNULL], [
|
||||
AC_DEFUN([CC_ATTRIBUTE_UNUSED], [
|
||||
AC_CACHE_CHECK([if compiler supports __attribute__((unused))],
|
||||
[cc_cv_attribute_unused],
|
||||
[AC_COMPILE_IFELSE([
|
||||
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
void some_function(void *foo, __attribute__((unused)) void *bar);
|
||||
],
|
||||
])],
|
||||
[cc_cv_attribute_unused=yes],
|
||||
[cc_cv_attribute_unused=no])
|
||||
])
|
||||
@@ -129,13 +129,13 @@ AC_DEFUN([CC_ATTRIBUTE_UNUSED], [
|
||||
AC_DEFUN([CC_FUNC_EXPECT], [
|
||||
AC_CACHE_CHECK([if compiler has __builtin_expect function],
|
||||
[cc_cv_func_expect],
|
||||
[AC_COMPILE_IFELSE([
|
||||
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
int some_function()
|
||||
{
|
||||
int a = 3;
|
||||
return (int)__builtin_expect(a, 3);
|
||||
}
|
||||
],
|
||||
])],
|
||||
[cc_cv_func_expect=yes],
|
||||
[cc_cv_func_expect=no])
|
||||
])
|
||||
|
||||
+18
-18
@@ -1,15 +1,15 @@
|
||||
AC_DEFUN([TORRENT_CHECK_XFS], [
|
||||
AC_MSG_CHECKING(for XFS support)
|
||||
|
||||
AC_COMPILE_IFELSE(
|
||||
[[#include <xfs/libxfs.h>
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
#include <xfs/libxfs.h>
|
||||
#include <sys/ioctl.h>
|
||||
int main() {
|
||||
struct xfs_flock64 l;
|
||||
ioctl(0, XFS_IOC_RESVSP64, &l);
|
||||
return 0;
|
||||
}
|
||||
]],
|
||||
])],
|
||||
[
|
||||
AC_DEFINE(USE_XFS, 1, Use XFS filesystem stuff.)
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -46,13 +46,13 @@ AC_DEFUN([TORRENT_WITH_XFS], [
|
||||
AC_DEFUN([TORRENT_CHECK_EPOLL], [
|
||||
AC_MSG_CHECKING(for epoll support)
|
||||
|
||||
AC_COMPILE_IFELSE(
|
||||
[[#include <sys/epoll.h>
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
#include <sys/epoll.h>
|
||||
int main() {
|
||||
int fd = epoll_create(100);
|
||||
return 0;
|
||||
}
|
||||
]],
|
||||
])],
|
||||
[
|
||||
AC_DEFINE(USE_EPOLL, 1, Use epoll.)
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -77,14 +77,14 @@ AC_DEFUN([TORRENT_WITHOUT_EPOLL], [
|
||||
AC_DEFUN([TORRENT_CHECK_KQUEUE], [
|
||||
AC_MSG_CHECKING(for kqueue support)
|
||||
|
||||
AC_LINK_IFELSE(
|
||||
[[#include <sys/time.h> /* Because OpenBSD's sys/event.h fails to compile otherwise. Yeah... */
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||
#include <sys/time.h> /* Because OpenBSD's sys/event.h fails to compile otherwise. Yeah... */
|
||||
#include <sys/event.h>
|
||||
int main() {
|
||||
int fd = kqueue();
|
||||
return 0;
|
||||
}
|
||||
]],
|
||||
])],
|
||||
[
|
||||
AC_DEFINE(USE_KQUEUE, 1, Use kqueue.)
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -96,8 +96,8 @@ AC_DEFUN([TORRENT_CHECK_KQUEUE], [
|
||||
AC_DEFUN([TORRENT_CHECK_KQUEUE_SOCKET_ONLY], [
|
||||
AC_MSG_CHECKING(whether kqueue supports pipes and ptys)
|
||||
|
||||
AC_RUN_IFELSE(
|
||||
[[#include <fcntl.h>
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/event.h>
|
||||
@@ -122,7 +122,7 @@ AC_DEFUN([TORRENT_CHECK_KQUEUE_SOCKET_ONLY], [
|
||||
if ((n = kevent(kfd, NULL, 0, ev_out, 2, &ts)) < 1) return 9;
|
||||
return 0;
|
||||
}
|
||||
]],
|
||||
])],
|
||||
[
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
@@ -364,11 +364,11 @@ AC_DEFUN([TORRENT_CHECK_TR1], [
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_MSG_CHECKING(for TR1 support)
|
||||
|
||||
AC_COMPILE_IFELSE(
|
||||
[[#include <tr1/unordered_map>
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
#include <tr1/unordered_map>
|
||||
class Foo;
|
||||
typedef std::tr1::unordered_map<Foo*, int> Bar;
|
||||
]],
|
||||
])],
|
||||
[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_TR1, 1, Define to 1 if your C++ library supports the extensions from Technical Report 1)
|
||||
@@ -385,14 +385,14 @@ AC_DEFUN([TORRENT_CHECK_CXX11], [
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_MSG_CHECKING(for C++11 support)
|
||||
|
||||
AC_COMPILE_IFELSE(
|
||||
[[#include <functional>
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
#include <functional>
|
||||
#include <unordered_map>
|
||||
class Foo;
|
||||
typedef std::unordered_map<Foo*, int> Bar;
|
||||
|
||||
union test { Bar b1; };
|
||||
]],
|
||||
])],
|
||||
[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_CXX11, 1, Define to 1 if your C++ compiler has support for C++11.)
|
||||
|
||||
+23
-24
@@ -99,11 +99,11 @@ AC_DEFUN([TORRENT_OTFD], [
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_MSG_CHECKING(for proper overloaded template function disambiguation)
|
||||
|
||||
AC_COMPILE_IFELSE(
|
||||
[[template <typename T> void f(T&) {}
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
template <typename T> void f(T&) {}
|
||||
template <typename T> void f(T*) {}
|
||||
int main() { int *i = 0; f(*i); f(i); }
|
||||
]],
|
||||
])],
|
||||
[
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
@@ -119,24 +119,24 @@ AC_DEFUN([TORRENT_MINCORE_SIGNEDNESS], [
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_MSG_CHECKING(signedness of mincore parameter)
|
||||
|
||||
AC_COMPILE_IFELSE(
|
||||
[[#include <sys/types.h>
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
void f() { mincore((char*)0, 0, (unsigned char*)0); }
|
||||
]],
|
||||
])],
|
||||
[
|
||||
AC_DEFINE(USE_MINCORE, 1, Use mincore)
|
||||
AC_DEFINE(USE_MINCORE_UNSIGNED, 1, use unsigned char* in mincore)
|
||||
AC_MSG_RESULT(unsigned)
|
||||
],
|
||||
[
|
||||
AC_COMPILE_IFELSE(
|
||||
[[#include <sys/types.h>
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
void f() { mincore((char*)0, 0, (char*)0); }
|
||||
]],
|
||||
])],
|
||||
[
|
||||
AC_DEFINE(USE_MINCORE, 1, Use mincore)
|
||||
AC_DEFINE(USE_MINCORE_UNSIGNED, 0, use char* in mincore)
|
||||
@@ -168,11 +168,11 @@ AC_DEFUN([TORRENT_MINCORE], [
|
||||
AC_DEFUN([TORRENT_CHECK_MADVISE], [
|
||||
AC_MSG_CHECKING(for madvise)
|
||||
|
||||
AC_COMPILE_IFELSE(
|
||||
[[#include <sys/types.h>
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
void f() { static char test[1024]; madvise((void *)test, sizeof(test), MADV_NORMAL); }
|
||||
]],
|
||||
])],
|
||||
[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_MADVISE, 1, Use madvise)
|
||||
@@ -184,10 +184,9 @@ AC_DEFUN([TORRENT_CHECK_MADVISE], [
|
||||
AC_DEFUN([TORRENT_CHECK_POPCOUNT], [
|
||||
AC_MSG_CHECKING(for __builtin_popcount)
|
||||
|
||||
AC_COMPILE_IFELSE(
|
||||
[[
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
void f() { __builtin_popcount(0); }
|
||||
]],
|
||||
])],
|
||||
[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_BUILTIN_POPCOUNT, 1, Use __builtin_popcount.)
|
||||
@@ -199,12 +198,12 @@ AC_DEFUN([TORRENT_CHECK_POPCOUNT], [
|
||||
AC_DEFUN([TORRENT_CHECK_CACHELINE], [
|
||||
AC_MSG_CHECKING(for cacheline)
|
||||
|
||||
AC_COMPILE_IFELSE(
|
||||
[[#include <stdlib.h>
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
#include <stdlib.h>
|
||||
#include <linux/cache.h>
|
||||
void* vptr __cacheline_aligned;
|
||||
void f() { posix_memalign(&vptr, SMP_CACHE_BYTES, 42); }
|
||||
]],
|
||||
])],
|
||||
[
|
||||
AC_MSG_RESULT(found builtin)
|
||||
dnl AC_DEFINE(LT_SMP_CACHE_BYTES, SMP_CACHE_BYTES, Largest L1 cache size we know of, should work on all archs.)
|
||||
@@ -224,10 +223,10 @@ dnl Need to fix this so that it uses the stuff defined by the system.
|
||||
AC_DEFUN([TORRENT_CHECK_EXECINFO], [
|
||||
AC_MSG_CHECKING(for execinfo.h)
|
||||
|
||||
AC_RUN_IFELSE(
|
||||
[[#include <execinfo.h>
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([
|
||||
#include <execinfo.h>
|
||||
int main() { backtrace((void**)0, 0); backtrace_symbols((char**)0, 0); return 0;}
|
||||
]],
|
||||
])],
|
||||
[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_EXECINFO, 1, Use execinfo.h)
|
||||
@@ -239,8 +238,8 @@ AC_DEFUN([TORRENT_CHECK_EXECINFO], [
|
||||
AC_DEFUN([TORRENT_CHECK_ALIGNED], [
|
||||
AC_MSG_CHECKING(the byte alignment)
|
||||
|
||||
AC_RUN_IFELSE(
|
||||
[[#include <inttypes.h>
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([
|
||||
#include <inttypes.h>
|
||||
int main() {
|
||||
char buf[8] = { 0, 0, 0, 0, 1, 0, 0, 0 };
|
||||
int i;
|
||||
@@ -248,7 +247,7 @@ AC_DEFUN([TORRENT_CHECK_ALIGNED], [
|
||||
if (*(uint32_t*)(buf + i) == 0) return -1;
|
||||
return 0;
|
||||
}
|
||||
]],
|
||||
])],
|
||||
[
|
||||
AC_MSG_RESULT(none needed)
|
||||
], [
|
||||
|
||||
Reference in New Issue
Block a user