<commit_before>#!/bin/env ruby

require 'mkmf'

CONFIG['CC'] = "g++"
CONFIG['LDSHARED'] = CONFIG['LDSHARED'].sub(/^cc /,'g++ ')	# otherwise we would not link with the C++ runtime
$LDFLAGS << " -L/usr/X11R6/lib"
$INCFLAGS << " -I/usr/local/include"

dir_config("gd")
dir_config("jpeg")
dir_config("png")

have_header("gd.h")

have_library("gd")<commit_msg>Infinitely better way to find gd library (by using gdlib-config).<commit_after>#!/bin/env ruby

require 'mkmf'

CONFIG['CC'] = "g++"
CONFIG['LDSHARED'] = CONFIG['LDSHARED'].sub(/^cc /,'g++ ')	# otherwise we would not link with the C++ runtime
gdc = with_config('gd-config') || 'gdlib-config'
$LDFLAGS += " #{`"#{gdc}" --ldflags`.chomp}"
$INCFLAGS += " #{`"#{gdc}" --cflags`.chomp}"
$CFLAGS += " #{`"#{gdc}" --cflags`.chomp}"

dir_config("gd")
dir_config("jpeg")
dir_config("png")

have_header("gd.h")

have_library("gd")
{'fraction_non_alphanumeric': 0.24114285714285713, 'fraction_numerical': 0.0034285714285714284, 'mean_word_length': 5.586466165413534, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5612910', 'n_tokens_mistral': 359, 'n_tokens_neox': 352, 'n_words': 70}