diff --git a/configure.ac b/configure.ac index c6b5fd947..c960d3b11 100644 --- a/configure.ac +++ b/configure.ac @@ -673,6 +673,8 @@ if test "x$TCL_PACKAGE_PATH" = x; then LIBS="$LIBS -lgc"]) fi fi +AM_CONDITIONAL([HAVE_LIBGC_WANTED], [test "x$TCL_PACKAGE_PATH" = x && test "x$enable_gc" = xyes]) + # check, if we have sigsetjmp and siglongjmp. # A trivial AC_CHECK_FUNCS(sigsetjmp) won't do because sigsetjmp() might be a # macro declared in . (joze) diff --git a/src/misc/Makefile.am b/src/misc/Makefile.am index 79e2c9523..09d4a6581 100644 --- a/src/misc/Makefile.am +++ b/src/misc/Makefile.am @@ -4,8 +4,6 @@ noinst_LTLIBRARIES = libmisc.la libmisc_la_SOURCES = \ - alloc.c \ - alloc.h \ dup2.c \ dstring.c \ dup2.h \ @@ -39,6 +37,11 @@ libmisc_la_SOURCES += getopt_long_bsd.c getopt_bsd.h endif endif +### alloc.c ### +if !HAVE_LIBGC_WANTED +libmisc_la_SOURCES += alloc.c alloc.h +endif + AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include AM_CFLAGS = $(STATIC) diff --git a/src/misc/alloc.c b/src/misc/alloc.c index 7c76dd995..8d5e14eb1 100644 --- a/src/misc/alloc.c +++ b/src/misc/alloc.c @@ -13,8 +13,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. extern void controlled_exit(int status); #endif -#ifndef HAVE_LIBGC - /*saj For Tcl module locking*/ #ifdef TCL_MODULE #include @@ -114,5 +112,3 @@ txfree(void *ptr) Tcl_MutexUnlock(alloc); #endif } - -#endif