mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
[platform] fsnotifier build for Linux: pass version to make.sh, check glibc compatibility
GitOrigin-RevId: 3b7df9f562d44ebd31c88e33657b78b009de48c6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3e31153c47
commit
a174c7d79d
@@ -1,8 +1,10 @@
|
|||||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
// Copyright 2000-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION "20210419.1140"
|
#ifndef VERSION
|
||||||
|
#define VERSION "SNAPSHOT"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
#define _FILE_OFFSET_BITS 64
|
#define _FILE_OFFSET_BITS 64
|
||||||
|
|||||||
@@ -1,14 +1,29 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
VER=$(date "+%Y%m%d.%H%M")
|
VER="${1:-}"
|
||||||
sed -i.bak "s/#define VERSION .*/#define VERSION \"${VER}\"/" fsnotifier.h && rm fsnotifier.h.bak
|
if [ -z "${VER:-}" ]; then
|
||||||
|
VER=$(date "+%Y%m%d.%H%M")
|
||||||
|
fi
|
||||||
|
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
|
|
||||||
|
# To make sure it's compatible with old Linux distributions, e.g. CentOS 7
|
||||||
|
max_allowed_glibc_version="2.17"
|
||||||
|
|
||||||
build_fsnotifier() {
|
build_fsnotifier() {
|
||||||
[ -f "$1" ] && rm "$1"
|
[ -f "$1" ] && rm "$1"
|
||||||
${CC:-clang} -O2 -Wall -Wextra -Wpedantic -std=c11 main.c inotify.c util.c -o "$1"
|
${CC:-clang} -O2 -Wall -Wextra -Wpedantic -D "VERSION=\"$VER\"" -std=c11 main.c inotify.c util.c -o "$1"
|
||||||
chmod 755 "$1"
|
chmod 755 "$1"
|
||||||
|
echo "Checking $1 for glibc version compatibility..."
|
||||||
|
glibc_version="$(objdump -x "$1" | grep -o "GLIBC_.*" | sort | uniq | cut -d _ -f 2 | sort -V | tail -n 1)"
|
||||||
|
newest=$(printf "%s\n%s\n" "$max_allowed_glibc_version" "$glibc_version" | sort -V | tail -n 1)
|
||||||
|
if [ "$newest" != "$max_allowed_glibc_version" ]; then
|
||||||
|
echo "ERROR: $1 uses glibc version $glibc_version which is newer than $max_allowed_glibc_version"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "OK: $1 uses glibc version $glibc_version"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "amd64" ]; then
|
if [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "amd64" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user