diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 59 |
1 files changed, 44 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac index 0b9f136..007efb8 100644 --- a/configure.ac +++ b/configure.ac @@ -10,11 +10,23 @@ dnl Process this file with autoconf to produce a configure script # As of 0.6cvs, distcc no longer uses automake, only autoconf. AC_PREREQ(2.69) -AC_INIT(distcc, 3.3.3, distcc@lists.samba.org) +AC_INIT(distcc, 3.4, distcc@lists.samba.org) AC_CONFIG_HEADERS(src/config.h) AC_CONFIG_MACRO_DIRS([m4]) +AC_CANONICAL_HOST +AC_MSG_CHECKING([if the host system type is Linux]) +case "${host_os}" in +linux*) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_LINUX, 1, [Define to 1 if the host system type is Linux.]) + ;; +*) + AC_MSG_RESULT(no) + ;; +esac + # FreeBSD installs its version of libpopt into /usr/local/, but does # not put that on the default library and header path. # Solaris doesn't even ship libpopt. We used to add that path if @@ -62,14 +74,13 @@ getpeername(0,0,&len); dnl Android requires -llog for printf and friends dnl and will only run position independent executables AC_MSG_CHECKING([if building on Android]) -AC_TRY_COMPILE([ +AC_TRY_COMPILE([], [ #ifdef __BIONIC__ int ok; (void)ok; #else choke me #endif], -[func("a"); func("a", "b"); func("a", "b", "c")], [AC_MSG_RESULT(yes) LDFLAGS="$LDFLAGS -llog -pie"], [AC_MSG_RESULT(no)]) @@ -133,10 +144,10 @@ AC_ARG_ENABLE(Werror, # we need. It's faster to just do it once during configuration. if test "x${with_gnome}" = xyes then - GNOME_PACKAGES="gtk+-2.0 libgnome-2.0 libgnomeui-2.0 pango" + GNOME_PACKAGES="gtk+-3.0 libgnome-3.0 libgnomeui-3.0 pango" elif test "x${with_gtk}" = xyes then - GNOME_PACKAGES="gtk+-2.0" + GNOME_PACKAGES="gtk+-3.0" else GNOME_PACKAGES="" fi @@ -399,12 +410,11 @@ if (mmap (NULL, 0, 0, 0, 0, 0) == MAP_FAILED) return 0; #else #error mmap unavailable -#endif], ,[ +#endif], AC_MSG_RESULT(yes), [ + AC_MSG_RESULT(no) AC_DEFINE([MAP_FAILED], [(void *)-1L], [Define if MAP_FAILED constant not available]) ]) -AC_MSG_RESULT() - dnl dnl Test if the preprocessor understand vararg macros @@ -433,9 +443,12 @@ fi AC_CACHE_CHECK([for C99 vsnprintf],rsync_cv_HAVE_C99_VSNPRINTF,[ AC_TRY_RUN([ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> #include <sys/types.h> #include <stdarg.h> -void foo(const char *format, ...) { +static int foo(const char *format, ...) { va_list ap; int len; char buf[5]; @@ -443,13 +456,13 @@ void foo(const char *format, ...) { va_start(ap, format); len = vsnprintf(0, 0, format, ap); va_end(ap); - if (len != 5) exit(1); + if (len != 5) return 1; - if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1); + if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) return 1; - exit(0); + return 0; } -main() { foo("hello"); } +int main() { return foo("hello"); } ], rsync_cv_HAVE_C99_VSNPRINTF=yes,rsync_cv_HAVE_C99_VSNPRINTF=no,rsync_cv_HAVE_C99_VSNPRINTF=cross)]) if test x"$rsync_cv_HAVE_C99_VSNPRINTF" = x"yes"; then @@ -462,9 +475,9 @@ AC_TRY_RUN([ #include <sys/types.h> #include <sys/socket.h> -main() { +int main() { int fd[2]; - exit((socketpair(AF_UNIX, SOCK_STREAM, 0, fd) != -1) ? 0 : 1); + return (socketpair(AF_UNIX, SOCK_STREAM, 0, fd) != -1) ? 0 : 1; }], rsync_cv_HAVE_SOCKETPAIR=yes,rsync_cv_HAVE_SOCKETPAIR=no,rsync_cv_HAVE_SOCKETPAIR=cross)]) if test x"$rsync_cv_HAVE_SOCKETPAIR" = x"yes"; then @@ -534,6 +547,22 @@ AC_SUBST(CPPFLAGS) AC_SUBST(POPT_INCLUDES) AC_SUBST(BUILD_POPT) AC_SUBST(GNOME_BIN) + + +# Sometimes canonical triples as used by configure differ from GCC ones +# x86: configure: x86_64-pc-linux-gnu, GCC: x86_64-linux-gnu +# ALT Linux: configure: ${arch}-alt-linux-gnu, GCC: ${arch}-alt-linux +# Therefore ask the compiler for its triple +if test "x${GCC}" = xyes ; then + native_compiler_triple=`$CC -dumpmachine` +fi +if test "x$native_compiler_triple" = "x"; then + native_compiler_triple="$host" +fi +AC_MSG_NOTICE([Native compiler triple: $native_compiler_triple]) + +AC_DEFINE_UNQUOTED(NATIVE_COMPILER_TRIPLE, ["$native_compiler_triple"], [Native compiler triple]) + AC_DEFINE_UNQUOTED(GNU_HOST, ["$host"], [Your gnu-style host triple]) # The '.stamp-conf' files force creation of the containing directories in the # build tree. |