[Mew-dist 06182] Re: UseCL=yes for Solaris 2.x

なかじ nakaji at example.com
1998年 8月 27日 (木) 17:04:58 JST


中治@京大防災研です。

>>>>> "M" == Motonori Nakamura <motonori at example.com> writes:

M> 確かに C で fsync() をコンパイルして、エラーになるかどうかで判断すると
M> 難しいでしょうけれど、他にも判断の方法はあると思います。やっぱりだめ?

grep fsync syscall.h する…(;_;)

というのを書いてみました。かっこよくない気がします。

Index: configure
===================================================================
RCS file: /home/nakaji/cvsroot/im-nakaji/configure,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 configure
--- configure	1998/08/27 04:24:04	1.1.1.1
+++ configure	1998/08/27 08:00:17
@@ -633,6 +633,8 @@
 im_version="version 980824"
 im_revised="Aug 24, 1998"
 im_file_attr="O_RDWR|O_CREAT|O_EXCL"
+nosync=no
+
 
 
 
@@ -646,7 +648,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:650: checking for $ac_word" >&5
+echo "configure:652: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'im_cv_path_im_path_perl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -687,7 +689,7 @@
    exit 1
 esac
 echo $ac_n "checking for site_perl""... $ac_c" 1>&6
-echo "configure:691: checking for site_perl" >&5
+echo "configure:693: checking for site_perl" >&5
 if eval "test \"`echo '$''{'im_cv_path_im_path_siteperl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -713,7 +715,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:717: checking for $ac_word" >&5
+echo "configure:719: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_im_path_chmod'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -750,7 +752,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:754: checking for $ac_word" >&5
+echo "configure:756: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_im_path_cp'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -787,7 +789,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:791: checking for $ac_word" >&5
+echo "configure:793: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_im_path_mkdir'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -824,7 +826,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:828: checking for $ac_word" >&5
+echo "configure:830: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_im_path_rm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -857,7 +859,7 @@
 test -n "$im_path_rm" || im_path_rm="missing_rm"
 
 echo $ac_n "checking for DB type""... $ac_c" 1>&6
-echo "configure:861: checking for DB type" >&5
+echo "configure:863: checking for DB type" >&5
 if eval "test \"`echo '$''{'im_cv_perl_im_db_type'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -898,7 +900,7 @@
 
 if test "${enable_inet6+set}" != set; then
 	echo $ac_n "checking for IPv6 Perl""... $ac_c" 1>&6
-echo "configure:902: checking for IPv6 Perl" >&5
+echo "configure:904: checking for IPv6 Perl" >&5
 	cat > conftest.pl <<EOF
 use Socket;
 print AF_INET6 . "\n";
@@ -921,6 +923,22 @@
 	im_inet6_pack_sockaddr_in6="pack('CCnN', 1+1+2+4+16, \$family, \$port, 0) . \$he_addr"
 fi
 
+echo "checking if fsync() is system call... "
+for syscall_h in /usr/include/syscall.h /usr/include/sys/syscall.h; do
+	count=`grep -c fsync ${syscall_h}`
+	if test -f ${syscall_h} ; then
+		if test $count -gt 0 ; then
+		# system has fsync(2)
+			echo "\tYour system has fsync(2)."
+			nosync=no
+		else
+		# system does not have fsync(2)
+			echo "\tYour system does not have fsync(2)."
+			nosync=yes
+		fi
+	fi
+done
+
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
@@ -1112,6 +1130,7 @@
 s%@im_file_attr@%$im_file_attr%g
 s%@im_inet6_family@%$im_inet6_family%g
 s%@im_inet6_pack_sockaddr_in6@%$im_inet6_pack_sockaddr_in6%g
+s%@nosync@%$nosync%g
 s%@im_path_perl@%$im_path_perl%g
 s%@im_path_siteperl@%$im_path_siteperl%g
 s%@im_path_chmod@%$im_path_chmod%g
Index: configure.in
===================================================================
RCS file: /home/nakaji/cvsroot/im-nakaji/configure.in,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 configure.in
--- configure.in	1998/08/27 04:24:04	1.1.1.1
+++ configure.in	1998/08/27 08:00:11
@@ -22,6 +22,7 @@
 im_version="version 980824"
 im_revised="Aug 24, 1998"
 im_file_attr="O_RDWR|O_CREAT|O_EXCL"
+nosync=no
 
 AC_SUBST(im_version)
 AC_SUBST(im_revised)
@@ -30,6 +31,7 @@
 AC_SUBST(im_file_attr)
 AC_SUBST(im_inet6_family)
 AC_SUBST(im_inet6_pack_sockaddr_in6)
+AC_SUBST(nosync)
 IM_PATH_PERLV_PROGS(im_path_perl, perl perl5, PERL5_NOT_FOUND)
 case "$im_path_perl" in
 ""|PERL5_NOT_FOUND)
@@ -82,6 +84,23 @@
 	im_inet6_family='24'
 	im_inet6_pack_sockaddr_in6="pack('CCnN', 1+1+2+4+16, \$family, \$port, 0) . \$he_addr"
 fi
+
+dnl check fsync() is in syscall.h or sys/syscall.h
+echo "checking if fsync() is system call... "
+for syscall_h in /usr/include/syscall.h /usr/include/sys/syscall.h; do
+	count=`grep -c fsync ${syscall_h}`
+	if test -f ${syscall_h} ; then
+		if test $count -gt 0 ; then
+		# system has fsync(2)
+			echo "\tYour system has fsync(2)."
+			nosync=no
+		else
+		# system does not have fsync(2)
+			echo "\tYour system does not have fsync(2)."
+			nosync=yes
+		fi
+	fi
+done
 
 AC_OUTPUT(imali:imali.in imcat:imcat.in imcd:imcd.in imclean:imclean.in \
 	imget:imget.in imgrep:imgrep.in imhist:imhist.in \
Index: imsetup.in
===================================================================
RCS file: /home/nakaji/cvsroot/im-nakaji/imsetup.in,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 imsetup.in
--- imsetup.in	1998/08/27 04:24:05	1.1.1.1
+++ imsetup.in	1998/08/27 04:53:49
@@ -45,7 +45,7 @@
 my $mail = "Mail";
 my $news = "News";
 my $usecl = "no";
-my $nosync = "no";
+my $nosync = "@nosync@";
 
 my ($mhdir, $mhalias, $domain, $nntpservers);
 



Mew-dist メーリングリストの案内