home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR24 / BASH_112.ZIP / BASH-112.TAR / bash-1.12 / sysdefs.h < prev    next >
Text File  |  1993-02-13  |  5KB  |  172 lines

  1. #if 0
  2. #!/bin/sh
  3. #
  4. # This file creates a file called "sysdefs.h" which contains CPP defines
  5. # helping to describe the operating system features.  We just take guesses
  6. # by looking at random files.
  7.  
  8. if [ "$1" ]; then
  9.   sysdefs=$1
  10. else
  11.   sysdefs=./sysdefs.h
  12. fi
  13.  
  14. rm -f $sysdefs
  15. #endif
  16.  
  17. /* sysdefs.h -- #defines for your system created by $0.
  18.    Do NOT EDIT this file, since any changes will disappear.
  19.    Instead, edit $0, or config.h, or machines.h. */
  20.  
  21. #if !defined (_SYSDEFS_H_)
  22. #  define _SYSDEFS_H_
  23.  
  24. #if 0
  25. # Removes any inherited definitions.
  26. SHLIB=
  27. SYSDEF=
  28.  
  29. # Test for shared libraries (this is pretty Sunish).
  30. if test -f /lib/ld.so; then
  31.   SHLIB=-DHAVE_SHARED_LIBS
  32.   echo ""                    >>$sysdefs
  33.   echo "#define HAVE_SHARED_LIBS"        >>$sysdefs
  34. fi
  35.  
  36. # Test for shared libraries (this is pretty sVr4ish).
  37. if test -f /usr/ccs/lib/libc.so; then
  38.   if [ "$SHLIB" = "" ]; then
  39.     SHLIB=-DHAVE_SHARED_LIBS
  40.     echo ""                    >>$sysdefs
  41.     echo "#if !defined (HAVE_SHARED_LIBS)"    >>$sysdefs
  42.     echo "#  define HAVE_SHARED_LIBS"        >>$sysdefs
  43.     echo "#endif /* HAVE_SHARED_LIBS */"    >>$sysdefs
  44.   fi
  45.   SYSDEF=USGr4
  46. fi
  47.  
  48. # Get name of maintainer.
  49. if (whoami) >/dev/null 2>&1 && (hostname) >/dev/null 2>&1; then
  50.   WHOAMI=`whoami`@`hostname`;
  51. else
  52.   WHOAMI=`who am i | awk '{ print $1; }'`
  53. fi
  54.  
  55. if [ "$WHOAMI" = "" ]; then 
  56.   WHOAMI=`id | sed 's/uid=[01-9]*(//' | sed 's/) [) A-Za-z01-9(=,]*//'`
  57.   if (hostname) >/dev/null 2>&1; then
  58.     WHOAMI=$WHOAMI@`hostname`
  59.   elif test -f /usr/bin/uuname -o -f /bin/uuname; then
  60.     WHOAMI=`uuname -l`!$WHOAMI
  61.   fi
  62. fi
  63.  
  64. if [ "$WHOAMI" = "" ]; then
  65.   WHOAMI=root
  66. fi
  67.  
  68. echo ""                        >>$sysdefs
  69. echo "#if !defined (MAINTAINER)"        >>$sysdefs
  70. echo "#  define MAINTAINER $WHOAMI"        >>$sysdefs
  71. echo "#endif /* MAINTAINER */"            >>$sysdefs
  72.  
  73. # Try to locate ranlib.  I think this is a bad idea.
  74. if [ -r /usr/bin/ranlib ]; then RANLIB_LOCATION=/usr/bin/ranlib;
  75. elif [ -r /bin/ranlib ]; then RANLIB_LOCATION=/bin/ranlib;
  76. elif [ -r /usr/local/bin/ranlib ]; then RANLIB_LOCATION=/usr/local/bin/ranlib;
  77. elif [ -r /usr/local/gnubin/ranlib ]; then RANLIB_LOCATION=/usr/local/gnubin/ranlib;
  78. fi
  79.  
  80. # Does this system have /bin/csh?  We don't care about other csh's.
  81. if [ -f /bin/csh ]; then
  82. #endif
  83.  
  84. #if !defined (HAVE_CSH)
  85. #  define HAVE_CSH
  86. #endif /* HAVE_CSH */
  87.  
  88. #if 0
  89. if [ "${RANLIB_LOCATION}" ]; then
  90.   echo ""                        >>$sysdefs
  91.   echo "#if !defined (RANLIB_LOCATION)"         >>$sysdefs
  92.   echo "#  define RANLIB_LOCATION ${RANLIB_LOCATION}"    >>$sysdefs
  93.   echo "#endif /* RANLIB_LOCATION */"             >>$sysdefs
  94. fi
  95.  
  96. #
  97. # Is this a Xenix system?
  98. #
  99. if [ -f /xenix ]; then
  100.   SYSDEF="Xenix"
  101.  case "`/bin/uname -p`" in
  102.   *286) SYSDEF="Xenix286" ;;
  103.   *386) SYSDEF="Xenix386" ;;
  104.  esac
  105. fi
  106.  
  107. #
  108. # Is this a cadmus system?
  109. #
  110. if [ -f /unix ]; then
  111.   if [ -d /generic ]; then   # This is an AIX system.
  112.     SYSDEF="aixpc"
  113.     cat cpp-Makefile | grep -v '/\*\*/' >aix-Makefile
  114.   elif [ -d /etc/conf/kconfig.d ] && [ -f /usr/include/sys/limits.h ]; then
  115.     SYSDEF="isc386"            # This is a 386 running ISC?
  116.   elif [ -f /etc/xlc.cfg ]; then
  117.     if fgrep _IBMR2 /etc/xlc.cfg >/dev/null 2>&1; then
  118.       SYSDEF=RISC6000
  119.       cat cpp-Makefile | grep -v '/\*\*/' >aix-Makefile
  120.     fi
  121.   elif [ -f /bin/4d -a -f /bin/uname ]; then
  122.     case "`uname -r`" in
  123.       3.*) SYSDEF="Irix3" ;;
  124.       4.*) SYSDEF="Irix4" ;;
  125.       *)   SYSDEF="Irix3" ;;
  126.     esac
  127.   elif [ -d /usr/amiga ]; then
  128.     SYSDEF="amiga"        # An Amiga running V.4.
  129.   else
  130.     if [ "$SYSDEF" = "" ]; then
  131.       SYSDEF="cadmus"
  132.     fi
  133.  
  134.     if [ -f /shlib/libc_s ]; then
  135.       SHLIB=-DHAVE_SHARED_LIBS
  136.       echo ""                    >>$sysdefs
  137.       echo "#if !defined (HAVE_SHARED_LIBS)"    >>$sysdefs
  138.       echo "#  define HAVE_SHARED_LIBS"        >>$sysdefs
  139.       echo "#endif /* HAVE_SHARED_LIBS */"    >>$sysdefs
  140.     fi
  141.   fi
  142. fi
  143.  
  144. if [ "$SYSDEF" != "" ]; then
  145.   echo ""                    >>$sysdefs
  146.   echo "#if !defined ($SYSDEF)"            >>$sysdefs
  147.   echo "#  define $SYSDEF"            >>$sysdefs
  148.   echo "#endif /* $SYSDEF */"            >>$sysdefs
  149. fi
  150.  
  151. if [ -f /usr/include/unistd.h ]; then
  152.   echo ""                    >>$sysdefs
  153.   echo "#if !defined (HAVE_UNISTD_H)"        >>$sysdefs
  154.   echo "#  define HAVE_UNISTD_H"        >>$sysdefs
  155.   echo "#endif /* HAVE_UNISTD_H */"        >>$sysdefs
  156. fi
  157. #endif
  158.  
  159. #if !defined (HAVE_WAIT_H)
  160. #  define HAVE_WAIT_H    
  161. #endif /* HAVE_WAIT_H */
  162.  
  163. #if !defined (HAVE_ALLOCA_H)
  164. #  define HAVE_ALLOCA_H
  165. #endif /* HAVE_ALLOCA_H */
  166.  
  167. #if !defined (HAVE_RESOURCE)
  168. #  define HAVE_RESOURCE
  169. #endif /* HAVE_RESOURCE */
  170.  
  171. #endif /* _SYSDEFS_H_ */
  172.