From 37130d2b5edab108b05a29cd71b7476ff0bed172 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Mon, 4 Oct 2004 07:05:07 +0000 Subject: Provide support for auto-detection and use of compression libraries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16643 91177308-0d34-0410-b5e6-96231b3b80d8 --- Makefile.config.in | 4 ++++ Makefile.rules | 20 ++++++++++++++------ autoconf/configure.ac | 2 ++ configure | 8 +++++++- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Makefile.config.in b/Makefile.config.in index 6b579fc..8a5d54c 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -155,6 +155,10 @@ ifndef SourceDir SourceDir=$(BUILD_SRC_DIR) endif +# Handle configured libraries +HAVE_BZIP2 := @HAVE_BZIP2@ +HAVE_ZILB := @HAVE_ZLIB@ + # Installation directories, as provided by the configure script. exec_prefix = @exec_prefix@ prefix = @prefix@ diff --git a/Makefile.rules b/Makefile.rules index 76b00ae..adf5ef9 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -463,8 +463,8 @@ $(sysconfdir): $(MKDIR) $(sysconfdir) install-config-files: $(sysconfdir) $(CONFIG_FILES) - $(VERB) echo Installing Configuration Files To $(sysconfdir) - $(VERB) for file in $(CONFIG_FILES); do \ + $(VERB)$(ECHO) Installing Configuration Files To $(sysconfdir) + $(VERB)for file in $(CONFIG_FILES); do \ $(INSTALL) $(SourceDir)/$${file} $(sysconfdir) ; \ done endif @@ -527,7 +527,7 @@ install-bytecode-library:: $(DESTDIR)$(bytecode_libdir)/lib$(LIBRARYNAME).bc $(DESTDIR)$(bytecode_libdir)/lib$(LIBRARYNAME).bc: $(LIBNAME_BC) $(DESTDIR)$(bytecode_libdir) @${ECHO} ======= Installing $(LIBRARYNAME) bytecode library ======= - cp $< $@ + $(VERB)cp $< $@ # Does the library want a .o version built? ifndef DONT_BUILD_RELINKED @@ -593,7 +593,7 @@ install-dynamic-library: $(LIBNAME_CUR) # $(LIBNAME_AO): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir @${ECHO} Linking $(LIBRARYNAME) archive release library - @$(RM) -f $@ + $(VERB)$(RM) -f $@ $(VERB) $(Link) -03 -o $@ $(ObjectsO) $(LibSubDirs) -static @${ECHO} Finished building $(LIBRARYNAME) archive release library ======= @@ -656,6 +656,13 @@ endif # ifdef TOOLNAME +# Handle compression libraries automatically +ifeq ($(HAVE_BZIP2),1) +USEDLIBS += bz2.a +endif +ifeq ($(HAVE_ZLIB),1) +USEDLIBS += z.a +endif # TOOLEXENAME* - These compute the output filenames to generate... TOOLEXENAME_G := $(DESTTOOLDEBUG)/$(TOOLNAME) TOOLEXENAME_O := $(DESTTOOLRELEASE)/$(TOOLNAME) @@ -728,8 +735,9 @@ $(TOOLEXENAME_P): $(ObjectsP) $(USED_LIB_PATHS_P) $(LLVM_LIB_PATHS_P) $(DESTTOOL @${ECHO} ======= Finished building $(TOOLNAME) profile executable ======= install:: $(TOOLEXENAMES) - $(MKDIR) $(DESTDIR)$(bindir) - $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) -c -m 0755 $(TOOLEXENAMES) $(DESTDIR)$(bindir)/$(TOOLNAME) + @${ECHO} Installing $(TOOLEXENAMES) to $(DESTDIR)$(bindir) + $(VERB)$(MKDIR) $(DESTDIR)$(bindir) + $(VERB)$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) -c -m 0755 $(TOOLEXENAMES) $(DESTDIR)$(bindir)/$(TOOLNAME) endif diff --git a/autoconf/configure.ac b/autoconf/configure.ac index f0ffcb5..bdc3151 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -250,6 +250,8 @@ AC_CHECK_LIB(elf, elf_begin) dnl Check for bzip2 and zlib compression libraries needed for archive reading/writing AC_CHECK_LIB(bz2,BZ2_bzCompressInit,[bzip2_found=1],[bzip2_found=0]) AC_CHECK_LIB(z,gzopen,[zlib_found=1],[zlib_found=0]) +AC_SUBST([HAVE_ZLIB],$zlib_found) +AC_SUBST([HAVE_BZIP2],$bzip2_found) if test $zlib_found -eq 1 ; then AC_DEFINE([HAVE_ZLIB],[1],[Define if zlib library is available on this platform.]) fi diff --git a/configure b/configure index 06f7af7..7d19a77 100755 --- a/configure +++ b/configure @@ -473,7 +473,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS subdirs INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVMGCCDIR ARCH CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL DOT ETAGS ETAGSFLAGS PYTHON QMTEST ENDIAN ALLOCA MMAP_FILE ENABLE_OPTIMIZED JIT LLVMCC1 LLVMCC1PLUS SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS subdirs INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVMGCCDIR ARCH CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL DOT ETAGS ETAGSFLAGS PYTHON QMTEST HAVE_ZLIB HAVE_BZIP2 ENDIAN ALLOCA MMAP_FILE ENABLE_OPTIMIZED JIT LLVMCC1 LLVMCC1PLUS SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -19339,6 +19339,10 @@ else zlib_found=0 fi +HAVE_ZLIB=$zlib_found + +HAVE_BZIP2=$bzip2_found + if test $zlib_found -eq 1 ; then cat >>confdefs.h <<\_ACEOF @@ -24853,6 +24857,8 @@ s,@ETAGS@,$ETAGS,;t t s,@ETAGSFLAGS@,$ETAGSFLAGS,;t t s,@PYTHON@,$PYTHON,;t t s,@QMTEST@,$QMTEST,;t t +s,@HAVE_ZLIB@,$HAVE_ZLIB,;t t +s,@HAVE_BZIP2@,$HAVE_BZIP2,;t t s,@ENDIAN@,$ENDIAN,;t t s,@ALLOCA@,$ALLOCA,;t t s,@MMAP_FILE@,$MMAP_FILE,;t t -- cgit v1.1