~herrhotzenplotz/gcli-devel

gcli: configure: Some fixes for Solaris with Sun Studio v1 APPLIED

Nico Sonack: 1
 configure: Some fixes for Solaris with Sun Studio

 1 files changed, 16 insertions(+), 6 deletions(-)
build pending: alpine.yml
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~herrhotzenplotz/gcli-devel/patches/54855/mbox | git am -3
Learn more about email & git

[PATCH gcli] configure: Some fixes for Solaris with Sun Studio Export this patch

I have started testing the build system on Solaris 10.
You have to invoke the configure script with /usr/xpg4/bin/sh because
the /bin/sh is too primitive to execute this configure script.

The Developer Studio Compiler itself doesn't print any useful target
information so we can only make an educated guess.

I didn't get past the configure script as I don't have libcurl
available for the system. Yet.

Signed-off-by: Nico Sonack <nsonack@herrhotzenplotz.de>
---
 configure | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 121aa0d..1ee0220 100755
--- a/configure
+++ b/configure
@@ -27,6 +27,11 @@ find_program() {

}

die() {
	printf "%s\n" "${*}"
	exit 1
}

REALPATH=${REALPATH:-$(find_program realpath realpath grealpath)}
[ $? -eq 0 ] || die "error: need realpath" # exit code of find_program()

@@ -37,11 +42,6 @@ tolower() {
	tr '[:upper:]' '[:lower:]'
}

die() {
	printf "%s\n" "${*}"
	exit 1
}

compiler_type() {
	if ${1} -v 2>&1 | grep clang > /dev/null; then
		echo "clang"
@@ -49,8 +49,9 @@ compiler_type() {
		echo "gcc"
	elif ${1} -qversion 2>&1 | grep 'IBM XL C' >/dev/null; then
		echo "xlc"
	elif ${1} -V 2>&1 | grep 'Studio' > /dev/null; then
		echo "sunstudio"
	else
		# TODO: implement studio
		echo "unknown"
	fi
}
@@ -82,6 +83,15 @@ compiler_target() {
			$xlc_as --version 2>&1 | grep 'GNU assembler' >/dev/null || die "Can only derive compiler target from GNU assembler, please submit fix for your assembler"
			$xlc_as --version 2>&1 | grep target | sed "s|.*\`\([^']*\)'.*|\1|"
			;;
		sunstudio)
			# Only tested on Solaris 10 ... if this messes up on Linux or SunOS
			# i86pc feel free to send a patch...
			if $cc -V 2>&1 | grep SunOS_sparc > /dev/null; then
				echo "sparc64-unknown-solaris"
			else
				echo "unknown-unknown-unknown"
			fi
			;;
		*)
			echo "unknown-unknown-unknown"
			;;
-- 
2.45.2