From 95254aa27ea1eeb48be552fc2ad02e510e75775c Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 24 Oct 2007 19:03:42 -0700 Subject: [PATCH] v0_8: disable lxt support if libbzip2 is not found. Configure was checking for libbzip2, but it was not doing anything with the result. This patch disables lxt support if libbzip2 is not found. --- configure.in | 3 +++ vpi/Makefile.in | 5 ++++- vpi/configure.in | 3 +++ vpi/sys_table.c | 4 ++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index adac3bb93..8ea916137 100644 --- a/configure.in +++ b/configure.in @@ -59,9 +59,12 @@ AC_CHECK_LIB(z, gzwrite, HAVE_LIBZ=yes, HAVE_LIBZ=no) AC_SUBST(HAVE_LIBZ) if test "$WIN32" = "yes"; then AC_CHECK_LIB(bz2, main) +AC_CHECK_LIB(bz2, main, HAVE_LIBBZ2=yes, HAVE_LIBBZ2=no) else AC_CHECK_LIB(bz2, BZ2_bzdopen) +AC_CHECK_LIB(bz2, BZ2_bzdopen, HAVE_LIBBZ2=yes, HAVE_LIBBZ2=no) fi +AC_SUBST(HAVE_LIBBZ2) AC_MSG_CHECKING(for sys/times) AC_TRY_LINK( diff --git a/vpi/Makefile.in b/vpi/Makefile.in index 35d095547..cfb293663 100644 --- a/vpi/Makefile.in +++ b/vpi/Makefile.in @@ -69,7 +69,10 @@ sys_readmem.o sys_readmem_lex.o \ sys_time.o sys_vcd.o sys_vcdoff.o vcd_priv.o mt19937int.o priv.o stringheap.o ifeq (@HAVE_LIBZ@,yes) -O += sys_lxt.o lxt_write.o sys_lxt2.o lxt2_write.o +ifeq (@HAVE_LIBBZ2@,yes) +O += sys_lxt.o lxt_write.o +endif +O += sys_lxt2.o lxt2_write.o endif LIBS = @LIBS@ diff --git a/vpi/configure.in b/vpi/configure.in index edff1072f..172378351 100644 --- a/vpi/configure.in +++ b/vpi/configure.in @@ -35,9 +35,12 @@ AC_CHECK_LIB(z, gzwrite, HAVE_LIBZ=yes, HAVE_LIBZ=no) AC_SUBST(HAVE_LIBZ) if test "$WIN32" = "yes"; then AC_CHECK_LIB(bz2, main) +AC_CHECK_LIB(bz2, main, HAVE_LIBBZ2=yes, HAVE_LIBBZ2=no) else AC_CHECK_LIB(bz2, BZ2_bzdopen) +AC_CHECK_LIB(bz2, BZ2_bzdopen, HAVE_LIBBZ2=yes, HAVE_LIBBZ2=no) fi +AC_SUBST(HAVE_LIBBZ2) # -- # Look for a dl library to use. First look for the standard dlopen diff --git a/vpi/sys_table.c b/vpi/sys_table.c index fb4bd6285..4a42e6059 100644 --- a/vpi/sys_table.c +++ b/vpi/sys_table.c @@ -40,7 +40,11 @@ extern void sys_vcd_register(); extern void sys_vcdoff_register(); #ifdef HAVE_LIBZ +#ifdef HAVE_LIBBZ2 extern void sys_lxt_register(); +#else +static void sys_lxt_register() { fputs("LXT support disabled since libbzip2 not available\n",stderr); exit(1); } +#endif extern void sys_lxt2_register(); #else static void sys_lxt_register() { fputs("LXT support disabled since zlib not available\n",stderr); exit(1); }