File: compile

package info (click to toggle)
lib25519 0~20241004-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 51,500 kB
  • sloc: asm: 317,113; ansic: 36,370; python: 5,332; sh: 482; makefile: 156; pascal: 13
file content (42 lines) | stat: -rwxr-xr-x 1,047 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh

opic="$1"; shift
base="$1"; shift
ext="$1"; shift
projectnamespace="$1"; shift

cd "$opic" || exit 1
compiler=`cat compiler`
opi=`dirname $opic`
op=`dirname $opi`
o=`dirname $op`
p=`basename $op`
iunder=`basename $opi | tr -d _-`
c=`basename $opic`
namespace=${projectnamespace}_${o}_${p}_${iunder}_${c}
shared_namespace=${projectnamespace}_${o}_${p}_${iunder}_shared

if $compiler \
  -I ../../../../include-build \
  -fvisibility=hidden \
  -D"CRYPTO_NAMESPACE(name)=${namespace}_##name" \
  -D"_CRYPTO_NAMESPACE(name)=_${namespace}_##name" \
  -D"CRYPTO_SHARED_NAMESPACE(name)=${shared_namespace}_##name" \
  -D"_CRYPTO_SHARED_NAMESPACE(name)=_${shared_namespace}_##name" \
  -D"CRYPTO_ALIGN(n)=__attribute__((aligned(n)))" \
  -c "$base.$ext" \
  > "result-compile-$base" 2>&1 
then
  cat "result-compile-$base"
else
  cat "result-compile-$base"
  case "$?" in
    111)
      # maybe someday compilers can be convinced
      # to use exit code 111 for temporary failures
      exit 111
      ;;
    *)
      : > "$base.o"
  esac
fi