Check-in [4ad42dd533]
Overview
Comment:Migrated zlib to new build script
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4ad42dd533905a7284657e7e1c08a335f9955918
User & Date: rkeene on 2016-09-06 03:43:46
Other Links: manifest | tags
Context
2016-09-06
03:44
Updated to not print a spurious error to the kitsh build log when Tk is not built check-in: a23f2effdc user: rkeene tags: trunk
03:43
Migrated zlib to new build script check-in: 4ad42dd533 user: rkeene tags: trunk
03:43
Updated to always create output directory check-in: 229a39bab1 user: rkeene tags: trunk
Changes

Modified zlib/build.sh from [9b9da94e1d] to [b64777234b].

1
2
3
4
5

6
7
8
9
10
11
12
13
14

15
16
17


18
19
20
21
22
23
24
25
26
27
28
29

30
31
32

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

54
55
56
57

58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74

75
76
77
78
79
80
81
82
83
84


85
86
87


88

1
2



3




4




5



6
7




8







9



10





















11


12

13





14
15

16
17
18
19
20




21






22
23


24
25



26
27

28


-
-
-
+
-
-
-
-

-
-
-
-
+
-
-
-
+
+
-
-
-
-

-
-
-
-
-
-
-
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-

-
+
-
-
-
-
-


-





-
-
-
-
+
-
-
-
-
-
-


-
-
+
+
-
-
-
+
+
-
+
#! /usr/bin/env bash

if [ ! -f 'build.sh' ]; then
	echo 'ERROR: This script must be run from the directory it is in' >&2

# BuildCompatible: KitCreator
	exit 1
fi
if [ -z "${TCLVERS}" ]; then
	echo 'ERROR: The TCLVERS environment variable is not set' >&2

	exit 1
fi

ZLIBVERS="1.2.8"
version="1.2.8"
SRC="src/zlib-${ZLIBVERS}.tar.gz"
SRCURL="http://sourceforge.net/projects/libpng/files/zlib/${ZLIBVERS}/zlib-${ZLIBVERS}.tar.gz/download"
SRCHASH='36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d'
url="http://sourceforge.net/projects/libpng/files/zlib/${version}/zlib-${version}.tar.gz"
sha256='36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d'
BUILDDIR="$(pwd)/build/zlib-${ZLIBVERS}"
OUTDIR="$(pwd)/out"
INSTDIR="$(pwd)/inst"
export ZLIBVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR

# Set configure options for this sub-project
LDFLAGS="${LDFLAGS} ${KC_ZLIB_LDFLAGS}"
CFLAGS="${CFLAGS} ${KC_ZLIB_CFLAGS}"
CPPFLAGS="${CPPFLAGS} ${KC_ZLIB_CPPFLAGS}"
LIBS="${LIBS} ${KC_ZLIB_LIBS}"
export LDFLAGS CFLAGS CPPFLAGS LIBS

function configure() {
rm -rf 'build' 'out' 'inst'
mkdir 'build' 'out' 'inst' || exit 1

	case "$(uname -s 2>/dev/null | dd conv=lcase 2>/dev/null)" in
if [ ! -f "${SRC}" ]; then
	mkdir 'src' >/dev/null 2>/dev/null

	if [ ! -d 'buildsrc' ]; then
		download "${SRCURL}" "${SRC}" "${SRCHASH}" || exit 1
	fi
fi

(
	cd 'build' || exit 1

	if [ ! -d '../buildsrc' ]; then
		gzip -dc "../${SRC}" | tar -xf -
	else
		cp -rp ../buildsrc/* './'
	fi

	cd "${BUILDDIR}" || exit 1

	case $(uname -s 2> /dev/null) in
		MINGW* | mingw*)
		mingw*)
			# use win32/Makefile.gcc instead.
			echo "Running: cp win32/Makefile.gcc Makefile"
			cp win32/Makefile.gcc Makefile

			make_extra=(BINARY_PATH="${installdir}/bin" INCLUDE_PATH="${installdir}/include" LIBRARY_PATH="${installdir}/lib")
			echo "Running: ${MAKE:-make}"
			${MAKE:-make} || exit 1

			echo "Running: BINARY_PATH=${INSTDIR}/bin INCLUDE_PATH=${INSTDIR}/include LIBRARY_PATH=${INSTDIR}/lib ${MAKE:-make} install"
			BINARY_PATH=${INSTDIR}/bin INCLUDE_PATH=${INSTDIR}/include LIBRARY_PATH=${INSTDIR}/lib ${MAKE:-make} install
			;;
		*)
			# If we are building for KitDLL, compile with '-fPIC'
			if [ "${KITTARGET}" = "kitdll" ]; then
				CFLAGS="${CFLAGS} -fPIC"
				export CFLAGS
			fi

			# We don't pass CONFIGUREEXTRA here, since this isn't a GNU autoconf
			# script and will puke
			echo "Running: ./configure --prefix=\"${INSTDIR}\" --libdir=\"${INSTDIR}/lib\" --static"
			./configure --prefix="${INSTDIR}" --libdir="${INSTDIR}/lib" --static
			./configure --prefix="${installdir}" --libdir="${installdir}/lib" --static

			echo "Running: ${MAKE:-make}"
			${MAKE:-make} || exit 1

			echo "Running: ${MAKE:-make} install"
			${MAKE:-make} install
			;;
	esac

	# We don't really care too much about failure in zlib
}

	exit 0
) || exit 1

function createruntime() {
	:
exit 0
}