summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfergus.henderson <fergushenderson@users.noreply.github.com>2014-04-02 23:14:25 +0000
committerfergus.henderson <fergushenderson@users.noreply.github.com>2014-04-02 23:14:25 +0000
commit214838b742467896aa19f9bb5546b0ca23ad80be (patch)
tree3f7117c25bf738377e31240060fb2924f29f2afa
parentbe166dc858c9ecde202bbc81f4cc7cf9a375dab2 (diff)
downloaddistcc-git-214838b742467896aa19f9bb5546b0ca23ad80be.tar.gz
Apply patch for issue 139
<http://code.google.com/p/distcc/issues/detail?id=139>: add configure option --without-libiberty, to allow building distcc without GPL3 license encumbrance.
-rw-r--r--configure.ac22
-rw-r--r--src/distcc.c6
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 <errno.h>
#include <signal.h>
+#if HAVE_LIBIBERTY
#if defined (HAVE_LIBIBERTY_H)
#include <libiberty.h>
#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);