summaryrefslogtreecommitdiff
path: root/m4/libo_fuzz_configury.m4
blob: c243fed8f3d11c0f596a30f838e7974a7a936b34 (plain)
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
dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; fill-column: 102 -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
AC_DEFUN([libo_FUZZ_ARG_WITH], [
    AC_ARG_WITH([$1],
        [$2],
        [$3],
        if test "$enable_fuzz_options" = yes; then
            if test `expr $RANDOM % 2` = 1; then
                m4_translit([with-$1], [-+.], [___])=yes
            else
                m4_translit([with-$1], [-+.], [___])=no
            fi
            AC_MSG_NOTICE([Randomly set m4_translit([with-$1], [-+.], [___]) to $m4_translit([with-$1], [-+.], [___])])
            libo_fuzzed_[]m4_translit([with-$1], [-+.], [___])=yes
        fi
        [$4]
        )
])

AC_DEFUN([libo_FUZZ_ARG_ENABLE], [
    AC_ARG_ENABLE([$1],
        [$2],
        [$3],
        if test "$enable_fuzz_options" = yes; then
            if test `expr $RANDOM % 2` = 1; then
                m4_translit([enable-$1], [-+.], [___])=yes
            else
                m4_translit([enable-$1], [-+.], [___])=no
            fi
            AC_MSG_NOTICE([Randomly set m4_translit([enable-$1], [-+.], [___]) to $m4_translit([enable-$1], [-+.], [___])])
            libo_fuzzed_[]m4_translit([enable-$1], [-+.], [___])=yes
        fi
        [$4])
])

dnl vim:set shiftwidth=4 softtabstop=4 expandtab: