From 5b2117ebc774a8a75bb77ca5c072b08f1f4f89c6 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Tue, 30 Jun 2015 10:07:43 -0500 Subject: [svn-r27299] Changed from using sed to perl. --- configure | 28 +++++++++++++--------------- configure.ac | 6 +++--- m4/aclocal_fc.m4 | 21 ++++++++++----------- 3 files changed, 26 insertions(+), 29 deletions(-) diff --git a/configure b/configure index 3a64492..4e7017d 100755 --- a/configure +++ b/configure @@ -5734,9 +5734,9 @@ else if ac_fn_c_try_run "$LINENO"; then : if test -s pac_Cconftest.out ; then - LDBL_DIG="`sed -n '1p' pac_Cconftest.out`" - FLT128_DIG="`sed -n '2p' pac_Cconftest.out`" - else + LDBL_DIG="`perl -ne '$. == 1 && print && exit' pac_Cconftest.out`" + FLT128_DIG="`perl -ne '$. == 2 && print && exit' pac_Cconftest.out`" + else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No output from test program!" >&5 $as_echo "$as_me: WARNING: No output from test program!" >&2;} fi @@ -7327,10 +7327,10 @@ _ACEOF PAC_FC_ALL_INTEGER_KINDS="{`echo $pac_validIntKinds`}" PAC_FC_ALL_REAL_KINDS="{`echo $pac_validRealKinds`}" - H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `perl -ne '$. == 5 && print && exit' pac_fconftest.out`" - H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $pac_validRealKinds`/)" H5CONFIG_F_NUM_IKIND="INTEGER, PARAMETER :: num_ikinds = `perl -ne '$. == 4 && print && exit' pac_fconftest.out`" H5CONFIG_F_IKIND="INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/`echo $pac_validIntKinds`/)" + H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `perl -ne '$. == 5 && print && exit' pac_fconftest.out`" + H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $pac_validRealKinds`/)" cat >>confdefs.h <<_ACEOF @@ -7363,7 +7363,6 @@ $as_echo_n "checking for Fortran REAL KINDs... " >&6; } $as_echo "$PAC_FC_ALL_REAL_KINDS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran REALs maximum decimal precision" >&5 $as_echo_n "checking for Fortran REALs maximum decimal precision... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_MAX_REAL_PRECISION" >&5 $as_echo "$PAC_FC_MAX_REAL_PRECISION" >&6; } else @@ -7548,10 +7547,10 @@ _ACEOF PAC_FC_ALL_INTEGER_KINDS="{`echo $pac_validIntKinds`}" PAC_FC_ALL_REAL_KINDS="{`echo $pac_validRealKinds`}" - H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `perl -ne '$. == 5 && print && exit' pac_fconftest.out`" - H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $pac_validRealKinds`/)" H5CONFIG_F_NUM_IKIND="INTEGER, PARAMETER :: num_ikinds = `perl -ne '$. == 4 && print && exit' pac_fconftest.out`" H5CONFIG_F_IKIND="INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/`echo $pac_validIntKinds`/)" + H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `perl -ne '$. == 5 && print && exit' pac_fconftest.out`" + H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $pac_validRealKinds`/)" cat >>confdefs.h <<_ACEOF @@ -7584,7 +7583,6 @@ $as_echo_n "checking for Fortran REAL KINDs... " >&6; } $as_echo "$PAC_FC_ALL_REAL_KINDS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran REALs maximum decimal precision" >&5 $as_echo_n "checking for Fortran REALs maximum decimal precision... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_MAX_REAL_PRECISION" >&5 $as_echo "$PAC_FC_MAX_REAL_PRECISION" >&6; } else @@ -7625,7 +7623,7 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu pack_int_sizeof="" rm -f pac_fconftest.out -for kind in `echo $pac_validIntKinds | sed -e 's/,/ /g'`; do +for kind in `echo $pac_validIntKinds | perl -pe 's/,/ /g'`; do cat > conftest.$ac_ext <<_ACEOF @@ -7667,7 +7665,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi done -PAC_FC_ALL_INTEGER_KINDS_SIZEOF="{`echo $pack_int_sizeof | sed -e 's/,$//' | sed -e 's/ //g'`}" +PAC_FC_ALL_INTEGER_KINDS_SIZEOF="{`echo $pack_int_sizeof | perl -pe 's/,$//' | perl -pe 's/ //g'`}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_ALL_INTEGER_KINDS_SIZEOF" >&5 $as_echo "$PAC_FC_ALL_INTEGER_KINDS_SIZEOF" >&6; } ac_ext=${ac_fc_srcext-f} @@ -7687,7 +7685,7 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu pack_real_sizeof="" rm -f pac_fconftest.out -for kind in `echo $pac_validRealKinds| sed -e 's/,/ /g'`; do +for kind in `echo $pac_validRealKinds| perl -pe 's/,/ /g'`; do cat > conftest.$ac_ext <<_ACEOF @@ -7729,7 +7727,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi done -PAC_FC_ALL_REAL_KINDS_SIZEOF="{`echo $pack_real_sizeof | sed -e 's/,$//' | sed -e 's/ //g'`}" +PAC_FC_ALL_REAL_KINDS_SIZEOF="{`echo $pack_real_sizeof | perl -pe 's/,$//' | perl -pe 's/ //g'`}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PAC_FC_ALL_REAL_KINDS_SIZEOF" >&5 $as_echo "$PAC_FC_ALL_REAL_KINDS_SIZEOF" >&6; } ac_ext=${ac_fc_srcext-f} @@ -7915,8 +7913,8 @@ $as_echo_n "checking for Fortran interoperable KINDS with C... " >&6; } $as_echo "$PAC_FC_ALL_REAL_KINDS" >&6; } H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `echo \"$PAC_FC_ALL_REAL_KINDS\" | perl -e '$count = ( =~ tr/,//);print $count+1'`" - H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $PAC_FC_ALL_REAL_KINDS | sed -e 's/{//g' | sed -e 's/}//g' | sed -e 's/ /,/g'`/)" - H5CONFIG_F_RKIND_SIZEOF="INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/`echo $PAC_FC_ALL_REAL_KINDS_SIZEOF | sed -e 's/{//g' | sed -e 's/}//g'| sed -e 's/ /,/g'`/)" + H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo \"$PAC_FC_ALL_REAL_KINDS\" | perl -pe 's/{//g' | perl -pe 's/}//g' | perl -pe 's/ /,/g'`/)" + H5CONFIG_F_RKIND_SIZEOF="INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/`echo \"$PAC_FC_ALL_REAL_KINDS_SIZEOF\" | perl -pe 's/{//g' | perl -pe 's/}//g'| perl -pe 's/ /,/g'`/)" cat >>confdefs.h <<_ACEOF diff --git a/configure.ac b/configure.ac index e7215af..ff35b24 100644 --- a/configure.ac +++ b/configure.ac @@ -564,7 +564,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then if test "X$FORTRAN_HAVE_C_LONG_DOUBLE"; then PAC_PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE if test "X$FORTRAN_C_LONG_DOUBLE_IS_UNIQUE" = "Xyes"; then - FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="1" + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="1" AC_DEFINE([FORTRAN_C_LONG_DOUBLE_IS_UNIQUE], [1], [Define if Fortran C_LONG_DOUBLE is different from C_DOUBLE]) else FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="0" @@ -596,9 +596,9 @@ if test "X$HDF_FORTRAN" = "Xyes"; then dnl count the number of real kinds H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `echo \"[$]PAC_FC_ALL_REAL_KINDS\" | perl -e '$count = ( =~ tr/,//);print $count+1'`" - H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $PAC_FC_ALL_REAL_KINDS | sed -e 's/{//g' | sed -e 's/}//g' | sed -e 's/ /,/g'`/)" + H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo \"[$]PAC_FC_ALL_REAL_KINDS\" | perl -pe 's/{//g' | perl -pe 's/}//g' | perl -pe 's/ /,/g'`/)" dnl H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (`echo \"[$]PAC_FC_ALL_REAL_KINDS\" | $PERL -pe 'tr |{}|//|' | $PERL -e 's/ /,/g`)" - H5CONFIG_F_RKIND_SIZEOF="INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/`echo $PAC_FC_ALL_REAL_KINDS_SIZEOF | sed -e 's/{//g' | sed -e 's/}//g'| sed -e 's/ /,/g'`/)" + H5CONFIG_F_RKIND_SIZEOF="INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/`echo \"[$]PAC_FC_ALL_REAL_KINDS_SIZEOF\" | perl -pe 's/{//g' | perl -pe 's/}//g'| perl -pe 's/ /,/g'`/)" AC_DEFINE_UNQUOTED([H5CONFIG_F_NUM_RKIND], $H5CONFIG_F_NUM_RKIND, [Define number of valid Fortran REAL KINDs]) AC_DEFINE_UNQUOTED([H5CONFIG_F_RKIND], $H5CONFIG_F_RKIND, [Define valid Fortran REAL KINDs]) diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4 index 09a87e2..f937b64 100644 --- a/m4/aclocal_fc.m4 +++ b/m4/aclocal_fc.m4 @@ -393,10 +393,10 @@ AC_RUN_IFELSE([ PAC_FC_ALL_INTEGER_KINDS="{`echo $pac_validIntKinds`}" PAC_FC_ALL_REAL_KINDS="{`echo $pac_validRealKinds`}" - H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `perl -ne '$. == 5 && print && exit' pac_fconftest.out`" - H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $pac_validRealKinds`/)" H5CONFIG_F_NUM_IKIND="INTEGER, PARAMETER :: num_ikinds = `perl -ne '$. == 4 && print && exit' pac_fconftest.out`" H5CONFIG_F_IKIND="INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/`echo $pac_validIntKinds`/)" + H5CONFIG_F_NUM_RKIND="INTEGER, PARAMETER :: num_rkinds = `perl -ne '$. == 5 && print && exit' pac_fconftest.out`" + H5CONFIG_F_RKIND="INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/`echo $pac_validRealKinds`/)" AC_DEFINE_UNQUOTED([H5CONFIG_F_NUM_RKIND], $H5CONFIG_F_NUM_RKIND, [Define number of valid Fortran REAL KINDs]) AC_DEFINE_UNQUOTED([H5CONFIG_F_NUM_IKIND], $H5CONFIG_F_NUM_IKIND, [Define number of valid Fortran INTEGER KINDs]) @@ -408,7 +408,6 @@ AC_RUN_IFELSE([ AC_MSG_CHECKING([for Fortran REAL KINDs]) AC_MSG_RESULT([$PAC_FC_ALL_REAL_KINDS]) AC_MSG_CHECKING([for Fortran REALs maximum decimal precision]) - AC_MSG_RESULT([$PAC_FC_MAX_REAL_PRECISION]) else AC_MSG_RESULT([Error]) @@ -434,7 +433,7 @@ AC_LANG_PUSH([Fortran]) pack_int_sizeof="" rm -f pac_fconftest.out -for kind in `echo $pac_validIntKinds | sed -e 's/,/ /g'`; do +for kind in `echo $pac_validIntKinds | perl -pe 's/,/ /g'`; do AC_LANG_CONFTEST([ AC_LANG_SOURCE([ PROGRAM main @@ -461,7 +460,7 @@ for kind in `echo $pac_validIntKinds | sed -e 's/,/ /g'`; do pack_int_sizeof="$2" ]) done -PAC_FC_ALL_INTEGER_KINDS_SIZEOF="{`echo $pack_int_sizeof | sed -e 's/,$//' | sed -e 's/ //g'`}" +PAC_FC_ALL_INTEGER_KINDS_SIZEOF="{`echo $pack_int_sizeof | perl -pe 's/,$//' | perl -pe 's/ //g'`}" AC_MSG_RESULT([$PAC_FC_ALL_INTEGER_KINDS_SIZEOF]) AC_LANG_POP([Fortran]) ]) @@ -472,7 +471,7 @@ AC_MSG_CHECKING([sizeof of available REAL KINDs]) AC_LANG_PUSH([Fortran]) pack_real_sizeof="" rm -f pac_fconftest.out -for kind in `echo $pac_validRealKinds| sed -e 's/,/ /g'`; do +for kind in `echo $pac_validRealKinds| perl -pe 's/,/ /g'`; do AC_LANG_CONFTEST([ AC_LANG_SOURCE([ PROGRAM main @@ -499,7 +498,7 @@ for kind in `echo $pac_validRealKinds| sed -e 's/,/ /g'`; do pack_real_sizeof="$2" ]) done -PAC_FC_ALL_REAL_KINDS_SIZEOF="{`echo $pack_real_sizeof | sed -e 's/,$//' | sed -e 's/ //g'`}" +PAC_FC_ALL_REAL_KINDS_SIZEOF="{`echo $pack_real_sizeof | perl -pe 's/,$//' | perl -pe 's/ //g'`}" AC_MSG_RESULT([$PAC_FC_ALL_REAL_KINDS_SIZEOF]) AC_LANG_POP([Fortran]) ]) @@ -590,10 +589,10 @@ rm -f pac_Cconftest.out ]) AC_RUN_IFELSE([],[ if test -s pac_Cconftest.out ; then -dnl LDBL_DIG="`perl -ne '$. == 1 && print && exit'`" -dnl FLT128_DIG="`perl -ne '$. == 2 && print && exit'`" - LDBL_DIG="`sed -n '1p' pac_Cconftest.out`" - FLT128_DIG="`sed -n '2p' pac_Cconftest.out`" + LDBL_DIG="`perl -ne '$. == 1 && print && exit' pac_Cconftest.out`" + FLT128_DIG="`perl -ne '$. == 2 && print && exit' pac_Cconftest.out`" + dnl LDBL_DIG="`sed -n '1p' pac_Cconftest.out`" + dnl FLT128_DIG="`sed -n '2p' pac_Cconftest.out`" else AC_MSG_WARN([No output from test program!]) fi -- cgit v0.12