summaryrefslogtreecommitdiff
path: root/zlib
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2012-10-26 15:33:26 +0200
committerDavid Tardon <dtardon@redhat.com>2012-10-26 17:33:30 +0200
commitcb2762360fc6edb6afe52759550979ce5068b9b0 (patch)
tree1c54a88a91458f94cdde87a70312021f235643b6 /zlib
parentb4b5376afc9d8bb9299ed267db2c4177e4b10969 (diff)
gbuildify zlib
Change-Id: I702c044fdf510c67364f2fc32889ca394583edf6
Diffstat (limited to 'zlib')
-rw-r--r--zlib/ExternalPackage_zlib.mk17
-rw-r--r--zlib/Makefile14
-rw-r--r--zlib/Module_zlib.mk28
-rw-r--r--zlib/StaticLibrary_zlib.mk28
-rw-r--r--zlib/StaticLibrary_zlib_x64.mk35
-rw-r--r--zlib/UnpackedTarball_zlib.mk19
-rwxr-xr-xzlib/make_patched_header.pl66
-rw-r--r--zlib/makefile.mk73
-rw-r--r--zlib/prj/d.lst11
-rw-r--r--zlib/prj/dmake0
-rw-r--r--zlib/zlib-dmakebuild.patch68
11 files changed, 141 insertions, 218 deletions
diff --git a/zlib/ExternalPackage_zlib.mk b/zlib/ExternalPackage_zlib.mk
new file mode 100644
index 000000000000..15571a1f4fef
--- /dev/null
+++ b/zlib/ExternalPackage_zlib.mk
@@ -0,0 +1,17 @@
+# -*- 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:
diff --git a/zlib/Makefile b/zlib/Makefile
new file mode 100644
index 000000000000..0997e628485b
--- /dev/null
+++ b/zlib/Makefile
@@ -0,0 +1,14 @@
+# -*- 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:
diff --git a/zlib/Module_zlib.mk b/zlib/Module_zlib.mk
new file mode 100644
index 000000000000..446e07edc24c
--- /dev/null
+++ b/zlib/Module_zlib.mk
@@ -0,0 +1,28 @@
+# -*- 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:
diff --git a/zlib/StaticLibrary_zlib.mk b/zlib/StaticLibrary_zlib.mk
new file mode 100644
index 000000000000..69e7017db63f
--- /dev/null
+++ b/zlib/StaticLibrary_zlib.mk
@@ -0,0 +1,28 @@
+# -*- 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:
diff --git a/zlib/StaticLibrary_zlib_x64.mk b/zlib/StaticLibrary_zlib_x64.mk
new file mode 100644
index 000000000000..cd250054bd39
--- /dev/null
+++ b/zlib/StaticLibrary_zlib_x64.mk
@@ -0,0 +1,35 @@
+# -*- 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:
diff --git a/zlib/UnpackedTarball_zlib.mk b/zlib/UnpackedTarball_zlib.mk
new file mode 100644
index 000000000000..fa476b918b7c
--- /dev/null
+++ b/zlib/UnpackedTarball_zlib.mk
@@ -0,0 +1,19 @@
+# -*- 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:
diff --git a/zlib/make_patched_header.pl b/zlib/make_patched_header.pl
deleted file mode 100755
index 41dbdc5fbb96..000000000000
--- a/zlib/make_patched_header.pl
+++ /dev/null
@@ -1,66 +0,0 @@
-:
-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);
-
-
diff --git a/zlib/makefile.mk b/zlib/makefile.mk
deleted file mode 100644
index 7a677e50cdb2..000000000000
--- a/zlib/makefile.mk
+++ /dev/null
@@ -1,73 +0,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)
diff --git a/zlib/prj/d.lst b/zlib/prj/d.lst
index ef40caf49c44..e69de29bb2d1 100644
--- a/zlib/prj/d.lst
+++ b/zlib/prj/d.lst
@@ -1,11 +0,0 @@
-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
diff --git a/zlib/prj/dmake b/zlib/prj/dmake
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/zlib/prj/dmake
+++ /dev/null
diff --git a/zlib/zlib-dmakebuild.patch b/zlib/zlib-dmakebuild.patch
deleted file mode 100644
index 7a3abb31ccbd..000000000000
--- a/zlib/zlib-dmakebuild.patch
+++ /dev/null
@@ -1,68 +0,0 @@
---- 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
-+