github-actions
authorMichael Wallner <mike@php.net>
Fri, 2 Oct 2020 07:58:06 +0000 (09:58 +0200)
committerMichael Wallner <mike@php.net>
Fri, 2 Oct 2020 07:58:06 +0000 (09:58 +0200)
.editorconfig [new file with mode: 0644]
.github/workflows/cmake-build-ci.gen [new file with mode: 0755]
.github/workflows/cmake-build-ci.yml [new file with mode: 0644]
.travis.yml [deleted file]
CMake/CheckDebug.cmake
CMakeConfig.txt

diff --git a/.editorconfig b/.editorconfig
new file mode 100644 (file)
index 0000000..17ed7c8
--- /dev/null
@@ -0,0 +1,29 @@
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.{C,c{,c,pp,xx},h{,h,pp,xx}}]
+indent_style = space
+indent_size = 2
+
+[*.yml]
+indent_style = space
+indent_size = 2
+
+[*.{rst,m{,{,ark}d{,own}}}}]
+trim_trailing_whitespace = false
+indent_style = space
+indent_size = 4
+
+[{CMake{Lists,Config}.txt,*.cmake}]
+indent_style = space
+indent_size = 4
+
+[{Makefile,*.mk}]
+indent_style = tab
+
+
diff --git a/.github/workflows/cmake-build-ci.gen b/.github/workflows/cmake-build-ci.gen
new file mode 100755 (executable)
index 0000000..2d5a6b7
--- /dev/null
@@ -0,0 +1,221 @@
+#!/usr/bin/env php
+<?php
+
+echo "# Generated file; do not edit!\n";
+
+const PRE = "     ";
+const DEF = [
+  "os" => "Linux",
+  "Linux" => "ubuntu-20.04",
+  "macOS" => "macos-10.15",
+  "ubuntu-20.04" => "gnu",
+  "macos-10.15" => "clang",
+  "gnu" => [
+    "ver" => "cur",
+    "CC"  => "gcc",
+    "CXX"  => "g++",
+  ],
+  "clang" => [
+    "ver" => "",
+    "CC"  => "clang",
+    "CXX"  => "clang++",
+  ],
+];
+const APT = [
+  "ubuntu-20.04" => [
+    "gnu" => [
+      "new" => [
+        "CC" => "gcc-10",
+        "CXX" => "g++-10",
+      ]
+    ]
+  ]
+];
+const MAP = [
+  'env.OS_VER' => [
+    "ubuntu-20.04" => [
+      'env.CC_VND' => [
+        "gnu" => [
+          'env.CC_VER' => [
+            "new"  => "-10",
+            "cur"  => "-9",
+            "old"  => "-8"
+          ]
+        ],
+        "clang" => [
+          'env.CC_VER' => [
+            "new"  => "-10",
+            "cur"  => "-9",
+            "old"  => "-8"
+          ]
+        ]
+      ]
+    ],
+    "ubuntu-18.04" => [
+      'env.CC_VND' => [
+        "gnu" => [
+          'env.CC_VER' => [
+            "new"  => "-9",
+            "cur"  => "-8",
+            "old"  => "-7"
+          ]
+        ],
+        "clang" => [
+          'env.CC_VER' => [
+            "new"  => "-9",
+            "cur"  => "-8",
+            "old"  => "-6.0"
+          ]
+        ]
+      ]
+    ]
+  ]
+];
+
+/**
+ * @var bool $splat_map false = no splat map, null = default splat map, true = full splat map
+ */
+function steps($splat_map = null) {
+  if ($splat_map !== false) {
+    foreach (MAP as $os_is => $os_vers) {
+      foreach ($os_vers as $os_ver => $cc_vnds_) {
+        if (!$splat_map && DEF[DEF["os"]] != $os_ver) continue;
+        foreach ($cc_vnds_ as $cc_vnd_is => $cc_vnds) {
+          foreach ($cc_vnds as $cc_vnd => $cc_vers_) {
+            if (!$splat_map && DEF[DEF[DEF["os"]]] != $cc_vnd) continue;
+            foreach ($cc_vers_ as $cc_ver_is => $cc_vers) {
+              foreach ($cc_vers as $cc_ver => $ver) {
+                if (!$splat_map && DEF[DEF[DEF[DEF["os"]]]]["ver"] != $cc_ver) continue;
+?>
+<?=PRE?> - name: Prepare environment (<?= "for $cc_ver $cc_vnd on $os_ver" ?>)
+<?=PRE?>   if: (<?="$os_is=='$os_ver') && ($cc_vnd_is=='$cc_vnd') && ($cc_ver_is=='$cc_ver'"?>)
+<?=PRE?>   run: echo CC=<?=DEF[$cc_vnd]["CC"] . $ver?> >> ${GITHUB_ENV}
+<?=PRE?>   run: echo CXX=<?=DEF[$cc_vnd]["CXX"] . $ver?> >> ${GITHUB_ENV}
+<?php
+                if (isset(APT[$os_ver][$cc_vnd][$cc_ver])) {
+                  $dep = APT[$os_ver][$cc_vnd][$cc_ver];
+?>
+<?=PRE?>   run: echo INSTALL_CC='<?=$dep["CC"]?>' >> ${GITHUB_ENV}
+<?=PRE?>   run: echo INSTALL_CXX='<?=$dep["CXX"]?>' >> ${GITHUB_ENV}
+<?php
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+?>
+<?=PRE?> - name: Install dependencies
+<?=PRE?>   if: runner.os == 'Linux'
+<?=PRE?>   run: sudo apt-get install libevent-dev libsasl-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX}
+<?=PRE?> - name: Generate build tree (${CMAKE_CONFIG_TYPE})
+<?=PRE?>   run: mkdir build
+<?=PRE?>   run: cmake -S . -B build
+<?=PRE?> - name: Build all with ${CXX} ${CXXFLAGS}
+<?=PRE?>   run: make -C build -j2 all
+<?=PRE?> - name: Test
+<?=PRE?>   run: make -C build -j2 test
+<?=PRE?> - name: Install
+<?=PRE?>   run: make -C build -j2 install DESTDIR=.
+<?=PRE?> - name: Failed tests log
+<?=PRE?>   if: ${{ failure() }}
+<?=PRE?>   run: cat Testing/Temporary/LastTest.log
+<?php
+}
+
+?>
+name: cmake-build-ci
+on: 
+  push:
+    paths-ignore: 
+      - "docs/**"
+    branches-ignore: 
+      - gh-pages
+      - v1.x
+  pull_request:
+    branches: 
+      - master
+      - v1.x
+env:
+  # defaults
+  INSTALL_MEMCACHED:  memcached
+  CMAKE_CONFIG_TYPE:  Debug
+  BUILD_TESTING:      "ON"
+  ENABLE_SASL:        "ON"
+  ENABLE_HASH_HSIEH:  "ON"
+  ENABLE_DTRACE:      "ON"
+  VERBOSE:            "ON"
+  OS_VND:   <?=DEF["os"]?> #
+  OS_VER:   <?=DEF[DEF["os"]]?> #
+  CC_VND:   <?=DEF[DEF[DEF["os"]]]?> #
+  CC_VER:   <?=DEF[DEF[DEF[DEF["os"]]]]["ver"]?> #
+
+jobs:
+  # release builds
+  ci-rel:
+    strategy:
+      matrix:
+        os: [ubuntu-20.04, ubuntu-18.04]
+        compiler_vendor: [gnu, clang]
+        compiler_version: [new, cur, old]
+    runs-on: ${{ matrix.os }}
+    env:
+      CMAKE_CONFIG_TYPE: Release
+      CC_VND: ${{ matrix.compiler_vendor }}
+      CC_VER: ${{ matrix.compiler_version }}
+      OS_VND: ${{ runner.os }}
+      OS_VER: ${{ matrix.os }}
+    steps:
+      - uses: actions/checkout@v2
+<?php steps(true); ?>
+
+  # sanitizer build
+  ci-san:
+    runs-on: <?=DEF[DEF["os"]]?> #
+    env:
+      ENABLE_SANITIZERS: "address;undefined"
+    steps: 
+      - uses: actions/checkout@v2
+<?php steps(); ?>
+
+  # coverage build
+  ci-cov:
+    runs-on: <?=DEF[DEF["os"]]?> #
+    env:
+      CFLAGS: --coverage
+      CXXFLAGS: --coverage
+    steps: 
+      - uses: actions/checkout@v2
+<?php steps(); ?>
+      - uses: codecov/codecov-action@v1.0.13
+
+  # memcached new
+  ci-new:
+    runs-on: <?=DEF[DEF["os"]]?> #
+    env:
+      INSTALL_MEMCACHED:
+      MEMCACHED_PREFIX: /tmp
+      MEMCACHED_BINARY: /tmp/bin/memcached
+      enable_sasl: yes
+      enable_sasl_pwdb: yes
+      enable_docs: no
+      enable_coverage: no
+      enable_dependency_tracking: no
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/checkout@v2
+        with:
+          repository: memcached/memcached
+          ref: 1.6.7
+      - name: Build memcached
+        run: |
+          cd memcached
+          ./autogen.sh
+          ./configure CFLAGS="-O2 -pipe" --prefix=${MEMCACHED_PREFIX}
+          make -j2
+          make install
+          cd ..
+      <?php steps(); ?>
+
diff --git a/.github/workflows/cmake-build-ci.yml b/.github/workflows/cmake-build-ci.yml
new file mode 100644 (file)
index 0000000..e33e604
--- /dev/null
@@ -0,0 +1,212 @@
+# Generated file; do not edit!
+name: cmake-build-ci
+on: 
+  push:
+    paths-ignore: 
+      - "docs/**"
+    branches-ignore: 
+      - gh-pages
+      - v1.x
+  pull_request:
+    branches: 
+      - master
+      - v1.x
+env:
+  # defaults
+  INSTALL_MEMCACHED:  memcached
+  CMAKE_CONFIG_TYPE:  Debug
+  BUILD_TESTING:      "ON"
+  ENABLE_SASL:        "ON"
+  ENABLE_HASH_HSIEH:  "ON"
+  ENABLE_DTRACE:      "ON"
+  VERBOSE:            "ON"
+  OS_VND:   Linux #
+  OS_VER:   ubuntu-20.04 #
+  CC_VND:   gnu #
+  CC_VER:   cur #
+
+jobs:
+  # release builds
+  ci-rel:
+    strategy:
+      matrix:
+        os: [ubuntu-20.04, ubuntu-18.04]
+        compiler_vendor: [gnu, clang]
+        compiler_version: [new, cur, old]
+    runs-on: ${{ matrix.os }}
+    env:
+      CMAKE_CONFIG_TYPE: Release
+      CC_VND: ${{ matrix.compiler_vendor }}
+      CC_VER: ${{ matrix.compiler_version }}
+      OS_VND: ${{ runner.os }}
+      OS_VER: ${{ matrix.os }}
+    steps:
+      - uses: actions/checkout@v2
+      - name: Prepare environment (for new gnu on ubuntu-20.04)
+        if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='gnu') && (env.CC_VER=='new')
+        run: echo CC=gcc-10 >> ${GITHUB_ENV}
+        run: echo CXX=g++-10 >> ${GITHUB_ENV}
+        run: echo INSTALL_CC='gcc-10' >> ${GITHUB_ENV}
+        run: echo INSTALL_CXX='g++-10' >> ${GITHUB_ENV}
+      - name: Prepare environment (for cur gnu on ubuntu-20.04)
+        if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='gnu') && (env.CC_VER=='cur')
+        run: echo CC=gcc-9 >> ${GITHUB_ENV}
+        run: echo CXX=g++-9 >> ${GITHUB_ENV}
+      - name: Prepare environment (for old gnu on ubuntu-20.04)
+        if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='gnu') && (env.CC_VER=='old')
+        run: echo CC=gcc-8 >> ${GITHUB_ENV}
+        run: echo CXX=g++-8 >> ${GITHUB_ENV}
+      - name: Prepare environment (for new clang on ubuntu-20.04)
+        if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='clang') && (env.CC_VER=='new')
+        run: echo CC=clang-10 >> ${GITHUB_ENV}
+        run: echo CXX=clang++-10 >> ${GITHUB_ENV}
+      - name: Prepare environment (for cur clang on ubuntu-20.04)
+        if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='clang') && (env.CC_VER=='cur')
+        run: echo CC=clang-9 >> ${GITHUB_ENV}
+        run: echo CXX=clang++-9 >> ${GITHUB_ENV}
+      - name: Prepare environment (for old clang on ubuntu-20.04)
+        if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='clang') && (env.CC_VER=='old')
+        run: echo CC=clang-8 >> ${GITHUB_ENV}
+        run: echo CXX=clang++-8 >> ${GITHUB_ENV}
+      - name: Prepare environment (for new gnu on ubuntu-18.04)
+        if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='gnu') && (env.CC_VER=='new')
+        run: echo CC=gcc-9 >> ${GITHUB_ENV}
+        run: echo CXX=g++-9 >> ${GITHUB_ENV}
+      - name: Prepare environment (for cur gnu on ubuntu-18.04)
+        if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='gnu') && (env.CC_VER=='cur')
+        run: echo CC=gcc-8 >> ${GITHUB_ENV}
+        run: echo CXX=g++-8 >> ${GITHUB_ENV}
+      - name: Prepare environment (for old gnu on ubuntu-18.04)
+        if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='gnu') && (env.CC_VER=='old')
+        run: echo CC=gcc-7 >> ${GITHUB_ENV}
+        run: echo CXX=g++-7 >> ${GITHUB_ENV}
+      - name: Prepare environment (for new clang on ubuntu-18.04)
+        if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='clang') && (env.CC_VER=='new')
+        run: echo CC=clang-9 >> ${GITHUB_ENV}
+        run: echo CXX=clang++-9 >> ${GITHUB_ENV}
+      - name: Prepare environment (for cur clang on ubuntu-18.04)
+        if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='clang') && (env.CC_VER=='cur')
+        run: echo CC=clang-8 >> ${GITHUB_ENV}
+        run: echo CXX=clang++-8 >> ${GITHUB_ENV}
+      - name: Prepare environment (for old clang on ubuntu-18.04)
+        if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='clang') && (env.CC_VER=='old')
+        run: echo CC=clang-6.0 >> ${GITHUB_ENV}
+        run: echo CXX=clang++-6.0 >> ${GITHUB_ENV}
+      - name: Install dependencies
+        if: runner.os == 'Linux'
+        run: sudo apt-get install libevent-dev libsasl-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX}
+      - name: Generate build tree (${CMAKE_CONFIG_TYPE})
+        run: mkdir build
+        run: cmake -S . -B build
+      - name: Build all with ${CXX} ${CXXFLAGS}
+        run: make -C build -j2 all
+      - name: Test
+        run: make -C build -j2 test
+      - name: Install
+        run: make -C build -j2 install DESTDIR=.
+      - name: Failed tests log
+        if: ${{ failure() }}
+        run: cat Testing/Temporary/LastTest.log
+
+  # sanitizer build
+  ci-san:
+    runs-on: ubuntu-20.04 #
+    env:
+      ENABLE_SANITIZERS: "address;undefined"
+    steps: 
+      - uses: actions/checkout@v2
+      - name: Prepare environment (for cur gnu on ubuntu-20.04)
+        if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='gnu') && (env.CC_VER=='cur')
+        run: echo CC=gcc-9 >> ${GITHUB_ENV}
+        run: echo CXX=g++-9 >> ${GITHUB_ENV}
+      - name: Install dependencies
+        if: runner.os == 'Linux'
+        run: sudo apt-get install libevent-dev libsasl-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX}
+      - name: Generate build tree (${CMAKE_CONFIG_TYPE})
+        run: mkdir build
+        run: cmake -S . -B build
+      - name: Build all with ${CXX} ${CXXFLAGS}
+        run: make -C build -j2 all
+      - name: Test
+        run: make -C build -j2 test
+      - name: Install
+        run: make -C build -j2 install DESTDIR=.
+      - name: Failed tests log
+        if: ${{ failure() }}
+        run: cat Testing/Temporary/LastTest.log
+
+  # coverage build
+  ci-cov:
+    runs-on: ubuntu-20.04 #
+    env:
+      CFLAGS: --coverage
+      CXXFLAGS: --coverage
+    steps: 
+      - uses: actions/checkout@v2
+      - name: Prepare environment (for cur gnu on ubuntu-20.04)
+        if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='gnu') && (env.CC_VER=='cur')
+        run: echo CC=gcc-9 >> ${GITHUB_ENV}
+        run: echo CXX=g++-9 >> ${GITHUB_ENV}
+      - name: Install dependencies
+        if: runner.os == 'Linux'
+        run: sudo apt-get install libevent-dev libsasl-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX}
+      - name: Generate build tree (${CMAKE_CONFIG_TYPE})
+        run: mkdir build
+        run: cmake -S . -B build
+      - name: Build all with ${CXX} ${CXXFLAGS}
+        run: make -C build -j2 all
+      - name: Test
+        run: make -C build -j2 test
+      - name: Install
+        run: make -C build -j2 install DESTDIR=.
+      - name: Failed tests log
+        if: ${{ failure() }}
+        run: cat Testing/Temporary/LastTest.log
+      - uses: codecov/codecov-action@v1.0.13
+
+  # memcached new
+  ci-new:
+    runs-on: ubuntu-20.04 #
+    env:
+      INSTALL_MEMCACHED:
+      MEMCACHED_PREFIX: /tmp
+      MEMCACHED_BINARY: /tmp/bin/memcached
+      enable_sasl: yes
+      enable_sasl_pwdb: yes
+      enable_docs: no
+      enable_coverage: no
+      enable_dependency_tracking: no
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/checkout@v2
+        with:
+          repository: memcached/memcached
+          ref: 1.6.7
+      - name: Build memcached
+        run: |
+          cd memcached
+          ./autogen.sh
+          ./configure CFLAGS="-O2 -pipe" --prefix=${MEMCACHED_PREFIX}
+          make -j2
+          make install
+          cd ..
+            - name: Prepare environment (for cur gnu on ubuntu-20.04)
+        if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='gnu') && (env.CC_VER=='cur')
+        run: echo CC=gcc-9 >> ${GITHUB_ENV}
+        run: echo CXX=g++-9 >> ${GITHUB_ENV}
+      - name: Install dependencies
+        if: runner.os == 'Linux'
+        run: sudo apt-get install libevent-dev libsasl-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX}
+      - name: Generate build tree (${CMAKE_CONFIG_TYPE})
+        run: mkdir build
+        run: cmake -S . -B build
+      - name: Build all with ${CXX} ${CXXFLAGS}
+        run: make -C build -j2 all
+      - name: Test
+        run: make -C build -j2 test
+      - name: Install
+        run: make -C build -j2 install DESTDIR=.
+      - name: Failed tests log
+        if: ${{ failure() }}
+        run: cat Testing/Temporary/LastTest.log
+
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index 5d96e69..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-services:
- - memcached
-
-addons:
- apt:
-  packages:
-   - python-sphinx
-   - valgrind
-   - libevent-dev
-   - libsasl2-dev
-
-dist: bionic
-language: cpp
-compiler:
-# - gcc
- - clang
-
-env:
-# - BUILD=Release SASL=false
-# - BUILD=Debug SASL=true PREFIX=/opt PORT=11212 MC_VERSION=1.5.22
-# - BUILD=Debug SASL=false PREFIX=/opt PORT=11212 MC_VERSION=1.6.6
- - BUILD=Debug SASL=true PREFIX=/opt PORT=11212 SANITIZERS="address;undefined"
-
-#before_install:
-install:
- - |
-   if ${SASL} || test -n "$MC_VERSION";
-   then
-     git clone -b ${MC_VERSION:-1.5.22} https://github.com/memcached/memcached &&
-     cd memcached && ./autogen.sh &&
-     CFLAGS="-O2 -pipe" ./configure --prefix=${PREFIX} --disable-dependency-tracking --enable-sasl --enable-sasl-pwdb --disable-coverage --disable-docs &&
-     make -j2 && make install && cd ..;
-     ${PREFIX}/bin/memcached -l 127.0.0.1 -p ${PORT} -U ${PORT} -m 128 &
-   fi;
-
-
-before_script:
- - echo stats settings | nc -q 0 localhost ${PORT:-11211} | column -t
- - sudo systemctl stop memcached
- - killall memcached || true
- - mkdir build
-
-script:
- - cd build
- - cmake -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=${BUILD} -DENABLE_SASL=${SASL} -DENABLE_SANITIZERS=${SANITIZERS} -DMEMCACHED_BINARY=${PREFIX:-/usr}/bin/memcached ..
- - make -j2 VERBOSE=1
- - make test VERBOSE=1
- - make install DESTDIR=.
-
-#before_cache:
-#after_success:
-
-after_failure:
- - cat Testing/Temporary/LastTest.log
-
-#after_script:
index cd0dd9b40f0cbbdd5e68a4e5de4610b8fe5d9d91..32fbf26d1ddb1dcd7caf576d4a2fdb13a487e164 100644 (file)
@@ -49,10 +49,7 @@ function(check_debug)
                 if(HAVE_ASAN)
                     add_compile_definitions(HAVE_ASAN)
                     add_compile_options(-fsanitize=address)
