<commit_before>dnl Check for YAJL Libraries
dnl CHECK_YAJL(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])

AC_DEFUN([PROG_YAJL], [

# Needed if pkg-config will be used.
AC_REQUIRE([PKG_PROG_PKG_CONFIG])


# Possible names for the yajl library/package (pkg-config)
YAJL_POSSIBLE_LIB_NAMES="yajl2 yajl"

# Possible extensions for the library
YAJL_POSSIBLE_EXTENSIONS="so la sl dll dylib"

# Possible paths (if pkg-config was not found, proceed with the file lookup)
YAJL_POSSIBLE_PATHS="/usr/lib /usr/local/lib /usr/local/libyajl /usr/local/yajl /usr/local /opt/libyajl /opt/yajl /opt /usr"

# Variables to be set by this very own script.
YAJL_VERSION=""
YAJL_CFLAGS=""
YAJL_CPPFLAGS=""
YAJL_LDADD=""
YAJL_LDFLAGS=""

AC_ARG_WITH(
    yajl,
    AC_HELP_STRING(
      [--with-yajl=PATH],
      [Path to yajl prefix or config script]
    )
)

if test "x${with_yajl}" == "xno"; then
    AC_DEFINE(HAVE_GEOIP, 0, [Support for GeoIP was disabled by the utilization of --without-yajl or --with-yajl=no])
    AC_MSG_NOTICE([Support for GeoIP was disabled by the utilization of --without-yajl or --with-yajl=no])
    YAJL_DISABLED=yes
else
    if test "x${with_yajl}" == "xyes"; then
        YAJL_MANDATORY=yes
        AC_MSG_NOTICE([GeoIP support was marked as mandatory by the utilization of --with-yajl=yes])
    fi
#        for x in ${YAJL_POSSIBLE_LIB_NAMES}; do
#            CHECK_FOR_YAJL_AT(${x})
#            if test -n "${YAJL_VERSION}"; then
#                break
#            fi
#        done

#    if test "x${with_yajl}" != "xyes" or test "x${with_yajl}" == "xyes"; then
        if test "x${with_yajl}" == "x" || test "x${with_yajl}" == "xyes"; then
            # Nothing about GeoIP was informed, using the pkg-config to figure things out.
            if test -n "${PKG_CONFIG}"; then
                YAJL_PKG_NAME=""
                for x in ${YAJL_POSSIBLE_LIB_NAMES}; do
                    if ${PKG_CONFIG} --exists ${x}; then
                        YAJL_PKG_NAME="$x"
                        break
                    fi
                done
            fi
            AC_MSG_NOTICE([Nothing about GeoIP was informed during the configure phase. Trying to detect it on the platform...])
            if test -n "${YAJL_PKG_NAME}"; then
                # Package was found using the pkg-config scripts
                YAJL_VERSION="`${PKG_CONFIG} ${YAJL_PKG_NAME} --modversion`"
                YAJL_CFLAGS="`${PKG_CONFIG} ${YAJL_PKG_NAME} --cflags`"
                YAJL_LDADD="`${PKG_CONFIG} ${YAJL_PKG_NAME} --libs-only-l`"
                YAJL_LDFLAGS="`${PKG_CONFIG} ${YAJL_PKG_NAME} --libs-only-L --libs-only-other`"
                YAJL_DISPLAY="${YAJL_LDADD}, ${YAJL_CFLAGS}"
            else
                # If pkg-config did not find anything useful, go over file lookup.
                for x in ${YAJL_POSSIBLE_LIB_NAMES}; do
                    CHECK_FOR_YAJL_AT(${x})
                    if test -n "${YAJL_VERSION}"; then
                        break
                    fi
                done
            fi
        fi
        if test "x${with_yajl}" != "x"; then
            # An specific path was informed, lets check.
            YAJL_MANDATORY=yes
            CHECK_FOR_YAJL_AT(${with_yajl})
        fi
#    fi
fi

if test -z "${YAJL_CFLAGS}"; then
    if test -z "${YAJL_MANDATORY}"; then
        if test -z "${YAJL_DISABLED}"; then
            AC_MSG_NOTICE([YAJL library was not found])
            YAJL_FOUND=0
        else
            YAJL_FOUND=2
        fi<commit_msg>Build: Looking for YAJL's LD flags instead of CFLAGS<commit_after>dnl Check for YAJL Libraries
dnl CHECK_YAJL(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])

AC_DEFUN([PROG_YAJL], [

# Needed if pkg-config will be used.
AC_REQUIRE([PKG_PROG_PKG_CONFIG])


# Possible names for the yajl library/package (pkg-config)
YAJL_POSSIBLE_LIB_NAMES="yajl2 yajl"

# Possible extensions for the library
YAJL_POSSIBLE_EXTENSIONS="so la sl dll dylib"

# Possible paths (if pkg-config was not found, proceed with the file lookup)
YAJL_POSSIBLE_PATHS="/usr/lib /usr/local/lib /usr/local/libyajl /usr/local/yajl /usr/local /opt/libyajl /opt/yajl /opt /usr"

# Variables to be set by this very own script.
YAJL_VERSION=""
YAJL_CFLAGS=""
YAJL_CPPFLAGS=""
YAJL_LDADD=""
YAJL_LDFLAGS=""

AC_ARG_WITH(
    yajl,
    AC_HELP_STRING(
      [--with-yajl=PATH],
      [Path to yajl prefix or config script]
    )
)

if test "x${with_yajl}" == "xno"; then
    AC_DEFINE(HAVE_GEOIP, 0, [Support for GeoIP was disabled by the utilization of --without-yajl or --with-yajl=no])
    AC_MSG_NOTICE([Support for GeoIP was disabled by the utilization of --without-yajl or --with-yajl=no])
    YAJL_DISABLED=yes
else
    if test "x${with_yajl}" == "xyes"; then
        YAJL_MANDATORY=yes
        AC_MSG_NOTICE([GeoIP support was marked as mandatory by the utilization of --with-yajl=yes])
    fi
#        for x in ${YAJL_POSSIBLE_LIB_NAMES}; do
#            CHECK_FOR_YAJL_AT(${x})
#            if test -n "${YAJL_VERSION}"; then
#                break
#            fi
#        done

#    if test "x${with_yajl}" != "xyes" or test "x${with_yajl}" == "xyes"; then
        if test "x${with_yajl}" == "x" || test "x${with_yajl}" == "xyes"; then
            # Nothing about GeoIP was informed, using the pkg-config to figure things out.
            if test -n "${PKG_CONFIG}"; then
                YAJL_PKG_NAME=""
                for x in ${YAJL_POSSIBLE_LIB_NAMES}; do
                    if ${PKG_CONFIG} --exists ${x}; then
                        YAJL_PKG_NAME="$x"
                        break
                    fi
                done
            fi
            AC_MSG_NOTICE([Nothing about GeoIP was informed during the configure phase. Trying to detect it on the platform...])
            if test -n "${YAJL_PKG_NAME}"; then
                # Package was found using the pkg-config scripts
                YAJL_VERSION="`${PKG_CONFIG} ${YAJL_PKG_NAME} --modversion`"
                YAJL_CFLAGS="`${PKG_CONFIG} ${YAJL_PKG_NAME} --cflags`"
                YAJL_LDADD="`${PKG_CONFIG} ${YAJL_PKG_NAME} --libs-only-l`"
                YAJL_LDFLAGS="`${PKG_CONFIG} ${YAJL_PKG_NAME} --libs-only-L --libs-only-other`"
                YAJL_DISPLAY="${YAJL_LDADD}, ${YAJL_CFLAGS}"
            else
                # If pkg-config did not find anything useful, go over file lookup.
                for x in ${YAJL_POSSIBLE_LIB_NAMES}; do
                    CHECK_FOR_YAJL_AT(${x})
                    if test -n "${YAJL_VERSION}"; then
                        break
                    fi
                done
            fi
        fi
        if test "x${with_yajl}" != "x"; then
            # An specific path was informed, lets check.
            YAJL_MANDATORY=yes
            CHECK_FOR_YAJL_AT(${with_yajl})
        fi
#    fi
fi

if test -z "${YAJL_LDADD}"; then
    if test -z "${YAJL_MANDATORY}"; then
        if test -z "${YAJL_DISABLED}"; then
            AC_MSG_NOTICE([YAJL library was not found])
            YAJL_FOUND=0
        else
            YAJL_FOUND=2
        fi
{'fraction_non_alphanumeric': 0.11303606929849475, 'fraction_numerical': 0.001136040897472309, 'mean_word_length': 2.0822757111597374, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3569399', 'n_tokens_mistral': 2649, 'n_tokens_neox': 2463, 'n_words': 623}