summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2021-07-26 00:27:02 +0300
committerIvan Maidanski <ivmai@mail.ru>2021-07-26 00:27:02 +0300
commit06e4efff9949a670d41e4455ca1d4eee3d9ba58c (patch)
treedd7b2478380b2e681be0ee27c3b60a30f2b5e7c9
parentabf191cbf9a6d7608ee6afa3b8b900c06f2f047b (diff)
downloadbdwgc-06e4efff9949a670d41e4455ca1d4eee3d9ba58c.tar.gz
Install gc_gcj.h and gc_pthread_redirects.h only if appropriate
gc_gcj.h should not be installed if support for gcj is off. gc_pthread_redirects.h should not be installed if threads support is off or not based on pthread library. * CMakeLists.txt [install_headers] (FILES): Install include/gc_gcj.h only if enable_gcj_support; install include/gc_pthread_redirects.h only if enable_threads AND CMAKE_USE_PTHREADS_INIT. * Makefile.am (libgc_la_SOURCES): Remove gcj_mlc.c unless ENABLE_GCJ_SUPPORT. * Makefile.am [PTHREADS] (pkginclude_HEADERS): Add include/gc_pthread_redirects.h. * Makefile.am [ENABLE_GCJ_SUPPORT] (pkginclude_HEADERS): Add include/gc_gcj.h. * configure.ac (ENABLE_GCJ_SUPPORT): New AM conditional. * include/include.am (pkginclude_HEADERS): Remove gc_gcj.h and gc_pthread_redirects.h.
-rw-r--r--CMakeLists.txt10
-rw-r--r--Makefile.am8
-rw-r--r--configure.ac2
-rw-r--r--include/include.am2
4 files changed, 16 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1aa0c4b6..282c8b1e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -551,10 +551,8 @@ if (install_headers)
install(FILES include/gc.h
include/gc_backptr.h
include/gc_config_macros.h
- include/gc_gcj.h
include/gc_inline.h
include/gc_mark.h
- include/gc_pthread_redirects.h
include/gc_tiny_fl.h
include/gc_typed.h
include/gc_version.h
@@ -573,6 +571,14 @@ if (install_headers)
install(FILES include/gc_disclaim.h
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/gc")
endif()
+ if (enable_gcj_support)
+ install(FILES include/gc_gcj.h
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/gc")
+ endif()
+ if (enable_threads AND CMAKE_USE_PTHREADS_INIT)
+ install(FILES include/gc_pthread_redirects.h
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/gc")
+ endif()
if (build_cord)
install(FILES include/cord.h
include/cord_pos.h
diff --git a/Makefile.am b/Makefile.am
index 9041b0cb..bc38e391 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -70,7 +70,7 @@ else
EXTRA_DIST += extra/gc.c
libgc_la_SOURCES = \
allchblk.c alloc.c blacklst.c dbg_mlc.c \
- dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c \
+ dyn_load.c finalize.c gc_dlopen.c headers.c \
mach_dep.c malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
obj_map.c os_dep.c ptr_chck.c reclaim.c specific.c typd_mlc.c
@@ -83,6 +83,7 @@ else
if PTHREADS
# Not Cygwin or MinGW.
libgc_la_SOURCES += pthread_start.c pthread_support.c
+pkginclude_HEADERS += include/gc_pthread_redirects.h
if DARWIN_THREADS
libgc_la_SOURCES += darwin_stop_world.c
else
@@ -103,6 +104,11 @@ if CHECKSUMS
libgc_la_SOURCES += checksums.c
endif
+if ENABLE_GCJ_SUPPORT
+libgc_la_SOURCES += gcj_mlc.c
+pkginclude_HEADERS += include/gc_gcj.h
+endif
+
if ENABLE_DISCLAIM
libgc_la_SOURCES += fnlz_mlc.c
pkginclude_HEADERS += include/gc_disclaim.h
diff --git a/configure.ac b/configure.ac
index a908d530..eb0b582c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -678,7 +678,6 @@ dnl Interface Selection
dnl -------------------
dnl
dnl By default, make the library as general as possible.
-dnl enable_gcj_support=no
AC_ARG_ENABLE(gcj-support,
[AS_HELP_STRING([--disable-gcj-support], [disable support for gcj])])
if test x"$enable_gcj_support" != xno; then
@@ -697,6 +696,7 @@ if test x"$enable_gcj_support" != xno; then
;;
esac
fi
+AM_CONDITIONAL(ENABLE_GCJ_SUPPORT, [test x"enable_gcj_support" != xno])
dnl Interaction with other programs that might use signals.
AC_ARG_ENABLE(sigrt-signals,
diff --git a/include/include.am b/include/include.am
index 0345e3e6..66353a33 100644
--- a/include/include.am
+++ b/include/include.am
@@ -16,10 +16,8 @@ pkginclude_HEADERS += \
include/gc.h \
include/gc_backptr.h \
include/gc_config_macros.h \
- include/gc_gcj.h \
include/gc_inline.h \
include/gc_mark.h \
- include/gc_pthread_redirects.h \
include/gc_tiny_fl.h \
include/gc_typed.h \
include/gc_version.h \