Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2e30eb6

Browse files
authored
improve alignment autoconf test (#1129) (#1139)
Replace the deprecated AC_TRY_RUN with AC_RUN_IFELSE. Also, standardize the variable name and allow for caching of the result.
1 parent 7ac96ec commit 2e30eb6

3 files changed

Lines changed: 36 additions & 22 deletions

File tree

aclocal.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
1515
dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
16-
dnl serial 11 (pkg-config-0.29)
16+
dnl serial 11 (pkg-config-0.29.1)
1717
dnl
1818
dnl Copyright © 2004 Scott James Remnant <[email protected]>.
1919
dnl Copyright © 2012-2015 Dan Nicholson <[email protected]>
@@ -55,7 +55,7 @@ dnl
5555
dnl See the "Since" comment for each macro you use to see what version
5656
dnl of the macros you require.
5757
m4_defun([PKG_PREREQ],
58-
[m4_define([PKG_MACROS_VERSION], [0.29])
58+
[m4_define([PKG_MACROS_VERSION], [0.29.1])
5959
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
6060
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
6161
])dnl PKG_PREREQ

configure

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@ infodir
784784
docdir
785785
oldincludedir
786786
includedir
787+
runstatedir
787788
localstatedir
788789
sharedstatedir
789790
sysconfdir
@@ -894,6 +895,7 @@ datadir='${datarootdir}'
894895
sysconfdir='${prefix}/etc'
895896
sharedstatedir='${prefix}/com'
896897
localstatedir='${prefix}/var'
898+
runstatedir='${localstatedir}/run'
897899
includedir='${prefix}/include'
898900
oldincludedir='/usr/include'
899901
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1146,6 +1148,15 @@ do
11461148
| -silent | --silent | --silen | --sile | --sil)
11471149
silent=yes ;;
11481150

1151+
-runstatedir | --runstatedir | --runstatedi | --runstated \
1152+
| --runstate | --runstat | --runsta | --runst | --runs \
1153+
| --run | --ru | --r)
1154+
ac_prev=runstatedir ;;
1155+
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1156+
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1157+
| --run=* | --ru=* | --r=*)
1158+
runstatedir=$ac_optarg ;;
1159+
11491160
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
11501161
ac_prev=sbindir ;;
11511162
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1283,7 +1294,7 @@ fi
12831294
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
12841295
datadir sysconfdir sharedstatedir localstatedir includedir \
12851296
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1286-
libdir localedir mandir
1297+
libdir localedir mandir runstatedir
12871298
do
12881299
eval ac_val=\$$ac_var
12891300
# Remove trailing slashes.
@@ -1436,6 +1447,7 @@ Fine tuning of the installation directories:
14361447
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
14371448
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
14381449
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
1450+
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
14391451
--libdir=DIR object code libraries [EPREFIX/lib]
14401452
--includedir=DIR C header files [PREFIX/include]
14411453
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -9697,8 +9709,11 @@ esac
96979709
# check for systems that require aligned memory access
96989710
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking aligned memory access is required" >&5
96999711
$as_echo_n "checking aligned memory access is required... " >&6; }
9700-
if test "$cross_compiling" = yes; then :
9701-
aligned_required=yes
9712+
if ${ac_cv_aligned_required+:} false; then :
9713+
$as_echo_n "(cached) " >&6
9714+
else
9715+
if test "$cross_compiling" = yes; then :
9716+
ac_cv_aligned_required=yes
97029717
else
97039718
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
97049719
/* end confdefs.h. */
@@ -9715,26 +9730,26 @@ int main()
97159730
return 1;
97169731
return 0;
97179732
}
9718-
97199733
_ACEOF
97209734
if ac_fn_c_try_run "$LINENO"; then :
9721-
aligned_required=no
9735+
ac_cv_aligned_required=no
97229736
else
9723-
aligned_required=yes
9737+
ac_cv_aligned_required=yes
97249738
fi
97259739
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
97269740
conftest.$ac_objext conftest.beam conftest.$ac_ext
97279741
fi
97289742

97299743

9730-
if test "$aligned_required" = yes ; then
9744+
fi
9745+
9746+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_aligned_required" >&5
9747+
$as_echo "$ac_cv_aligned_required" >&6; }
9748+
if test "$ac_cv_aligned_required" = yes ; then
97319749

97329750
$as_echo "#define HAVE_ALIGNED_REQUIRED 1" >>confdefs.h
97339751

97349752
fi
9735-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aligned_required" >&5
9736-
$as_echo "$aligned_required" >&6; }
9737-
97389753

97399754
# str, bytes and memoryview hash algorithm
97409755

configure.ac

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2696,7 +2696,8 @@ esac
26962696

26972697
# check for systems that require aligned memory access
26982698
AC_MSG_CHECKING(aligned memory access is required)
2699-
AC_TRY_RUN([
2699+
AC_CACHE_VAL(ac_cv_aligned_required,
2700+
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
27002701
int main()
27012702
{
27022703
char s[16];
@@ -2708,18 +2709,16 @@ int main()
27082709
if (*p1 == *p2)
27092710
return 1;
27102711
return 0;
2711-
}
2712-
],
2713-
[aligned_required=no],
2714-
[aligned_required=yes],
2715-
[aligned_required=yes])
2716-
2717-
if test "$aligned_required" = yes ; then
2712+
}]])],
2713+
[ac_cv_aligned_required=no],
2714+
[ac_cv_aligned_required=yes],
2715+
[ac_cv_aligned_required=yes])
2716+
])
2717+
AC_MSG_RESULT($ac_cv_aligned_required)
2718+
if test "$ac_cv_aligned_required" = yes ; then
27182719
AC_DEFINE([HAVE_ALIGNED_REQUIRED], [1],
27192720
[Define if aligned memory access is required])
27202721
fi
2721-
AC_MSG_RESULT($aligned_required)
2722-
27232722

27242723
# str, bytes and memoryview hash algorithm
27252724
AH_TEMPLATE(Py_HASH_ALGORITHM,

0 commit comments

Comments
 (0)