Kaydet (Commit) cb276236 authored tarafından David Tardon's avatar David Tardon

gbuildify zlib

Change-Id: I702c044fdf510c67364f2fc32889ca394583edf6
üst b4b5376a
......@@ -203,6 +203,7 @@ xmlreader\
xmlscript\
xmlsecurity\
xsltml\
zlib\
dmake_modules:=\
berkeleydb\
......@@ -247,7 +248,6 @@ setup_native\
stlport\
sysui\
xpdf\
zlib\
export gb_TAILBUILDTARGET=all slowcheck
......
......@@ -167,23 +167,46 @@ $(call gb_LinkTarget_add_libs,$(1),-lz)
endef
# nothing on system
define gb_LinkTarget__use_zlib_x64
endef
else # !SYSTEM_ZLIB
$(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
zlib \
zlib_x64 \
))
define gb_LinkTarget__use_zlib
define gb_LinkTarget__use_zlib_multiarch
$(if $(2),,$(call gb_Output_error,gb_LinkTarget__use_zlib_multiarch needs two arguments))
$(call gb_LinkTarget_use_packages,$(1),\
zlib_inc \
)
$(call gb_LinkTarget_set_include,$(1),\
-I$(OUTDIR)/inc/external/zlib \
$$(INCLUDE) \
)
$(call gb_LinkTarget_use_static_libraries,$(1),\
zlib \
$(2) \
)
endef
define gb_LinkTarget__use_zlib
$(call gb_LinkTarget__use_zlib_multiarch,$(1),zlib)
endef
define gb_LinkTarget__use_zlib_x64
$(call gb_LinkTarget__use_zlib_multiarch,$(1),zlib_x64)
endef
endif # SYSTEM_ZLIB
......
......@@ -705,3 +705,4 @@ export XSLTML_TARBALL=@XSLTML_TARBALL@
export XSLTPROC=@XSLTPROC@
export ZLIB_CFLAGS=@ZLIB_CFLAGS@
export ZLIB_LIBS=@ZLIB_LIBS@
export ZLIB_TARBALL=@ZLIB_TARBALL@
......@@ -6837,12 +6837,14 @@ else
BUILD_TYPE="$BUILD_TYPE ZLIB"
ZLIB_CFLAGS="-I${OUTDIR}/inc/external/zlib"
ZLIB_LIBS="-L${OUTDIR}/lib -lz"
ZLIB_TARBALL="2ab442d169156f34c379c968f3f482dd-zlib-1.2.7.tar.bz2"
fi
AC_SUBST(ZLIB_CFLAGS)
AC_SUBST(ZLIB_LIBS)
AC_SUBST(SYSTEM_ZLIB)
AC_SUBST([SYSTEM_MINIZIP])
AC_SUBST([MINGW_MINIZIP_DLL])
AC_SUBST(ZLIB_TARBALL)
dnl ===================================================================
dnl Check for system jpeg
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_ExternalPackage_ExternalPackage,zlib_inc,zlib))
$(eval $(call gb_ExternalPackage_add_unpacked_files,zlib_inc,inc/external/zlib,\
zconf.h \
zlib.h \
))
# vim: set noet sw=4 ts=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
include $(module_directory)/../solenv/gbuild/partial_build.mk
# vim: set noet sw=4 ts=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
ifneq ($(SYSTEM_ZLIB),YES)
$(eval $(call gb_Module_Module,zlib))
$(eval $(call gb_Module_add_targets,zlib,\
ExternalPackage_zlib \
StaticLibrary_zlib \
UnpackedTarball_zlib \
))
ifeq ($(BUILD_X64),TRUE)
$(eval $(call gb_Module_add_targets,zlib,\
StaticLibrary_zlib_x64 \
))
endif
endif
# vim: set noet sw=4 ts=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_StaticLibrary_StaticLibrary,zlib))
$(eval $(call gb_StaticLibrary_use_unpacked,zlib,zlib))
$(eval $(call gb_StaticLibrary_set_warnings_not_errors,zlib))
$(eval $(call gb_StaticLibrary_add_generated_cobjects,zlib,\
UnpackedTarball/zlib/adler32 \
UnpackedTarball/zlib/compress \
UnpackedTarball/zlib/crc32 \
UnpackedTarball/zlib/deflate \
UnpackedTarball/zlib/inffast \
UnpackedTarball/zlib/inflate \
UnpackedTarball/zlib/inftrees \
UnpackedTarball/zlib/trees \
UnpackedTarball/zlib/zutil \
))
# vim: set noet sw=4 ts=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_StaticLibrary_StaticLibrary,zlib_x64))
$(eval $(call gb_StaticLibrary_set_x64,zlib,YES))
$(eval $(call gb_StaticLibrary_use_unpacked,zlib_x64,zlib))
$(eval $(call gb_StaticLibrary_set_warnings_not_errors,zlib_x64))
$(eval $(call gb_StaticLibrary_set_include,zlib_x64,\
-I$(call gb_UnpackedTarball_get_dir,zlib) \
$$(INCLUDE) \
))
$(eval $(call gb_StaticLibrary_add_x64_generated_cobjects,zlib_x64,\
UnpackedTarball/zlib/x64/adler32 \
UnpackedTarball/zlib/x64/compress \
UnpackedTarball/zlib/x64/crc32 \
UnpackedTarball/zlib/x64/deflate \
UnpackedTarball/zlib/x64/inffast \
UnpackedTarball/zlib/x64/inflate \
UnpackedTarball/zlib/x64/inftrees \
UnpackedTarball/zlib/x64/trees \
UnpackedTarball/zlib/x64/zutil \
))
# vim: set noet sw=4 ts=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_UnpackedTarball_UnpackedTarball,zlib))
$(eval $(call gb_UnpackedTarball_set_tarball,zlib,$(ZLIB_TARBALL)))
$(eval $(call gb_UnpackedTarball_set_post_action,zlib,\
mkdir -p x64 && \
cp $(addsuffix .c,adler32 compress crc32 deflate inffast inflate inftrees trees zutil) x64 \
))
# vim: set noet sw=4 ts=4:
:
eval 'exec perl -S $0 ${1+"$@"}'
if 0;
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
#
# make_patched_header - make patched header
#
use strict;
use File::Basename;
use File::Path;
use Carp;
my $patched_file = shift @ARGV;
$patched_file =~ s/\\/\//g;
my $module = shift @ARGV;
my $patch_dir = dirname($patched_file);
my $orig_file = $patched_file;
$orig_file =~ s/\/patched\//\//;
if (!-f $orig_file) { carp("Cannot find file $orig_file\n"); };
if (!-d $patch_dir) {
mkpath($patch_dir, 0, 0775);
if (!-d $patch_dir) {("mkdir: could not create directory $patch_dir\n"); };
};
open(PATCHED_FILE, ">$patched_file") or carp("Cannot open file $patched_file\n");
open(ORIG_FILE, "<$orig_file") or carp("Cannot open file $orig_file\n");
foreach (<ORIG_FILE>) {
if (/#include\s*"(\w+\.h\w*)"/) {
my $include = $1;
s/#include "$include"/#include <$module\/$include>/g;
};
print PATCHED_FILE $_;
};
close PATCHED_FILE;
close ORIG_FILE;
exit(0);
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
PRJ=.
PRJNAME=zlib
TARGET=zlib
.IF "$(GUI)" == "UNX"
.IF "$(SYSTEM_ZLIB)" == "YES"
all:
@echo "An already available installation of zlib should exist on your system."
@echo "Therefore the version provided here does not need to be built in addition."
.ENDIF
.ENDIF
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
# --- Files --------------------------------------------------------
TARFILE_NAME=zlib-1.2.7
TARFILE_MD5=2ab442d169156f34c379c968f3f482dd
PATCH_FILES=zlib-dmakebuild.patch
ADDITIONAL_FILES=makefile.mk
#relative to CONFIGURE_DIR
BUILD_DIR=$(CONFIGURE_DIR)
BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS)
OUT2INC= \
zlib.h \
zconf.h
PATCHED_HEADERS=$(INCCOM)$/patched$/zlib.h
# --- Targets ------------------------------------------------------
.INCLUDE : set_ext.mk
.INCLUDE : target.mk
.INCLUDE : tg_ext.mk
ALLTAR: $(PATCHED_HEADERS)
$(PATCHED_HEADERS) : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
@$(PERL) make_patched_header.pl $@ $(PRJNAME)
mkdir: %_DEST%\inc\external\zlib
mkdir: %_DEST%\lib\x64
..\%__SRC%\inc\patched\zlib.h %_DEST%\inc\external\zlib\zlib.h
..\%__SRC%\inc\zconf.h %_DEST%\inc\external\zlib\zconf.h
..\%__SRC%\lib\libzlib.a %_DEST%\lib\libzlib.a
..\%__SRC%\slb\zlib.lib %_DEST%\lib\zlib.lib
..\%__SRC%\slb\zlib.lin %_DEST%\lib\zlib.lin
..\%__SRC%\slb\x64\zlib.lib %_DEST%\lib\x64\zlib.lib
..\%__SRC%\slb\x64\zlib.lin %_DEST%\lib\x64\zlib.lin
--- misc/zlib-1.2.7/makefile.mk Fri Mar 14 10:17:06 2008
+++ misc/build/zlib-1.2.7/makefile.mk Fri Mar 14 10:16:56 2008
@@ -1 +1,64 @@
-dummy
+#*************************************************************************
+#
+# Copyright according the GNU Public License.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..$/..
+
+PRJNAME=zlib
+TARGET=zlib
+LIBTARGET=NO
+EXTERNAL_WARNINGS_NOT_ERRORS=TRUE
+UWINAPILIB=
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files --------------------------------------------------------
+
+INCEXT=contrib$/minizip
+
+SLOFILES= $(SLO)$/adler32.obj \
+ $(SLO)$/compress.obj \
+ $(SLO)$/deflate.obj \
+ $(SLO)$/crc32.obj \
+ $(SLO)$/inffast.obj \
+ $(SLO)$/inflate.obj \
+ $(SLO)$/inftrees.obj \
+ $(SLO)$/trees.obj \
+ $(SLO)$/zutil.obj
+
+
+LIB1TARGET=$(SLB)$/$(TARGET).lib
+LIB1ARCHIV=$(LB)$/lib$(TARGET).a
+LIB1OBJFILES=$(SLOFILES)
+
+.IF "$(BUILD_X64)"!=""
+SLOFILES_X64= $(SLO_X64)$/adler32.obj \
+ $(SLO_X64)$/compress.obj \
+ $(SLO_X64)$/deflate.obj \
+ $(SLO_X64)$/crc32.obj \
+ $(SLO_X64)$/inffast.obj \
+ $(SLO_X64)$/inflate.obj \
+ $(SLO_X64)$/inftrees.obj \
+ $(SLO_X64)$/trees.obj \
+ $(SLO_X64)$/zutil.obj
+
+LIB1TARGET_X64=$(SLB_X64)$/$(TARGET).lib
+LIB1OBJFILES_X64=$(SLOFILES_X64)
+.ENDIF # "$(BUILD_X64)"!=""
+
+
+# --- Targets ------------------------------------------------------
+
+$(MISC)$/%.c : contrib$/minizip$/%.c
+ @echo ------------------------------
+ @echo Making: $@
+ @$(COPY) $< $@
+
+.INCLUDE : set_wntx64.mk
+.INCLUDE : target.mk
+.INCLUDE : tg_wntx64.mk
+
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment