github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/engine/hack/make/.go-autogen (about) 1 #!/usr/bin/env bash 2 3 rm -rf autogen/* 4 5 source hack/dockerfile/install/runc.installer 6 source hack/dockerfile/install/tini.installer 7 source hack/dockerfile/install/containerd.installer 8 9 LDFLAGS="${LDFLAGS} \ 10 -X \"github.com/docker/docker/dockerversion.Version=${VERSION}\" \ 11 -X \"github.com/docker/docker/dockerversion.GitCommit=${GITCOMMIT}\" \ 12 -X \"github.com/docker/docker/dockerversion.BuildTime=${BUILDTIME}\" \ 13 -X \"github.com/docker/docker/dockerversion.IAmStatic=${IAMSTATIC:-true}\" \ 14 -X \"github.com/docker/docker/dockerversion.PlatformName=${PLATFORM}\" \ 15 -X \"github.com/docker/docker/dockerversion.ProductName=${PRODUCT}\" \ 16 -X \"github.com/docker/docker/dockerversion.DefaultProductLicense=${DEFAULT_PRODUCT_LICENSE}\" \ 17 " 18 19 # Compile the Windows resources into the sources 20 if [ "$(go env GOOS)" = "windows" ]; then 21 mkdir -p autogen/winresources/tmp autogen/winresources/dockerd 22 cp hack/make/.resources-windows/resources.go autogen/winresources/dockerd/ 23 24 if [ "$(go env GOHOSTOS)" == "windows" ]; then 25 WINDRES=windres 26 WINDMC=windmc 27 else 28 # Cross compiling 29 WINDRES=x86_64-w64-mingw32-windres 30 WINDMC=x86_64-w64-mingw32-windmc 31 fi 32 33 # Generate a Windows file version of the form major,minor,patch,build (with any part optional) 34 if [ ! -v VERSION_QUAD ]; then 35 VERSION_QUAD=$(echo -n $VERSION | sed -re 's/^([0-9.]*).*$/\1/' | tr . ,) 36 fi 37 38 # Pass version and commit information into the resource compiler 39 defs= 40 [ ! -z $VERSION ] && defs="$defs -D DOCKER_VERSION=\"$VERSION\"" 41 [ ! -z $VERSION_QUAD ] && defs="$defs -D DOCKER_VERSION_QUAD=$VERSION_QUAD" 42 [ ! -z $GITCOMMIT ] && defs="$defs -D DOCKER_COMMIT=\"$GITCOMMIT\"" 43 44 function makeres { 45 ${WINDRES} \ 46 -i hack/make/.resources-windows/$1 \ 47 -o $3 \ 48 -F $2 \ 49 --use-temp-file \ 50 -I autogen/winresources/tmp \ 51 $defs 52 } 53 54 ${WINDMC} \ 55 hack/make/.resources-windows/event_messages.mc \ 56 -h autogen/winresources/tmp \ 57 -r autogen/winresources/tmp 58 59 makeres dockerd.rc pe-x86-64 autogen/winresources/dockerd/rsrc_amd64.syso 60 61 rm -r autogen/winresources/tmp 62 fi