-                    if(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
-                        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -v -fsanitize=address")
-                    endif()
-                    link_libraries(asan)
+                    link_libraries(-fsanitize=address)
                     check_flag(-fsanitize-recover=address IGNORE)
                 endif()
             endif()
@@ -65,10 +62,7 @@ function(check_debug)
                 if(HAVE_UBSAN)
                     add_compile_definitions(HAVE_UBSAN)
                     add_compile_options(-fsanitize=undefined)
-                    if(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
-                        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -v -fsanitize=undefined")
-                    endif()
-                    link_libraries(ubsan)
+                    link_libraries(-fsanitize=undefined)
                     check_flag(-fsanitize-recover=undefined IGNORE)
                 endif()
             endif()
index b99b507dae388c3f7e7aa83582c2f5c845fd13ac..231ebcbc31417bce44ca655db63d7b3f06662b1c 100644 (file)
@@ -13,9 +13,9 @@ elseif(UNIX)
 endif()
 
 option(BUILD_TESTING        "whether to enable build of the test suite"
-        OFF)
+        $ENV{BUILD_TESTING})
 option(BUILD_DOCSONLY       "build *only* documentation"
-        OFF)
+        $ENV{BUILD_DOCSONLY})
 option(BUILD_DOCS           "build documentation"
         ${BUILD_DOCSONLY})
 option(BUILD_DOCS_HTML      "build HTML docs"
@@ -26,19 +26,19 @@ option(BUILD_DOCS_MANGZ     "gzip manpages"
         ${BUILD_DOCS_MAN})
 
 option(ENABLE_DTRACE        "enable dtrace support"
-        OFF)
+        $ENV{ENABLE_DTRACE})
 option(ENABLE_HASH_FNV64    "enable fnv64 hash support"
         ON)
 option(ENABLE_HASH_MURMUR   "enable murmur hash support"
         ON)
 option(ENABLE_HASH_HSIEH    "enable hsieh hash support"
-        OFF)
+        $ENV{ENABLE_HASH_HSIEH})
 option(ENABLE_MEMASLAP      "enable memaslap client"
         ON)
 option(ENABLE_SASL          "enable SASL support"
-        OFF)
+        $ENV{ENABLE_SASL})
 
-set(ENABLE_SANITIZERS ""
+set(ENABLE_SANITIZERS $ENV{ENABLE_SANITIZERS}
     CACHE STRING "sanitizers to enable (e.g. address undefined ...)")
 
 if(BUILD_TESTING)