[schilytools] [PATCH] (#51) Add configure test for detecting man page style on Solaris systems

nsonack at herrhotzenplotz.de nsonack at herrhotzenplotz.de
Fri Feb 10 13:41:36 CET 2023


From: Nico Sonack <nsonack at herrhotzenplotz.de>

Different make implementations have different macros to run shell
commands. Previously a shell command was used in such an unportable
macro call to detect the style of manual pages on a given Solaris
system. This broke when building with GNU make on such systems.

This patch moves the test to a configure script and instead substitutes
a make internal variable to indicate the Solaris manstyle.

Tested to work on OmniOS i86pc (Illumos/SunOS 5.11).

Fixes #51

Signed-off-by: Nico Sonack <nsonack at herrhotzenplotz.de>
---
 RULES/os-sunos5.def   |  2 +-
 autoconf/configure    | 13 +++++++++++++
 autoconf/configure.in | 12 ++++++++++++
 autoconf/rules.cnf.in |  3 +++
 4 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/RULES/os-sunos5.def b/RULES/os-sunos5.def
index f4aebe2f..5e42abb8 100644
--- a/RULES/os-sunos5.def
+++ b/RULES/os-sunos5.def
@@ -23,4 +23,4 @@
 ###########################################################################
 # MANSTYLE was switched to bsd in Solaris 11.4.
 # Illumos switched in early 2022.
-MANSTYLE	:sh=	[ -f /usr/share/man/man8/Intro.8 ] && echo bsd || echo sysv
+MANSTYLE=$(SOLARIS_MANSTYLE)
diff --git a/autoconf/configure b/autoconf/configure
index 3bfc8727..44802baf 100755
--- a/autoconf/configure
+++ b/autoconf/configure
@@ -25455,6 +25455,18 @@ fi
 fi	# <ext2fs/ext2_fs.h> was missing
 fi	# Linux only tests
 
+if test ".$UNAME" = ".SunOS"; then
+	echo $ac_n "checking for manual page style on Solaris Systems""... $ac_c" 1>&6
+echo "configure:25461: checking for manual page style on Solaris Systems" >&5
+	if test -f /usr/share/man/man8/Intro.8; then
+		solaris_manstyle=bsd
+	else
+		solaris_manstyle=sysv
+	fi
+	echo "$ac_t""$solaris_manstyle" 1>&6
+fi
+
+
 
 
 
@@ -25671,6 +25683,7 @@ s%@lib_dl@%$lib_dl%g
 s%@lib_dir@%$lib_dir%g
 s%@lib_cap@%$lib_cap%g
 s%@lib_selinux@%$lib_selinux%g
+s%@solaris_manstyle@%$solaris_manstyle%g
 
 CEOF
 EOF
diff --git a/autoconf/configure.in b/autoconf/configure.in
index 4cca72dc..2656745f 100644
--- a/autoconf/configure.in
+++ b/autoconf/configure.in
@@ -1118,6 +1118,17 @@ fi
 fi	# <ext2fs/ext2_fs.h> was missing
 fi	# Linux only tests
 
+dnl SunOS Manual Page Style Tests
+if test ".$UNAME" = ".SunOS"; then
+	AC_MSG_CHECKING([for manual page style on Solaris Systems])
+	if test -f /usr/share/man/man8/Intro.8; then
+		solaris_manstyle=bsd
+	else
+		solaris_manstyle=sysv
+	fi
+	AC_MSG_RESULT([$solaris_manstyle])
+fi
+
 AC_SUBST(may_linux_src_include)
 
 AC_SUBST(largefile_cc_opt)
@@ -1149,5 +1160,6 @@ AC_SUBST(lib_dl)
 AC_SUBST(lib_dir)
 AC_SUBST(lib_cap)
 AC_SUBST(lib_selinux)
+AC_SUBST(solaris_manstyle)
 
 AC_OUTPUT(rules.cnf)
diff --git a/autoconf/rules.cnf.in b/autoconf/rules.cnf.in
index eec28ebb..c28ccb88 100644
--- a/autoconf/rules.cnf.in
+++ b/autoconf/rules.cnf.in
@@ -28,6 +28,9 @@ HP_CC_ANSI_OPT= @hp_cc_ansi_opt@	# Used on HP-UX
 HP_CC_OPT_OPT= @hp_cc_opt_opt@	# Used on HP-UX
 HP_CC_GPROF_OPT= @hp_cc_gprof_opt@	# Used on HP-UX
 
+# bsd/sysv manual page style, Solaris 11.4 switched to BSD style
+SOLARIS_MANSTYLE=@solaris_manstyle@
+
 MAY_LINUX_SRC_INCLUDE= @may_linux_src_include@	# /usr/src/include useful
 
 SCSILIB= @scsi_lib@		# IRIX libcam (outdated)
-- 
2.39.0



More information about the schilytools mailing list