autogen.sh
author psykose <alice@ayaya.dev>
Thu, 21 Apr 2022 20:23:32 +0200
changeset 744 4ebe32453682
parent 709 bdcdb9b34992
permissions -rwxr-xr-x
fix macro define for freeaddrinfo with asyncns previously, this define was only made in lm-asyncns-resolver.c, which does not propagate it to lm-resolver.c, where freeaddrinfo() is used. this means that when asyncns support is used, the standard libc freeaddrinfo() is called on an addrinfo acquired from asyncns_getaddrinfo, which is undefined behaviour, and leads to a segfault on musl libc.

#!/bin/sh
# Run this to generate all the initial makefiles, etc.

: ${AUTORECONF=autoreconf}
: ${GTKDOCIZE=gtkdocize}

if ! [ -f "./autogen.sh" ]; then
	# Avoid creation of files in random directories
	echo "Error: You have to run this script in the root of loudmouth sources."
	exit 1
fi

if [ "x$1" = "x-h" ] || [ "x$1" = "x--help" ]; then
	echo "./autogen.sh [-n]"
	echo
	echo " -n  disable gtk-doc"
	echo
	echo "Also uses environment variables AUTORECONF and GTKDOCIZE"
	exit 1
elif [ "x$1" = "x-n" ]; then
	# ensure, that gtk-doc.make exists and is readable
	# otherwise automake will fail - it is included from
	# doc/reference/Makefile.am
	if [ -h "./gtk-doc.make" ]; then
		rm -f "./gtk-doc.make"
	fi
	if [ -n "./gtk-doc.make" ]; then
		: > "./gtk-doc.make"
	fi
	GTKDOCIZE=":"
fi

$GTKDOCIZE || exit 1
$AUTORECONF --install || exit 1