* [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc
@ 2016-11-22 20:44 Matthias Klose
2016-11-30 8:30 ` Andreas Schwab
0 siblings, 1 reply; 14+ messages in thread
From: Matthias Klose @ 2016-11-22 20:44 UTC (permalink / raw)
To: GCC Patches, Andrew Pinski, Nicola Pero, Jeff Law
[-- Attachment #1: Type: text/plain, Size: 1456 bytes --]
Re-posting this top-level, discussions and review happened in the GCJ removal
thread:
- https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02069.html (last patch
review).
- https://gcc.gnu.org/ml/gcc-patches/2016-10/msg00387.html (first patch
sent)
- https://gcc.gnu.org/ml/gcc-patches/2016-10/msg00290.html (OK by Jeff
Law to remove boehm-gc)
Afaiu, it needs an ok by a global reviewer, and maybe an libobjc maintainer (?).
Matthias
<toplevel>
2016-11-19 Matthias Klose <doko@ubuntu.com>
* Makefile.def: Remove reference to boehm-gc target module.
* configure.ac: Include pkg.m4, check for --with-target-bdw-gc
options and for the bdw-gc pkg-config module.
* configure: Regenerate.
* Makefile.in: Regenerate.
gcc/
2016-11-19 Matthias Klose <doko@ubuntu.com>
* doc/install.texi: Document configure options --enable-objc-gc
and --with-target-bdw-gc.
config/
2016-11-19 Matthias Klose <doko@ubuntu.com>
* pkg.m4: New file.
libobjc/
2016-11-19 Matthias Klose <doko@ubuntu.com>
* configure.ac (--enable-objc-gc): Allow to configure with a
system provided boehm-gc.
* configure: Regenerate.
* Makefile.in (OBJC_BOEHM_GC_LIBS): Get value from configure.
* gc.c: Include system bdw-gc headers.
* memory.c: Likewise
* objects.c: Likewise
boehm-gc/
2016-11-19 Matthias Klose <doko@ubuntu.com>
Remove
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: libobjc-bdw-gc.diff --]
[-- Type: text/x-diff; name="libobjc-bdw-gc.diff", Size: 48712 bytes --]
<toplevel>
2016-11-19 Matthias Klose <doko@ubuntu.com>
* Makefile.def: Remove reference to boehm-gc target module.
* configure.ac: Include pkg.m4, check for --with-target-bdw-gc
options and for the bdw-gc pkg-config module.
* configure: Regenerate.
* Makefile.in: Regenerate.
gcc/
2016-11-19 Matthias Klose <doko@ubuntu.com>
* doc/install.texi: Document configure options --enable-objc-gc
and --with-target-bdw-gc.
config/
2016-11-19 Matthias Klose <doko@ubuntu.com>
* pkg.m4: New file.
libobjc/
2016-11-19 Matthias Klose <doko@ubuntu.com>
* configure.ac (--enable-objc-gc): Allow to configure with a
system provided boehm-gc.
* configure: Regenerate.
* Makefile.in (OBJC_BOEHM_GC_LIBS): Get value from configure.
* gc.c: Include system bdw-gc headers.
* memory.c: Likewise
* objects.c: Likewise
boehm-gc/
2016-11-19 Matthias Klose <doko@ubuntu.com>
Remove
Index: Makefile.def
===================================================================
--- Makefile.def (revision 242721)
+++ Makefile.def (working copy)
@@ -166,7 +166,6 @@
target_modules = { module= libgloss; no_check=true; };
target_modules = { module= libffi; no_install=true; };
target_modules = { module= zlib; };
-target_modules = { module= boehm-gc; };
target_modules = { module= rda; };
target_modules = { module= libada; };
target_modules = { module= libgomp; bootstrap= true; lib_path=.libs; };
@@ -543,7 +542,6 @@
// a dependency on libgcc for native targets to configure.
lang_env_dependencies = { module=libiberty; no_c=true; };
-dependencies = { module=configure-target-boehm-gc; on=all-target-libstdc++-v3; };
dependencies = { module=configure-target-fastjar; on=configure-target-zlib; };
dependencies = { module=all-target-fastjar; on=all-target-zlib; };
dependencies = { module=configure-target-libgo; on=configure-target-libffi; };
@@ -551,8 +549,6 @@
dependencies = { module=all-target-libgo; on=all-target-libbacktrace; };
dependencies = { module=all-target-libgo; on=all-target-libffi; };
dependencies = { module=all-target-libgo; on=all-target-libatomic; };
-dependencies = { module=configure-target-libobjc; on=configure-target-boehm-gc; };
-dependencies = { module=all-target-libobjc; on=all-target-boehm-gc; };
dependencies = { module=configure-target-libstdc++-v3; on=configure-target-libgomp; };
dependencies = { module=configure-target-liboffloadmic; on=configure-target-libgomp; };
dependencies = { module=configure-target-libsanitizer; on=all-target-libstdc++-v3; };
Index: config/pkg.m4
===================================================================
--- config/pkg.m4 (nonexistent)
+++ config/pkg.m4 (working copy)
@@ -0,0 +1,825 @@
+dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+dnl serial 11 (pkg-config-0.29)
+dnl
+dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+ [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])dnl PKG_PROG_PKG_CONFIG
+
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])dnl _PKG_CONFIG
+
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
+
+
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+ [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_INSTALLDIR
+
+
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR
+dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+dnl serial 11 (pkg-config-0.29)
+dnl
+dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+ [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])dnl PKG_PROG_PKG_CONFIG
+
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])dnl _PKG_CONFIG
+
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
+
+
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+ [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_INSTALLDIR
+
+
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR
+dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+dnl serial 11 (pkg-config-0.29)
+dnl
+dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+ [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])dnl PKG_PROG_PKG_CONFIG
+
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])dnl _PKG_CONFIG
+
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
+
+
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+ [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_INSTALLDIR
+
+
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR
Index: configure.ac
===================================================================
--- configure.ac (revision 242721)
+++ configure.ac (working copy)
@@ -29,6 +29,7 @@
m4_include([ltversion.m4])
m4_include([lt~obsolete.m4])
m4_include([config/isl.m4])
+m4_include([config/pkg.m4])
AC_INIT(move-if-change)
AC_PREREQ(2.64)
@@ -161,7 +162,6 @@
target-libssp \
target-libquadmath \
target-libgfortran \
- target-boehm-gc \
target-libffi \
target-libobjc \
target-libada \
@@ -2060,22 +2060,36 @@
AC_ARG_ENABLE(objc-gc,
[AS_HELP_STRING([--enable-objc-gc],
[enable use of Boehm's garbage collector with the
- GNU Objective-C runtime])],
-[case ,${enable_languages},:${enable_objc_gc}:${noconfigdirs} in
- *,objc,*:*:yes:*target-boehm-gc*)
- AC_MSG_ERROR([Boehm's garbage collector was requested yet not supported in this configuration])
- ;;
-esac])
-
-# Make sure we only build Boehm's garbage collector if required.
-case ,${enable_languages},:${enable_objc_gc} in
- *,objc,*:yes)
- # Keep target-boehm-gc if requested for Objective-C.
- ;;
- *)
- # Otherwise remove target-boehm-gc.
- noconfigdirs="$noconfigdirs target-boehm-gc"
- ;;
+ GNU Objective-C runtime])])
+AC_ARG_WITH([target-bdw-gc],
+[AS_HELP_STRING([--with-target-bdw-gc=PATHLIST],
+ [specify prefix directory for installed bdw-gc package.
+ Equivalent to --with-target-bdw-gc-include=PATH/include
+ plus --with-target-bdw-gc-lib=PATH/lib])])
+AC_ARG_WITH([target-bdw-gc-include],
+[AS_HELP_STRING([--with-target-bdw-gc-include=PATHLIST],
+ [specify directories for installed bdw-gc include files])])
+AC_ARG_WITH([target-bdw-gc-lib],
+[AS_HELP_STRING([--with-target-bdw-gc-lib=PATHLIST],
+ [specify directories for installed bdw-gc library])])
+
+case ,${enable_languages},:${enable_objc_gc} in *,objc,*:yes|*,objc,*:auto)
+ AC_MSG_CHECKING([for bdw garbage collector])
+ if test "x$with_target_bdw_gc$with_target_bdw_gc_include$with_target_bdw_gc_lib" = x; then
+ dnl no bdw-gw options, fall back to the bdw-gc pkg-config module
+ PKG_CHECK_EXISTS(bdw-gc,
+ AC_MSG_RESULT([using bdw-gc pkg-config module]),
+ AC_MSG_ERROR([no --with-target-bdw-gc options and no bdw-gc pkg-config module found]))
+ else
+ dnl bdw-gw options, first error checking, complete checking in libobjc
+ if test "x$with_target_bdw_gc_include" = x && test "x$with_target_bdw_gc_lib" != x; then
+ AC_MSG_ERROR([found --with-target-bdw-gc-lib but --with-target-bdw-gc-include missing])
+ elif test "x$with_target_bdw_gc_include" != x && test "x$with_target_bdw_gc_lib" = x; then
+ AC_MSG_ERROR([found --with-target-bdw-gc-include but --with-target-bdw-gc-lib missing])
+ else
+ AC_MSG_RESULT([using paths configured with --with-target-bdw-gc options])
+ fi
+ fi
esac
# Disable libcilkrts, libitm, libsanitizer, libvtv, liboffloadmic if we're not building C++
Index: gcc/doc/install.texi
===================================================================
--- gcc/doc/install.texi (revision 242721)
+++ gcc/doc/install.texi (working copy)
@@ -2183,6 +2183,37 @@
overrides, you can pass a setting for @env{CONFIG_SITE} and set
variables in the site file.
+@subheading Objective-C-Specific Options
+
+The following options apply to the build of the Objective-C runtime library.
+
+@table @code
+@item --enable-objc-gc
+Specify that an additional variant of the GNU Objective-C runtime library
+is built, using an external build of the Boehm-Demers-Weiser garbage
+collector (@uref{http://www.hboehm.info/gc/}). This library needs to be
+available for each multilib variant, unless configured with
+@option{--enable-objc-gc=@samp{auto}} in which case the build of the
+additional runtime library is skipped when not available and the build
+continues.
+
+@item --with-target-bdw-gc=@var{list}
+@itemx --with-target-bdw-gc-include=@var{list}
+@itemx --with-target-bdw-gc-lib=@var{list}
+Specify search directories for the garbage collector header files and
+libraries. @var{list} is a comma separated list of key value pairs of the
+form @samp{@var{multilibdir}=@var{path}}, where the default multilib key
+is named as @samp{.} (dot), or is omitted (e.g.
+@samp{--with-target-bdw-gc=/opt/bdw-gc,32=/opt-bdw-gc32}).
+
+The options @option{--with-target-bdw-gc-include} and
+@option{--with-target-bdw-gc-lib} must always be specified together
+for each multilib variant and they take precedence over
+@option{--with-target-bdw-gc}. If none of these options are
+specified, the values are taken from the @command{pkg-config}
+@samp{bdw-gc} module.
+@end table
+
@html
<hr />
<p>
Index: libobjc/Makefile.in
===================================================================
--- libobjc/Makefile.in (revision 242721)
+++ libobjc/Makefile.in (working copy)
@@ -47,8 +47,6 @@
top_builddir = .
--include ../boehm-gc/threads.mk
-
libdir = $(exec_prefix)/lib
libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
@@ -95,7 +93,7 @@
OBJC_GCFLAGS=@OBJC_GCFLAGS@
OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@
-OBJC_BOEHM_GC_LIBS=../boehm-gc/libgcjgc_convenience.la $(thread_libs_and_flags)
+OBJC_BOEHM_GC_LIBS=@OBJC_BOEHM_GC_LIBS@
INCLUDES = -I$(srcdir)/$(MULTISRCTOP)../gcc \
-I$(srcdir)/$(MULTISRCTOP)../gcc/config \
Index: libobjc/configure.ac
===================================================================
--- libobjc/configure.ac (revision 242721)
+++ libobjc/configure.ac (working copy)
@@ -18,6 +18,8 @@
#along with GCC; see the file COPYING3. If not see
#<http://www.gnu.org/licenses/>.
+m4_include([../config/pkg.m4])
+
AC_PREREQ(2.64)
AC_INIT(package-unused, version-unused,, libobjc)
AC_CONFIG_SRCDIR([objc/objc.h])
@@ -57,26 +59,6 @@
[version_specific_libs=no])
AC_MSG_RESULT($version_specific_libs)
-AC_ARG_ENABLE(objc-gc,
-[ --enable-objc-gc enable the use of Boehm's garbage collector with
- the GNU Objective-C runtime.],
-[case $enable_objc_gc in
- no)
- OBJC_GCFLAGS=''
- OBJC_BOEHM_GC=''
- OBJC_BOEHM_GC_INCLUDES=''
- ;;
- *)
- OBJC_GCFLAGS='-DOBJC_WITH_GC=1'
- OBJC_BOEHM_GC='libobjc_gc$(libsuffix).la'
- OBJC_BOEHM_GC_INCLUDES='-I$(top_srcdir)/../boehm-gc/include -I../boehm-gc/include'
- ;;
-esac],
-[OBJC_GCFLAGS=''; OBJC_BOEHM_GC=''; OBJC_BOEHM_GC_INCLUDES=''])
-AC_SUBST(OBJC_GCFLAGS)
-AC_SUBST(OBJC_BOEHM_GC)
-AC_SUBST(OBJC_BOEHM_GC_INCLUDES)
-
# -----------
# Directories
# -----------
@@ -214,6 +196,163 @@
gt_BITFIELD_TYPE_MATTERS
+# -----------
+# boehm-gc
+# -----------
+
+AC_ARG_ENABLE(objc-gc,
+[AS_HELP_STRING([--enable-objc-gc],
+ [enable use of Boehm's garbage collector with the
+ GNU Objective-C runtime])])
+AC_ARG_WITH([target-bdw-gc],
+[AS_HELP_STRING([--with-target-bdw-gc=PATHLIST],
+ [specify prefix directory for installed bdw-gc package.
+ Equivalent to --with-target-bdw-gc-include=PATH/include
+ plus --with-target-bdw-gc-lib=PATH/lib])])
+AC_ARG_WITH([target-bdw-gc-include],
+[AS_HELP_STRING([--with-target-bdw-gc-include=PATHLIST],
+ [specify directories for installed bdw-gc include files])])
+AC_ARG_WITH([target-bdw-gc-lib],
+[AS_HELP_STRING([--with-target-bdw-gc-lib=PATHLIST],
+ [specify directories for installed bdw-gc library])])
+
+case "$enable_objc_gc" in
+no)
+ use_bdw_gc=no
+ ;;
+*)
+ AC_MSG_CHECKING([for bdw garbage collector])
+ if test "x$with_target_bdw_gc$with_target_bdw_gc_include$with_target_bdw_gc_lib" = x; then
+ dnl no bdw-gw options, fall back to the bdw-gc pkg-config module
+ PKG_CHECK_EXISTS(bdw-gc,
+ AC_MSG_RESULT([using bdw-gc pkg-config module]),
+ AC_MSG_ERROR([no --with-target-bdw-gc options and no bdw-gc pkg-config module found]))
+ else
+ dnl bdw-gw options, first error checking, complete checking in libobjc
+ if test "x$with_target_bdw_gc_include" = x && test "x$with_target_bdw_gc_lib" != x; then
+ AC_MSG_ERROR([found --with-target-bdw-gc-lib but --with-target-bdw-gc-include missing])
+ elif test "x$with_target_bdw_gc_include" != x && test "x$with_target_bdw_gc_lib" = x; then
+ AC_MSG_ERROR([found --with-target-bdw-gc-include but --with-target-bdw-gc-lib missing])
+ else
+ AC_MSG_RESULT([using paths configured with --with-target-bdw-gc options])
+ fi
+ fi
+ mldir=`${CC-gcc} --print-multi-directory 2>/dev/null`
+ bdw_val=
+ if test "x$with_target_bdw_gc" != x; then
+ for i in `echo $with_target_bdw_gc | tr ',' ' '`; do
+ case "$i" in
+ *=*) sd=${i%%=*}; d=${i#*=} ;;
+ *) sd=.; d=$i ;;
+ esac
+ if test "$mldir" = "$sd"; then
+ bdw_val=$d
+ fi
+ done
+ if test "x$bdw_val" = x; then
+ AC_MSG_ERROR([no multilib path ($mldir) found in --with-target-bdw-gc])
+ fi
+ bdw_inc_dir="$bdw_val/include"
+ bdw_lib_dir="$bdw_val/lib"
+ fi
+ bdw_val=
+ if test "x$with_target_bdw_gc_include" != x; then
+ for i in `echo $with_target_bdw_gc_include | tr ',' ' '`; do
+ case "$i" in
+ *=*) sd=${i%%=*}; d=${i#*=} ;;
+ *) sd=.; d=$i ;;
+ esac
+ if test "$mldir" = "$sd"; then
+ bdw_val=$d
+ fi
+ done
+ if test "x$bdw_val" = x; then
+ AC_MSG_ERROR([no multilib path ($mldir) found in --with-target-bdw-gc-include])
+ fi
+ bdw_inc_dir="$bdw_val"
+ fi
+ bdw_val=
+ if test "x$with_target_bdw_gc_lib" != x; then
+ for i in `echo $with_target_bdw_gc_lib | tr ',' ' '`; do
+ case "$i" in
+ *=*) sd=${i%%=*}; d=${i#*=} ;;
+ *) sd=.; d=$i ;;
+ esac
+ if test "$mldir" = "$sd"; then
+ bdw_val=$d
+ fi
+ done
+ if test "x$bdw_val" = x; then
+ AC_MSG_ERROR([no multilib path ($mldir) found in --with-target-bdw-gc-lib])
+ fi
+ bdw_lib_dir="$bdw_val"
+ fi
+ if test "x$bdw_inc_dir" = x; then
+ AC_MSG_ERROR([no multilib path ($mldir) found in --with-target-bdw-gc-include])
+ fi
+ if test "x$bdw_lib_dir" = x; then
+ AC_MSG_ERROR([no multilib path ($mldir) found in --with-target-bdw-gc-lib])
+ fi
+ BDW_GC_CFLAGS="-I$bdw_inc_dir"
+ BDW_GC_LIBS="-L$bdw_lib_dir -lgc"
+ AC_MSG_RESULT([found])
+ use_bdw_gc=maybe
+esac
+
+if test "$use_bdw_gc" = maybe; then
+ AC_MSG_CHECKING([for system boehm-gc])
+ save_CFLAGS=$CFLAGS
+ save_LIBS=$LIBS
+ CFLAGS="$CFLAGS $BDW_GC_CFLAGS"
+ LIBS="$LIBS $BDW_GC_LIBS"
+ dnl the link test is not good enough for ARM32 multilib detection,
+ dnl first check to link, then to run
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([#include <gc/gc.h>],[GC_init()])],
+ [
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ #include <gc/gc.h>
+ int main() {
+ GC_init();
+ return 0;
+ }
+ ]])],
+ [system_bdw_gc_found=yes],
+ [system_bdw_gc_found=no],
+ dnl assume no system boehm-gc for cross builds ...
+ [system_bdw_gc_found=no]
+ )
+ ],
+ [system_bdw_gc_found=no])
+ CFLAGS=$save_CFLAGS
+ LIBS=$save_LIBS
+ if test x$enable_objc_gc = xauto && test x$system_bdw_gc_found = xno; then
+ AC_MSG_WARN([system bdw-gc not found, not building libobjc_gc])
+ use_bdw_gc=no
+ elif test x$enable_objc_gc = xyes && test x$system_bdw_gc_found = xno; then
+ AC_MSG_ERROR([system bdw-gc required but not found])
+ else
+ use_bdw_gc=yes
+ AC_MSG_RESULT([found])
+ fi
+fi
+
+if test "$use_bdw_gc" = no; then
+ OBJC_GCFLAGS=''
+ OBJC_BOEHM_GC=''
+ OBJC_BOEHM_GC_INCLUDES=''
+ OBJC_BOEHM_GC_LIBS=''
+else
+ OBJC_GCFLAGS='-DOBJC_WITH_GC=1'
+ OBJC_BOEHM_GC='libobjc_gc$(libsuffix).la'
+ OBJC_BOEHM_GC_INCLUDES=$BDW_GC_CFLAGS
+ OBJC_BOEHM_GC_LIBS=$BDW_GC_LIBS
+fi
+AC_SUBST(OBJC_GCFLAGS)
+AC_SUBST(OBJC_BOEHM_GC)
+AC_SUBST(OBJC_BOEHM_GC_INCLUDES)
+AC_SUBST(OBJC_BOEHM_GC_LIBS)
+
# ------
# Output
# ------
Index: libobjc/gc.c
===================================================================
--- libobjc/gc.c (revision 242721)
+++ libobjc/gc.c (working copy)
@@ -36,7 +36,7 @@
#include "objc/runtime.h"
#include "objc-private/module-abi-8.h"
-#include <gc.h>
+#include <gc/gc.h>
#include <limits.h>
/* gc_typed.h uses the following but doesn't declare them */
@@ -44,7 +44,7 @@
typedef GC_signed_word signed_word;
#define BITS_PER_WORD (CHAR_BIT * sizeof (word))
-#include <gc_typed.h>
+#include <gc/gc_typed.h>
/* The following functions set up in `mask` the corresponding pointers.
The offset is incremented with the size of the type. */
Index: libobjc/memory.c
===================================================================
--- libobjc/memory.c (revision 242721)
+++ libobjc/memory.c (working copy)
@@ -41,7 +41,7 @@
#include "objc/runtime.h"
#if OBJC_WITH_GC
-#include <gc.h>
+#include <gc/gc.h>
void *
objc_malloc (size_t size)
Index: libobjc/objects.c
===================================================================
--- libobjc/objects.c (revision 242721)
+++ libobjc/objects.c (working copy)
@@ -31,8 +31,8 @@
#include <string.h> /* For memcpy() */
#if OBJC_WITH_GC
-# include <gc.h>
-# include <gc_typed.h>
+# include <gc/gc.h>
+# include <gc/gc_typed.h>
#endif
/* FIXME: The semantics of extraBytes are not really clear. */
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc
2016-11-22 20:44 [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc Matthias Klose
@ 2016-11-30 8:30 ` Andreas Schwab
2016-11-30 10:06 ` Matthias Klose
0 siblings, 1 reply; 14+ messages in thread
From: Andreas Schwab @ 2016-11-30 8:30 UTC (permalink / raw)
To: Matthias Klose; +Cc: GCC Patches, Andrew Pinski, Nicola Pero, Jeff Law
configure: error: no --with-target-bdw-gc options and no bdw-gc pkg-config module found
make[1]: *** [Makefile:19775: configure-target-libobjc] Error 1
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc
2016-11-30 8:30 ` Andreas Schwab
@ 2016-11-30 10:06 ` Matthias Klose
2016-11-30 10:11 ` Andreas Schwab
2016-11-30 10:17 ` Richard Biener
0 siblings, 2 replies; 14+ messages in thread
From: Matthias Klose @ 2016-11-30 10:06 UTC (permalink / raw)
To: Andreas Schwab; +Cc: GCC Patches, Andrew Pinski, Nicola Pero, Jeff Law
On 30.11.2016 09:29, Andreas Schwab wrote:
> configure: error: no --with-target-bdw-gc options and no bdw-gc pkg-config module found
> make[1]: *** [Makefile:19775: configure-target-libobjc] Error 1
>
> Andreas.
that's a bit terse. Could you send the complete output for the configuration of
the libobjc subdir and the config.log?
I assume that is a configuration with --enable-objc-gc and then the pkg-config
module cannot be found. Are gc/gc.h and libgc.so in standard paths without
having the bdw-gc pkg-config module available? Which libgc version is installed?
Thanks, Matthias
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc
2016-11-30 10:06 ` Matthias Klose
@ 2016-11-30 10:11 ` Andreas Schwab
2016-11-30 10:17 ` Richard Biener
1 sibling, 0 replies; 14+ messages in thread
From: Andreas Schwab @ 2016-11-30 10:11 UTC (permalink / raw)
To: Matthias Klose; +Cc: GCC Patches, Andrew Pinski, Nicola Pero, Jeff Law
On Nov 30 2016, Matthias Klose <doko@ubuntu.com> wrote:
> I assume that is a configuration with --enable-objc-gc
No.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc
2016-11-30 10:06 ` Matthias Klose
2016-11-30 10:11 ` Andreas Schwab
@ 2016-11-30 10:17 ` Richard Biener
2016-11-30 10:53 ` Jakub Jelinek
1 sibling, 1 reply; 14+ messages in thread
From: Richard Biener @ 2016-11-30 10:17 UTC (permalink / raw)
To: Matthias Klose
Cc: Andreas Schwab, GCC Patches, Andrew Pinski, Nicola Pero, Jeff Law
On Wed, Nov 30, 2016 at 11:06 AM, Matthias Klose <doko@ubuntu.com> wrote:
> On 30.11.2016 09:29, Andreas Schwab wrote:
>> configure: error: no --with-target-bdw-gc options and no bdw-gc pkg-config module found
>> make[1]: *** [Makefile:19775: configure-target-libobjc] Error 1
>>
>> Andreas.
>
> that's a bit terse. Could you send the complete output for the configuration of
> the libobjc subdir and the config.log?
>
> I assume that is a configuration with --enable-objc-gc and then the pkg-config
> module cannot be found. Are gc/gc.h and libgc.so in standard paths without
> having the bdw-gc pkg-config module available? Which libgc version is installed?
I see the same failure with just
../configure --enable-languages=objc
usually we disable languages (with a diagnostic) if requirements
cannot be fulfilled.
But it seems the default chosen is bad somehow... (and breaks my bootstraps with
default languages).
Richard.
> Thanks, Matthias
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc
2016-11-30 10:17 ` Richard Biener
@ 2016-11-30 10:53 ` Jakub Jelinek
2016-11-30 11:13 ` Matthias Klose
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Jakub Jelinek @ 2016-11-30 10:53 UTC (permalink / raw)
To: Richard Biener
Cc: Matthias Klose, Andreas Schwab, GCC Patches, Andrew Pinski,
Nicola Pero, Jeff Law
On Wed, Nov 30, 2016 at 11:17:32AM +0100, Richard Biener wrote:
> On Wed, Nov 30, 2016 at 11:06 AM, Matthias Klose <doko@ubuntu.com> wrote:
> > On 30.11.2016 09:29, Andreas Schwab wrote:
> >> configure: error: no --with-target-bdw-gc options and no bdw-gc pkg-config module found
> >> make[1]: *** [Makefile:19775: configure-target-libobjc] Error 1
> >>
> >> Andreas.
> >
> > that's a bit terse. Could you send the complete output for the configuration of
> > the libobjc subdir and the config.log?
> >
> > I assume that is a configuration with --enable-objc-gc and then the pkg-config
> > module cannot be found. Are gc/gc.h and libgc.so in standard paths without
> > having the bdw-gc pkg-config module available? Which libgc version is installed?
>
> I see the same failure with just
>
> ../configure --enable-languages=objc
>
> usually we disable languages (with a diagnostic) if requirements
> cannot be fulfilled.
>
> But it seems the default chosen is bad somehow... (and breaks my bootstraps with
> default languages).
I'm now testing the default (no --enable-objc-gc, --enable-objc-gc=*,
--disable-objc-gc) with. Ok for trunk if it succeeds?
2016-11-30 Jakub Jelinek <jakub@redhat.com>
* configure.ac (--enable-objc-gc): If not given, default to
enable_objc_gc=no.
* configure: Regenerated.
--- libobjc/configure.ac.jj 2016-11-30 08:57:26.000000000 +0100
+++ libobjc/configure.ac 2016-11-30 11:47:33.085828683 +0100
@@ -203,7 +203,7 @@ gt_BITFIELD_TYPE_MATTERS
AC_ARG_ENABLE(objc-gc,
[AS_HELP_STRING([--enable-objc-gc],
[enable use of Boehm's garbage collector with the
- GNU Objective-C runtime])])
+ GNU Objective-C runtime])],,enable_objc_gc=no)
AC_ARG_WITH([target-bdw-gc],
[AS_HELP_STRING([--with-target-bdw-gc=PATHLIST],
[specify prefix directory for installed bdw-gc package.
--- libobjc/configure.jj 2016-11-30 08:57:26.000000000 +0100
+++ libobjc/configure 2016-11-30 11:47:44.720680375 +0100
@@ -11509,6 +11509,8 @@ $as_echo "#define HAVE_BITFIELD_TYPE_MAT
# Check whether --enable-objc-gc was given.
if test "${enable_objc_gc+set}" = set; then :
enableval=$enable_objc_gc;
+else
+ enable_objc_gc=no
fi
Jakub
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc
2016-11-30 10:53 ` Jakub Jelinek
@ 2016-11-30 11:13 ` Matthias Klose
2016-11-30 11:30 ` Matthias Klose
2016-11-30 11:37 ` Richard Biener
2 siblings, 0 replies; 14+ messages in thread
From: Matthias Klose @ 2016-11-30 11:13 UTC (permalink / raw)
To: Jakub Jelinek, Richard Biener
Cc: Andreas Schwab, GCC Patches, Andrew Pinski, Nicola Pero, Jeff Law
On 30.11.2016 11:52, Jakub Jelinek wrote:
> On Wed, Nov 30, 2016 at 11:17:32AM +0100, Richard Biener wrote:
>> On Wed, Nov 30, 2016 at 11:06 AM, Matthias Klose <doko@ubuntu.com> wrote:
>>> On 30.11.2016 09:29, Andreas Schwab wrote:
>>>> configure: error: no --with-target-bdw-gc options and no bdw-gc pkg-config module found
>>>> make[1]: *** [Makefile:19775: configure-target-libobjc] Error 1
>>>>
>>>> Andreas.
>>>
>>> that's a bit terse. Could you send the complete output for the configuration of
>>> the libobjc subdir and the config.log?
>>>
>>> I assume that is a configuration with --enable-objc-gc and then the pkg-config
>>> module cannot be found. Are gc/gc.h and libgc.so in standard paths without
>>> having the bdw-gc pkg-config module available? Which libgc version is installed?
>>
>> I see the same failure with just
>>
>> ../configure --enable-languages=objc
>>
>> usually we disable languages (with a diagnostic) if requirements
>> cannot be fulfilled.
>>
>> But it seems the default chosen is bad somehow... (and breaks my bootstraps with
>> default languages).
>
> I'm now testing the default (no --enable-objc-gc, --enable-objc-gc=*,
> --disable-objc-gc) with. Ok for trunk if it succeeds?
>
> 2016-11-30 Jakub Jelinek <jakub@redhat.com>
>
> * configure.ac (--enable-objc-gc): If not given, default to
> enable_objc_gc=no.
> * configure: Regenerated.
>
> --- libobjc/configure.ac.jj 2016-11-30 08:57:26.000000000 +0100
> +++ libobjc/configure.ac 2016-11-30 11:47:33.085828683 +0100
> @@ -203,7 +203,7 @@ gt_BITFIELD_TYPE_MATTERS
> AC_ARG_ENABLE(objc-gc,
> [AS_HELP_STRING([--enable-objc-gc],
> [enable use of Boehm's garbage collector with the
> - GNU Objective-C runtime])])
> + GNU Objective-C runtime])],,enable_objc_gc=no)
> AC_ARG_WITH([target-bdw-gc],
> [AS_HELP_STRING([--with-target-bdw-gc=PATHLIST],
> [specify prefix directory for installed bdw-gc package.
> --- libobjc/configure.jj 2016-11-30 08:57:26.000000000 +0100
> +++ libobjc/configure 2016-11-30 11:47:44.720680375 +0100
> @@ -11509,6 +11509,8 @@ $as_echo "#define HAVE_BITFIELD_TYPE_MAT
> # Check whether --enable-objc-gc was given.
> if test "${enable_objc_gc+set}" = set; then :
> enableval=$enable_objc_gc;
> +else
> + enable_objc_gc=no
> fi
>
I can confirm, that this works for any configureation not enabling the objc-gc.
I found another issue with enabling objc-gc, but your patch restores the
standard bootstrap.
Matthias
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc
2016-11-30 10:53 ` Jakub Jelinek
2016-11-30 11:13 ` Matthias Klose
@ 2016-11-30 11:30 ` Matthias Klose
2016-11-30 11:38 ` Richard Biener
2016-11-30 11:37 ` Richard Biener
2 siblings, 1 reply; 14+ messages in thread
From: Matthias Klose @ 2016-11-30 11:30 UTC (permalink / raw)
To: Jakub Jelinek, Richard Biener
Cc: Andreas Schwab, GCC Patches, Andrew Pinski, Nicola Pero, Jeff Law
[-- Attachment #1: Type: text/plain, Size: 2691 bytes --]
On 30.11.2016 11:52, Jakub Jelinek wrote:
> On Wed, Nov 30, 2016 at 11:17:32AM +0100, Richard Biener wrote:
>> On Wed, Nov 30, 2016 at 11:06 AM, Matthias Klose <doko@ubuntu.com> wrote:
>>> On 30.11.2016 09:29, Andreas Schwab wrote:
>>>> configure: error: no --with-target-bdw-gc options and no bdw-gc pkg-config module found
>>>> make[1]: *** [Makefile:19775: configure-target-libobjc] Error 1
>>>>
>>>> Andreas.
>>>
>>> that's a bit terse. Could you send the complete output for the configuration of
>>> the libobjc subdir and the config.log?
>>>
>>> I assume that is a configuration with --enable-objc-gc and then the pkg-config
>>> module cannot be found. Are gc/gc.h and libgc.so in standard paths without
>>> having the bdw-gc pkg-config module available? Which libgc version is installed?
>>
>> I see the same failure with just
>>
>> ../configure --enable-languages=objc
>>
>> usually we disable languages (with a diagnostic) if requirements
>> cannot be fulfilled.
>>
>> But it seems the default chosen is bad somehow... (and breaks my bootstraps with
>> default languages).
>
> I'm now testing the default (no --enable-objc-gc, --enable-objc-gc=*,
> --disable-objc-gc) with. Ok for trunk if it succeeds?
>
> 2016-11-30 Jakub Jelinek <jakub@redhat.com>
>
> * configure.ac (--enable-objc-gc): If not given, default to
> enable_objc_gc=no.
> * configure: Regenerated.
>
> --- libobjc/configure.ac.jj 2016-11-30 08:57:26.000000000 +0100
> +++ libobjc/configure.ac 2016-11-30 11:47:33.085828683 +0100
> @@ -203,7 +203,7 @@ gt_BITFIELD_TYPE_MATTERS
> AC_ARG_ENABLE(objc-gc,
> [AS_HELP_STRING([--enable-objc-gc],
> [enable use of Boehm's garbage collector with the
> - GNU Objective-C runtime])])
> + GNU Objective-C runtime])],,enable_objc_gc=no)
> AC_ARG_WITH([target-bdw-gc],
> [AS_HELP_STRING([--with-target-bdw-gc=PATHLIST],
> [specify prefix directory for installed bdw-gc package.
> --- libobjc/configure.jj 2016-11-30 08:57:26.000000000 +0100
> +++ libobjc/configure 2016-11-30 11:47:44.720680375 +0100
> @@ -11509,6 +11509,8 @@ $as_echo "#define HAVE_BITFIELD_TYPE_MAT
> # Check whether --enable-objc-gc was given.
> if test "${enable_objc_gc+set}" = set; then :
> enableval=$enable_objc_gc;
> +else
> + enable_objc_gc=no
> fi
There's one more fix needed for the case of only having the pkg-config module
installed when configuring with --enable-objc-gc. We can't use PKG_CHECK_MODULES
directly because the pkg.m4 macros choke on the dash in the module name. Thus
setting the CFLAGS and LIBS directly. Ok to install?
* configure.ac: Set BDW_GC_CFLAGS and BDW_GC_LIBS after checking
for the existence of the pkg-config modules.
* Regenerate.
[-- Attachment #2: bdw-gc.diff --]
[-- Type: text/x-diff, Size: 663 bytes --]
--- libobjc/configure.ac (Revision 243006)
+++ libobjc/configure.ac (Arbeitskopie)
@@ -225,7 +225,9 @@
if test "x$with_target_bdw_gc$with_target_bdw_gc_include$with_target_bdw_gc_lib" = x; then
dnl no bdw-gw options, fall back to the bdw-gc pkg-config module
PKG_CHECK_EXISTS(bdw-gc,
- AC_MSG_RESULT([using bdw-gc pkg-config module]),
+ [AC_MSG_RESULT([using bdw-gc pkg-config module])
+ BDW_GC_CFLAGS=`$PKG_CONFIG --cflags bdw-gc`
+ BDW_GC_LIBS=`$PKG_CONFIG --libs bdw-gc`],
AC_MSG_ERROR([no --with-target-bdw-gc options and no bdw-gc pkg-config module found]))
else
dnl bdw-gw options passed by configure flags
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc
2016-11-30 10:53 ` Jakub Jelinek
2016-11-30 11:13 ` Matthias Klose
2016-11-30 11:30 ` Matthias Klose
@ 2016-11-30 11:37 ` Richard Biener
2 siblings, 0 replies; 14+ messages in thread
From: Richard Biener @ 2016-11-30 11:37 UTC (permalink / raw)
To: Jakub Jelinek
Cc: Matthias Klose, Andreas Schwab, GCC Patches, Andrew Pinski,
Nicola Pero, Jeff Law
On Wed, Nov 30, 2016 at 11:52 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Nov 30, 2016 at 11:17:32AM +0100, Richard Biener wrote:
>> On Wed, Nov 30, 2016 at 11:06 AM, Matthias Klose <doko@ubuntu.com> wrote:
>> > On 30.11.2016 09:29, Andreas Schwab wrote:
>> >> configure: error: no --with-target-bdw-gc options and no bdw-gc pkg-config module found
>> >> make[1]: *** [Makefile:19775: configure-target-libobjc] Error 1
>> >>
>> >> Andreas.
>> >
>> > that's a bit terse. Could you send the complete output for the configuration of
>> > the libobjc subdir and the config.log?
>> >
>> > I assume that is a configuration with --enable-objc-gc and then the pkg-config
>> > module cannot be found. Are gc/gc.h and libgc.so in standard paths without
>> > having the bdw-gc pkg-config module available? Which libgc version is installed?
>>
>> I see the same failure with just
>>
>> ../configure --enable-languages=objc
>>
>> usually we disable languages (with a diagnostic) if requirements
>> cannot be fulfilled.
>>
>> But it seems the default chosen is bad somehow... (and breaks my bootstraps with
>> default languages).
>
> I'm now testing the default (no --enable-objc-gc, --enable-objc-gc=*,
> --disable-objc-gc) with. Ok for trunk if it succeeds?
Ok.
Thanks,
Richard.
> 2016-11-30 Jakub Jelinek <jakub@redhat.com>
>
> * configure.ac (--enable-objc-gc): If not given, default to
> enable_objc_gc=no.
> * configure: Regenerated.
>
> --- libobjc/configure.ac.jj 2016-11-30 08:57:26.000000000 +0100
> +++ libobjc/configure.ac 2016-11-30 11:47:33.085828683 +0100
> @@ -203,7 +203,7 @@ gt_BITFIELD_TYPE_MATTERS
> AC_ARG_ENABLE(objc-gc,
> [AS_HELP_STRING([--enable-objc-gc],
> [enable use of Boehm's garbage collector with the
> - GNU Objective-C runtime])])
> + GNU Objective-C runtime])],,enable_objc_gc=no)
> AC_ARG_WITH([target-bdw-gc],
> [AS_HELP_STRING([--with-target-bdw-gc=PATHLIST],
> [specify prefix directory for installed bdw-gc package.
> --- libobjc/configure.jj 2016-11-30 08:57:26.000000000 +0100
> +++ libobjc/configure 2016-11-30 11:47:44.720680375 +0100
> @@ -11509,6 +11509,8 @@ $as_echo "#define HAVE_BITFIELD_TYPE_MAT
> # Check whether --enable-objc-gc was given.
> if test "${enable_objc_gc+set}" = set; then :
> enableval=$enable_objc_gc;
> +else
> + enable_objc_gc=no
> fi
>
>
> Jakub
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc
2016-11-30 11:30 ` Matthias Klose
@ 2016-11-30 11:38 ` Richard Biener
2016-11-30 12:08 ` Matthias Klose
2016-11-30 16:54 ` Matthias Klose
0 siblings, 2 replies; 14+ messages in thread
From: Richard Biener @ 2016-11-30 11:38 UTC (permalink / raw)
To: Matthias Klose
Cc: Jakub Jelinek, Andreas Schwab, GCC Patches, Andrew Pinski,
Nicola Pero, Jeff Law
On Wed, Nov 30, 2016 at 12:30 PM, Matthias Klose <doko@ubuntu.com> wrote:
> On 30.11.2016 11:52, Jakub Jelinek wrote:
>> On Wed, Nov 30, 2016 at 11:17:32AM +0100, Richard Biener wrote:
>>> On Wed, Nov 30, 2016 at 11:06 AM, Matthias Klose <doko@ubuntu.com> wrote:
>>>> On 30.11.2016 09:29, Andreas Schwab wrote:
>>>>> configure: error: no --with-target-bdw-gc options and no bdw-gc pkg-config module found
>>>>> make[1]: *** [Makefile:19775: configure-target-libobjc] Error 1
>>>>>
>>>>> Andreas.
>>>>
>>>> that's a bit terse. Could you send the complete output for the configuration of
>>>> the libobjc subdir and the config.log?
>>>>
>>>> I assume that is a configuration with --enable-objc-gc and then the pkg-config
>>>> module cannot be found. Are gc/gc.h and libgc.so in standard paths without
>>>> having the bdw-gc pkg-config module available? Which libgc version is installed?
>>>
>>> I see the same failure with just
>>>
>>> ../configure --enable-languages=objc
>>>
>>> usually we disable languages (with a diagnostic) if requirements
>>> cannot be fulfilled.
>>>
>>> But it seems the default chosen is bad somehow... (and breaks my bootstraps with
>>> default languages).
>>
>> I'm now testing the default (no --enable-objc-gc, --enable-objc-gc=*,
>> --disable-objc-gc) with. Ok for trunk if it succeeds?
>>
>> 2016-11-30 Jakub Jelinek <jakub@redhat.com>
>>
>> * configure.ac (--enable-objc-gc): If not given, default to
>> enable_objc_gc=no.
>> * configure: Regenerated.
>>
>> --- libobjc/configure.ac.jj 2016-11-30 08:57:26.000000000 +0100
>> +++ libobjc/configure.ac 2016-11-30 11:47:33.085828683 +0100
>> @@ -203,7 +203,7 @@ gt_BITFIELD_TYPE_MATTERS
>> AC_ARG_ENABLE(objc-gc,
>> [AS_HELP_STRING([--enable-objc-gc],
>> [enable use of Boehm's garbage collector with the
>> - GNU Objective-C runtime])])
>> + GNU Objective-C runtime])],,enable_objc_gc=no)
>> AC_ARG_WITH([target-bdw-gc],
>> [AS_HELP_STRING([--with-target-bdw-gc=PATHLIST],
>> [specify prefix directory for installed bdw-gc package.
>> --- libobjc/configure.jj 2016-11-30 08:57:26.000000000 +0100
>> +++ libobjc/configure 2016-11-30 11:47:44.720680375 +0100
>> @@ -11509,6 +11509,8 @@ $as_echo "#define HAVE_BITFIELD_TYPE_MAT
>> # Check whether --enable-objc-gc was given.
>> if test "${enable_objc_gc+set}" = set; then :
>> enableval=$enable_objc_gc;
>> +else
>> + enable_objc_gc=no
>> fi
>
> There's one more fix needed for the case of only having the pkg-config module
> installed when configuring with --enable-objc-gc. We can't use PKG_CHECK_MODULES
> directly because the pkg.m4 macros choke on the dash in the module name. Thus
> setting the CFLAGS and LIBS directly. Ok to install?
Why not fix pkg.m4?
Richard.
> * configure.ac: Set BDW_GC_CFLAGS and BDW_GC_LIBS after checking
> for the existence of the pkg-config modules.
> * Regenerate.
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc
2016-11-30 11:38 ` Richard Biener
@ 2016-11-30 12:08 ` Matthias Klose
2016-11-30 16:54 ` Matthias Klose
1 sibling, 0 replies; 14+ messages in thread
From: Matthias Klose @ 2016-11-30 12:08 UTC (permalink / raw)
To: Richard Biener
Cc: Jakub Jelinek, Andreas Schwab, GCC Patches, Andrew Pinski,
Nicola Pero, Jeff Law
[-- Attachment #1: Type: text/plain, Size: 692 bytes --]
On 30.11.2016 12:38, Richard Biener wrote:
> On Wed, Nov 30, 2016 at 12:30 PM, Matthias Klose <doko@ubuntu.com> wrote:
>> There's one more fix needed for the case of only having the pkg-config module
>> installed when configuring with --enable-objc-gc. We can't use PKG_CHECK_MODULES
>> directly because the pkg.m4 macros choke on the dash in the module name. Thus
>> setting the CFLAGS and LIBS directly. Ok to install?
>
> Why not fix pkg.m4?
as discussed on irc, now avoiding the use pkg-config, and assuming that libgc is
available in default locations when no --with-target-bdw-gc flags are given.
Checked with --enable-objc-gc and --enabled-objc-gc=auto. Ok to install?
Matthias
[-- Attachment #2: no-pkg.diff --]
[-- Type: text/x-diff, Size: 3005 bytes --]
<toplevel>
* configure.ac: Don't use pkg-config to check for bdw-gc.
config/
* pkg.m4: Remove.
libobjc/
* configure.ac: Don't use pkg-config to check for bdw-gc.
gcc/
* doc/install.texi: Don't use pkg-config to check for bdw-gc.
Index: configure.ac
===================================================================
--- configure.ac (Revision 243006)
+++ configure.ac (Arbeitskopie)
@@ -29,7 +29,6 @@
m4_include([ltversion.m4])
m4_include([lt~obsolete.m4])
m4_include([config/isl.m4])
-m4_include([config/pkg.m4])
AC_INIT(move-if-change)
AC_PREREQ(2.64)
@@ -2076,10 +2075,8 @@
case ,${enable_languages},:${enable_objc_gc} in *,objc,*:yes|*,objc,*:auto)
AC_MSG_CHECKING([for bdw garbage collector])
if test "x$with_target_bdw_gc$with_target_bdw_gc_include$with_target_bdw_gc_lib" = x; then
- dnl no bdw-gw options, fall back to the bdw-gc pkg-config module
- PKG_CHECK_EXISTS(bdw-gc,
- AC_MSG_RESULT([using bdw-gc pkg-config module]),
- AC_MSG_ERROR([no --with-target-bdw-gc options and no bdw-gc pkg-config module found]))
+ dnl no bdw-gw options, assume default locations
+ AC_MSG_RESULT([using bdw-gc in default locations])
else
dnl bdw-gw options, first error checking, complete checking in libobjc
if test "x$with_target_bdw_gc_include" = x && test "x$with_target_bdw_gc_lib" != x; then
Index: gcc/doc/install.texi
===================================================================
--- gcc/doc/install.texi (Revision 243006)
+++ gcc/doc/install.texi (Arbeitskopie)
@@ -2204,8 +2204,7 @@
@option{--with-target-bdw-gc-lib} must always be specified together
for each multilib variant and they take precedence over
@option{--with-target-bdw-gc}. If none of these options are
-specified, the values are taken from the @command{pkg-config}
-@samp{bdw-gc} module.
+specified, the library is assumed in default locations.
@end table
@html
Index: libobjc/configure.ac
===================================================================
--- libobjc/configure.ac (Revision 243006)
+++ libobjc/configure.ac (Arbeitskopie)
@@ -18,8 +18,6 @@
#along with GCC; see the file COPYING3. If not see
#<http://www.gnu.org/licenses/>.
-m4_include([../config/pkg.m4])
-
AC_PREREQ(2.64)
AC_INIT(package-unused, version-unused,, libobjc)
AC_CONFIG_SRCDIR([objc/objc.h])
@@ -223,10 +221,9 @@
*)
AC_MSG_CHECKING([for bdw garbage collector])
if test "x$with_target_bdw_gc$with_target_bdw_gc_include$with_target_bdw_gc_lib" = x; then
- dnl no bdw-gw options, fall back to the bdw-gc pkg-config module
- PKG_CHECK_EXISTS(bdw-gc,
- AC_MSG_RESULT([using bdw-gc pkg-config module]),
- AC_MSG_ERROR([no --with-target-bdw-gc options and no bdw-gc pkg-config module found]))
+ dnl no bdw-gw options, assuming bdw-gc in default locations
+ BDW_GC_CFLAGS=
+ BDW_GC_LIBS="-lgc"
else
dnl bdw-gw options passed by configure flags
if test "x$with_target_bdw_gc_include" = x && test "x$with_target_bdw_gc_lib" != x; then
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc
2016-11-30 11:38 ` Richard Biener
2016-11-30 12:08 ` Matthias Klose
@ 2016-11-30 16:54 ` Matthias Klose
2016-11-30 17:27 ` Jeff Law
1 sibling, 1 reply; 14+ messages in thread
From: Matthias Klose @ 2016-11-30 16:54 UTC (permalink / raw)
To: Richard Biener
Cc: Jakub Jelinek, Andreas Schwab, GCC Patches, Andrew Pinski,
Nicola Pero, Jeff Law
On 30.11.2016 12:38, Richard Biener wrote:
> On Wed, Nov 30, 2016 at 12:30 PM, Matthias Klose <doko@ubuntu.com> wrote:
>> There's one more fix needed for the case of only having the pkg-config module
>> installed when configuring with --enable-objc-gc. We can't use PKG_CHECK_MODULES
>> directly because the pkg.m4 macros choke on the dash in the module name. Thus
>> setting the CFLAGS and LIBS directly. Ok to install?
>
> Why not fix pkg.m4?
>
> Richard.
Jakub suggested to avoid using pkg-config at all, so we can get rid off this
code altogether.
To re-enable bootstrap with --enable-objc-gc enabled, I checked in this change
as a stop-gap:
>> * configure.ac: Set BDW_GC_CFLAGS and BDW_GC_LIBS after checking
>> for the existence of the pkg-config modules.
>> * Regenerate.
Matthias
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc
2016-11-30 16:54 ` Matthias Klose
@ 2016-11-30 17:27 ` Jeff Law
2016-12-01 12:32 ` Matthias Klose
0 siblings, 1 reply; 14+ messages in thread
From: Jeff Law @ 2016-11-30 17:27 UTC (permalink / raw)
To: Matthias Klose, Richard Biener
Cc: Jakub Jelinek, Andreas Schwab, GCC Patches, Andrew Pinski, Nicola Pero
On 11/30/2016 09:53 AM, Matthias Klose wrote:
> On 30.11.2016 12:38, Richard Biener wrote:
>> On Wed, Nov 30, 2016 at 12:30 PM, Matthias Klose <doko@ubuntu.com> wrote:
>>> There's one more fix needed for the case of only having the pkg-config module
>>> installed when configuring with --enable-objc-gc. We can't use PKG_CHECK_MODULES
>>> directly because the pkg.m4 macros choke on the dash in the module name. Thus
>>> setting the CFLAGS and LIBS directly. Ok to install?
>>
>> Why not fix pkg.m4?
>>
>> Richard.
>
> Jakub suggested to avoid using pkg-config at all, so we can get rid off this
> code altogether.
I thought we'd OK'd pkg-config (for JIT) which is why I didn't call it out.
Looking now, pkg-config got NAKd there and was removed.
Jeff
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc
2016-11-30 17:27 ` Jeff Law
@ 2016-12-01 12:32 ` Matthias Klose
0 siblings, 0 replies; 14+ messages in thread
From: Matthias Klose @ 2016-12-01 12:32 UTC (permalink / raw)
To: Jeff Law, Richard Biener
Cc: Jakub Jelinek, Andreas Schwab, GCC Patches, Andrew Pinski, Nicola Pero
On 30.11.2016 18:26, Jeff Law wrote:
> On 11/30/2016 09:53 AM, Matthias Klose wrote:
>> On 30.11.2016 12:38, Richard Biener wrote:
>>> On Wed, Nov 30, 2016 at 12:30 PM, Matthias Klose <doko@ubuntu.com> wrote:
>>>> There's one more fix needed for the case of only having the pkg-config module
>>>> installed when configuring with --enable-objc-gc. We can't use
>>>> PKG_CHECK_MODULES
>>>> directly because the pkg.m4 macros choke on the dash in the module name. Thus
>>>> setting the CFLAGS and LIBS directly. Ok to install?
>>>
>>> Why not fix pkg.m4?
>>>
>>> Richard.
>>
>> Jakub suggested to avoid using pkg-config at all, so we can get rid off this
>> code altogether.
> I thought we'd OK'd pkg-config (for JIT) which is why I didn't call it out.
>
> Looking now, pkg-config got NAKd there and was removed.
ok, removed again.
Matthias
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2016-12-01 12:32 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-22 20:44 [patch] boehm-gc removal and libobjc changes to build with an external bdw-gc Matthias Klose
2016-11-30 8:30 ` Andreas Schwab
2016-11-30 10:06 ` Matthias Klose
2016-11-30 10:11 ` Andreas Schwab
2016-11-30 10:17 ` Richard Biener
2016-11-30 10:53 ` Jakub Jelinek
2016-11-30 11:13 ` Matthias Klose
2016-11-30 11:30 ` Matthias Klose
2016-11-30 11:38 ` Richard Biener
2016-11-30 12:08 ` Matthias Klose
2016-11-30 16:54 ` Matthias Klose
2016-11-30 17:27 ` Jeff Law
2016-12-01 12:32 ` Matthias Klose
2016-11-30 11:37 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).