<commit_before>PROJECT(vtklibxml2 C)

SET(PACKAGE "vtklibxml2")
SET(VERSION "2.6.27")
SET(LIBXML_VERSION_NUMBER 20627)
SET(LIBXML_VERSION_EXTRA "")
SET(MODULE_EXTENSION ${CMAKE_SHARED_MODULE_SUFFIX})

SET(PACKAGE_TARNAME "")
SET(PACKAGE_BUGREPORT " ")
SET(PACKAGE_NAME "")
SET(PACKAGE_VERSION "")
SET(PACKAGE_STRING "")
SET(PACKAGE_BUGREPORT "")

INCLUDE(CheckLibraryExists)
INCLUDE(CheckIncludeFile)
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckSymbolExists)
INCLUDE(libxml2PlatformTests.cmake)

SET(LIBXML2_PLATFORM_TEST_FILE_C platformTestsC.c)

FIND_PACKAGE(Threads)

SET(CMAKE_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING
  "Thread library used.")

# This macro checks if the symbol exists in the library and if it
# does, it appends library to the list.
SET(LIBXML2_LIBS "")
MACRO(CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
  CHECK_LIBRARY_EXISTS("${LIBRARY};${LIBXML2_LIBS}" ${SYMBOL} "" ${VARIABLE})
  IF(${VARIABLE})
    SET(LIBXML2_LIBS ${LIBXML2_LIBS} ${LIBRARY})
  ENDIF(${VARIABLE})
ENDMACRO(CHECK_LIBRARY_EXISTS_CONCAT)

CHECK_LIBRARY_EXISTS_CONCAT("dl"       dlopen         HAVE_LIBDL)
CHECK_LIBRARY_EXISTS_CONCAT("history"  append_history HAVE_LIBHISTORY)
CHECK_LIBRARY_EXISTS_CONCAT("readline" readline       HAVE_LIBREADLINE)
CHECK_LIBRARY_EXISTS_CONCAT("z"        inflateEnd     HAVE_LIBZ)

SET(LIBXML2_LIBS ${LIBXML2_LIBS} ${CMAKE_THREAD_LIBS} ${CMAKE_DL_LIBS})
IF(UNIX)
  SET(LIBXML2_LIBS ${LIBXML2_LIBS} m)
ENDIF(UNIX)

# Check for symbol dlopen separately from the dl library.
CHECK_LIBRARY_EXISTS("${LIBXML2_LIBS}" dlopen "" HAVE_DLOPEN)

# For other tests to use the same libraries
SET(CMAKE_REQUIRED_LIBRARIES ${LIBXML2_LIBS})
SET(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")

# Check if header file exists and add it to the list.
MACRO(CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
  CHECK_INCLUDE_FILES("${LIBXML2_INCLUDES};${FILE}" ${VARIABLE})
  IF(${VARIABLE})
    SET(LIBXML2_INCLUDES ${LIBXML2_INCLUDES} ${FILE})
  ENDIF(${VARIABLE})
ENDMACRO(CHECK_INCLUDE_FILE_CONCAT)

# Check for headers not actually needed for the configured header but
# that may be needed to include the other headers tested.
CHECK_INCLUDE_FILE_CONCAT("stdio.h"          HAVE_STDIO_H)
CHECK_INCLUDE_FILE_CONCAT("stddef.h"         HAVE_STDDEF_H)

CHECK_INCLUDE_FILE_CONCAT("sys/types.h"      HAVE_SYS_TYPES_H)<commit_msg>COMP: Added HAVE_SHLLOAD configuration test.<commit_after>PROJECT(vtklibxml2 C)

SET(PACKAGE "vtklibxml2")
SET(VERSION "2.6.27")
SET(LIBXML_VERSION_NUMBER 20627)
SET(LIBXML_VERSION_EXTRA "")
SET(MODULE_EXTENSION ${CMAKE_SHARED_MODULE_SUFFIX})

SET(PACKAGE_TARNAME "")
SET(PACKAGE_BUGREPORT " ")
SET(PACKAGE_NAME "")
SET(PACKAGE_VERSION "")
SET(PACKAGE_STRING "")
SET(PACKAGE_BUGREPORT "")

INCLUDE(CheckLibraryExists)
INCLUDE(CheckIncludeFile)
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckSymbolExists)
INCLUDE(libxml2PlatformTests.cmake)

SET(LIBXML2_PLATFORM_TEST_FILE_C platformTestsC.c)

FIND_PACKAGE(Threads)

SET(CMAKE_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING
  "Thread library used.")

# This macro checks if the symbol exists in the library and if it
# does, it appends library to the list.
SET(LIBXML2_LIBS "")
MACRO(CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
  CHECK_LIBRARY_EXISTS("${LIBRARY};${LIBXML2_LIBS}" ${SYMBOL} "" ${VARIABLE})
  IF(${VARIABLE})
    SET(LIBXML2_LIBS ${LIBXML2_LIBS} ${LIBRARY})
  ENDIF(${VARIABLE})
ENDMACRO(CHECK_LIBRARY_EXISTS_CONCAT)

CHECK_LIBRARY_EXISTS_CONCAT("dl"       dlopen         HAVE_LIBDL)
CHECK_LIBRARY_EXISTS_CONCAT("dld"      shl_load       HAVE_SHLLOAD)
CHECK_LIBRARY_EXISTS_CONCAT("history"  append_history HAVE_LIBHISTORY)
CHECK_LIBRARY_EXISTS_CONCAT("readline" readline       HAVE_LIBREADLINE)
CHECK_LIBRARY_EXISTS_CONCAT("z"        inflateEnd     HAVE_LIBZ)

SET(LIBXML2_LIBS ${LIBXML2_LIBS} ${CMAKE_THREAD_LIBS} ${CMAKE_DL_LIBS})
IF(UNIX)
  SET(LIBXML2_LIBS ${LIBXML2_LIBS} m)
ENDIF(UNIX)

# Check for symbol dlopen separately from the dl library.
CHECK_LIBRARY_EXISTS("${LIBXML2_LIBS}" dlopen "" HAVE_DLOPEN)

# For other tests to use the same libraries
SET(CMAKE_REQUIRED_LIBRARIES ${LIBXML2_LIBS})
SET(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")

# Check if header file exists and add it to the list.
MACRO(CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
  CHECK_INCLUDE_FILES("${LIBXML2_INCLUDES};${FILE}" ${VARIABLE})
  IF(${VARIABLE})
    SET(LIBXML2_INCLUDES ${LIBXML2_INCLUDES} ${FILE})
  ENDIF(${VARIABLE})
ENDMACRO(CHECK_INCLUDE_FILE_CONCAT)

# Check for headers not actually needed for the configured header but
# that may be needed to include the other headers tested.
CHECK_INCLUDE_FILE_CONCAT("stdio.h"          HAVE_STDIO_H)
CHECK_INCLUDE_FILE_CONCAT("stddef.h"         HAVE_STDDEF_H)

CHECK_INCLUDE_FILE_CONCAT("sys/types.h"      HAVE_SYS_TYPES_H)
{'fraction_non_alphanumeric': 0.10199370409233997, 'fraction_numerical': 0.010912906610703044, 'mean_word_length': 7.1331058020477816, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '5197779', 'n_tokens_mistral': 1933, 'n_tokens_neox': 1777, 'n_words': 326}