"include/ck/utility/get_id.hpp" did not exist on "766b0a9eafe29a5d2a75c350345e54165ceaf405"
build.sh 2.26 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
#!/bin/bash

if [ "$1" = "sim" ]; then
    exopt="-DVENTOY_SIM"
fi

build_func() {    
    libsuffix=$2
    toolDir=$3
    
longpanda's avatar
longpanda committed
11
    XXFLAG='-std=gnu99 -D_FILE_OFFSET_BITS=64 -O2'
12
13
14
15
16
17
    XXLIB=""
    
    echo "CC=$1 libsuffix=$libsuffix toolDir=$toolDir"    
    
    echo "CC civetweb.o"
    $1 $XXFLAG -c -Wall -Wextra -Wshadow -Wformat-security -Winit-self \
longpanda's avatar
longpanda committed
18
        -Wmissing-prototypes -DLINUX \
19
20
21
22
23
24
25
        -I./src/Lib/libhttp/include \
        -DNDEBUG -DNO_CGI -DNO_CACHING -DNO_SSL -DSQLITE_DISABLE_LFS -DSSL_ALREADY_INITIALIZED \
        -DUSE_STACK_SIZE=102400 -DNDEBUG -fPIC \
        ./src/Lib/libhttp/include/civetweb.c \
        -o ./civetweb.o

    echo "CC plugson.o"
longpanda's avatar
longpanda committed
26
    $1 $XXFLAG $exopt -Wall -Wno-unused-function -DSTATIC=static -DINIT= \
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
        -I./src \
        -I./src/Core \
        -I./src/Web \
        -I./src/Include \
        -I./src/Lib/libhttp/include \
        -I./src/Lib/fat_io_lib/include \
        -I./src/Lib/xz-embedded/linux/include \
        -I./src/Lib/xz-embedded/linux/include/linux \
        -I./src/Lib/xz-embedded/userspace \
        -I ./src/Lib/exfat/src/libexfat \
        -I ./src/Lib/exfat/src/mkfs \
        -I ./src/Lib/fat_io_lib \
        \
        -L ./src/Lib/fat_io_lib/lib \
        src/main_linux.c \
        src/Core/ventoy_crc32.c \
        src/Core/ventoy_disk.c \
        src/Core/ventoy_disk_linux.c \
        src/Core/ventoy_json.c \
        src/Core/ventoy_log.c \
        src/Core/ventoy_md5.c \
48
        src/Core/ventoy_utf.c \
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
        src/Core/ventoy_util.c \
        src/Core/ventoy_util_linux.c \
        src/Web/*.c \
        src/Lib/xz-embedded/linux/lib/decompress_unxz.c \
        src/Lib/fat_io_lib/*.c \
        $XXLIB \
        -l pthread \
        ./civetweb.o \
        -o Plugson$libsuffix

    rm -f *.o
    
    if [ "$libsuffix" = "aa64" ]; then
        aarch64-linux-gnu-strip Plugson$libsuffix
    elif [ "$libsuffix" = "m64e" ]; then
        mips-linux-gnu-strip Plugson$libsuffix
    else
        strip Plugson$libsuffix
    fi
    
    rm -f ../INSTALL/tool/$toolDir/Plugson
    cp -a Plugson$libsuffix ../INSTALL/tool/$toolDir/Plugson
    
}

build_func "gcc" '64' 'x86_64'
build_func "gcc -m32" '32' 'i386'
build_func "aarch64-linux-gnu-gcc" 'aa64' 'aarch64'
build_func "mips-linux-gnu-gcc -mips64r2 -mabi=64" 'm64e' 'mips64el'