Skip to content

Commit

Permalink
Try harder in configuration to determine architecture of machine
Browse files Browse the repository at this point in the history
Ask R for '.Machine$sizeof.pointer' if 'AC_CHECK_SIZEOF([void*])'
fails.
  • Loading branch information
stewid committed Dec 10, 2017
1 parent 047a9ba commit c87d880
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
27 changes: 13 additions & 14 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,6 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
Expand Down Expand Up @@ -763,7 +762,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
Expand Down Expand Up @@ -1016,15 +1014,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;

-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;

-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
Expand Down Expand Up @@ -1162,7 +1151,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
Expand Down Expand Up @@ -1315,7 +1304,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
Expand Down Expand Up @@ -3817,10 +3805,21 @@ if test "x$ac_cv_sizeof_voidp" = "x8"; then
elif test "x$ac_cv_sizeof_voidp" = "x4"; then
CPPFLAGS="${CPPFLAGS} -DGIT_ARCH_32"
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void*" >&5
$as_echo_n "checking size of void*... " >&6; }
sizeof_voidp=`"${RBIN}" --slave -e "cat(.Machine\\$sizeof.pointer)"`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sizeof_voidp" >&5
$as_echo "$sizeof_voidp" >&6; }
if test "x$sizeof_voidp" = "x8"; then
CPPFLAGS="${CPPFLAGS} -DGIT_ARCH_64"
elif test "x$sizeof_voidp" = "x4"; then
CPPFLAGS="${CPPFLAGS} -DGIT_ARCH_32"
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Unsupported architecture
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
# Check for zlib
Expand Down
11 changes: 10 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,16 @@ if test "x$ac_cv_sizeof_voidp" = "x8"; then
elif test "x$ac_cv_sizeof_voidp" = "x4"; then
CPPFLAGS="${CPPFLAGS} -DGIT_ARCH_32"
else
AC_MSG_FAILURE([Unsupported architecture])
AC_MSG_CHECKING([size of void*])
sizeof_voidp=`"${RBIN}" --slave -e "cat(.Machine\\$sizeof.pointer)"`
AC_MSG_RESULT([$sizeof_voidp])
if test "x$sizeof_voidp" = "x8"; then
CPPFLAGS="${CPPFLAGS} -DGIT_ARCH_64"
elif test "x$sizeof_voidp" = "x4"; then
CPPFLAGS="${CPPFLAGS} -DGIT_ARCH_32"
else
AC_MSG_FAILURE([Unsupported architecture])
fi
fi

# Check for zlib
Expand Down

0 comments on commit c87d880

Please sign in to comment.