summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac72
1 files changed, 33 insertions, 39 deletions
diff --git a/configure.ac b/configure.ac
index 16a593f..8f4a202 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script
-# "We are ugly but we have the music"
+# "We are ugly but we have the music"
# -- Leonard Cohen
#
# http://jerkcity.com/jerkcity1335.html
@@ -48,10 +48,10 @@ AC_CHECK_TYPE([socklen_t], ,[
AC_MSG_CHECKING([for socklen_t equivalent])
AC_CACHE_VAL([dcc_cv_socklen_t_equiv],
[
- # Systems have either "struct sockaddr *" or
+ # Systems have either "struct sockaddr{,_in} *" or
# "void *" as the second argument to getpeername
dcc_cv_socklen_t_equiv=
- for arg2 in "struct sockaddr" void; do
+ for arg2 in "struct sockaddr_in" "struct sockaddr" void; do
for t in int size_t unsigned long "unsigned long"; do
AC_TRY_COMPILE([
#include <sys/types.h>
@@ -78,6 +78,21 @@ getpeername(0,0,&len);
[#include <sys/types.h>
#include <sys/socket.h>])
+dnl Android requires -llog for printf and friends
+dnl and will only run position independant executables
+AC_MSG_CHECKING([if building on Android])
+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)])
+
# TODO: Handle program transform rules by autoconf.
### Checks for configure options
@@ -124,7 +139,7 @@ AC_ARG_ENABLE(Werror,
# Now get the package configuration information for whatever packages
# we need. It's faster to just do it once during configuration.
if test "x${with_gnome}" = xyes
-then
+then
GNOME_PACKAGES="gtk+-2.0 libgnome-2.0 libgnomeui-2.0 pango"
elif test "x${with_gtk}" = xyes
then
@@ -140,11 +155,11 @@ do
then
AC_MSG_RESULT($gnomevers)
else
- AC_MSG_ERROR([$pkg was not found by pkg-config])
+ AC_MSG_ERROR([$pkg was not found by pkg-config])
fi
done
-if test x${with_gnome} = xyes -o x${with_gtk} = xyes
+if test x${with_gnome} = xyes -o x${with_gtk} = xyes
then
INSTALL_GNOME="install-gnome-data"
UNINSTALL_GNOME="uninstall-gnome-data"
@@ -210,7 +225,8 @@ then
-Wno-write-strings"
# For popt/*.c, we disable unused variable warnings.
- POPT_CFLAGS="-Wno-unused"
+ # When using Apple GCC/Clang you have to explicitly disable unused parameters.
+ POPT_CFLAGS="-Wno-unused -Wno-unused-parameter"
AC_MSG_NOTICE([Adding gcc options: $CFLAGS])
fi
@@ -239,35 +255,12 @@ CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
AC_PROG_MAKE_SET
AC_PROG_INSTALL
-# We prefer to use the latest Python, but try to find an explicit
-# version to make sure we don't get a really old one.
-#
-# The include server requires python 2.4 or later, but the 'make test'
-# routines only require python 2.2. Thus we have two separate
-# variables. Each variable is the empty string if the python that we
-# haven't isn't recent enough for that use, or the path to a python
-# executable if it is recent enough.
+# We prefer to use the latest Python
#
# NB: Cannot use AC_CONFIG_LIBOBJ_DIR here, because it's not present
# in autoconf 2.53.
-AC_PATH_PROGS(PYTHON, [python2.7 python-2.7 python2.6 python-2.6 python2.5 python-2.5 python2.4 python-2.4 python])
+AM_PATH_PYTHON([3.1],,[:])
AC_ARG_VAR(PYTHON, [Python interpreter])
-# Python 1 doesn't even support -V
-if ! "$PYTHON" -V 2>&1 | grep "^Python" >/dev/null; then
- TEST_PYTHON=""
- INCLUDESERVER_PYTHON=""
-elif "$PYTHON" -V 2>&1 | grep "^Python 2.1" >/dev/null; then
- TEST_PYTHON=""
- INCLUDESERVER_PYTHON=""
-elif "$PYTHON" -V 2>&1 | grep "^Python 2.[[23]]" >/dev/null; then
- TEST_PYTHON="$PYTHON"
- INCLUDESERVER_PYTHON=""
-else
- TEST_PYTHON="$PYTHON"
- INCLUDESERVER_PYTHON="$PYTHON"
-fi
-AC_SUBST(TEST_PYTHON)
-AC_SUBST(INCLUDESERVER_PYTHON)
AC_SUBST(PYTHON_RELATIVE_LIB)
AC_C_INLINE
AC_C_BIGENDIAN
@@ -277,7 +270,7 @@ AC_C_BIGENDIAN
# Some of these are needed by popt (or other libraries included in the future).
-AC_CHECK_HEADERS([unistd.h sys/types.h sys/sendfile.h sys/signal.h])
+AC_CHECK_HEADERS([unistd.h sys/types.h sys/sendfile.h])
AC_CHECK_HEADERS([ctype.h sys/resource.h sys/socket.h sys/select.h])
AC_CHECK_HEADERS([netinet/in.h], [], [],
[#if HAVE_SYS_TYPES_H
@@ -342,8 +335,8 @@ AC_SEARCH_LIBS(inet_aton, [resolv])
if test x"$with_included_popt" != x"yes" && test x"$with_included_popt" != xno
then
- # If not explicitly requested, guess.
- # People might have the library but not the header, in which case we
+ # If not explicitly requested, guess.
+ # People might have the library but not the header, in which case we
# still need to use the included copy.
AC_CHECK_LIB(popt, poptGetContext, , [with_included_popt=yes])
AC_CHECK_HEADER(popt.h, , [with_included_popt=yes])
@@ -409,6 +402,7 @@ AC_CHECK_DECLS([snprintf, vsnprintf, vasprintf, asprintf, strndup])
AC_MSG_CHECKING([if mmap() supports MAP_FAILED])
AC_TRY_COMPILE([
+#include <stddef.h>
#ifdef HAVE_SYS_MMAN_H
# include <sys/mman.h>
#endif],[
@@ -453,7 +447,7 @@ AC_CACHE_CHECK([for C99 vsnprintf],rsync_cv_HAVE_C99_VSNPRINTF,[
AC_TRY_RUN([
#include <sys/types.h>
#include <stdarg.h>
-void foo(const char *format, ...) {
+void foo(const char *format, ...) {
va_list ap;
int len;
char buf[5];
@@ -525,7 +519,7 @@ AC_ARG_WITH([auth],
if test x"$with_auth" = xyes; then
AC_SEARCH_LIBS([gss_init_sec_context],
- [gssapi gssapi_krb5],
+ [gssapi gssapi_krb5 gss],
AC_DEFINE(HAVE_GSSAPI, 1, [Define if the GSS_API is available])
AUTH_COMMON_OBJS="src/auth_common.o"
AUTH_DISTCC_OBJS="src/auth_distcc.o"
@@ -578,12 +572,12 @@ cat <<EOF
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,