master
1#!/bin/sh
2#***************************************************************************
3# _ _ ____ _
4# Project ___| | | | _ \| |
5# / __| | | | |_) | |
6# | (__| |_| | _ <| |___
7# \___|\___/|_| \_\_____|
8#
9# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
10#
11# This software is licensed as described in the file COPYING, which
12# you should have received as part of this distribution. The terms
13# are also available at https://curl.se/docs/copyright.html.
14#
15# You may opt to use, copy, modify, merge, publish, distribute and/or sell
16# copies of the Software, and permit persons to whom the Software is
17# furnished to do so, under the terms of the COPYING file.
18#
19# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20# KIND, either express or implied.
21#
22# SPDX-License-Identifier: curl
23#
24###########################################################################
26CLcommand()
27{
28 /usr/bin/system "${@}" || exit 1
29}
31setenv()
33{
34 # Define and export.
36 eval "${1}=${2}"
37 export "${1?}"
38}
41case "${SCRIPTDIR}" in
42/*) ;;
43*) SCRIPTDIR="$(pwd)/${SCRIPTDIR}"
44esac
46while true
47do case "${SCRIPTDIR}" in
48 */.) SCRIPTDIR="${SCRIPTDIR%/.}";;
49 *) break;;
50 esac
51done
53# The script directory is supposed to be in $TOPDIR/projects/os400.
55TOPDIR=$(dirname "${SCRIPTDIR}")
56TOPDIR=$(dirname "${TOPDIR}")
57export SCRIPTDIR TOPDIR
59# Extract the SONAME from the library makefile.
61SONAME="$(sed -e '/^VERSIONCHANGE=/!d;s/^.*=\([0-9]*\).*/\1/' \
62 < "${TOPDIR}/lib/Makefile.soname")"
63export SONAME
65# Get OS/400 configuration parameters.
67. "${SCRIPTDIR}/config400.default"
68if [ -f "${SCRIPTDIR}/config400.override" ]
69then . "${SCRIPTDIR}/config400.override"
70fi
72# Check if perl available.
73{ [ -n "${PASEPERL}" ] && [ -x "${PASEPERL}" ]; } || PASEPERL=
75# Need to get the version definitions.
77LIBCURL_VERSION=$(grep '^#define *LIBCURL_VERSION ' \
78 "${TOPDIR}/include/curl/curlver.h" |
79 sed 's/.*"\(.*\)".*/\1/')
80LIBCURL_VERSION_MAJOR=$(grep '^#define *LIBCURL_VERSION_MAJOR ' \
81 "${TOPDIR}/include/curl/curlver.h" |
82 sed 's/^#define *LIBCURL_VERSION_MAJOR *\([^ ]*\).*/\1/')
83LIBCURL_VERSION_MINOR=$(grep '^#define *LIBCURL_VERSION_MINOR ' \
84 "${TOPDIR}/include/curl/curlver.h" |
85 sed 's/^#define *LIBCURL_VERSION_MINOR *\([^ ]*\).*/\1/')
86LIBCURL_VERSION_PATCH=$(grep '^#define *LIBCURL_VERSION_PATCH ' \
87 "${TOPDIR}/include/curl/curlver.h" |
88 sed 's/^#define *LIBCURL_VERSION_PATCH *\([^ ]*\).*/\1/')
89LIBCURL_VERSION_NUM=$(grep '^#define *LIBCURL_VERSION_NUM ' \
90 "${TOPDIR}/include/curl/curlver.h" |
91 sed 's/^#define *LIBCURL_VERSION_NUM *0x\([^ ]*\).*/\1/')
92LIBCURL_TIMESTAMP=$(grep '^#define *LIBCURL_TIMESTAMP ' \
93 "${TOPDIR}/include/curl/curlver.h" |
94 sed 's/.*"\(.*\)".*/\1/')
95export LIBCURL_VERSION
96export LIBCURL_VERSION_MAJOR LIBCURL_VERSION_MINOR LIBCURL_VERSION_PATCH
97export LIBCURL_VERSION_NUM LIBCURL_TIMESTAMP
99################################################################################
100#
101# OS/400 specific definitions.
102#
103################################################################################
105LIBIFSNAME="/QSYS.LIB/${TARGETLIB}.LIB"
108################################################################################
109#
110# Procedures.
111#
112################################################################################
114# action_needed dest [src]
115#
116# dest is an object to build
117# if specified, src is an object on which dest depends.
118#
119# exit 0 (succeeds) if some action has to be taken, else 1.
121action_needed()
123{
124 [ ! -e "${1}" ] && return 0
125 [ -n "${2}" ] || return 1
126 # shellcheck disable=SC3013
127 [ "${1}" -ot "${2}" ] && return 0
128 return 1
129}
132# canonicalize_path path
133#
134# Return canonicalized path as:
135# - Absolute
136# - No . or .. component.
138canonicalize_path()
140{
141 if expr "${1}" : '^/' > /dev/null
142 then P="${1}"
143 else P="$(pwd)/${1}"
144 fi
146 R=
147 IFSSAVE="${IFS}"
148 IFS="/"
150 for C in ${P}
151 do IFS="${IFSSAVE}"
152 case "${C}" in
153 .) ;;
154 ..) R="$(expr "${R}" : '^\(.*/\)..*')"
155 ;;
156 ?*) R="${R}${C}/"
157 ;;
158 *) ;;
159 esac
160 done
162 IFS="${IFSSAVE}"
163 echo "/$(expr "${R}" : '^\(.*\)/')"
164}
167# make_module module_name source_name [additional_definitions]
168#
169# Compile source name into ASCII module if needed.
170# As side effect, append the module name to variable MODULES.
171# Set LINK to "YES" if the module has been compiled.
173make_module()
175{
176 MODULES="${MODULES} ${1}"
177 MODIFSNAME="${LIBIFSNAME}/${1}.MODULE"
178 action_needed "${MODIFSNAME}" "${2}" || return 0;
179 SRCDIR="$(dirname "$(canonicalize_path "${2}")")"
181 # #pragma convert has to be in the source file itself, i.e.
182 # putting it in an include file makes it only active
183 # for that include file.
184 # Thus we build a temporary file with the pragma prepended to
185 # the source file and we compile that temporary file.
187 {
188 echo "#line 1 \"${2}\""
189 echo "#pragma convert(819)"
190 echo "#line 1"
191 cat "${2}"
192 } > "${1}"__819.c
193 CMD="CRTCMOD MODULE(${TARGETLIB}/${1}) SRCSTMF('${1}__819.c')"
194 CMD="${CMD} SYSIFCOPT(*IFS64IO *ASYNCSIGNAL)"
195# CMD="${CMD} OPTION(*INCDIRFIRST *SHOWINC *SHOWSYS)"
196 CMD="${CMD} OPTION(*INCDIRFIRST)"
197 CMD="${CMD} LOCALETYPE(*LOCALE) FLAG(10)"
198 CMD="${CMD} INCDIR('${QADRTDIR}/include'"
199 CMD="${CMD} '${TOPDIR}/include/curl' '${TOPDIR}/include' '${SRCDIR}'"
200 CMD="${CMD} '${TOPDIR}/projects/OS400'"
202 if [ "${WITH_ZLIB}" != "0" ]
203 then CMD="${CMD} '${ZLIB_INCLUDE}'"
204 fi
206 if [ "${WITH_LIBSSH2}" != "0" ]
207 then CMD="${CMD} '${LIBSSH2_INCLUDE}'"
208 fi
210 CMD="${CMD} ${INCLUDES})"
211 CMD="${CMD} TGTCCSID(${TGTCCSID}) TGTRLS(${TGTRLS})"
212 CMD="${CMD} OUTPUT(${OUTPUT})"
213 CMD="${CMD} OPTIMIZE(${OPTIMIZE})"
214 CMD="${CMD} DBGVIEW(${DEBUG})"
216 DEFINES="${3} 'qadrt_use_inline'"
218 if [ "${WITH_ZLIB}" != "0" ]
219 then DEFINES="${DEFINES} HAVE_LIBZ"
220 fi
222 if [ "${WITH_LIBSSH2}" != "0" ]
223 then DEFINES="${DEFINES} USE_LIBSSH2"
224 fi
226 if [ -n "${DEFINES}" ]
227 then CMD="${CMD} DEFINE(${DEFINES})"
228 fi
230 CLcommand "${CMD}"
231 if [ "${DEBUG}" = "*NONE" ]
232 then rm -f "${1}"__819.c
233 fi
234 # shellcheck disable=SC2034
235 LINK=YES
236}
239# Determine DB2 object name from IFS name.
241db2_name()
243{
244 if [ "${2}" = 'nomangle' ]
245 then basename "${1}" |
246 tr 'a-z-' 'A-Z_' |
247 sed -e 's/\..*//' \
248 -e 's/^\(.\).*\(.........\)$/\1\2/'
249 else basename "${1}" |
250 tr 'a-z-' 'A-Z_' |
251 sed -e 's/\..*//' \
252 -e 's/^CURL_*/C/' \
253 -e 's/^TOOL_*/T/' \
254 -e 's/^\(.\).*\(.........\)$/\1\2/'
255 fi
256}
259# Copy IFS file replacing version info.
261versioned_copy()
263{
264 sed -e "s/@LIBCURL_VERSION@/${LIBCURL_VERSION}/g" \
265 -e "s/@LIBCURL_VERSION_MAJOR@/${LIBCURL_VERSION_MAJOR}/g" \
266 -e "s/@LIBCURL_VERSION_MINOR@/${LIBCURL_VERSION_MINOR}/g" \
267 -e "s/@LIBCURL_VERSION_PATCH@/${LIBCURL_VERSION_PATCH}/g" \
268 -e "s/@LIBCURL_VERSION_NUM@/${LIBCURL_VERSION_NUM}/g" \
269 -e "s/@LIBCURL_TIMESTAMP@/${LIBCURL_TIMESTAMP}/g" \
270 < "${1}" > "${2}"
271}
274# Get definitions from a make file.
275# The `sed' statement works as follows:
276# - Join \nl-separated lines.
277# - Retain only lines that begins with "identifier =".
278# - Replace @...@ substitutions by shell variable references.
279# - Turn these lines into shell variable assignments.
281get_make_vars()
283{
284 eval "$(sed -e ': begin' \
285 -e '/\\$/{' \
286 -e 'N' \
287 -e 's/\\\n/ /' \
288 -e 'b begin' \
289 -e '}' \
290 -e 's/[[:space:]][[:space:]]*/ /g' \
291 -e '/^[A-Za-z_][A-Za-z0-9_]* *=/!d' \
292 -e 's/@\([A-Za-z0-9_]*\)@/${\1}/g' \
293 -e 's/ *= */=/' \
294 -e 's/=\(.*[^ ]\) *$/="\1"/' \
295 -e 's/\$(\([^)]*\))/${\1}/g' \
296 < "${1}")"
297}
Diagnostics4 git calls · 219 ms
CallStatusSizeTime0219 ms
discover200152 B3 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=2 git.response.bytes=152 git.server.agent=gitty/1.0 git.server.object_format=sha1 git.server.caps=agent ls-refs fetch object-format git.server.fetch=shallow filter sideband-all git.protocol.version=2 git.pkt.frames=8 git.pkt.data=6 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=152 git.pkt.payload.max=34
ls-refs200149 B · hit3 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=149 git.response.cache=HIT git.response.duration_ms=3 git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=149 git.pkt.payload.max=78 git.ls_refs.count=2 git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit2 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=214 git.response.bytes=293470 git.response.cache=HIT git.response.duration_ms=2 git.fetch.filter=blob:none git.fetch.filter.requested=tree:0 git.fetch.filter.fallback=blob:none git.fetch.filter.learned=false git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=10 git.pkt.data=8 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=293470 git.pkt.payload.max=65516 git.sideband.band1.bytes=293354 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=87 git.pack.bytes=293354 git.pack.ofs_delta=0 git.pack.ref_delta=1 git.pack.chain.max=1 git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0 git.pack.full=86Open pack map
fetch2002.9 KiB214 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=3013 git.response.cache=MISS git.response.duration_ms=214 git.fetch.wants=dcdcfa800078bc428d2586b593a23d7d6f38b2b3 git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=3013 git.pkt.payload.max=2992 git.sideband.band1.bytes=2991 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
- Ref
- refs/heads/master
- Commit
- 31c911efe5652725e930f4d2e60c9060e5f6646d
- cf-ray
- a5e184936c98dbb4
- Request
- ba195883…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format