⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286934 in webkit


Ignore:
Timestamp:
Dec 12, 2021, 11:16:02 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[libpas] make build.sh, test.sh, build_and_test.sh, and clean.sh work on Linux
https://bugs.webkit.org/show_bug.cgi?id=233821

Patch by Zan Dobersek <zdobersek@igalia.com> on 2021-12-12
Reviewed by Yusuke Suzuki.

Adjust and enhance the shell scripts for building and testing CMake
builds of libpas. In build.sh, the 'cmake' SDK option handling is added,
invoking CMake to produce a libpas build of the desired variant and
configuration. The Debug and Release configuration possibilities map
exactly to the CMAKE_BUILD_TYPE option. The ENABLE_PAS_TESTING option
used for the testing variant is converted into a macro definition that's
passed to both CMAKE_C_FLAGS and CMAKE_CXX_FLAGS.

The function declarations are adjusted to use the "fname()" form, making
things runnable on shells that don't support the "function" keyword.

  • libpas/build.sh:
  • libpas/common.sh:
  • libpas/test.sh:
Location:
trunk/Source/bmalloc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/bmalloc/ChangeLog

    r286816 r286934  
     12021-12-12  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [libpas] make build.sh, test.sh, build_and_test.sh, and clean.sh work on Linux
     4        https://bugs.webkit.org/show_bug.cgi?id=233821
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Adjust and enhance the shell scripts for building and testing CMake
     9        builds of libpas. In build.sh, the 'cmake' SDK option handling is added,
     10        invoking CMake to produce a libpas build of the desired variant and
     11        configuration. The Debug and Release configuration possibilities map
     12        exactly to the CMAKE_BUILD_TYPE option. The ENABLE_PAS_TESTING option
     13        used for the testing variant is converted into a macro definition that's
     14        passed to both CMAKE_C_FLAGS and CMAKE_CXX_FLAGS.
     15
     16        The function declarations are adjusted to use the "fname()" form, making
     17        things runnable on shells that don't support the "function" keyword.
     18
     19        * libpas/build.sh:
     20        * libpas/common.sh:
     21        * libpas/test.sh:
     22
    1232021-12-09  Alex Christensen  <achristensen@webkit.org>
    224
  • trunk/Source/bmalloc/libpas/build.sh

    r279867 r286934  
    2525. common.sh
    2626
    27 function build_variant {
     27build_variant_xcodebuild() {
    2828    variant=$1
    29     extra_xcodebuild_options="$2"
    30     target=$3
     29    target=$2
     30    extra_xcodebuild_options="EXTRA_DEFINES=$3"
    3131   
    3232    build_dir=build-$sdk-$variant
     
    4444    case $target in
    4545        mbmalloc|all)
    46             function link_mbmalloc_personality {
     46            link_mbmalloc_personality() {
    4747                personality=$1
    4848               
     
    6161}
    6262
    63 function build_variants {
     63build_variant_cmake() {
     64    variant=$1
     65    target=$2
     66    extra_options=$3
     67
     68    case $config in
     69        Release)
     70            ;;
     71        Debug)
     72            ;;
     73        *)
     74            echo "Bad value of config"
     75            exit 1
     76    esac
     77
     78    build_dir=build-$sdk-$variant/$configdir
     79    mkdir -p $build_dir
     80
     81    extra_cmake_options=""
     82    for option in $extra_options; do
     83        extra_cmake_options="${extra_cmake_options} -D${option}"
     84    done
     85    extra_cmake_options=\"${extra_cmake_options#* }\"
     86
     87    echo $extra_cmake_options
     88
     89    cmake -DCMAKE_BUILD_TYPE=$config -DCMAKE_C_FLAGS=$extra_cmake_options -DCMAKE_CXX_FLAGS=$extra_cmake_options -B $build_dir
     90    cmake --build $build_dir --parallel
     91}
     92
     93build_variant() {
     94    case $sdk in
     95        cmake)
     96            build_variant_cmake $@
     97            ;;
     98        *)
     99            build_variant_xcodebuild
     100            ;;
     101    esac
     102}
     103
     104build_variants() {
    64105    target=$1
    65106   
    66107    case $variants in
    67108        all|testing)
    68             build_variant testing "EXTRA_DEFINES=ENABLE_PAS_TESTING" $target
     109            build_variant testing $target "ENABLE_PAS_TESTING"
    69110            ;;
    70111    esac
    71112    case $variants in
    72113        all|default)
    73             build_variant default "EXTRA_DEFINES=" $target
     114            build_variant default $target ""
    74115            ;;
    75116    esac
  • trunk/Source/bmalloc/libpas/common.sh

    r283371 r286934  
    3232port=10022
    3333
    34 function show_help {
     34show_help() {
    3535    set +x
    3636    echo "$0 [-hcsavtpb]"
  • trunk/Source/bmalloc/libpas/test.sh

    r279867 r286934  
    2525. common.sh
    2626
    27 function copy_variant {
     27copy_variant() {
    2828    variant=$1
    2929   
Note: See TracChangeset for help on using the changeset viewer.