From 05e157e9c2f27a793f79f38077c8e45d411a4edf Mon Sep 17 00:00:00 2001 From: "fergus.henderson@gmail.com" Date: Wed, 2 Apr 2014 23:14:25 +0000 Subject: Apply patch for issue 139 : add configure option --without-libiberty, to allow building distcc without GPL3 license encumbrance. git-svn-id: http://distcc.googlecode.com/svn/trunk@790 01de4be4-8c4a-0410-9132-4925637da917 --- configure.ac | 22 +++++++++++++--------- src/distcc.c | 6 +++++- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 8b18122..feec478 100644 --- a/configure.ac +++ b/configure.ac @@ -359,17 +359,21 @@ else POPT_INCLUDES='' fi -AC_CHECK_LIB([iberty], [expandargv], - , - AC_MSG_ERROR([Cannot find libiberty])) -AC_CHECK_HEADERS([libiberty.h libiberty/libiberty.h], - [break]) -if (test "$ac_cv_header_libiberty_h" != yes) && - (test "$ac_cv_header_libiberty_libiberty_h" != yes); then - AC_MSG_ERROR([Cannot find libiberty.h]) +AC_ARG_WITH(binutils, + AC_HELP_STRING([--without-libiberty], [build without libiberty (no @file support)])) + +if test x"$with_libiberty" != xno; then + AC_CHECK_LIB([iberty], [expandargv], + , + AC_MSG_ERROR([Cannot find libiberty])) + AC_CHECK_HEADERS([libiberty.h libiberty/libiberty.h], + [break]) + if (test "$ac_cv_header_libiberty_h" != yes) && + (test "$ac_cv_header_libiberty_libiberty_h" != yes); then + AC_MSG_ERROR([Cannot find libiberty.h]) + fi fi - ######################################################################## # Check for types AC_TYPE_SIGNAL diff --git a/src/distcc.c b/src/distcc.c index b6db148..16d10a6 100644 --- a/src/distcc.c +++ b/src/distcc.c @@ -41,6 +41,7 @@ #include #include +#if HAVE_LIBIBERTY #if defined (HAVE_LIBIBERTY_H) #include #elif defined (HAVE_LIBIBERTY_LIBIBERTY_H) @@ -48,6 +49,7 @@ #else #error Need libiberty.h #endif +#endif #include "distcc.h" #include "trace.h" @@ -241,9 +243,11 @@ int main(int argc, char **argv) compiler_name = (char *) dcc_find_basename(argv[0]); +#if HAVE_LIBIBERTY /* Expand @FILE arguments. */ expandargv(&argc, &argv); - +#endif + /* Ignore SIGPIPE; we consistently check error codes and will * see the EPIPE. */ dcc_ignore_sigpipe(1); -- cgit v1.2.1