<commit_before>#!/bin/bash
#
# Script to generate the Borland's C++ Compiler 5.5 Makefiles
#
# Copyright (c) 2014, <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

EXIT_SUCCESS=0;
EXIT_FAILURE=1;

REQUIRES_ZLIB=0;

if test ! -f configure.ac;
then
	echo "Missing: configure.ac";

	exit ${EXIT_FAILURE};
fi

PROJECT=`grep -A 1 'AC_INIT' configure.ac | grep -v 'AC_INIT' | sed 's/^[^\[]*\[//;s/\][^\]]*$//'`;
PREFIX=`echo ${PROJECT} | sed 's/lib//'`;

for DIRECTORY in lib* *tools;
do
	if test ! -d ${DIRECTORY};
	then
		continue;
	fi
	# Do not compile .Net or Python bindings.
	if test ${DIRECTORY} = "${PREFIX}.net" || test ${DIRECTORY} = "py${PREFIX}";
	then
		continue;
	fi
	if test ! -f ${DIRECTORY}/Makefile.am;
	then
		continue;
	fi

	# Determine the build targets.
	grep -e '^bin_PROGRAMS' ${DIRECTORY}/Makefile.am > /dev/null;
	if test $? -eq 0;
	then
		BUILD_TARGETS=`sed '/^AM_CPPFLAGS =/,/^bin_PROGRAMS =/ { d }; /^$/,$ { d }' ${DIRECTORY}/Makefile.am | sed 's/^\s*//;s/ \\\\//' | tr '\n' ' '`;
	else
		BUILD_TARGETS="${DIRECTORY}";
	fi

	AM_CPPFLAGS=`sed '/^AM_LFLAGS =/,/^$/ { d }; /^if / { d }; /^AM_CPPFLAGS =/ { d }; /^$/,$ { d }' ${DIRECTORY}/Makefile.am | sed 's/^\s*//;s/ \\\\//' | tr '\n' ' '`;

	# Determine the include directories.
	INCLUDES=`echo ${AM_CPPFLAGS} | tr ' ' '\n' | grep -e '^@LIB[^_]*_CPPFLAGS@$' | grep -v -e '^@LIBCRYPTO_CPPFLAGS@$' -e '^@LIBFUSE_CPPFLAGS@$' | sed 's/^@\([^_]*\)_CPPFLAGS@$/..\\\\\1/' | tr '[A-Z]' '[a-z]' | tr '\n' ';'`;

	# Determine the definitions.
	DEFINITIONS_PART1=`echo ${AM_CPPFLAGS} | tr ' ' '\n' | grep -e '@LIB[^_]*_CPPFLAGS@' | sed 's/^@\([^_]*\)_CPPFLAGS@$/-DHAVE_LOCAL_\1/' | tr '\n' ' '`;

	if test ${DIRECTORY} = ${PROJECT};
	then
		DEFINITIONS_PART2=`echo -D${DIRECTORY}_DLL_EXPORT | tr '[a-z]' '[A-Z]'`;
		DEFINITIONS_PART2="${DEFINITIONS_PART2} -DHAVE_DLLMAIN";

	elif test ${DIRECTORY} = "${PREFIX}tools";
	then
		DEFINITIONS_PART2=`echo -D${DIRECTORY}_DLL_IMPORT | tr '[a-z]' '[A-Z]'`;

	else
		DEFINITIONS_PART2=`echo -DHAVE_LOCAL_${DIRECTORY} | tr '[a-z]' '[A-Z]'`;
	fi
	DEFINITIONS="${DEFINITIONS_PART1}${DEFINITIONS_PART2}";<commit_msg>Worked on script to generate BCC Makefiles.<commit_after>#!/bin/bash
#
# Script to generate the Borland's C++ Compiler 5.5 Makefiles
#
# Copyright (c) 2014, <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

EXIT_SUCCESS=0;
EXIT_FAILURE=1;

REQUIRES_ZLIB=0;

if test ! -f configure.ac;
then
	echo "Missing: configure.ac";

	exit ${EXIT_FAILURE};
fi

PROJECT=`grep -A 1 'AC_INIT' configure.ac | grep -v 'AC_INIT' | sed 's/^[^\[]*\[//;s/\][^\]]*$//'`;
PREFIX=`echo ${PROJECT} | sed 's/lib//'`;

for DIRECTORY in lib* *tools;
do
	if test ! -d ${DIRECTORY};
	then
		continue;
	fi
	# Do not compile .Net or Python bindings.
	if test ${DIRECTORY} = "${PREFIX}.net" || test ${DIRECTORY} = "py${PREFIX}";
	then
		continue;
	fi
	if test ! -f ${DIRECTORY}/Makefile.am;
	then
		continue;
	fi

	# Determine the build targets.
	grep -e '^bin_PROGRAMS' ${DIRECTORY}/Makefile.am > /dev/null;
	if test $? -eq 0;
	then
		BUILD_TARGETS=`sed '/^AM_CPPFLAGS =/,/^bin_PROGRAMS =/ { d }; /^$/,$ { d }' ${DIRECTORY}/Makefile.am | sed 's/^\s*//;s/ \\\\//' | tr '\n' ' '`;
	else
		BUILD_TARGETS="${DIRECTORY}";
	fi

	AM_CPPFLAGS=`sed '/^AM_LFLAGS =/,/^$/ { d }; /^if / { d }; /^AM_CPPFLAGS =/ { d }; /^$/,$ { d }' ${DIRECTORY}/Makefile.am | sed 's/^\s*//;s/ \\\\//' | tr '\n' ' '`;

	# Determine the include directories.
	INCLUDES=`echo ${AM_CPPFLAGS} | tr ' ' '\n' | grep -e '^@LIB[^_]*_CPPFLAGS@$' | grep -v -e '^@LIBCRYPTO_CPPFLAGS@$' -e '^@LIBFUSE_CPPFLAGS@$' | sed 's/^@\([^_]*\)_CPPFLAGS@$/..\\\\\1/' | tr '[A-Z]' '[a-z]' | tr '\n' ';'`;

	# Determine the definitions.
	DEFINITIONS_PART1=`echo ${AM_CPPFLAGS} | tr ' ' '\n' | grep -e '@LIB[^_]*_CPPFLAGS@' | sed 's/^@\([^_]*\)_CPPFLAGS@$/-DHAVE_LOCAL_\1/' | tr '\n' ' '`;

	if test ${DIRECTORY} = ${PROJECT};
	then
		DEFINITIONS_PART2=`echo -D${DIRECTORY}_DLL_EXPORT | tr '[a-z]' '[A-Z]'`;

	elif test ${DIRECTORY} = "${PREFIX}tools";
	then
		DEFINITIONS_PART2=`echo -D${DIRECTORY}_DLL_IMPORT | tr '[a-z]' '[A-Z]'`;

	else
		DEFINITIONS_PART2=`echo -DHAVE_LOCAL_${DIRECTORY} | tr '[a-z]' '[A-Z]'`;
	fi
	DEFINITIONS="${DEFINITIONS_PART1}${DEFINITIONS_PART2}";
{'fraction_non_alphanumeric': 0.21055651176133103, 'fraction_numerical': 0.009179575444635685, 'mean_word_length': 3.7937671860678277, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '760237', 'n_tokens_mistral': 2190, 'n_tokens_neox': 2032, 'n_words': 535}