Skip to content

Commit 1a216bf

Browse files
committed
autoconf: fix obsolete macros
- Drop unused HAVE_ST_BLKSIZE, if we need it for any reason we should use HAVE_STRUCT_STAT_ST_BLKSIZE instead - Replace AC_TRY_LINK with the new AC_LINK_IFELSE Reference: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>
1 parent cf3b53b commit 1a216bf

File tree

5 files changed

+88
-94
lines changed

5 files changed

+88
-94
lines changed

aclocal.m4

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -425,19 +425,28 @@ fi
425425
AC_DEFUN([AC_VAR_TIMEZONE_EXTERNALS],
426426
[ AC_REQUIRE([AC_STRUCT_TIMEZONE])dnl
427427
AC_CACHE_CHECK(for timezone external, mb_cv_var_timezone,
428-
[ AC_TRY_LINK([#include <time.h>], [return (int)timezone;],
429-
mb_cv_var_timezone=yes,
430-
mb_cv_var_timezone=no)
428+
[ AC_LINK_IFELSE(
429+
[AC_LANG_PROGRAM([[#include <time.h>]],
430+
[[return (int)timezone;]])],
431+
mb_cv_var_timezone=yes,
432+
mb_cv_var_timezone=no
433+
)
431434
])
432435
AC_CACHE_CHECK(for altzone external, mb_cv_var_altzone,
433-
[ AC_TRY_LINK([#include <time.h>], [return (int)altzone;],
434-
mb_cv_var_altzone=yes,
435-
mb_cv_var_altzone=no)
436+
[ AC_LINK_IFELSE(
437+
[AC_LANG_PROGRAM([[#include <time.h>]],
438+
[[return (int)altzone;]])],
439+
mb_cv_var_altzone=yes,
440+
mb_cv_var_altzone=no
441+
)
436442
])
437443
AC_CACHE_CHECK(for daylight external, mb_cv_var_daylight,
438-
[ AC_TRY_LINK([#include <time.h>], [return (int)daylight;],
439-
mb_cv_var_daylight=yes,
440-
mb_cv_var_daylight=no)
444+
[ AC_LINK_IFELSE(
445+
[AC_LANG_PROGRAM([[#include <time.h>]],
446+
[[return (int)daylight;]])],
447+
mb_cv_var_daylight=yes,
448+
mb_cv_var_daylight=no
449+
)
441450
])
442451
if test $mb_cv_var_timezone = yes; then
443452
AC_DEFINE([HAVE_TIMEZONE], 1,
@@ -460,9 +469,9 @@ do
460469
AC_MSG_CHECKING([for global variable ${ac_global}])
461470
AC_CACHE_VAL(ac_cv_global_$ac_global,
462471
[
463-
AC_TRY_LINK(dnl
464-
[/* no includes */],
465-
[ extern long int $ac_global; exit((int)$ac_global)],
472+
AC_LINK_IFELSE(dnl
473+
[AC_LANG_PROGRAM([[/* no includes */]],
474+
[[extern long int $ac_global; exit((int)$ac_global)]])],
466475
eval "ac_cv_global_${ac_global}=yes",
467476
eval "ac_cv_global_${ac_global}=no"
468477
)

configure

Lines changed: 65 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,66 +2079,6 @@ printf "%s\n" "$ac_res" >&6; }
20792079

20802080
} # ac_fn_c_check_type
20812081

2082-
# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
2083-
# ----------------------------------------------------
2084-
# Tries to find if the field MEMBER exists in type AGGR, after including
2085-
# INCLUDES, setting cache variable VAR accordingly.
2086-
ac_fn_c_check_member ()
2087-
{
2088-
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2089-
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
2090-
printf %s "checking for $2.$3... " >&6; }
2091-
if eval test \${$4+y}
2092-
then :
2093-
printf %s "(cached) " >&6
2094-
else $as_nop
2095-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2096-
/* end confdefs.h. */
2097-
$5
2098-
int
2099-
main (void)
2100-
{
2101-
static $2 ac_aggr;
2102-
if (ac_aggr.$3)
2103-
return 0;
2104-
;
2105-
return 0;
2106-
}
2107-
_ACEOF
2108-
if ac_fn_c_try_compile "$LINENO"
2109-
then :
2110-
eval "$4=yes"
2111-
else $as_nop
2112-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2113-
/* end confdefs.h. */
2114-
$5
2115-
int
2116-
main (void)
2117-
{
2118-
static $2 ac_aggr;
2119-
if (sizeof ac_aggr.$3)
2120-
return 0;
2121-
;
2122-
return 0;
2123-
}
2124-
_ACEOF
2125-
if ac_fn_c_try_compile "$LINENO"
2126-
then :
2127-
eval "$4=yes"
2128-
else $as_nop
2129-
eval "$4=no"
2130-
fi
2131-
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
2132-
fi
2133-
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
2134-
fi
2135-
eval ac_res=\$$4
2136-
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2137-
printf "%s\n" "$ac_res" >&6; }
2138-
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2139-
2140-
} # ac_fn_c_check_member
2141-
21422082
# ac_fn_c_check_func LINENO FUNC VAR
21432083
# ----------------------------------
21442084
# Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -2332,6 +2272,66 @@ fi
23322272
as_fn_set_status $ac_retval
23332273

23342274
} # ac_fn_cxx_try_link
2275+
2276+
# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
2277+
# ----------------------------------------------------
2278+
# Tries to find if the field MEMBER exists in type AGGR, after including
2279+
# INCLUDES, setting cache variable VAR accordingly.
2280+
ac_fn_c_check_member ()
2281+
{
2282+
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2283+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
2284+
printf %s "checking for $2.$3... " >&6; }
2285+
if eval test \${$4+y}
2286+
then :
2287+
printf %s "(cached) " >&6
2288+
else $as_nop
2289+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2290+
/* end confdefs.h. */
2291+
$5
2292+
int
2293+
main (void)
2294+
{
2295+
static $2 ac_aggr;
2296+
if (ac_aggr.$3)
2297+
return 0;
2298+
;
2299+
return 0;
2300+
}
2301+
_ACEOF
2302+
if ac_fn_c_try_compile "$LINENO"
2303+
then :
2304+
eval "$4=yes"
2305+
else $as_nop
2306+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2307+
/* end confdefs.h. */
2308+
$5
2309+
int
2310+
main (void)
2311+
{
2312+
static $2 ac_aggr;
2313+
if (sizeof ac_aggr.$3)
2314+
return 0;
2315+
;
2316+
return 0;
2317+
}
2318+
_ACEOF
2319+
if ac_fn_c_try_compile "$LINENO"
2320+
then :
2321+
eval "$4=yes"
2322+
else $as_nop
2323+
eval "$4=no"
2324+
fi
2325+
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
2326+
fi
2327+
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
2328+
fi
2329+
eval ac_res=\$$4
2330+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2331+
printf "%s\n" "$ac_res" >&6; }
2332+
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2333+
2334+
} # ac_fn_c_check_member
23352335
ac_configure_args_raw=
23362336
for ac_arg
23372337
do
@@ -7800,17 +7800,6 @@ printf "%s\n" "#define off_t long int" >>confdefs.h
78007800

78017801
fi
78027802

7803-
ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
7804-
if test "x$ac_cv_member_struct_stat_st_blksize" = xyes
7805-
then :
7806-
7807-
printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h
7808-
7809-
7810-
printf "%s\n" "#define HAVE_ST_BLKSIZE 1" >>confdefs.h
7811-
7812-
fi
7813-
78147803

78157804
ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default"
78167805
if test "x$ac_cv_type_ssize_t" = xyes
@@ -16097,7 +16086,7 @@ else $as_nop
1609716086
int
1609816087
main (void)
1609916088
{
16100-
extern long int $ac_global; exit((int)$ac_global)
16089+
extern long int $ac_global; exit((int)$ac_global)
1610116090
;
1610216091
return 0;
1610316092
}
@@ -16141,7 +16130,7 @@ else $as_nop
1614116130
int
1614216131
main (void)
1614316132
{
16144-
extern long int $ac_global; exit((int)$ac_global)
16133+
extern long int $ac_global; exit((int)$ac_global)
1614516134
;
1614616135
return 0;
1614716136
}
@@ -16294,6 +16283,7 @@ then :
1629416283
mb_cv_var_timezone=yes
1629516284
else $as_nop
1629616285
mb_cv_var_timezone=no
16286+
1629716287
fi
1629816288
rm -f core conftest.err conftest.$ac_objext conftest.beam \
1629916289
conftest$ac_exeext conftest.$ac_ext
@@ -16323,6 +16313,7 @@ then :
1632316313
mb_cv_var_altzone=yes
1632416314
else $as_nop
1632516315
mb_cv_var_altzone=no
16316+
1632616317
fi
1632716318
rm -f core conftest.err conftest.$ac_objext conftest.beam \
1632816319
conftest$ac_exeext conftest.$ac_ext
@@ -16352,6 +16343,7 @@ then :
1635216343
mb_cv_var_daylight=yes
1635316344
else $as_nop
1635416345
mb_cv_var_daylight=no
16346+
1635516347
fi
1635616348
rm -f core conftest.err conftest.$ac_objext conftest.beam \
1635716349
conftest$ac_exeext conftest.$ac_ext

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ AC_C_CONST
348348
AC_TYPE_SIZE_T
349349
AC_FUNC_ALLOCA
350350
AC_TYPE_OFF_T
351-
AC_ST_BLKSIZE
351+
352352
AC_CHECK_TYPE(ssize_t, signed)
353353

354354
case $ac_cv_sizeof_int_p in

src/gdbm/systems.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
/* Default block size. Some systems do not have blocksize in their
154154
stat record. This code uses the BSD blocksize from stat. */
155155

156-
#if HAVE_ST_BLKSIZE
156+
#if HAVE_STRUCT_STAT_ST_BLKSIZE
157157
#define STATBLKSIZE file_stat.st_blksize
158158
#else
159159
#define STATBLKSIZE 1024

src/h/auto.in

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,16 +314,9 @@
314314
/* Define to 1 if you have the <string.h> header file. */
315315
#undef HAVE_STRING_H
316316

317-
/* Define to 1 if `st_blksize' is a member of `struct stat'. */
318-
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
319-
320317
/* Define to 1 if `tm_zone' is a member of `struct tm'. */
321318
#undef HAVE_STRUCT_TM_TM_ZONE
322319

323-
/* Define to 1 if your `struct stat' has `st_blksize'. Deprecated, use
324-
`HAVE_STRUCT_STAT_ST_BLKSIZE' instead. */
325-
#undef HAVE_ST_BLKSIZE
326-
327320
/* Define to 1 if you have the `sysconf' function. */
328321
#undef HAVE_SYSCONF
329322

0 commit comments

Comments
 (0)