Fix missing newline in test output
[platform/upstream/glibc.git] / aclocal.m4
index b173e9e..bc48586 100644 (file)
@@ -9,8 +9,8 @@ m4_defn([AC_AUTOCONF_VERSION])
 ), [63])])dnl
 dnl
 dnl We define the macro GLIBC_PROVIDES to do an AC_PROVIDE for each macro
-dnl which appears in configure.in before the sysdep configure scripts are run.
-dnl Each sysdep configure.in does GLIBC_PROVIDES first, to avoid any
+dnl which appears in configure.ac before the sysdep configure scripts are run.
+dnl Each sysdep configure.ac does GLIBC_PROVIDES first, to avoid any
 dnl AC_REQUIREs or AC_BEFOREs duplicating their code.
 dnl
 define([GLIBC_PROVIDES], [dnl
@@ -39,7 +39,7 @@ dnl Ripped out of AS_INIT, which does more cruft we do not want.
 m4_wrap([m4_divert_pop([BODY])[]])
 m4_divert_push([BODY])[]dnl
 dnl End of ripped out of AS_INIT.
-# This file is generated from configure.in by Autoconf.  DO NOT EDIT!
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
 define([_AC_LANG], [C])dnl
 ])dnl
 dnl
@@ -213,3 +213,71 @@ AC_DEFUN([ACX_BUGURL],[
   AC_SUBST(REPORT_BUGS_TO)
   AC_SUBST(REPORT_BUGS_TEXI)
 ])
+
+dnl Check linker option support.
+dnl LIBC_LINKER_FEATURE([ld_option], [cc_option], [action-if-true], [action-if-false])
+AC_DEFUN([LIBC_LINKER_FEATURE],
+[AC_MSG_CHECKING([for linker that supports $1])
+libc_linker_feature=no
+if test x"$gnu_ld" = x"yes"; then
+  libc_linker_check=`$LD -v --help 2>/dev/null | grep "\$1"`
+  if test -n "$libc_linker_check"; then
+    cat > conftest.c <<EOF
+int _start (void) { return 42; }
+EOF
+    if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+                               $2 -nostdlib -nostartfiles
+                               -fPIC -shared -o conftest.so conftest.c
+                               1>&AS_MESSAGE_LOG_FD])
+    then
+      libc_linker_feature=yes
+    fi
+    rm -f conftest*
+  fi
+fi
+if test $libc_linker_feature = yes; then
+  $3
+else
+  $4
+fi
+AC_MSG_RESULT($libc_linker_feature)])
+
+dnl Add a makefile variable, with value set from a shell string
+dnl (expanded by the shell inside double quotes), to config.make.
+dnl LIBC_CONFIG_VAR(make-variable, shell-value)
+AC_DEFUN([LIBC_CONFIG_VAR],
+[config_vars="$config_vars
+$1 = $2"])
+
+dnl Check that function FUNC was inlined as a builtin.  The code fragment
+dnl CODE is compiled with additional options CC_OPTION.  If FUNC is
+dnl not found in the assembly then it is assumed the compiler has support
+dnl for this builtin and has inlined the call.  If the compiler has the
+dnl feature then ACTION-IF-TRUE is called, otherwise ACTION-IF-FALSE.
+dnl It is up to the caller to provide a CC_OPTION that ensures the
+dnl builtin is inlined if present.
+dnl Warning: This may not work for some machines. For example on ARM the
+dnl ABI dictates that some functions should not be inlined and instead
+dnl should be provided by a compiler helper library e.g. __aeabi_memcpy.
+dnl This is done to reduce code size.
+dnl LIBC_COMPILER_BUILTIN([func], [code], [cc_option], [action-if-true], [action-if-false])
+AC_DEFUN([LIBC_COMPILER_BUILTIN_INLINED],
+[AC_MSG_CHECKING([for compiler support of inlined builtin function $1])
+libc_compiler_builtin_inlined=no
+cat > conftest.c <<EOF
+int _start (void) { $2 return 0; }
+EOF
+if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+                    $3 -nostdlib -nostartfiles
+                    -S conftest.c -o - | fgrep "$1"
+                    1>&AS_MESSAGE_LOG_FD])
+then
+  libc_compiler_builtin_inlined=yes
+fi
+rm -f conftest*
+if test $libc_compiler_builtin_inlined = yes; then
+  $4
+else
+  $5
+fi
+AC_MSG_RESULT($libc_compiler_builtin_inlined)])