<commit_before># $Id$

AC_DEFUN([ACX_SEMAPHORE],[
	SEMAPHORE_LIB=

	AC_CHECK_LIB(
		rt,
		sem_open,
		[
			AC_CHECK_LIB(rt, sem_close,    [], AC_MSG_ERROR([Could not find sem_close]))
			AC_CHECK_LIB(rt, sem_unlink,   [], AC_MSG_ERROR([Could not find sem_unlink]))
			AC_CHECK_LIB(rt, sem_post,     [], AC_MSG_ERROR([Could not find sem_post]))
			AC_CHECK_LIB(rt, sem_wait,     [], AC_MSG_ERROR([Could not find sem_wait]))
			AC_CHECK_LIB(rt, sem_trywait,  [], AC_MSG_ERROR([Could not find sem_trywait]))
			AC_CHECK_LIB(rt, sem_getvalue, [], AC_MSG_ERROR([Could not find sem_getvalue]))
			SEMAPHORE_LIB=-lrt
		],
		[
			AC_CHECK_LIB(
				posix4,
				sem_open,
				[
					AC_CHECK_LIB(posix4, sem_close,    [], AC_MSG_ERROR([Could not find sem_close]))
					AC_CHECK_LIB(posix4, sem_unlink,   [], AC_MSG_ERROR([Could not find sem_unlink]))
					AC_CHECK_LIB(posix4, sem_post,     [], AC_MSG_ERROR([Could not find sem_post]))
					AC_CHECK_LIB(posix4, sem_wait,     [], AC_MSG_ERROR([Could not find sem_wait]))
					AC_CHECK_LIB(posix4, sem_trywait,  [], AC_MSG_ERROR([Could not find sem_trywait]))
					AC_CHECK_LIB(posix4, sem_getvalue, [], AC_MSG_ERROR([Could not find sem_getvalue]))
					SEMAPHORE_LIB=-lposix4
				]
			)
		]
	)
	AC_SUBST([SEMAPHORE_LIB])

	AC_CHECK_HEADERS([fcntl.h sys/stat.h])
])
<commit_msg>Fix for linking pthread into .so on Linux which is left out by libtool<commit_after># $Id$

AC_DEFUN([ACX_SEMAPHORE],[
	SEMAPHORE_LIB=

	AC_CHECK_LIB(
		rt,
		sem_open,
		[
			AC_CHECK_LIB(rt, sem_close,    [], AC_MSG_ERROR([Could not find sem_close]))
			AC_CHECK_LIB(rt, sem_unlink,   [], AC_MSG_ERROR([Could not find sem_unlink]))
			AC_CHECK_LIB(rt, sem_post,     [], AC_MSG_ERROR([Could not find sem_post]))
			AC_CHECK_LIB(rt, sem_wait,     [], AC_MSG_ERROR([Could not find sem_wait]))
			AC_CHECK_LIB(rt, sem_trywait,  [], AC_MSG_ERROR([Could not find sem_trywait]))
			AC_CHECK_LIB(rt, sem_getvalue, [], AC_MSG_ERROR([Could not find sem_getvalue]))
			SEMAPHORE_LIB=-lrt
		],
		[
			AC_CHECK_LIB(
				posix4,
				sem_open,
				[
					AC_CHECK_LIB(posix4, sem_close,    [], AC_MSG_ERROR([Could not find sem_close]))
					AC_CHECK_LIB(posix4, sem_unlink,   [], AC_MSG_ERROR([Could not find sem_unlink]))
					AC_CHECK_LIB(posix4, sem_post,     [], AC_MSG_ERROR([Could not find sem_post]))
					AC_CHECK_LIB(posix4, sem_wait,     [], AC_MSG_ERROR([Could not find sem_wait]))
					AC_CHECK_LIB(posix4, sem_trywait,  [], AC_MSG_ERROR([Could not find sem_trywait]))
					AC_CHECK_LIB(posix4, sem_getvalue, [], AC_MSG_ERROR([Could not find sem_getvalue]))
					SEMAPHORE_LIB=-lposix4
				],
				[
					AC_CHECK_LIB(
						pthread,
						sem_open,
						[
							AC_CHECK_LIB(pthread, sem_close,    [], AC_MSG_ERROR([Could not find sem_close]))
							AC_CHECK_LIB(pthread, sem_unlink,   [], AC_MSG_ERROR([Could not find sem_unlink]))
							AC_CHECK_LIB(pthread, sem_post,     [], AC_MSG_ERROR([Could not find sem_post]))
							AC_CHECK_LIB(pthread, sem_wait,     [], AC_MSG_ERROR([Could not find sem_wait]))
							AC_CHECK_LIB(pthread, sem_trywait,  [], AC_MSG_ERROR([Could not find sem_trywait]))
							AC_CHECK_LIB(pthread, sem_getvalue, [], AC_MSG_ERROR([Could not find sem_getvalue]))
							SEMAPHORE_LIB=-lpthread
						]
					)
				]	
			)
		]
	)
	AC_SUBST([SEMAPHORE_LIB])

	AC_CHECK_HEADERS([fcntl.h sys/stat.h])
])

{'fraction_non_alphanumeric': 0.12847325963549447, 'fraction_numerical': 0.004780400358530027, 'mean_word_length': 4.142857142857143, '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': '4781248', 'n_tokens_mistral': 1517, 'n_tokens_neox': 1330, 'n_words': 227}