diff options
author | Mark Kettenis <kettenis@gnu.org> | 2005-01-21 11:53:23 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2005-01-21 11:53:23 +0000 |
commit | b19aa7add36e1771981de4302657276a705405ca (patch) | |
tree | de9f739348e0fb09704c46a198d175970eb1392a /gdb/configure | |
parent | d39140e6d32ff30470dae4917ceee68326274c2f (diff) | |
download | gdb-b19aa7add36e1771981de4302657276a705405ca.tar.gz |
* configure.ac (targ_archs): Use standard autoconf check for
"struct stat.st_blocks" instead of rolling our own.
* configure: Regenerated.
* acconfig.h (HAVE_STRUCT_STAT_ST_BLOCKS): Remove undef.
* config.in: Regenerated.
Diffstat (limited to 'gdb/configure')
-rwxr-xr-x | gdb/configure | 147 |
1 files changed, 100 insertions, 47 deletions
diff --git a/gdb/configure b/gdb/configure index 8759ad17cfa..028e495530a 100755 --- a/gdb/configure +++ b/gdb/configure @@ -13010,9 +13010,16 @@ fi done -echo "$as_me:$LINENO: checking for member st_blocks in struct stat" >&5 -echo $ECHO_N "checking for member st_blocks in struct stat... $ECHO_C" >&6 -if test "${gdb_cv_have_struct_stat_with_st_blocks_member+set}" = set; then +# ------------------------- # +# Checks for declarations. # +# ------------------------- # + +for ac_func in getopt +do + ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 +echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6 +if eval "test \"\${gcc_cv_have_decl_$ac_func+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -13021,12 +13028,16 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <sys/types.h> -#include <sys/stat.h> +#undef $ac_tr_decl +#define $ac_tr_decl 1 + + int main () { -struct stat st; (void) st.st_blocks; +#ifndef $ac_func +char *(*pfn) = (char *(*)) $ac_func ; +#endif ; return 0; } @@ -13053,35 +13064,46 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - gdb_cv_have_struct_stat_with_st_blocks_member=yes + eval "gcc_cv_have_decl_$ac_func=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gdb_cv_have_struct_stat_with_st_blocks_member=no +eval "gcc_cv_have_decl_$ac_func=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gdb_cv_have_struct_stat_with_st_blocks_member" >&5 -echo "${ECHO_T}$gdb_cv_have_struct_stat_with_st_blocks_member" >&6 -if test $gdb_cv_have_struct_stat_with_st_blocks_member = yes; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_STAT_ST_BLOCKS 1 +if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 ; cat >>confdefs.h <<_ACEOF +#define $ac_tr_decl 1 +_ACEOF + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 ; cat >>confdefs.h <<_ACEOF +#define $ac_tr_decl 0 _ACEOF fi -# ------------------------- # -# Checks for declarations. # -# ------------------------- # +done +if test x = y ; then -for ac_func in getopt -do - ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` -echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 -echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6 -if eval "test \"\${gcc_cv_have_decl_$ac_func+set}\" = set"; then +cat >>confdefs.h <<\_ACEOF +#define HAVE_DECL_GETOPT 1 +_ACEOF +fi + + +# ----------------------- # +# Checks for structures. # +# ----------------------- # + +echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 +echo $ECHO_N "checking for struct stat.st_blocks... $ECHO_C" >&6 +if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -13090,16 +13112,57 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#undef $ac_tr_decl -#define $ac_tr_decl 1 - +$ac_includes_default +int +main () +{ +static struct stat ac_aggr; +if (ac_aggr.st_blocks) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_stat_st_blocks=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default int main () { -#ifndef $ac_func -char *(*pfn) = (char *(*)) $ac_func ; -#endif +static struct stat ac_aggr; +if (sizeof ac_aggr.st_blocks) +return 0; ; return 0; } @@ -13126,36 +13189,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "gcc_cv_have_decl_$ac_func=yes" + ac_cv_member_struct_stat_st_blocks=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "gcc_cv_have_decl_$ac_func=no" +ac_cv_member_struct_stat_st_blocks=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6 +if test $ac_cv_member_struct_stat_st_blocks = yes; then -if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 ; cat >>confdefs.h <<_ACEOF -#define $ac_tr_decl 1 -_ACEOF - -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 ; cat >>confdefs.h <<_ACEOF -#define $ac_tr_decl 0 +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLOCKS 1 _ACEOF -fi - -done -if test x = y ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_GETOPT 1 -_ACEOF fi |