mirror of
https://github.com/falk-werner/webfuse
synced 2024-10-27 20:34:10 +00:00
adds eclipse-cdt project and necessary discovery for toolchain settings
This commit is contained in:
parent
1c9d1c8420
commit
1063b7a604
66
.cproject
Normal file
66
.cproject
Normal file
@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.2091678410">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.2091678410" moduleId="org.eclipse.cdt.core.settings" name="amd64-ubuntu">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.2091678410" name="amd64-ubuntu" parent="org.eclipse.cdt.build.core.emptycfg">
|
||||
<folderInfo id="cdt.managedbuild.toolchain.gnu.base.2091678410.118484177" name="/" resourcePath="">
|
||||
<toolChain id="cdt.managedbuild.toolchain.gnu.base.1517489953" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF" id="cdt.managedbuild.target.gnu.platform.base.971240548" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
|
||||
<builder id="cdt.managedbuild.target.gnu.builder.base.232876219" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="false" superClass="cdt.managedbuild.target.gnu.builder.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1816617162" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.545065126" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.2051808734" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.327402516" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.2075154955" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.1022031726" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.437603593" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1581559480" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.assembler.base.804063739" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.707113868" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="fuse-wsfs.null.1226539536" name="fuse-wsfs"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="amd64-ubuntu"/>
|
||||
<configuration configurationName="Default">
|
||||
<resource resourceType="PROJECT" workspacePath="/fuse-wsfs"/>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.2091678410;cdt.managedbuild.toolchain.gnu.base.2091678410.118484177;cdt.managedbuild.tool.gnu.cpp.compiler.base.545065126;cdt.managedbuild.tool.gnu.cpp.compiler.input.2051808734">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.2091678410;cdt.managedbuild.toolchain.gnu.base.2091678410.118484177;cdt.managedbuild.tool.gnu.c.compiler.base.327402516;cdt.managedbuild.tool.gnu.c.compiler.input.2075154955">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
</cproject>
|
27
.project
Normal file
27
.project
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>web-fuse</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
15
.settings/language.settings.xml
Normal file
15
.settings/language.settings.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<project>
|
||||
<configuration id="cdt.managedbuild.toolchain.gnu.base.2091678410" name="amd64-ubuntu">
|
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||
<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="(g?cc)|([gc]\+\+)|(clang)" prefer-non-shared="true"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="true" env-hash="1867779357393874872" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="make discover-cc-amd64-ubuntu-builder" prefer-non-shared="true" store-entries-with-project="false">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
</extension>
|
||||
</configuration>
|
||||
</project>
|
12
.settings/org.eclipse.cdt.core.prefs
Normal file
12
.settings/org.eclipse.cdt.core.prefs
Normal file
@ -0,0 +1,12 @@
|
||||
eclipse.preferences.version=1
|
||||
environment/project/cdt.managedbuild.toolchain.gnu.base.2091678410/BUILDTARGET/delimiter=\:
|
||||
environment/project/cdt.managedbuild.toolchain.gnu.base.2091678410/BUILDTARGET/operation=append
|
||||
environment/project/cdt.managedbuild.toolchain.gnu.base.2091678410/BUILDTARGET/value=amd64-ubuntu-builder
|
||||
environment/project/cdt.managedbuild.toolchain.gnu.base.2091678410/BUILDVERBOSE/delimiter=\:
|
||||
environment/project/cdt.managedbuild.toolchain.gnu.base.2091678410/BUILDVERBOSE/operation=append
|
||||
environment/project/cdt.managedbuild.toolchain.gnu.base.2091678410/BUILDVERBOSE/value=1
|
||||
environment/project/cdt.managedbuild.toolchain.gnu.base.2091678410/NINJA_STATUS/delimiter=\:
|
||||
environment/project/cdt.managedbuild.toolchain.gnu.base.2091678410/NINJA_STATUS/operation=append
|
||||
environment/project/cdt.managedbuild.toolchain.gnu.base.2091678410/NINJA_STATUS/value=
|
||||
environment/project/cdt.managedbuild.toolchain.gnu.base.2091678410/append=true
|
||||
environment/project/cdt.managedbuild.toolchain.gnu.base.2091678410/appendContributed=true
|
110
Makefile
110
Makefile
@ -6,10 +6,12 @@ default: all
|
||||
export SOURCE_DATE_EPOCH ?= $(shell $(PROJECT_ROOT)/build/get_source_date_epoch.sh)
|
||||
export BUILDTIME ?= $(shell date -u -d '@$(SOURCE_DATE_EPOCH)' --rfc-3339 ns 2>/dev/null | sed -e 's/ /T/')
|
||||
|
||||
VERBOSE ?=
|
||||
MARCH ?=
|
||||
VERBOSE ?=
|
||||
BUILDVERBOSE ?=
|
||||
BUILDTARGET ?=
|
||||
MARCH ?= $(call march,$(BUILDTARGET))
|
||||
|
||||
PROJECT_NAME ?= webfs
|
||||
PROJECT_NAME ?= webfuse
|
||||
PROJECT_ROOT ?= .
|
||||
VERSION ?= $(shell cat $(PROJECT_ROOT)/VERSION)
|
||||
OUT ?= $(PROJECT_ROOT)/.build
|
||||
@ -22,7 +24,12 @@ DOCKER_BUILDKIT ?=
|
||||
|
||||
CONTAINER_USER ?= $(UID)
|
||||
CONTAINER_GROUP ?= $(shell id -g)
|
||||
CONTAINER_WORKSPACE ?= /workspace
|
||||
|
||||
PORTABLE_WORSPACE ?=
|
||||
CONTAINER_PROJECT_ROOT ?= /workspace/src
|
||||
CONTAINER_OUT ?= /workspace/out
|
||||
$(PORTABLE_WORSPACE)CONTAINER_PROJECT_ROOT = $(abspath $(PROJECT_ROOT))
|
||||
$(PORTABLE_WORSPACE)CONTAINER_OUT = $(abspath $(OUT))
|
||||
|
||||
UBUNTU_CODENAME ?= bionic
|
||||
|
||||
@ -54,6 +61,11 @@ $(OUT)/docker/qemu-arm-static-$(QEMU_VERSION): URL := https://github.com/multiar
|
||||
|
||||
# Architecture-specific rule target configuration
|
||||
|
||||
march = $(shell echo '$1' | sed -n -e 's@\([^-]*\)-.*@\1@p')
|
||||
|
||||
TARGETS += $(BUILDTARGET)
|
||||
MARCH := $(MARCH)
|
||||
|
||||
MARCH_AMD64 := $(filter-out amd64,$(MARCH))
|
||||
$(MARCH_AMD64)MARCHS += amd64
|
||||
$(MARCH_AMD64)TARGETS += amd64-ubuntu-builder
|
||||
@ -76,7 +88,10 @@ $(addprefix $(OUT)/docker/,$(UBUNTU_TARGETS)): CODENAME := $(UBUNTU_CODENAME)
|
||||
|
||||
MAKEFLAGS += $(PARALLELMFLAGS) --no-builtin-rules
|
||||
|
||||
CMAKEFLAGS += -GNinja
|
||||
CMAKEFLAGS += '-GNinja'
|
||||
|
||||
BUILDSILENT := $(if $(BUILDVERBOSE),,1)
|
||||
$(BUILDSILENT)NINJAFLAGS += -v
|
||||
|
||||
DOCKER_RUNFLAGS += --interactive
|
||||
DOCKER_RUNFLAGS += --rm
|
||||
@ -85,11 +100,13 @@ DOCKER_RUNFLAGS += --user $(CONTAINER_USER):$(CONTAINER_GROUP)
|
||||
DOCKER_RUNFLAGS += --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined
|
||||
DOCKER_RUNFLAGS += --env SOURCE_DATE_EPOCH
|
||||
DOCKER_RUNFLAGS += --env BUILDTIME
|
||||
DOCKER_RUNFLAGS += --env NINJA_STATUS
|
||||
|
||||
DOCKER_BUILDARGS += CODENAME=$(CODENAME)
|
||||
DOCKER_BUILDARGS += PARALLELMFLAGS=$(PARALLELMFLAGS)
|
||||
DOCKER_BUILDARGS += USERID=$(UID)
|
||||
DOCKER_BUILDARGS += WORKSPACE=$(CONTAINER_WORKSPACE)
|
||||
DOCKER_BUILDARGS += PROJECT_ROOT=$(CONTAINER_PROJECT_ROOT)
|
||||
DOCKER_BUILDARGS += OUT=$(CONTAINER_OUT)
|
||||
|
||||
DOCKER_BUILDFLAGS += --rm
|
||||
DOCKER_BUILDFLAGS += $(addprefix --build-arg ,$(DOCKER_BUILDARGS))
|
||||
@ -102,15 +119,10 @@ OUT_DIRS += $(addprefix $(OUT)/,$(TARGETS))
|
||||
BUILD_TARGETS += $(addprefix build-,$(TARGETS))
|
||||
CHECK_TARGETS += $(addprefix check-,$(TARGETS))
|
||||
EXTRACT_TARGETS += $(patsubst $(OUT)/%.tar.gz,$(OUT)/src/%,$(FETCH_TARGETS))
|
||||
DISCOVER_CC_TARGETS += $(addprefix discover-cc-,$(TARGETS))
|
||||
RULE_TARGETS = $(addprefix $(OUT)/,$(addsuffix /rules.mk,$(TARGETS)))
|
||||
|
||||
BUILD_TARGETS := $(BUILD_TARGETS)
|
||||
CHECK_TARGETS := $(CHECK_TARGETS)
|
||||
MEMCHECK_TARGETS := $(MEMCHECK_TARGETS)
|
||||
CONTAINER_GROUP := $(CONTAINER_GROUP)
|
||||
VERSION := $(VERSION)
|
||||
PROJECT_ROOT := $(PROJECT_ROOT)
|
||||
OUT := $(OUT)
|
||||
TARGETS := $(sort $(TARGETS))
|
||||
|
||||
# Macros
|
||||
|
||||
@ -118,32 +130,58 @@ echo_if_silent = VERBOSE=1
|
||||
$(VERBOSE)echo_if_silent = echo $1
|
||||
$(VERBOSE)SILENT := @
|
||||
|
||||
image_rule = $$(OUT)/docker/$1: $$(OUT)/docker/$1.dockerfile $$(EXTRACT_TARGETS) $$(PROJECT_ROOT)/Makefile; $$(call image,$1)
|
||||
container_run = $(DOCKER) run $(DOCKER_RUNFLAGS) $3 \
|
||||
--volume '$(realpath $(PROJECT_ROOT)):$(CONTAINER_PROJECT_ROOT)' \
|
||||
--volume '$(realpath $(OUT)/$1):$(CONTAINER_OUT)/$1' \
|
||||
--workdir '$(CONTAINER_OUT)/$1' \
|
||||
$(PROJECT_NAME)-$1:$(VERSION) \
|
||||
$2
|
||||
|
||||
image_rule = \
|
||||
$$(OUT)/docker/$1: $$(OUT)/docker/$1.dockerfile $$(EXTRACT_TARGETS) $$(PROJECT_ROOT)/Makefile; \
|
||||
$$(call image,$1)
|
||||
image = $(SILENT) \
|
||||
$(call echo_if_silent,docker build $(PROJECT_NAME)-$1:$(VERSION) $(OUT)) \
|
||||
&& $(DOCKER) build $(DOCKER_BUILDFLAGS) --iidfile $@ --file $< --tag $(PROJECT_NAME)-$1:$(VERSION) $(OUT)
|
||||
|
||||
run_rule = run-$1: $$(OUT)/docker/$1; $$(call run,$1,/bin/bash,--tty)
|
||||
run = $(SILENT) \
|
||||
$(call echo_if_silent,TARGET=$1 $2) \
|
||||
&& $(DOCKER) run $(DOCKER_RUNFLAGS) $3 \
|
||||
--volume '$(realpath $(PROJECT_ROOT)):$(CONTAINER_WORKSPACE)' \
|
||||
--volume '$(realpath $(OUT)/$1):$(CONTAINER_WORKSPACE)/$(notdir $(OUT))' \
|
||||
--workdir '$(CONTAINER_WORKSPACE)/$(notdir $(OUT))' \
|
||||
$(PROJECT_NAME)-$1:$(VERSION) \
|
||||
$2
|
||||
run_rule = \
|
||||
run-$1: $$(OUT)/docker/$1; \
|
||||
$$(call run_recipe,$1,/bin/bash,--tty)
|
||||
run = $(call echo_if_silent,TARGET=$1 $2) && $(call container_run,$1,$2,$3)
|
||||
run_recipe = $(SILENT)$(call run,$1,$2,$3)
|
||||
|
||||
configure_rule = $$(OUT)/$1/CMakeCache.txt: $$(PROJECT_ROOT)/CMakeLists.txt $$(OUT)/docker/$1; $$(call configure,$1)
|
||||
configure = $(call run,$1,cmake $(CMAKEFLAGS) ..) && touch $@
|
||||
configure_rule = \
|
||||
$$(OUT)/$1/CMakeCache.txt: $$(PROJECT_ROOT)/CMakeLists.txt $$(OUT)/docker/$1; \
|
||||
$$(call configure,$1)
|
||||
configure = $(SILENT) \
|
||||
$(call run,$1,sh -c 'cmake $(CMAKEFLAGS) $(CONTAINER_PROJECT_ROOT) && $(CONTAINER_PROJECT_ROOT)/build/discover_cc_settings.sh $(notdir $@)') \
|
||||
&& touch $@
|
||||
|
||||
build_rule = build-$1: $$(OUT)/$1/CMakeCache.txt; $$(call build,$1)
|
||||
build = $(call run,$1,ninja $(PARALLELMFLAGS) $(GLOAS))
|
||||
build_rule = \
|
||||
build-$1: $$(OUT)/$1/CMakeCache.txt; \
|
||||
$$(call build,$1)
|
||||
build = $(SILENT)$(call run,$1,ninja $(PARALLELMFLAGS) $(NINJAFLAGS) $(GLOAS))
|
||||
|
||||
check_rule = check-$1: build-$1; $$(call check,$1)
|
||||
check = $(call run,$1,ctest $(CTESTFLAGS))
|
||||
check_rule = \
|
||||
check-$1: build-$1; \
|
||||
$$(call check,$1)
|
||||
check = $(SILENT)$(call run,$1,ctest $(CTESTFLAGS))
|
||||
|
||||
memcheck_rule = memcheck-$1: build-$1; $$(call memcheck,$1)
|
||||
memcheck = $(call run,$1,ctest -T memcheck $(CTESTFLAGS))
|
||||
memcheck_rule = \
|
||||
memcheck-$1: build-$1; \
|
||||
$$(call memcheck,$1)
|
||||
memcheck = $(SILENT)$(call run,$1,ctest -T memcheck $(CTESTFLAGS))
|
||||
|
||||
discover_cc_settings_rule = \
|
||||
$$(OUT)/$1/include_dirs.txt: $$(OUT)/$1/CMakeCache.txt; \
|
||||
$$(call discover_cc_settings,$1)
|
||||
discover_cc_settings = $(SILENT) \
|
||||
$(call run,$1,$(CONTAINER_PROJECT_ROOT)/build/discover_cc_settings.sh $(notdir $<)) \
|
||||
|
||||
discover_cc_rule = \
|
||||
discover-cc-$1: $$(OUT)/$1/include_dirs.txt; \
|
||||
$$(call discover_cc,$1)
|
||||
discover_cc = $(SILENT)cat $<
|
||||
|
||||
# Rules
|
||||
|
||||
@ -166,6 +204,10 @@ $(RULE_TARGETS): $(PROJECT_ROOT)/Makefile | $(OUT_DIRS)
|
||||
echo '$(call memcheck_rule,$(TARGET))'; \
|
||||
echo; \
|
||||
echo '$(call run_rule,$(TARGET))'; \
|
||||
echo; \
|
||||
echo '$(call discover_cc_settings_rule,$(TARGET))'; \
|
||||
echo; \
|
||||
echo '$(call discover_cc_rule,$(TARGET))'; \
|
||||
} > $@
|
||||
|
||||
.PHONY: all
|
||||
@ -184,6 +226,9 @@ clean: $(CLEAN_TARGETS)
|
||||
.PHONY: get-deps
|
||||
get-deps: $(EXTRACT_TARGETS)
|
||||
|
||||
.PHONY: discover-cc
|
||||
discover-cc: $(DISCOVER_CC_TARGETS)
|
||||
|
||||
.PHONY: debug-print-%
|
||||
debug-print-%:
|
||||
@printf '%s\n' '$*:' $($*)
|
||||
@ -211,6 +256,3 @@ $(OUT)/src/%: $(OUT)/%.tar.gz | $(OUT_DIRS)
|
||||
$(OUT_DIRS):
|
||||
$(SILENT)mkdir -p $@
|
||||
|
||||
.PRECIOUS: $(OUT)/docker/% $(OUT)/%/CMakeCache.txt
|
||||
.DELETE_ON_ERROR: $(OUT)/%/CMakeCache.txt
|
||||
|
||||
|
@ -10,6 +10,7 @@ RUN set -x \
|
||||
cmake \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
rsync \
|
||||
valgrind \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@ -70,12 +71,13 @@ ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
|
||||
|
||||
ARG USERID=1000
|
||||
|
||||
ARG WORKSPACE=/workspace
|
||||
ARG PROJECT_ROOT=/workspace/src
|
||||
ARG OUT=/workspace/out
|
||||
|
||||
RUN set -x \
|
||||
&& useradd -u "$USERID" -ms /bin/bash user \
|
||||
&& mkdir -p "$WORKSPACE" \
|
||||
&& chown user:user "$WORKSPACE"
|
||||
&& mkdir -p "$PROJECT_ROOT" "$OUT" \
|
||||
&& chown user:user "$PROJECT_ROOT" "$OUT"
|
||||
|
||||
WORKDIR "$WORKSPACE"
|
||||
WORKDIR "$OUT"
|
||||
|
||||
|
@ -12,6 +12,7 @@ RUN set -x \
|
||||
cmake \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
rsync \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY src /usr/local/src
|
||||
@ -71,12 +72,13 @@ ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
|
||||
|
||||
ARG USERID=1000
|
||||
|
||||
ARG WORKSPACE=/workspace
|
||||
ARG PROJECT_ROOT=/workspace/src
|
||||
ARG OUT=/workspace/out
|
||||
|
||||
RUN set -x \
|
||||
&& useradd -u "$USERID" -ms /bin/bash user \
|
||||
&& mkdir -p "$WORKSPACE" \
|
||||
&& chown user:user "$WORKSPACE"
|
||||
&& mkdir -p "$PROJECT_ROOT" "$OUT" \
|
||||
&& chown user:user "$PROJECT_ROOT" "$OUT"
|
||||
|
||||
WORKDIR "$WORKSPACE"
|
||||
WORKDIR "$OUT"
|
||||
|
||||
|
51
build/discover_cc_settings.sh
Executable file
51
build/discover_cc_settings.sh
Executable file
@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
cleanup() {
|
||||
rm -rf "$INCLUDE_DIRS_TMPFILE"
|
||||
}
|
||||
|
||||
trap cleanup TERM INT EXIT
|
||||
|
||||
DEST="${DEST:-$PWD}"
|
||||
INCLUDE_DIRS_TMPFILE="${2:-$(mktemp -p "$DEST" include_dirs_XXXXXXXXXX.txt)}"
|
||||
INCLUDE_DIRS_FILE="${INCLUDE_DIRS_FILE:-$DEST/include_dirs.txt}"
|
||||
|
||||
CMAKE_CACHE_FILE="${1:-CMakeCache.txt}"
|
||||
CMAKE_CXX_COMPILER="$(sed -n -e 's/CMAKE_CXX_COMPILER:FILEPATH=\(.*\)$/\1/p' "$CMAKE_CACHE_FILE")"
|
||||
CMAKE_C_COMPILER="$(sed -n -e 's/CMAKE_C_COMPILER:FILEPATH=\(.*\)$/\1/p' "$CMAKE_CACHE_FILE")"
|
||||
|
||||
C_BUILTIN_FILE="${C_BUILTIN_FILE:-$DEST/builtins.h}"
|
||||
CXX_BUILTIN_FILE="${CXX_BUILTIN_FILE:-$DEST/builtins.hpp}"
|
||||
|
||||
if [ -z "${RSYNC+x}" ]; then
|
||||
RSYNC=rsync
|
||||
fi
|
||||
|
||||
{
|
||||
{
|
||||
echo | "$CMAKE_CXX_COMPILER" -xc++ -E -Wp,-v - 2>&1;
|
||||
echo | "$CMAKE_C_COMPILER" -xc -E -Wp,-v - 2>&1;
|
||||
} \
|
||||
| sed -n -e 's/\s\+\(\/.*$\).*/\1/p';
|
||||
|
||||
sed -n -e 's/.*_INCLUDE_DIRS:INTERNAL=\(.*\)$/\1/p' "$CMAKE_CACHE_FILE";
|
||||
} \
|
||||
| sed 's/;/\n/g' | sed '/^$/d' | sort -u 2>/dev/null 1> "$INCLUDE_DIRS_TMPFILE"
|
||||
|
||||
{
|
||||
echo '#include <...> search starts here:'
|
||||
cat "$INCLUDE_DIRS_TMPFILE" | sed -n -e "s@\(.*\)@$DEST\1@p"
|
||||
echo 'End of search list.'
|
||||
} > "$INCLUDE_DIRS_FILE"
|
||||
|
||||
if [ -n "$RSYNC" ]; then
|
||||
"$RSYNC" -arR --files-from="$INCLUDE_DIRS_TMPFILE" / "$DEST"
|
||||
echo "Include folders copied to $DEST" >&2
|
||||
fi
|
||||
|
||||
"$CMAKE_C_COMPILER" -xc -dM -E - < /dev/null > "$C_BUILTIN_FILE"
|
||||
echo "C Compiler built-ins written to $C_BUILTIN_FILE" >&2
|
||||
"$CMAKE_CXX_COMPILER" -xc++ -dM -E - < /dev/null > "$CXX_BUILTIN_FILE"
|
||||
echo "C++ Compiler built-ins written to $CXX_BUILTIN_FILE" >&2
|
@ -1,25 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
export LANG=C
|
||||
export LC_ALL=C
|
||||
|
||||
[ -n "$TOPDIR" ] && cd "$TOPDIR"
|
||||
|
||||
try_git() {
|
||||
[ -e .git ] || return 1
|
||||
SOURCE_DATE_EPOCH="$(git log -1 --format=format:%ct)"
|
||||
[ -n "$SOURCE_DATE_EPOCH" ]
|
||||
[ -e .git ] || return 1
|
||||
SOURCE_DATE_EPOCH="$(git log -1 --format=format:%ct)"
|
||||
[ -n "$SOURCE_DATE_EPOCH" ]
|
||||
}
|
||||
|
||||
try_hg() {
|
||||
[ -d .hg ] || return 1
|
||||
SOURCE_DATE_EPOCH="$(hg log --template '{date}' -l 1 | cut -d. -f1)"
|
||||
[ -n "$SOURCE_DATE_EPOCH" ]
|
||||
[ -d .hg ] || return 1
|
||||
SOURCE_DATE_EPOCH="$(hg log --template '{date}' -l 1 | cut -d. -f1)"
|
||||
[ -n "$SOURCE_DATE_EPOCH" ]
|
||||
}
|
||||
|
||||
try_mtime() {
|
||||
perl -e 'print((stat $ARGV[0])[9])' "$0"
|
||||
[ -n "$SOURCE_DATE_EPOCH" ]
|
||||
perl -e 'print((stat $ARGV[0])[9])' "$0"
|
||||
[ -n "$SOURCE_DATE_EPOCH" ]
|
||||
}
|
||||
|
||||
try_git || try_hg || try_mtime || SOURCE_DATE_EPOCH=""
|
||||
|
Loading…
Reference in New Issue
Block a user