[llvm-commits] [llvm] r72018 - in /llvm/trunk: autoconf/configure.ac cmake/config-ix.cmake configure include/llvm/Config/config.h.cmake include/llvm/Config/config.h.in lib/System/Unix/Process.inc

Douglas Gregor dgregor at apple.com
Mon May 18 10:21:34 PDT 2009


Author: dgregor
Date: Mon May 18 12:21:34 2009
New Revision: 72018

URL: http://llvm.org/viewvc/llvm-project?rev=72018&view=rev
Log:
termios.h contains the winsize structure we need to determine the
width of a terminal. Don't try to get the width of a terminal if we
don't have this header.

Modified:
    llvm/trunk/autoconf/configure.ac
    llvm/trunk/cmake/config-ix.cmake
    llvm/trunk/configure
    llvm/trunk/include/llvm/Config/config.h.cmake
    llvm/trunk/include/llvm/Config/config.h.in
    llvm/trunk/lib/System/Unix/Process.inc

Modified: llvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=72018&r1=72017&r2=72018&view=diff

==============================================================================
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Mon May 18 12:21:34 2009
@@ -823,8 +823,8 @@
 AC_HEADER_TIME
 
 AC_CHECK_HEADERS([dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.h])
-AC_CHECK_HEADERS([malloc.h setjmp.h signal.h stdint.h unistd.h utime.h])
-AC_CHECK_HEADERS([windows.h])
+AC_CHECK_HEADERS([malloc.h setjmp.h signal.h stdint.h termios.h unistd.h])
+AC_CHECK_HEADERS([utime.h windows.h])
 AC_CHECK_HEADERS([sys/mman.h sys/param.h sys/resource.h sys/time.h])
 AC_CHECK_HEADERS([sys/types.h sys/ioctl.h malloc/malloc.h mach/mach.h])
 if test "$ENABLE_THREADS" -eq 1 ; then

Modified: llvm/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=72018&r1=72017&r2=72018&view=diff

==============================================================================
--- llvm/trunk/cmake/config-ix.cmake (original)
+++ llvm/trunk/cmake/config-ix.cmake Mon May 18 12:21:34 2009
@@ -34,6 +34,7 @@
 check_include_file(sys/stat.h HAVE_SYS_STAT_H)
 check_include_file(sys/time.h HAVE_SYS_TIME_H)
 check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+check_include_file(termios.h HAVE_TERMIOS_H)
 check_include_file(unistd.h HAVE_UNISTD_H)
 check_include_file(utime.h HAVE_UTIME_H)
 check_include_file(windows.h HAVE_WINDOWS_H)

Modified: llvm/trunk/configure
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=72018&r1=72017&r2=72018&view=diff

==============================================================================
--- llvm/trunk/configure (original)
+++ llvm/trunk/configure Mon May 18 12:21:34 2009
@@ -28963,7 +28963,7 @@
 
 
 
-for ac_header in malloc.h setjmp.h signal.h stdint.h unistd.h utime.h
+for ac_header in malloc.h setjmp.h signal.h stdint.h termios.h unistd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -29132,7 +29132,8 @@
 done
 
 
-for ac_header in windows.h
+
+for ac_header in utime.h windows.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then

Modified: llvm/trunk/include/llvm/Config/config.h.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.cmake?rev=72018&r1=72017&r2=72018&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Config/config.h.cmake (original)
+++ llvm/trunk/include/llvm/Config/config.h.cmake Mon May 18 12:21:34 2009
@@ -419,6 +419,9 @@
 /* Define to 1 if the system has the type `uint64_t'. */
 #undef HAVE_UINT64_T
 
+/* Define to 1 if you have the <termios.h> header file. */
+#cmakedefine HAVE_TERMIOS_H ${HAVE_TERMIOS_H}
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #cmakedefine HAVE_UNISTD_H ${HAVE_UNISTD_H}
 

Modified: llvm/trunk/include/llvm/Config/config.h.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.in?rev=72018&r1=72017&r2=72018&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Config/config.h.in (original)
+++ llvm/trunk/include/llvm/Config/config.h.in Mon May 18 12:21:34 2009
@@ -419,6 +419,9 @@
 /* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
 #undef HAVE_SYS_WAIT_H
 
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
 /* Define to 1 if the system has the type `uint64_t'. */
 #undef HAVE_UINT64_T
 

Modified: llvm/trunk/lib/System/Unix/Process.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Process.inc?rev=72018&r1=72017&r2=72018&view=diff

==============================================================================
--- llvm/trunk/lib/System/Unix/Process.inc (original)
+++ llvm/trunk/lib/System/Unix/Process.inc Mon May 18 12:21:34 2009
@@ -27,6 +27,9 @@
 #ifdef HAVE_SYS_IOCTL_H
 #  include <sys/ioctl.h>
 #endif
+#ifdef HAVE_TERMIOS_H
+#  include <termios.h>
+#endif
 
 //===----------------------------------------------------------------------===//
 //=== WARNING: Implementation here must contain only generic UNIX code that
@@ -204,7 +207,7 @@
 
   unsigned Columns = 0;
 
-#ifdef HAVE_SYS_IOCTL_H
+#if defined(HAVE_SYS_IOCTL_H) && defined(HAVE_TERMIOS_H)
   // Try to determine the width of the terminal.
   struct winsize ws;
   if (ioctl(FileID, TIOCGWINSZ, &ws) == 0)





More information about the llvm-commits mailing list