remove our internal copy of talloc, use system libtalloc

Shipping our own private copy of talloc was a good idea in 2008,
when it was not readily available on most target platforms.  Today,
the situation is quite different, as it is a standard library on
major Linux distributions.
diff --git a/configure.ac b/configure.ac
index 3daa392..33c9b5c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,6 +82,8 @@
 dnl Generate the output
 AC_CONFIG_HEADER(config.h)
 
+PKG_CHECK_MODULES(TALLOC, [talloc >= 2.0.1])
+
 AC_ARG_ENABLE([pcsc], [AS_HELP_STRING([--disable-pcsc], [Build without PC/SC support])],
     [
         enable_pcsc=$enableval
@@ -94,28 +96,6 @@
 ])
 AM_CONDITIONAL(ENABLE_PCSC, test "x$enable_pcsc" = "xyes")
 
-AC_ARG_ENABLE(talloc,
-	[AS_HELP_STRING(
-		[--disable-talloc],
-		[Disable building libosmocore internal talloc memory allocator]
-	)],
-	[enable_talloc=$enableval], [enable_talloc="yes"])
-AM_CONDITIONAL(ENABLE_TALLOC, [test x"$enable_talloc" = x"yes"])
-
-AC_ARG_WITH(system-talloc,
-	[AS_HELP_STRING(
-		[--with-system-talloc],
-		[Build using a system-level talloc library]
-	)],
-	[with_system_talloc=$withval], [with_system_talloc="no"])
-AM_CONDITIONAL(WITH_SYSTEM_TALLOC, [test x"$with_system_talloc" = x"yes"])
-AS_IF([test x"$with_system_talloc" = x"yes"], [
-	PKG_CHECK_MODULES(TALLOC, talloc)
-	if test x"$enable_talloc" = x"yes"; then
-		AC_MSG_ERROR([You cannot enable both internal and system talloc])
-	fi
-])
-
 AC_ARG_ENABLE(plugin,
 	[AS_HELP_STRING(
 		[--disable-plugin],
@@ -199,42 +179,11 @@
 	AM_CONDITIONAL(ENABLE_MSGFILE, false)
 	AM_CONDITIONAL(ENABLE_SERIAL, false)
 	AM_CONDITIONAL(ENABLE_VTY, false)
-	AM_CONDITIONAL(ENABLE_TALLOC, false)
 	AM_CONDITIONAL(ENABLE_UTILITIES, false)
 	AM_CONDITIONAL(ENABLE_GB, false)
 	AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
 fi
 
-AC_OUTPUT_COMMANDS([
-	if test -n "$CONFIG_FILES" && test -n "$CONFIG_HEADERS"; then
-		CONFIG_OTHER=${CONFIG_OTHER-include/osmocom/core/talloc.h}
-	fi
-	case "$CONFIG_OTHER" in
-	"include/osmocom/core/talloc.h")
-		outfile=include/osmocom/core/talloc.h
-		stampfile=include/stamp-talloc
-		tmpfile=${outfile}T
-		dirname="sed s,^.*/,,g"
-
-		echo creating $outfile
-		cat > $outfile << _EOF_
-/* DO NOT EDIT THIS FILE!  It has been automaticall generated from
- * configure.ac on host: `(hostname || uname -n) 2>/dev/null | sed 1q`
- */
-#pragma once
-_EOF_
-		if test x"$with_system_talloc" = x"yes"; then
-			echo '#include <talloc.h>' >> $outfile
-		else
-			echo '#include <osmocom/core/talloc-internal.h>' >> $outfile
-		fi
-	esac
-],[
-   srcdir=$srcdir
-   with_system_talloc=$with_system_talloc
-])
-
-
 AC_OUTPUT(
 	libosmocore.pc
 	libosmocodec.pc