From 43a55a8eb0046bc69a118d0a5fadbbecdafc03a3 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Wed, 3 May 2017 21:47:58 -0700 Subject: [PATCH] Allow the user to flip "--with-system-zlib" We need this to have different polarity for different platforms (Windows vs RedHat). I don't know how to autodetect this for now, so I'm just doing it manually. --- Makefile.in | 8 ++++---- configure | 35 ++++++++++++++++++++++++++++++++++- configure.ac | 11 +++++++++++ 3 files changed, 49 insertions(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index 33f8b640..61510300 100644 --- a/Makefile.in +++ b/Makefile.in @@ -153,7 +153,7 @@ stamps/build-gcc-linux-stage1: $(srcdir)/riscv-gcc stamps/build-binutils-linux \ --without-headers \ --disable-shared \ --disable-threads \ - --with-system-zlib \ + @with_system_zlib@ \ --enable-tls \ --enable-languages=c \ --disable-libatomic \ @@ -182,7 +182,7 @@ stamps/build-gcc-linux-stage2: $(srcdir)/riscv-gcc $(addprefix stamps/build-glib $(CONFIGURE_HOST) \ --prefix=$(INSTALL_DIR) \ --with-sysroot=$(SYSROOT) \ - --with-system-zlib \ + @with_system_zlib@ \ --enable-shared \ --enable-tls \ --enable-languages=c,c++,fortran \ @@ -223,7 +223,7 @@ stamps/build-gcc-newlib-stage1: $(srcdir)/riscv-gcc stamps/build-binutils-newlib --disable-threads \ --disable-tls \ --enable-languages=c,c++ \ - --with-system-zlib \ + @with_system_zlib@ \ --with-newlib \ --disable-libmudflap \ --disable-libssp \ @@ -264,7 +264,7 @@ stamps/build-gcc-newlib-stage2: $(srcdir)/riscv-gcc stamps/build-newlib --disable-shared \ --disable-threads \ --enable-languages=c,c++ \ - --with-system-zlib \ + @with_system_zlib@ \ --enable-tls \ --with-newlib \ --with-headers=$(INSTALL_DIR)/riscv$(XLEN)-unknown-elf/include \ diff --git a/configure b/configure index 0ebf2d54..6b7e218d 100755 --- a/configure +++ b/configure @@ -584,6 +584,7 @@ PACKAGE_URL='' ac_subst_vars='LTLIBOBJS LIBOBJS +with_system_zlib configure_host cmodel gcc_checking @@ -628,6 +629,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -658,6 +660,7 @@ enable_multilib enable_gcc_checking with_cmodel with_host +with_system_zlib ' ac_precious_vars='build_alias host_alias @@ -705,6 +708,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -957,6 +961,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1094,7 +1107,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1247,6 +1260,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1296,6 +1310,7 @@ Optional Packages: --with-host=x86_64-w64-mingw32 Sets the host for the tools, you probably want nothing + --without-system-zlib use the builtin copy of zlib from GCC Some influential environment variables: CC C compiler command @@ -3343,6 +3358,24 @@ else fi + +# Check whether --with-system-zlib was given. +if test "${with_system_zlib+set}" = set; then : + withval=$with_system_zlib; +else + with_system_zlib=yes + +fi + + +if test "x$with_system_zlib" != xno; then : + with_system_zlib=--with-system-zlib + +else + with_system_zlib=--without-system-zlib + +fi + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure diff --git a/configure.ac b/configure.ac index c0f3a9f6..01b72da7 100644 --- a/configure.ac +++ b/configure.ac @@ -135,4 +135,15 @@ AS_IF([test "x$with_host" != xdefault], [AC_SUBST(configure_host,--host=$with_host)], [AC_SUBST(configure_host,"")]) +AC_ARG_WITH(system-zlib, + [AS_HELP_STRING([--without-system-zlib], + [use the builtin copy of zlib from GCC])], + [], + [with_system_zlib=yes] + ) + +AS_IF([test "x$with_system_zlib" != xno], + [AC_SUBST(with_system_zlib,--with-system-zlib)], + [AC_SUBST(with_system_zlib,--without-system-zlib)]) + AC_OUTPUT