all: use cosmopolitan make.com everywhere

This commit is contained in:
Connor Olding 2022-10-11 10:07:48 -07:00
parent 16fe288a9f
commit 4ef5dd5a5e
2 changed files with 14 additions and 5 deletions

View File

@ -25,9 +25,6 @@ RUN --mount=type=cache,id=common,target=/media/common,sharing=locked \
FROM localhost/cosmo AS builder FROM localhost/cosmo AS builder
# TODO: this shouldn't be necessary!
RUN apk add --no-cache make
COPY --from=downloader /perl /perl COPY --from=downloader /perl /perl
RUN : \ RUN : \
&& cd cosmopolitan \ && cd cosmopolitan \
@ -51,12 +48,14 @@ RUN : \
&& tar zxf dist/headers.tar.gz \ && tar zxf dist/headers.tar.gz \
\ \
&& for f in \ && for f in \
bin/make.com \
bin/unzip.com \ bin/unzip.com \
bin/zip.com \ bin/zip.com \
;do : \ ;do : \
&& cp -- "$f" /a.out \ && cp -- "$f" /a.out \
&& /cosmopolitan/bin/ape bin/assimilate.com /a.out \ && bin/ape bin/assimilate.com /a.out \
&& install -m0755 /a.out "/usr/bin/$(basename "${f%.com}")" \ && install -m0755 /a.out "/usr/bin/$(basename "${f%.com}")" \
|| exit \
;done \ ;done \
\ \
&& rm /usr/bin/strings \ && rm /usr/bin/strings \
@ -64,6 +63,7 @@ RUN : \
;do : \ ;do : \
&& g="$(basename "$f")" \ && g="$(basename "$f")" \
&& ln -s "$(realpath "$f")" "/usr/bin/${g#x86_64-linux-musl-}" \ && ln -s "$(realpath "$f")" "/usr/bin/${g#x86_64-linux-musl-}" \
|| exit \
;done \ ;done \
; ;

View File

@ -32,11 +32,13 @@ RUN --mount=type=cache,id=common,target=/media/common,sharing=locked \
FROM localhost/cosmo AS builder FROM localhost/cosmo AS builder
RUN apk add --no-cache autoconf gperf make RUN apk add --no-cache autoconf gperf
RUN : \ RUN : \
&& cd /cosmopolitan \ && cd /cosmopolitan \
&& tar zxf dist/headers.tar.gz \ && tar zxf dist/headers.tar.gz \
&& install -m0755 bin/make.com /usr/bin/make \
&& bin/ape bin/assimilate.com /usr/bin/make \
; ;
COPY --chmod=0755 --from=localhost/notwa-util /nu/cosmocc /nu/quickconf /nu/shed /usr/bin/ COPY --chmod=0755 --from=localhost/notwa-util /nu/cosmocc /nu/quickconf /nu/shed /usr/bin/
@ -47,6 +49,8 @@ RUN : \
&& shed src/application.c '/#include <unistd.h>/i\\#include <time.h>' \ && shed src/application.c '/#include <unistd.h>/i\\#include <time.h>' \
# completely override CFLAGS: \ # completely override CFLAGS: \
&& shed configure '/passtocompiler -fpic/i\\CFLAGS=" -O2 -g -Wall"' \ && shed configure '/passtocompiler -fpic/i\\CFLAGS=" -O2 -g -Wall"' \
# mitigate issues with 'shell' command (this related to using landlocked make) \
&& shed makefile.in '/^INCLUDES=/c\INCLUDES=-I../build' \
# we don't need -static here because it's already part of cosmocc: \ # we don't need -static here because it's already part of cosmocc: \
&& CC=cosmocc ./configure \ && CC=cosmocc ./configure \
; ;
@ -83,6 +87,11 @@ RUN : \
&& shed src/terms/bv_constants.c 's/\bhextoint\b/&_/g' \ && shed src/terms/bv_constants.c 's/\bhextoint\b/&_/g' \
&& shed src/terms/bv64_constants.c 's/\bhextoint\b/&_/g' \ && shed src/terms/bv64_constants.c 's/\bhextoint\b/&_/g' \
&& shed src/utils/timeout.c '/#include <unistd.h>/i\\#include <time.h>' \ && shed src/utils/timeout.c '/#include <unistd.h>/i\\#include <time.h>' \
# mitigate issues with 'shell' command (this related to using landlocked make) \
&& shed Makefile \
'/^ARCH=/c\ARCH=x86_64-pc-linux-gnu' \
'/^POSIXOS=/c\POSIXOS=linux' \
'/^YICES_TOP_DIR=/c\YICES_TOP_DIR=/yices' \
# the static-lib target attempts to build a dynamic library. don't do that. \ # the static-lib target attempts to build a dynamic library. don't do that. \
&& shed src/Makefile 's/ $(static_libyices_dynamic)//g' \ && shed src/Makefile 's/ $(static_libyices_dynamic)//g' \
\ \