Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gzip support, take 2 #2509

Merged
merged 9 commits into from
Jun 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ cache:
- packages-master.tar.gz

install:
- '%CYG_ROOT%\setup-%CYG_ARCH%.exe -qnNdO -R %CYG_ROOT% -s http://cygwin.mirror.constant.com -l %CYG_ROOT%/var/cache/setup -P libgmp-devel'
- '%CYG_ROOT%\setup-%CYG_ARCH%.exe -qnNdO -R %CYG_ROOT% -s http://cygwin.mirror.constant.com -l %CYG_ROOT%/var/cache/setup -P libgmp-devel,zlib-devel'

# scripts that run after cloning repository
build_script:
Expand Down
5 changes: 5 additions & 0 deletions GNUmakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ GMP_CPPFLAGS = @GMP_CPPFLAGS@
GMP_LDFLAGS = @GMP_LDFLAGS@
GMP_LIBS = @GMP_LIBS@

BUILD_ZLIB = @BUILD_ZLIB@
ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
ZLIB_LIBS = @ZLIB_LIBS@

READLINE_CPPFLAGS = @READLINE_CPPFLAGS@
READLINE_LDFLAGS = @READLINE_LDFLAGS@
READLINE_LIBS = @READLINE_LIBS@
Expand Down
34 changes: 34 additions & 0 deletions Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,13 @@ GAP_PKG_CPPFLAGS += $(DEFS)

# Add flags for dependencies
GAP_CPPFLAGS += $(GMP_CPPFLAGS)
GAP_CPPFLAGS += $(ZLIB_CPPFLAGS)
GAP_CPPFLAGS += $(READLINE_CPPFLAGS)
GAP_CPPFLAGS += $(BOEHM_GC_CPPFLAGS)
GAP_CPPFLAGS += $(LIBATOMIC_OPS_CPPFLAGS)

GAP_PKG_CPPFLAGS += $(GMP_CPPFLAGS)
GAP_PKG_CPPFLAGS += $(ZLIB_CPPFLAGS)
GAP_PKG_CPPFLAGS += $(READLINE_CPPFLAGS)
GAP_PKG_CPPFLAGS += $(BOEHM_GC_CPPFLAGS)
GAP_PKG_CPPFLAGS += $(LIBATOMIC_OPS_CPPFLAGS)
Expand Down Expand Up @@ -193,6 +195,7 @@ GAP_LDFLAGS = $(ABI_CFLAGS)

# Add flags for dependencies
GAP_LDFLAGS += $(GMP_LDFLAGS)
GAP_LDFLAGS += $(ZLIB_LDFLAGS)
GAP_LDFLAGS += $(READLINE_LDFLAGS)
GAP_LDFLAGS += $(BOEHM_GC_LDFLAGS)
GAP_LDFLAGS += $(LIBATOMIC_OPS_LDFLAGS)
Expand All @@ -210,6 +213,7 @@ GAP_LIBS =

# Add flags for dependencies
GAP_LIBS += $(GMP_LIBS)
GAP_LIBS += $(ZLIB_LIBS)
GAP_LIBS += $(READLINE_LIBS)
GAP_LIBS += $(BOEHM_GC_LIBS)
GAP_LIBS += $(LIBATOMIC_OPS_LIBS)
Expand Down Expand Up @@ -540,6 +544,36 @@ gmp:
endif # BUILD_GMP


#
# ZLIB
#
ifeq ($(BUILD_ZLIB),yes)

ZLIB_BUILDDIR := extern/build/zlib
ZLIB_PREFIX := extern/install/zlib
# ZLIB_PREREQ := $(ZLIB_BUILDDIR)/config.status
ZLIB_FILES := $(ZLIB_PREFIX)/include/zlib.h

EXTERN_FILES += $(ZLIB_FILES)

zlib: $(ZLIB_FILES)
$(ZLIB_FILES):
MAKE=$(MAKE) CFLAGS="$(CFLAGS) $(ABI_CFLAGS)" $(srcdir)/cnf/build-extern.sh zlib "$(abs_srcdir)/extern/zlib"

.PHONY: zlib

# TODO: add clean, distclean, check targets?
# TODO: pass on cachfile?
# TODO: pass on certain *FLAGS ?

else

zlib:
echo "Using external zlib, nothing to do be done"

endif # BUILD_ZLIB


#
# libatomic_ops
#
Expand Down
60 changes: 60 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,66 @@ dnl remove this eventually.
AC_DEFINE([USE_GMP], [1], [for backwards compatibility])


dnl Find zlib
AC_ARG_WITH([zlib],
[AS_HELP_STRING([--with-zlib@<:@=builtin|PREFIX@:>@],
[prefix of zlib installation. e.g. /usr/local; specify `builtin' to let GAP builds its own version of zlib])],
[],[with_zlib=yes])

BUILD_ZLIB=no
ZLIB_CPPFLAGS=
ZLIB_LDFLAGS=
ZLIB_LIBS="-lz"
AS_CASE([$with_zlib],
[builtin],[
# user explicitly requested to use builtin zlib
BUILD_ZLIB=yes
AC_MSG_NOTICE([Using bundled zlib])
],
[no],[
AC_MSG_ERROR([Building without zlib is not supported])
],
[system],[with_zlib=yes], dnl supported for backwards compatibility with old build system
[yes],[],
[*],[
ZLIB_CPPFLAGS="-I${with_zlib}/include"
ZLIB_LDFLAGS="-L${with_zlib}/lib"
]
)

AS_IF([test $BUILD_ZLIB = no],
[
# try to link against zlib
AX_CHECK_LIBRARY([ZLIB], [zlib.h], [z], [inflateEnd])
AS_IF([test $ax_cv_have_ZLIB = no],[
AS_IF([test "x$with_zlib" = "xyes"],[
BUILD_ZLIB=yes
AC_MSG_NOTICE([No usable zlib found, switching to included zlib])
],
[AC_MSG_ERROR([zlib not found at prefix $with_zlib])]
)
])
])

# Use bundled zlib if requested
AS_IF([test x$BUILD_ZLIB = xyes],[
AS_CASE([$host_os],
[*cygwin*],[
AC_MSG_ERROR([Builtin zlib not supported on cygwin. Install zlib-devel package])
]
)
BUILD_ZLIB=yes
ZLIB_CPPFLAGS='-I${abs_builddir}/extern/install/zlib/include'
ZLIB_LDFLAGS='${abs_builddir}/extern/install/zlib/lib/libz.a'
ZLIB_LIBS=
])

AC_SUBST([BUILD_ZLIB])
AC_SUBST([ZLIB_CPPFLAGS])
AC_SUBST([ZLIB_LDFLAGS])
AC_SUBST([ZLIB_LIBS])


dnl Find GNU readline
AC_ARG_WITH([readline],
[AS_HELP_STRING([--with-readline@<:@=PREFIX@:>@],
Expand Down
Loading