]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/configure
libstdc++: Add autoconf checks for mkdir, chmod, chdir, and getcwd
[thirdparty/gcc.git] / libstdc++-v3 / configure
index 22cb5b02d74b8ed1e5dc624743cdde2500ca1868..51c1d493ac9e3719cc756c7c73b5070e66ff8fd0 100755 (executable)
@@ -71838,6 +71838,258 @@ $as_echo "$glibcxx_cv_dirent_d_type" >&6; }
 
 $as_echo "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h
 
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chmod" >&5
+$as_echo_n "checking for chmod... " >&6; }
+if ${glibcxx_cv_chmod+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      if test x$gcc_no_link = xyes; then
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+       #include <sys/stat.h>
+
+int
+main ()
+{
+
+       int i = chmod("", S_IRUSR);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  glibcxx_cv_chmod=yes
+else
+  glibcxx_cv_chmod=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+       #include <sys/stat.h>
+
+int
+main ()
+{
+
+       int i = chmod("", S_IRUSR);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  glibcxx_cv_chmod=yes
+else
+  glibcxx_cv_chmod=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_chmod" >&5
+$as_echo "$glibcxx_cv_chmod" >&6; }
+  if test $glibcxx_cv_chmod = yes; then
+
+$as_echo "#define _GLIBCXX_USE_CHMOD 1" >>confdefs.h
+
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mkdir" >&5
+$as_echo_n "checking for mkdir... " >&6; }
+if ${glibcxx_cv_mkdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      if test x$gcc_no_link = xyes; then
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+       #include <sys/stat.h>
+
+int
+main ()
+{
+
+       int i = mkdir("", S_IRUSR);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  glibcxx_cv_mkdir=yes
+else
+  glibcxx_cv_mkdir=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+       #include <sys/stat.h>
+
+int
+main ()
+{
+
+       int i = mkdir("", S_IRUSR);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  glibcxx_cv_mkdir=yes
+else
+  glibcxx_cv_mkdir=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_mkdir" >&5
+$as_echo "$glibcxx_cv_mkdir" >&6; }
+  if test $glibcxx_cv_mkdir = yes; then
+
+$as_echo "#define _GLIBCXX_USE_MKDIR 1" >>confdefs.h
+
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chdir" >&5
+$as_echo_n "checking for chdir... " >&6; }
+if ${glibcxx_cv_chdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      if test x$gcc_no_link = xyes; then
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+       #include <unistd.h>
+
+int
+main ()
+{
+
+       int i = chdir("");
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  glibcxx_cv_chdir=yes
+else
+  glibcxx_cv_chdir=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+       #include <unistd.h>
+
+int
+main ()
+{
+
+       int i = chdir("");
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  glibcxx_cv_chdir=yes
+else
+  glibcxx_cv_chdir=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_chdir" >&5
+$as_echo "$glibcxx_cv_chdir" >&6; }
+  if test $glibcxx_cv_chdir = yes; then
+
+$as_echo "#define _GLIBCXX_USE_CHDIR 1" >>confdefs.h
+
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getcwd" >&5
+$as_echo_n "checking for getcwd... " >&6; }
+if ${glibcxx_cv_getcwd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      if test x$gcc_no_link = xyes; then
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+       #include <unistd.h>
+
+int
+main ()
+{
+
+       char* s = getcwd((char*)0, 1);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  glibcxx_cv_getcwd=yes
+else
+  glibcxx_cv_getcwd=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+       #include <unistd.h>
+
+int
+main ()
+{
+
+       char* s = getcwd((char*)0, 1);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  glibcxx_cv_getcwd=yes
+else
+  glibcxx_cv_getcwd=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_getcwd" >&5
+$as_echo "$glibcxx_cv_getcwd" >&6; }
+  if test $glibcxx_cv_getcwd = yes; then
+
+$as_echo "#define _GLIBCXX_USE_GETCWD 1" >>confdefs.h
+
   fi
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for realpath" >&5
 $as_echo_n "checking for realpath... " >&6; }