Skip to content

Commit cdc2c06

Browse files
committed
configure.in cleanup for tr and strerror2.
1 parent 775098b commit cdc2c06

File tree

2 files changed

+73
-25
lines changed

2 files changed

+73
-25
lines changed

src/configure

Lines changed: 70 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,8 +1506,8 @@ done
15061506
test -n "$TR" || TR="NOT_FOUND"
15071507

15081508

1509-
TRSTRINGS=`echo ABCdef | $TR "'[a-z]' '[A-Z]'" | grep ABCDEF`
1510-
TRCLASS=`echo ABCdef | $TR "[:lower:]" "[:upper:]" | grep ABCDEF`
1509+
TRSTRINGS=`echo ABCdef | $TR 'a-z' 'A-Z' 2>/dev/null | grep ABCDEF`
1510+
TRCLASS=`echo ABCdef | $TR ':lower:' ':upper:' 2>/dev/null | grep ABCDEF`
15111511

15121512
if test "$TRSTRINGS" = "ABCDEF"; then
15131513
TRARGS="'[a-z]' '[A-Z]'"
@@ -3580,17 +3580,65 @@ else
35803580
STRERROR='strerror.o'
35813581
fi
35823582

3583-
eC_CHECK_FUNC(strerror, cat >> confdefs.h <<\EOF
3583+
echo $ac_n "checking for strerror""... $ac_c" 1>&6
3584+
echo "configure:3585: checking for strerror" >&5
3585+
if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then
3586+
echo $ac_n "(cached) $ac_c" 1>&6
3587+
else
3588+
cat > conftest.$ac_ext <<EOF
3589+
#line 3590 "configure"
3590+
#include "confdefs.h"
3591+
/* System header to define __stub macros and hopefully few prototypes,
3592+
which can conflict with char strerror(); below. */
3593+
#include <assert.h>
3594+
/* Override any gcc2 internal prototype to avoid an error. */
3595+
/* We use char because int might match the return type of a gcc2
3596+
builtin and then its argument prototype would still apply. */
3597+
char strerror();
3598+
3599+
int main() {
3600+
3601+
/* The GNU C library defines this for functions which it implements
3602+
to always fail with ENOSYS. Some functions are actually named
3603+
something starting with __ and the normal name is an alias. */
3604+
#if defined (__stub_strerror) || defined (__stub___strerror)
3605+
choke me
3606+
#else
3607+
strerror();
3608+
#endif
3609+
3610+
; return 0; }
3611+
EOF
3612+
if { (eval echo configure:3613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3613+
rm -rf conftest*
3614+
eval "ac_cv_func_strerror=yes"
3615+
else
3616+
echo "configure: failed program was:" >&5
3617+
cat conftest.$ac_ext >&5
3618+
rm -rf conftest*
3619+
eval "ac_cv_func_strerror=no"
3620+
fi
3621+
rm -f conftest*
3622+
fi
3623+
3624+
if eval "test \"`echo '$ac_cv_func_'strerror`\" = yes"; then
3625+
echo "$ac_t""yes" 1>&6
3626+
cat >> confdefs.h <<\EOF
35843627
#define HAVE_STRERROR 1
35853628
EOF
3586-
, STRERROR2='../../backend/port/strerror.o')
3629+
3630+
else
3631+
echo "$ac_t""no" 1>&6
3632+
STRERROR2='../../backend/port/strerror.o'
3633+
fi
3634+
35873635
echo $ac_n "checking for strdup""... $ac_c" 1>&6
3588-
echo "configure:3589: checking for strdup" >&5
3636+
echo "configure:3637: checking for strdup" >&5
35893637
if eval "test \"`echo '$''{'ac_cv_func_strdup'+set}'`\" = set"; then
35903638
echo $ac_n "(cached) $ac_c" 1>&6
35913639
else
35923640
cat > conftest.$ac_ext <<EOF
3593-
#line 3594 "configure"
3641+
#line 3642 "configure"
35943642
#include "confdefs.h"
35953643
/* System header to define __stub macros and hopefully few prototypes,
35963644
which can conflict with char strdup(); below. */
@@ -3613,7 +3661,7 @@ strdup();
36133661
36143662
; return 0; }
36153663
EOF
3616-
if { (eval echo configure:3617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3664+
if { (eval echo configure:3665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
36173665
rm -rf conftest*
36183666
eval "ac_cv_func_strdup=yes"
36193667
else
@@ -3641,12 +3689,12 @@ fi
36413689

36423690

36433691
echo $ac_n "checking for cbrt""... $ac_c" 1>&6
3644-
echo "configure:3645: checking for cbrt" >&5
3692+
echo "configure:3693: checking for cbrt" >&5
36453693
if eval "test \"`echo '$''{'ac_cv_func_cbrt'+set}'`\" = set"; then
36463694
echo $ac_n "(cached) $ac_c" 1>&6
36473695
else
36483696
cat > conftest.$ac_ext <<EOF
3649-
#line 3650 "configure"
3697+
#line 3698 "configure"
36503698
#include "confdefs.h"
36513699
/* System header to define __stub macros and hopefully few prototypes,
36523700
which can conflict with char cbrt(); below. */
@@ -3669,7 +3717,7 @@ cbrt();
36693717
36703718
; return 0; }
36713719
EOF
3672-
if { (eval echo configure:3673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3720+
if { (eval echo configure:3721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
36733721
rm -rf conftest*
36743722
eval "ac_cv_func_cbrt=yes"
36753723
else
@@ -3690,15 +3738,15 @@ EOF
36903738
else
36913739
echo "$ac_t""no" 1>&6
36923740
echo $ac_n "checking for cbrt in -lm""... $ac_c" 1>&6
3693-
echo "configure:3694: checking for cbrt in -lm" >&5
3741+
echo "configure:3742: checking for cbrt in -lm" >&5
36943742
ac_lib_var=`echo m'_'cbrt | sed 'y%./+-%__p_%'`
36953743
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
36963744
echo $ac_n "(cached) $ac_c" 1>&6
36973745
else
36983746
ac_save_LIBS="$LIBS"
36993747
LIBS="-lm $LIBS"
37003748
cat > conftest.$ac_ext <<EOF
3701-
#line 3702 "configure"
3749+
#line 3750 "configure"
37023750
#include "confdefs.h"
37033751
/* Override any gcc2 internal prototype to avoid an error. */
37043752
/* We use char because int might match the return type of a gcc2
@@ -3709,7 +3757,7 @@ int main() {
37093757
cbrt()
37103758
; return 0; }
37113759
EOF
3712-
if { (eval echo configure:3713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3760+
if { (eval echo configure:3761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
37133761
rm -rf conftest*
37143762
eval "ac_cv_lib_$ac_lib_var=yes"
37153763
else
@@ -3735,12 +3783,12 @@ fi
37353783
fi
37363784

37373785
echo $ac_n "checking for rint""... $ac_c" 1>&6
3738-
echo "configure:3739: checking for rint" >&5
3786+
echo "configure:3787: checking for rint" >&5
37393787
if eval "test \"`echo '$''{'ac_cv_func_rint'+set}'`\" = set"; then
37403788
echo $ac_n "(cached) $ac_c" 1>&6
37413789
else
37423790
cat > conftest.$ac_ext <<EOF
3743-
#line 3744 "configure"
3791+
#line 3792 "configure"
37443792
#include "confdefs.h"
37453793
/* System header to define __stub macros and hopefully few prototypes,
37463794
which can conflict with char rint(); below. */
@@ -3763,7 +3811,7 @@ rint();
37633811
37643812
; return 0; }
37653813
EOF
3766-
if { (eval echo configure:3767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3814+
if { (eval echo configure:3815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
37673815
rm -rf conftest*
37683816
eval "ac_cv_func_rint=yes"
37693817
else
@@ -3784,15 +3832,15 @@ EOF
37843832
else
37853833
echo "$ac_t""no" 1>&6
37863834
echo $ac_n "checking for rint in -lm""... $ac_c" 1>&6
3787-
echo "configure:3788: checking for rint in -lm" >&5
3835+
echo "configure:3836: checking for rint in -lm" >&5
37883836
ac_lib_var=`echo m'_'rint | sed 'y%./+-%__p_%'`
37893837
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
37903838
echo $ac_n "(cached) $ac_c" 1>&6
37913839
else
37923840
ac_save_LIBS="$LIBS"
37933841
LIBS="-lm $LIBS"
37943842
cat > conftest.$ac_ext <<EOF
3795-
#line 3796 "configure"
3843+
#line 3844 "configure"
37963844
#include "confdefs.h"
37973845
/* Override any gcc2 internal prototype to avoid an error. */
37983846
/* We use char because int might match the return type of a gcc2
@@ -3803,7 +3851,7 @@ int main() {
38033851
rint()
38043852
; return 0; }
38053853
EOF
3806-
if { (eval echo configure:3807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3854+
if { (eval echo configure:3855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
38073855
rm -rf conftest*
38083856
eval "ac_cv_lib_$ac_lib_var=yes"
38093857
else
@@ -3830,7 +3878,7 @@ fi
38303878

38313879

38323880
echo $ac_n "checking setting USE_LOCALE""... $ac_c" 1>&6
3833-
echo "configure:3834: checking setting USE_LOCALE" >&5
3881+
echo "configure:3882: checking setting USE_LOCALE" >&5
38343882
if test "$USE_LOCALE" = "yes"
38353883
then
38363884
echo "$ac_t""enabled" 1>&6
@@ -3842,14 +3890,14 @@ else
38423890
echo "$ac_t""disabled" 1>&6
38433891
fi
38443892
echo $ac_n "checking setting DEF_PGPORT""... $ac_c" 1>&6
3845-
echo "configure:3846: checking setting DEF_PGPORT" >&5
3893+
echo "configure:3894: checking setting DEF_PGPORT" >&5
38463894
cat >> confdefs.h <<EOF
38473895
#define DEF_PGPORT "${DEF_PGPORT}"
38483896
EOF
38493897

38503898
echo "$ac_t""$DEF_PGPORT" 1>&6
38513899
echo $ac_n "checking setting HBA""... $ac_c" 1>&6
3852-
echo "configure:3853: checking setting HBA" >&5
3900+
echo "configure:3901: checking setting HBA" >&5
38533901
if test "$NOHBA" = "no"
38543902
then
38553903
echo "$ac_t""enabled" 1>&6

src/configure.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ AC_PATH_PROG(ipcrm, ipcrm)
314314
AC_PATH_PROGS(TR, trbsd tr, NOT_FOUND)
315315

316316
dnl Check tr flags to convert from lower to upper case
317-
TRSTRINGS=`echo ABCdef | $TR "'[[a-z]]' '[[A-Z]]'" | grep ABCDEF`
318-
TRCLASS=`echo ABCdef | $TR "[[:lower:]]" "[[:upper:]]" | grep ABCDEF`
317+
TRSTRINGS=`echo ABCdef | $TR '[a-z]' '[A-Z]' 2>/dev/null | grep ABCDEF`
318+
TRCLASS=`echo ABCdef | $TR '[:lower:]' '[:upper:]' 2>/dev/null | grep ABCDEF`
319319

320320
if test "$TRSTRINGS" = "ABCDEF"; then
321321
TRARGS="'[[a-z]]' '[[A-Z]]'"
@@ -413,7 +413,7 @@ AC_CHECK_FUNCS(isinf tzset getrusage vfork memmove sigsetjmp kill sysconf)
413413
AC_CHECK_FUNCS(sigprocmask waitpid setsid random fcvt)
414414
AC_CHECK_FUNC(inet_aton, AC_DEFINE(HAVE_INET_ATON), INET_ATON='inet_aton.o')
415415
AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR), STRERROR='strerror.o')
416-
eC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR), STRERROR2='../../backend/port/strerror.o')
416+
AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR), STRERROR2='../../backend/port/strerror.o')
417417
AC_CHECK_FUNC(strdup, AC_DEFINE(HAVE_STRDUP), STRDUP='../../utils/strdup.o')
418418
AC_SUBST(STRDUP)
419419
AC_SUBST(INET_ATON)

0 commit comments

Comments
 (0)