Use Gnulib's `count-one-bits' module.
* m4/gnulib-cache.m4 (gl_MODULES): Add `count-one-bits'.
This commit is contained in:
parent
53f4876abc
commit
d7014610b1
8 changed files with 293 additions and 2 deletions
|
|
@ -18,3 +18,5 @@ time_h.m4
|
|||
time_r.m4
|
||||
tm_gmtoff.m4
|
||||
wchar.m4
|
||||
count-one-bits.m4
|
||||
inline.m4
|
||||
|
|
|
|||
12
m4/count-one-bits.m4
Normal file
12
m4/count-one-bits.m4
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# count-one-bits.m4 serial 1
|
||||
dnl Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_COUNT_ONE_BITS],
|
||||
[
|
||||
dnl We don't need (and can't compile) count_one_bits_ll
|
||||
dnl unless the type 'unsigned long long int' exists.
|
||||
AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
|
||||
])
|
||||
|
|
@ -15,12 +15,13 @@
|
|||
|
||||
|
||||
# Specification in the form of a command-line invocation:
|
||||
# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl alloca extensions strcase strftime
|
||||
# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl alloca count-one-bits extensions strcase strftime
|
||||
|
||||
# Specification in the form of a few gnulib-tool.m4 macro invocations:
|
||||
gl_LOCAL_DIR([])
|
||||
gl_MODULES([
|
||||
alloca
|
||||
count-one-bits
|
||||
extensions
|
||||
strcase
|
||||
strftime
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ LTALLOCA=`echo "$ALLOCA" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
|
|||
changequote([, ])dnl
|
||||
AC_SUBST([LTALLOCA])
|
||||
gl_FUNC_ALLOCA
|
||||
gl_COUNT_ONE_BITS
|
||||
gl_INLINE
|
||||
AM_STDBOOL_H
|
||||
gl_STRCASE
|
||||
gl_FUNC_GNU_STRFTIME
|
||||
|
|
@ -184,6 +186,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
build-aux/link-warning.h
|
||||
lib/alloca.c
|
||||
lib/alloca.in.h
|
||||
lib/count-one-bits.h
|
||||
lib/dummy.c
|
||||
lib/stdbool.in.h
|
||||
lib/strcasecmp.c
|
||||
|
|
@ -193,11 +196,14 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/strncasecmp.c
|
||||
lib/time.in.h
|
||||
lib/time_r.c
|
||||
lib/verify.h
|
||||
lib/wchar.in.h
|
||||
m4/alloca.m4
|
||||
m4/count-one-bits.m4
|
||||
m4/extensions.m4
|
||||
m4/gnulib-common.m4
|
||||
m4/include_next.m4
|
||||
m4/inline.m4
|
||||
m4/mbstate_t.m4
|
||||
m4/stdbool.m4
|
||||
m4/strcase.m4
|
||||
|
|
|
|||
40
m4/inline.m4
Normal file
40
m4/inline.m4
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
# inline.m4 serial 3
|
||||
dnl Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl Test for the 'inline' keyword or equivalent.
|
||||
dnl Define 'inline' to a supported equivalent, or to nothing if not supported,
|
||||
dnl like AC_C_INLINE does. Also, define HAVE_INLINE if 'inline' or an
|
||||
dnl equivalent is effectively supported, i.e. if the compiler is likely to
|
||||
dnl drop unused 'static inline' functions.
|
||||
AC_DEFUN([gl_INLINE],
|
||||
[
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_CACHE_CHECK([whether the compiler generally respects inline],
|
||||
[gl_cv_c_inline_effective],
|
||||
[if test $ac_cv_c_inline = no; then
|
||||
gl_cv_c_inline_effective=no
|
||||
else
|
||||
dnl GCC defines __NO_INLINE__ if not optimizing or if -fno-inline is
|
||||
dnl specified.
|
||||
dnl Use AC_COMPILE_IFELSE here, not AC_EGREP_CPP, because the result
|
||||
dnl depends on optimization flags, which can be in CFLAGS.
|
||||
dnl (AC_EGREP_CPP looks only at the CPPFLAGS.)
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[]],
|
||||
[[#ifdef __NO_INLINE__
|
||||
#error "inline is not effective"
|
||||
#endif]])],
|
||||
[gl_cv_c_inline_effective=yes],
|
||||
[gl_cv_c_inline_effective=no])
|
||||
fi
|
||||
])
|
||||
if test $gl_cv_c_inline_effective = yes; then
|
||||
AC_DEFINE([HAVE_INLINE], 1,
|
||||
[Define to 1 if the compiler supports one of the keywords
|
||||
'inline', '__inline__', '__inline' and effectively inlines
|
||||
functions marked as such.])
|
||||
fi
|
||||
])
|
||||
Loading…
Add table
Add a link
Reference in a new issue