home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dbmalloc.zip / Configure < prev    next >
Text File  |  1993-01-04  |  30KB  |  1,294 lines

  1. #!/bin/sh
  2. #
  3. #
  4. # (c) Copyright 1990, 1991, 1992 Conor P. Cahill (cpcahil@virtech.vti.com)
  5. #
  6. # This software may be distributed freely as long as the following conditions
  7. # are met:
  8. #         * the distribution, or any derivative thereof, may not be
  9. #          included as part of a commercial product
  10. #        * full source code is provided including this copyright
  11. #        * there is no charge for the software itself (there may be
  12. #          a minimal charge for the copying or distribution effort)
  13. #        * this copyright notice is not modified or removed from any
  14. #          source file
  15. #
  16. # $Id: Configure,v 1.22 1992/08/22 16:27:13 cpcahil Exp $
  17. #
  18. # This shell script attempts to automatically determine the correct settings
  19. # for the malloc library include file and compile pre-defines.  This script has
  20. # been tested by the author in the following environments:
  21. #
  22. #    Intel 486    ISC UNIX 3.0    cc & gcc 2.1
  23. #    Intel 486    DELL SVR4     cc & gcc 1.40
  24. #    HP9000        HP/UX 8.0    cc & cc -Aa -D_POSIX_SOURCE
  25. #    AT&T 3B2-600    SVR4.1ES    cc (relaxed ansi - no cc flags)
  26. #    IBM RS6000    AIX 3.1        cc 
  27. #    Sun Sparc 2    SunOS 4.1.1    cc
  28. #
  29. # It has also been reported to work in the following environments:
  30. #
  31. #    DG AViiON    DG/UX        gcc 2.1 & cc (which is gcc -traditional)
  32. #    Sun Sparc 2    SunOS 4.1.1    cc (apparently in the sys5 environment)
  33. #    Hp 9000/400    HP-UX 7.0x    cc
  34. #    Hp 9000/700    HP-UX 8.05    cc
  35. #    Sun Sparc     SunOs 4.1.1    cc (in bsd environment)
  36. #    Motorola 88K    SysV 3.2
  37. #    DecStation 5100    Ultrix 4.2    
  38. #    IBM rs/6000    AIX 3.1.1    
  39. #    IBM rs/6000    AIX 3.2    
  40. #    Intel 486    ESIX SysV 4.0
  41. #
  42. # If you run this script in a different environment it may not work correctly or
  43. # it may make an incorrect determination, so be more cautious about the results.
  44. #
  45. SP="           "
  46. CCFILE=CF$$c
  47. CCLIST="gcc2 gcc como CC g++ c89 cc pcc"
  48. CONFFILE=.configure
  49. DIRLIST="`echo $PATH | tr ':' ' '`"
  50. INCDIR=/usr/include
  51. LIBDIRS="/lib /usr/lib /usr/ucb/lib"
  52. TMPDIR=/tmp
  53. TMPBREAK=${TMPDIR}/CF$$break
  54. TMPCC=${TMPDIR}/CF$$cc
  55. TMPCCFILE=${TMPDIR}/${CCFILE}.c
  56. TMPCOMP=${TMPDIR}/CF$$cmp
  57. TMPDEF=${TMPDIR}/CF$$def
  58. TMPEND=${TMPDIR}/CF$$end
  59. TMPFATAL=${TMPDIR}/CF$$fatal
  60. TMPFIRST=${TMPDIR}/CF$$first
  61. TMPFOUND=${TMPDIR}/CF$$fnd
  62. TMPPREDEF=${TMPDIR}/CF$$pred
  63. TMPSET=${TMPDIR}/CF$$set
  64. TMPSKIPPED=${TMPDIR}/CF$$skip
  65. WARN_REGEXP="[Ww]arning|^w "\"".*"\"",L[0-9]*/C[0-9]*:"
  66.  
  67. if [ $# != 0 ]; then
  68.     debug=$1
  69.  
  70.     if [ $debug -gt 10 ]; then
  71.         set -x
  72.     fi
  73. else
  74.     debug=0
  75. fi
  76.  
  77. #
  78. # if we already have a configuration 
  79. #
  80. if [ $# = 0 -a -s "${CONFFILE}" -a -s "${CONFFILE}.s" ]; then
  81.  
  82.     echo "Using existing configuration.  If this is not correct, you"
  83.     echo "need to remove the ${CONFFILE} file and re-run the make"
  84.  
  85. else
  86.  
  87.     echo "Determining the correct configuration for malloc.h on this" \
  88.             "system."
  89.     echo "This may take a while, please be patient"
  90.  
  91.     
  92.     #
  93.     # Determine default sizetype (for use when we are guessing at 
  94.     # parameter settings).
  95.     #
  96.     grep size_t ${INCDIR}/sys/types.h >/dev/null 2>&1
  97.     if [ $? = 0 ]; then
  98.         dfltsize=size_t
  99.     else
  100.         dfltsize="unsigned int"
  101.     fi
  102.  
  103.     #
  104.     # determine the compiler(s) that are available on this system
  105.     #
  106.  
  107.     echo "    Looking for compilers..."
  108.     rm -f ${TMPCOMP}
  109.     touch ${TMPCOMP}
  110.  
  111.     #
  112.     # if in debug mode and the compiler is specified as an argument
  113.     #
  114.     if [ $# -gt 1 ]; then
  115.         echo $2 > ${TMPCOMP}
  116.     else
  117.  
  118.         #
  119.         # look for the listed compilers.  Note that cc is last.  This
  120.         # is as it should be because cc is probably the only compiler
  121.         # listed that doesn't have one of the pre-defined symbols that
  122.         # we look for and therefore must be last because the
  123.         # configuration check loop requires that all compilers other
  124.         # than the last compiler have one of the pre-defined symbols.
  125.         #
  126.         for compiler in ${CCLIST}
  127.         do
  128.             for dir in ${DIRLIST}
  129.             do
  130.                 if [ -s $dir/$compiler ]; then
  131.                     echo "        found $compiler in $dir"
  132.                     echo $dir/$compiler >> ${TMPCOMP}
  133.                     #
  134.                     # if this is gcc, also add a second 
  135.                     #   entry with the -traditional flag
  136.                     #
  137.                     if [ $compiler = "gcc" ]; then
  138.                         echo $dir/$compiler \
  139.                           -traditional >> ${TMPCOMP}
  140.                     fi
  141.                     
  142.                     break
  143.                 fi
  144.             done
  145.         done
  146.  
  147.         #
  148.         # if we didn't find any compilers
  149.         #
  150.         if [ ! -s ${TMPCOMP} ]; then
  151.             echo "I can't find your compiler"
  152.             echo 1 > ${TMPFATAL}
  153.             exit 1
  154.         fi
  155.  
  156.     fi
  157.  
  158.     rm -f ${TMPSET} ${TMPEND} ${TMPSET}.s ${TMPEND}.s ${TMPFIRST} ${TMPSKIPPED}
  159.  
  160.     cp /dev/null ${TMPSET}
  161.     cp /dev/null ${TMPSET}.s
  162.     cp /dev/null ${TMPEND}
  163.     cp /dev/null ${TMPEND}.s
  164.     first=1
  165.     ending=
  166.     #
  167.     # for each compiler. 
  168.     #
  169.     echo "    checking compiler configuration(s)..."
  170.     while read cc
  171.     do
  172.         (
  173.         echo "        checking $cc..."
  174.  
  175.         #
  176.         # if we should be using any special flags for this compile
  177.         #
  178.         if [ -s Config.flags ]; then
  179.             newcc="`basename $cc`"
  180.             newcc="`eval grep \"\^$newcc\" Config.flags`"
  181.             if [ ! -z "$newcc" ]; then
  182.                 cc="$newcc"
  183.             fi
  184.         fi
  185.  
  186.         if [ -s ${TMPFIRST} ]; then
  187.             #
  188.             # See if the current set of defines meets the conditions
  189.             # for this compiler.  If so, there is no need to verify
  190.             # the parameters further.
  191.             #
  192.             rm -f ${TMPCCFILE}
  193.             cat ${TMPSET} ${TMPEND} cctest.c > ${TMPCCFILE}
  194.             $cc -DMALLOC_COMPILETEST -DMEM_COMPILETEST \
  195.                -DSTR_COMPILETEST -DFREE_COMPILETEST -DEXITTEST\
  196.                -c ${TMPCCFILE} >${TMPCC} 2>&1
  197.             ccresult=$?
  198.  
  199.             rm -f ${TMPCCFILE}
  200.  
  201.             if [ $ccresult = 0 ]; then
  202.                 if egrep "${WARN_REGEXP}" ${TMPCC}>/dev/null; then
  203.                     rm ${TMPCC};
  204.                 else
  205.                     continue
  206.                 fi
  207.             fi
  208.  
  209.             #
  210.             # otherwise if the last compiler didn't have a
  211.             # pre-defined symbol we can't add another set
  212.             # because it would conflict with the previous 
  213.             # set of definitions.
  214.             #
  215.             if [ ! -s ${TMPPREDEF} ]; then
  216.             
  217.                 echo "${SP}More than one compiler and no way to tell the" \
  218.                      "difference between them"
  219.                 echo "${SP}So, hopefully the one set of defs will suffice"
  220.                 echo "break" > ${TMPBREAK}
  221.                 exit
  222.             fi
  223.  
  224.             PREDEF=`cat ${TMPPREDEF}`
  225.  
  226.             if [ ! -s ${TMPSKIPPED} ]; then
  227.                 echo >> ${TMPSET}
  228.                 echo "#else  /* $PREDEF */" >> ${TMPSET}
  229.                 echo >> ${TMPSET}
  230.     
  231.                 echo >> ${TMPSET}.s
  232.                 echo "#else  /* $PREDEF */" >> ${TMPSET}.s
  233.                 echo >> ${TMPSET}.s
  234.             fi
  235.  
  236.         fi
  237.  
  238.         #
  239.         # add the appropriate #ifdef to the settings file for this 
  240.         # compiler (if it has any)
  241.         #
  242.         $cc -DPRE_DEFINES -o cctest cctest.c > /dev/null 2>&1
  243.  
  244.         ./cctest > ${TMPPREDEF}1
  245.  
  246.         if [ ! -s ${TMPPREDEF}1 ]; then
  247.             echo "skipped" >> ${TMPSKIPPED}
  248.             echo "${SP}Failed to determine pre-definitions for this compiler"
  249.             echo "${SP}    skipping this set of pre-defs.  NOTE: this problem"
  250.             echo "${SP}    is usually caused by a compiler installed without"
  251.             echo "${SP}    its libraries (like g++)"
  252.             exit 0
  253.             
  254.         else
  255.  
  256.             rm -f ${TMPSKIPPED}
  257.  
  258.             PREDEF=`cat ${TMPPREDEF}1`
  259.  
  260.             if [ "x${PREDEF}" = "xnone" ]; then
  261.                 cp /dev/null ${TMPPREDEF}
  262.                 PREDEF=""
  263.             else
  264.  
  265.                 mv ${TMPPREDEF}1 ${TMPPREDEF}
  266.  
  267.                 echo >> ${TMPSET}
  268.                 echo "#if       $PREDEF" >> ${TMPSET}
  269.                 echo >> ${TMPSET}
  270.  
  271.                 if [ -s ${TMPEND}.o ]; then
  272.                     rm -f ${TMPEND}.o
  273.                 fi
  274.                 if [ -s ${TMPEND} ]; then
  275.                     mv ${TMPEND} ${TMPEND}.o
  276.                 fi
  277.                 echo > ${TMPEND}
  278.                 echo "#endif /* $PREDEF */" >> ${TMPEND}
  279.                 echo >> ${TMPEND}
  280.  
  281.                 if [ -s ${TMPEND}.o ]; then
  282.                     cat ${TMPEND}.o >> ${TMPEND}
  283.                     rm -f ${TMPEND}.o
  284.                 fi
  285.  
  286.                 echo >> ${TMPSET}.s
  287.                 echo "#if       $PREDEF" >> ${TMPSET}.s
  288.                 echo >> ${TMPSET}.s
  289.  
  290.                 if [ -s ${TMPEND}.s.o ]; then
  291.                     rm -f ${TMPEND}.s.o
  292.                 fi
  293.                 if [ -s ${TMPEND}.s ]; then
  294.                     mv ${TMPEND}.s ${TMPEND}.s.o
  295.                 fi
  296.                 echo > ${TMPEND}.s
  297.                 echo "#endif /* $PREDEF */" >> ${TMPEND}.s
  298.                 echo >> ${TMPEND}.s
  299.  
  300.                 if [ -s ${TMPEND}.s.o ]; then
  301.                     cat ${TMPEND}.s.o >> ${TMPEND}.s
  302.                     rm -f ${TMPEND}.s.o
  303.                 fi
  304.             fi
  305.         fi
  306.  
  307.         #
  308.         # flag that this is not the first time
  309.         #
  310.         echo "second" > ${TMPFIRST}
  311.  
  312.         #
  313.         # First step is to determine the correct settings for the
  314.         # DATATYPE, SIZETYPE and VOIDTYPE pre-defines for this compiler.
  315.         #
  316.         # Check void
  317.         #
  318.         $cc -DVOIDTEST -c cctest.c > ${TMPCC} 2>&1
  319.         cc_result=$?
  320.         egrep "${WARN_REGEXP}" ${TMPCC} > /dev/null 2>&1
  321.         grep_result=$?
  322.  
  323.         if [ $cc_result = 0 -a $grep_result != 0 ] ; then
  324.             voidtype=void
  325.         else
  326.             voidtype=int
  327.         fi
  328.  
  329.         echo "#define VOIDTYPE $voidtype" >> ${TMPSET}
  330.  
  331.         #
  332.         # Check const
  333.         #
  334.         $cc -DCONSTTEST -c cctest.c > ${TMPCC} 2>&1
  335.         cc_result=$?
  336.         egrep "${WARN_REGEXP}" ${TMPCC} > /dev/null 2>&1
  337.         grep_result=$?
  338.  
  339.         if [ $cc_result = 0 -a $grep_result != 0 ] ; then
  340.             const=const
  341.         else
  342.             const=
  343.         fi
  344.  
  345.         echo "#define CONST $const" >> ${TMPSET}
  346.  
  347.         #
  348.         # Check ABORT_SIGNAL.  Note that this goes into the settings.s
  349.         # file which eventually goes into sysdefs.h
  350.         #
  351.         $cc -DSIGABRTTEST -c cctest.c > ${TMPCC} 2>&1
  352.         cc_result=$?
  353.         egrep "${WARN_REGEXP}" ${TMPCC} > /dev/null 2>&1
  354.         grep_result=$?
  355.         if [ $cc_result = 0 -a $grep_result != 0 ] ; then
  356.             abortsig=SIGABRT
  357.         else
  358.             $cc -DSIGIOTTEST -c cctest.c > ${TMPCC} 2>&1
  359.             cc_result=$?
  360.             egrep "${WARN_REGEXP}" ${TMPCC} > /dev/null 2>&1
  361.             grep_result=$?
  362.             if [ $cc_result = 0 -a $grep_result != 0 ] ; then
  363.                 abortsig=SIGIOT
  364.             else
  365.                 abortsig=6
  366.             fi
  367.         fi
  368.  
  369.         echo "/*" >> ${TMPSET}.s
  370.         echo " * Signal to use to abort program " >> ${TMPSET}.s
  371.         echo " */" >> ${TMPSET}.s
  372.         echo "#define ABORT_SIGNAL $abortsig" >> ${TMPSET}.s
  373.         echo "" >> ${TMPSET}.s
  374.  
  375.         #
  376.         # Check SETENV stuff.  Note that this goes into the settings.s
  377.         # file which eventually goes into sysdefs.h
  378.         #
  379.         $cc -DSETENVTEST cctest.c > ${TMPCC} 2>&1
  380.         cc_result=$?
  381.         egrep "${WARN_REGEXP}" ${TMPCC} > /dev/null 2>&1
  382.         gres=$?
  383.         grep "setenv" ${TMPCC} > /dev/null 2>&1
  384.         gres2=$?
  385.         if [ $cc_result = 0 -a $gres != 0 -a $gres2 != 0 ]; then
  386.             echo "/*" >> ${TMPSET}.s
  387.             echo " * Use setenv() for env mods" >> ${TMPSET}.s
  388.             echo " */" >> ${TMPSET}.s
  389.             echo "#define USE_SETENV 1" >> ${TMPSET}.s
  390.             echo "" >> ${TMPSET}.s
  391.         fi
  392.  
  393.         #
  394.         # Check to see if POSIX header files (in particular,
  395.         # <unistd.h>) are available
  396.         #
  397.         $cc -DPOSIXHEADERTEST cctest.c > ${TMPCC} 2>&1
  398.         cc_result=$?
  399.         egrep "$WARN_REGEXP" ${TMPCC} > /dev/null 2>&1
  400.         gres=$?
  401.         if [ $cc_result = 0 -a $gres != 0 ]; then
  402.             echo "/*" >> ${TMPSET}.s
  403.             echo " * POSIX header files are available" >> ${TMPSET}.s
  404.             echo " */" >> ${TMPSET}.s
  405.             echo "#define POSIX_HEADERS 1" >> ${TMPSET}.s
  406.             echo "" >> ${TMPSET}.s
  407.             USE_UNISTD=-DUSE_UNISTD
  408.         else
  409.             USE_UNISTD=
  410.         fi
  411.  
  412.         #
  413.         # Check to see if ANSI header files (in particular,
  414.         # <stdlib.h>) are available
  415.         #
  416.         $cc -DANSIHEADERTEST cctest.c > ${TMPCC} 2>&1
  417.         cc_result=$?
  418.         egrep "$WARN_REGEXP" ${TMPCC} > /dev/null 2>&1
  419.         gres=$?
  420.         if [ $cc_result = 0 -a $gres != 0 ]; then
  421.             echo "/*" >> ${TMPSET}.s
  422.             echo " * ANSI header files are available" >> ${TMPSET}.s
  423.             echo " */" >> ${TMPSET}.s
  424.             echo "#define ANSI_HEADERS 1" >> ${TMPSET}.s
  425.             echo "" >> ${TMPSET}.s
  426.             USE_STDLIB=-DUSE_STDLIB
  427.         else
  428.             USE_STDLIB=
  429.         fi
  430.  
  431.         #
  432.         # Check the type of exit
  433.         #
  434.         
  435.         for type in ${voidtype} int
  436.         do
  437.             $cc -DEXITTEST ${USE_UNISTD} ${USE_STDLIB} \
  438.                 -DEXITTYPE=${type} -c cctest.c > ${TMPCC} 2>&1
  439.             cc_result=$?
  440.             egrep "${WARN_REGEXP}" ${TMPCC} > /dev/null 2>&1
  441.             grep_result=$?
  442.  
  443.             if [ $cc_result = 0 -a $grep_result != 0 ] ; then
  444.                 exittype=${type}
  445.                 break
  446.             else
  447.                 exittype=
  448.             fi
  449.         done
  450.         
  451.         if [ "x${exittype}" != "x" ]; then
  452.             echo "#define EXITTYPE $exittype" >> ${TMPSET}
  453.         else
  454.             echo "${SP}couldn't determine the correct setting for"
  455.             echo "${SP}  the return type of exit, guessing"
  456.             echo "${SP}  VOIDTYPE"
  457.             echo "#define EXITTYPE VOIDTYPE  /* *GUESS* */" \
  458.                 >> ${TMPSET}
  459.         fi
  460.  
  461.         #
  462.         # Check to see if <malloc.h> is available -- if it
  463.         # isn't, we don't have to try using it later in the
  464.         # script and things will go faster
  465.         # 
  466.         $cc -DMALLOCHTEST cctest.c > ${TMPCC} 2>&1
  467.         cc_result=$?
  468.         egrep "$WARN_REGEXP" ${TMPCC} > /dev/null 2>&1
  469.         gres=$?
  470.         if [ $cc_result = 0 -a $gres != 0 ]; then
  471.             USE_MALLOC=-DUSE_MALLOC
  472.         else
  473.             USE_MALLOC=
  474.         fi
  475.  
  476.         #
  477.         # check ASM stuff for i386 systems (need for underscore and/or repe
  478.         # instruction
  479.         #
  480.         echo "/*" >> ${TMPSET}.s
  481.         echo " * ASM settings that only apply to 80x86 systems ">> ${TMPSET}.s
  482.         echo " */" >> ${TMPSET}.s
  483.         echo "" >> ${TMPSET}.s
  484.  
  485.         $cc -DASM_UNDTEST cctest.c > ${TMPCC} 2>&1
  486.         cc_result=$?
  487.         if [ -s a.out ]; then
  488.             res=`./a.out 2>&1`
  489.         else
  490.             res=""
  491.         fi
  492.  
  493.         echo "/*" >> ${TMPSET}.s
  494.         echo " * Use Underscores for ASM global symbols" >> ${TMPSET}.s
  495.         echo " */" >> ${TMPSET}.s
  496.         if [ $cc_result = 0 -a "$res" = "OK" ]; then
  497.             cflag="-DUSE_UNDERSCORE"
  498.             echo "#define USE_UNDERSCORE 1" >> ${TMPSET}.s
  499.         else
  500.             cflag=""
  501.             echo "/* #define USE_UNDERSCORE 1 */" >> ${TMPSET}.s
  502.         fi
  503.         echo "" >> ${TMPSET}.s
  504.  
  505.         $cc -DASM_REPTEST $cflag cctest.c > ${TMPCC} 2>&1
  506.         cc_result=$?
  507.         if [ -s a.out ]; then
  508.             res=`./a.out 2>&1`
  509.         else
  510.             res=""
  511.         fi
  512.  
  513.         echo "/*" >> ${TMPSET}.s
  514.         echo " * Use REPE instruction for ASM repeat op" >> ${TMPSET}.s
  515.         echo " */" >> ${TMPSET}.s
  516.  
  517.         if [ $cc_result = 0 -a "$res" = "OK" ]; then
  518.             echo "#define USE_REPE 1" >> ${TMPSET}.s
  519.         else
  520.             echo "/*#define USE_REPE 1*/" >> ${TMPSET}.s
  521.         fi
  522.         echo "" >> ${TMPSET}.s
  523.  
  524.         #
  525.         # the only way to test the malloc and size datatypes is to
  526.         # define them and install them into the test malloc.h to
  527.         # see if they are valid
  528.         #
  529.         # NOTE: this will fail if a prior version of the debug
  530.         # malloc.h is in the include path for the compiler before
  531.         # the system malloc.h file.
  532.         #
  533.  
  534.         #
  535.         # check settings for malloc
  536.         #
  537.         if [ "$debug" -gt 0 ]; then
  538.             DSP="${SP}    "
  539.             echo "${DSP}Checking malloc"
  540.             DSP="${DSP}    "
  541.         fi
  542.  
  543.         rm -f ${TMPDEF}
  544.         for fileinc in ${USE_STDLIB} ${USE_MALLOC} "${USE_STDLIB} ${USE_MALLOC}"
  545.         do
  546.                 for datatype in void char
  547.                 do
  548.                     for sizetype in size_t int "unsigned int" \
  549.                         long "unsigned long"
  550.                     do
  551.                         if [ $debug != 0 ]; then
  552.                             echo "${DSP}data:$datatype size:$sizetype"
  553.                         fi
  554.  
  555.                         #
  556.                         # compile the test module
  557.                         #
  558.                         $cc -DDATATYPE="$datatype" -DSIZETYPE="$sizetype"   \
  559.                             $fileinc -DCONST="$const" -DMALLOC_COMPILETEST  \
  560.                             -c cctest.c >${TMPCC} 2>&1
  561.                         result=$?
  562.  
  563.                         if [ $debug -gt 5 ]; then
  564.                             cat ${TMPCC}
  565.                         fi
  566.                         if [ $result = 0 ]; then
  567.                             egrep "${WARN_REGEXP}" ${TMPCC} > /dev/null 2>&1
  568.                             if [ $? != 0 ]; then
  569.                                 echo "#define DATATYPE $datatype" > ${TMPDEF}
  570.                                 echo "#define SIZETYPE $sizetype" >> ${TMPDEF}
  571.                                 break
  572.                             fi
  573.                         fi
  574.  
  575.                     done
  576.  
  577.                     if [ -s ${TMPDEF} ]; then
  578.                         break
  579.                     fi
  580.  
  581.                 done
  582.  
  583.                 if [ -s ${TMPDEF} ]; then
  584.                     break
  585.                 fi
  586.  
  587.         done
  588.  
  589.         if [ ! -s ${TMPDEF} ]; then
  590.             #
  591.             # guess at what the correct settings should be.  If the compiler
  592.             # supports the void data type, guess that the pointer returned
  593.             # by malloc is a void * and the size is size_t, otherwise use
  594.             # char * and unsigned int
  595.             #
  596.             if [ "$voidtype" = void ]; then
  597.                 datatype=void
  598.                 sizetype=size_t
  599.             else
  600.                 datatype=char
  601.                 sizetype="unsigned int"
  602.             fi
  603.  
  604.             echo "${SP}couldn't determine the correct settings for the datatype"
  605.             echo "${SP}  and sizetype parameters for malloc, guessing that the"
  606.             echo "${SP}  datatype is $datatype and sizetype is $sizetype"
  607.  
  608.             #
  609.             # put the guesses into the tmpdef file and flag them as a guess
  610.             #
  611.             echo "#define DATATYPE $datatype  /* *GUESS* */" >  ${TMPDEF}
  612.             echo "#define SIZETYPE $sizetype  /* *GUESS* */" >> ${TMPDEF}
  613.         fi
  614.  
  615.         cat < ${TMPDEF} >> ${TMPSET}
  616.  
  617.         rm -f ${TMPDEF}
  618.         for fileinc in ${USE_STDLIB} ${USE_MALLOC} "${USE_STDLIB} ${USE_MALLOC}"
  619.         do
  620.             for freetype in ${voidtype} int
  621.             do
  622.                 if [ $debug != 0 ]; then
  623.                     echo "${DSP}freetype:$freetype"
  624.                 fi
  625.  
  626.                 #
  627.                 # compile the test module
  628.                 #
  629.                 $cc -DFREETYPE="$freetype" -DDATATYPE="$datatype" \
  630.                     $fileinc -DCONST="$const" -DFREE_COMPILETEST  \
  631.                     -c cctest.c >${TMPCC} 2>&1
  632.                 result=$?
  633.  
  634.                 if [ $debug -gt 5 ]; then
  635.                     cat ${TMPCC}
  636.                 fi
  637.                 if [ $result = 0 ]; then
  638.                     egrep "${WARN_REGEXP}" ${TMPCC} > /dev/null 2>&1
  639.                     if [ $? != 0 ]; then
  640.                         echo "#define FREETYPE $freetype" > ${TMPDEF}
  641.                         break
  642.                     fi
  643.                 fi
  644.             done
  645.  
  646.             if [ -s ${TMPDEF} ]; then
  647.                 break;
  648.             fi
  649.         done
  650.  
  651.         if [ ! -s ${TMPDEF} ]; then
  652.             #
  653.             # guess at what the correct settings should be.
  654.             #
  655.  
  656.             echo "${SP}couldn't determine the correct settings for the return"
  657.             echo "${SP}  value of free, guessing VOIDTYPE"
  658.  
  659.             #
  660.             # put the guesses into the tmpdef file and flag them as a guess
  661.             #
  662.             echo "#define FREETYPE VOIDTYPE  /* *GUESS* */" >  ${TMPDEF}
  663.         fi
  664.  
  665.         cat < ${TMPDEF} >> ${TMPSET}
  666.  
  667.         #
  668.         # check settings for memory functions
  669.         #
  670.         if [ "$debug" -gt 0 ]; then
  671.             DSP="${SP}    "
  672.             echo "${DSP}Checking memory functions"
  673.             DSP="${DSP}    "
  674.         fi
  675.         rm -f ${TMPDEF}
  676.  
  677.         #
  678.         # see if we should try to use string.h if memory.h fails.
  679.         #
  680.         if grep "memcpy" ${INCDIR}/string.h > /dev/null 2>&1; then
  681.             extra="-DUSE_STRING_H"
  682.         else
  683.             extra=""
  684.         fi
  685.  
  686.         # 
  687.         # for each include file we are checking
  688.         #
  689.         for fileinc in -DUSE_MEMORY_H  $extra
  690.         do
  691.             if [ $debug -ge 1 ]; then
  692.                 echo "${DSP}checking inc: $fileinc"
  693.                 ODSP="${DSP}"
  694.                 DSP="${DSP}    "
  695.             fi
  696.             for datatype in void char
  697.             do
  698.                 for sizetype in size_t int "unsigned int" long "unsigned long"
  699.                 do
  700.                     if [ $debug -ge 3 ]; then
  701.                         echo "${DSP}data:$datatype size:$sizetype"
  702.                     fi
  703.  
  704.                     #
  705.                     # compile the test module
  706.                     #
  707.                     $cc -DMEMDATA="$datatype" -DMEMSIZE="$sizetype" \
  708.                         -DCONST="$const" -DMEM_COMPILETEST  \
  709.                         $fileinc -c cctest.c >${TMPCC} 2>&1
  710.                     result=$?
  711.                     if [ $debug -gt 10 ]; then
  712.                         cat ${TMPCC}
  713.                     fi
  714.                     if [ $result = 0 ]; then
  715.                         egrep "${WARN_REGEXP}" ${TMPCC} > /dev/null 2>&1
  716.                         if [ $? != 0 ]; then
  717.                             echo "#define MEMDATA $datatype" > ${TMPDEF}
  718.                             echo "#define MEMSIZE $sizetype" >> ${TMPDEF}
  719.                             break
  720.                         fi
  721.                     fi
  722.  
  723.                 done
  724.  
  725.                 if [ -s ${TMPDEF} ]; then
  726.                     break
  727.                 fi
  728.             done
  729.  
  730.             if [ $debug -ge 1 ]; then
  731.                 DSP="${ODSP}"
  732.             fi
  733.  
  734.             if [ -s ${TMPDEF} ]; then
  735.                 break;
  736.             fi
  737.  
  738.         done
  739.  
  740.         if [ ! -s ${TMPDEF} ]; then
  741.             #
  742.             # guess at what the correct settings should be.  If the compiler
  743.             # supports the void data type, guess that the pointer used by
  744.             # memcpy is a void * and the size is size_t, otherwise use
  745.             # char * and unsigned int
  746.             #
  747.             if [ "$voidtype" = void ]; then
  748.                 datatype=void
  749.                 sizetype=size_t
  750.             else
  751.                 datatype=char
  752.                 sizetype="unsigned int"
  753.             fi
  754.  
  755.             echo "${SP}Couldn't determine the correct settings for the datatype"
  756.             echo "${SP}  and sizetype parameters for mem* functions, I will"
  757.             echo "${SP}  guess that the datatype is $datatype and sizetype"
  758.             echo "${SP}  is $sizetype"
  759.  
  760.             #
  761.             # put the guesses into the tmpdef file and flag them as a guess
  762.             #
  763.             echo "#define MEMDATA $datatype  /* *GUESS* */" >  ${TMPDEF}
  764.             echo "#define MEMSIZE $sizetype  /* *GUESS* */" >> ${TMPDEF}
  765.         fi
  766.  
  767.         cat < ${TMPDEF} >> ${TMPSET}
  768.  
  769.         #
  770.         # check memory comparison setting
  771.         #
  772.         if [ "$debug" -gt 0 ]; then
  773.             DSP="${SP}    "
  774.             echo "${DSP}Checking memory func comparision type"
  775.             DSP="${DSP}    "
  776.         fi
  777.         rm -f ${TMPDEF}
  778.         for comptype in "char" "unsigned char" "signed char"
  779.         do
  780.             if [ "x$comptype" = "xchar" ]; then
  781.                 testtype=TESTCHAR
  782.             else
  783.                 testtype=TESTUCHAR
  784.             fi
  785.  
  786.             #
  787.             # compile the test module
  788.             #
  789.             rm -f cctest
  790.             $cc -D$testtype -DCOMPARETEST=memcmp \
  791.                 cctest.c -o cctest >${TMPCC} 2>&1
  792.     
  793.             if [ -s ./cctest ]; then
  794.                 ./cctest
  795.                 if [ $? = 0 ]; then
  796.                     echo "#define MEMCMPTYPE $comptype" \
  797.                             > ${TMPDEF}
  798.                     break
  799.                 fi
  800.             fi
  801.             rm -f ${TMPCC};
  802.         done
  803.  
  804.         if [ ! -s ${TMPDEF} ]; then
  805.             #
  806.             # if we don't know, then guess the natural character type
  807.             # (which may be signed or unsigned)
  808.             #
  809.             comptype=char
  810.  
  811.             echo "${SP}Couldn't determine the correct settings for the"
  812.             echo "${SP}  comparison type for the memory funcs, I will guess"
  813.             echo "${SP}  that the comparison type is $comptype"
  814.  
  815.             #
  816.             # put the guesses into the tmpdef file and flag them as a guess
  817.             #
  818.             echo "#define MEMCMPTYPE $comptype  /* *GUESS* */" >  ${TMPDEF}
  819.         fi
  820.  
  821.         cat < ${TMPDEF} >> ${TMPSET}
  822.  
  823.         #
  824.         # check settings for string functions
  825.         #
  826.         rm -f ${TMPDEF}
  827.         for sizetype in size_t int "unsigned int" long "unsigned long"
  828.         do
  829.             #
  830.             # compile the test module
  831.             #
  832.             $cc -DSTRSIZE="$sizetype"   -DCONST="$const" \
  833.                 -DSTR_COMPILETEST  -c cctest.c >${TMPCC} 2>&1
  834.             
  835.             if [ $? = 0 ]; then
  836.                 if egrep "${WARN_REGEXP}" ${TMPCC}>/dev/null; then
  837.                     rm ${TMPCC};
  838.                 else
  839.                     echo "#define STRSIZE $sizetype" > ${TMPDEF}
  840.                     break
  841.                 fi
  842.             fi
  843.  
  844.         done
  845.         
  846.         if [ ! -s ${TMPDEF} ]; then
  847.             #
  848.             # guess at what the correct setting should be.  If size_t is in
  849.             # /usr/include/string.h, use it, otherwise use the default size 
  850.             # type
  851.             #
  852.             if grep size_t ${INCDIR}/string.h >/dev/null 2>&1; then
  853.                 sizetype=size_t
  854.             else
  855.                 sizetype="$dfltsize"
  856.             fi
  857.  
  858.             echo "${SP}Couldn't determine the correct settings for the sizetype"
  859.             echo "${SP}  parameter for the string functions.  I will guess "
  860.             echo "${SP}  that the correct setting is $sizetype"
  861.  
  862.             #
  863.             # put the guesses into the tmpdef file and flag them as a guess
  864.             #
  865.             echo "#define STRSIZE $sizetype  /* *GUESS* */" >> ${TMPDEF}
  866.         fi
  867.  
  868.         cat < ${TMPDEF} >> ${TMPSET}
  869.  
  870.         #
  871.         # check string comparison setting
  872.         #
  873.         rm -f ${TMPDEF}
  874.         for comptype in "char" "unsigned char" "signed char"
  875.         do
  876.             if [ "x$comptype" = "xchar" ]; then
  877.                 testtype=TESTCHAR
  878.             else
  879.                 testtype=TESTUCHAR
  880.             fi
  881.  
  882.             #
  883.             # compile the test module
  884.             #
  885.             rm -f cctest
  886.             $cc -D$testtype -DCOMPARETEST=strncmp \
  887.                 cctest.c -o cctest >${TMPCC} 2>&1
  888.     
  889.             if [ -s ./cctest ]; then
  890.                 ./cctest
  891.                 if [ $? = 0 ]; then
  892.                     echo "#define STRCMPTYPE $comptype" \
  893.                             > ${TMPDEF}
  894.                     break
  895.                 fi
  896.             fi
  897.             rm -f ${TMPCC};
  898.         done
  899.  
  900.         if [ ! -s ${TMPDEF} ]; then
  901.             #
  902.             # if we don't know, then guess the natural character type
  903.             # (which may be signed or unsigned)
  904.             #
  905.             comptype=char
  906.  
  907.             echo "${SP}Couldn't determine the correct settings for the"
  908.             echo "${SP}  comparison type for the string funcs, I will guess"
  909.             echo "${SP}  that the comparison type is $comptype"
  910.  
  911.             #
  912.             # put the guesses into the tmpdef file and flag them as a guess
  913.             #
  914.             echo "#define STRCMPTYPE $comptype  /* *GUESS* */" >  ${TMPDEF}
  915.         fi
  916.  
  917.         cat < ${TMPDEF} >> ${TMPSET}
  918.         
  919.         #
  920.         # check settings for write size
  921.         #
  922.         rm -f ${TMPDEF}
  923.         for fileinc in -DUSE_SYSENT -DUSE_NONE
  924.         do
  925.             for sizetype in size_t "unsigned int" int long "unsigned long"
  926.             do
  927.                 #
  928.                 # compile the test module
  929.                 #
  930.                 $cc -DWRTSIZE="$sizetype"   $fileinc -DCONST="$const" \
  931.                     ${USE_UNISTD} ${USE_STDLIB} \
  932.                     -DWRT_COMPILETEST  -c cctest.c >${TMPCC} 2>&1
  933.                 
  934.                 if [ $? = 0 ]; then
  935.                     if egrep "${WARN_REGEXP}" ${TMPCC} >/dev/null; then
  936.                         rm ${TMPCC};
  937.                     else
  938.                         echo "#define WRTSIZE $sizetype" > ${TMPDEF}
  939.                         break
  940.                     fi
  941.                 fi
  942.  
  943.             done
  944.         done
  945.         
  946.         if [ ! -s ${TMPDEF} ]; then
  947.             #
  948.             # if we don't know, then guess the natural character type
  949.             # (which may be signed or unsigned)
  950.             #
  951.             sizetype="$dfltsize"
  952.  
  953.             echo "${SP}Couldn't determine the correct settings for the"
  954.             echo "${SP}  sizetype parameter for the write func, I will guess"
  955.             echo "${SP}  that the sizetype is $sizetype"
  956.  
  957.             #
  958.             # put the guesses into the tmpdef file and flag them as a guess
  959.             #
  960.             echo "#define WRTSIZE $siztype  /* *GUESS* */" >  ${TMPDEF}
  961.         fi
  962.  
  963.         cat < ${TMPDEF} >> ${TMPSET}.s
  964.  
  965.         #
  966.         # now that we have the settings determined, lets see if we have
  967.         # any routines that are built in by the compiler.  These will
  968.         # typically be string functions like strcpy and/or memory funcs
  969.         #
  970.         # -- not implemented yet
  971.         #
  972.         
  973.         ) < /dev/null
  974.  
  975.         if [ -s ${TMPBREAK} ]; then
  976.             break;
  977.         fi
  978.  
  979.     done < ${TMPCOMP}
  980.  
  981.     if [ -s ${TMPFATAL} ]; then
  982.         exit `cat ${TMPFATAL}`
  983.     fi
  984.  
  985.     cat ${TMPEND} >> ${TMPSET}
  986.  
  987.     cp ${TMPSET} ${CONFFILE}
  988.  
  989.     #
  990.     # now make the correct determinations for building the library (see
  991.     # what #defs are needed for the compilation).
  992.     #
  993.  
  994.     rm -f ${CONFFILE}.s
  995.     (
  996.     echo "/*"
  997.     echo " * This file is mechanically generated by the Configure script."
  998.     echo " * If there is something wrong here, modify the configure script"
  999.     echo " * so that it is no longer generated wrong and please send email"
  1000.     echo " * to the author so that the fix is included with the next patch"
  1001.     echo " * release."
  1002.     echo " */"
  1003.     echo ""
  1004.     echo "#ifndef _SYSDEF_H     /* double inclusion guard */"
  1005.     echo "#define _SYSDEF_H 1"
  1006.     echo ""
  1007.     ) > ${CONFFILE}.s
  1008.  
  1009.     #
  1010.     # put in the compiler settings
  1011.     #
  1012.     cat ${TMPSET}.s >> ${CONFFILE}.s
  1013.  
  1014.     if [ -s ${TMPEND}.s ]; then
  1015.         cat ${TMPEND}.s >> ${CONFFILE}.s
  1016.     fi
  1017.  
  1018.     rm -f ${TMPFOUND}
  1019.  
  1020.     #
  1021.     # if we have the Intrinsic.h file, then set the flag to indicate so
  1022.     #
  1023.     if [ -s /usr/include/X11/Intrinsic.h ]; then
  1024.         (    
  1025.         echo "/*" 
  1026.         echo " * Found X intrinsic file in /usr/include/X11"
  1027.         echo " */"
  1028.         echo "#define FOUND_X_INTRINSIC 1"
  1029.         echo ""
  1030.         ) >> ${CONFFILE}.s
  1031.     else
  1032.         (    
  1033.         echo "/*" 
  1034.         echo " * Didn't find X intrinsic file in /usr/include/X11"
  1035.         echo " */"
  1036.         echo "/* #define FOUND_X_INTRINSIC 1 */" 
  1037.         echo ""
  1038.         ) >> ${CONFFILE}.s
  1039.     fi
  1040.     
  1041.  
  1042.     #
  1043.     # if wait.h is present in /usr/include/sys/wait.h
  1044.     #
  1045.     if [ -s /usr/include/sys/wait.h ]; then
  1046.         (    
  1047.         echo "/*" 
  1048.         echo " * Found wait.h in /usr/include/sys"
  1049.         echo " */"
  1050.         echo "#define NEED_WAIT 1"
  1051.         echo ""
  1052.         ) >> ${CONFFILE}.s
  1053.     else
  1054.         (    
  1055.         echo "/*" 
  1056.         echo " * Didn't find wait.h in /usr/include/sys"
  1057.         echo " */"
  1058.         echo "/* #define NEED_WAIT 1 */" 
  1059.         echo ""
  1060.         ) >> ${CONFFILE}.s
  1061.     fi
  1062.     
  1063.     #
  1064.     # check to see if the XtAlloc module includes definitions for the Heap
  1065.     # management.  Note that this is generic for all compilers, so it
  1066.     # will come after the per-compiler stuff in ${CONFFILE}.s
  1067.     #
  1068.     for i in $LIBDIRS
  1069.     do
  1070.         if [ -s $i/libXt.a ]; then
  1071.             ar xv $i/libXt.a Alloc.o > /dev/null 2>&1
  1072.             heap=`( nm Alloc.o | grep XtHeapInit ) 2>/dev/null`
  1073.             rm -f Alloc.o
  1074.             echo found >> ${TMPFOUND}
  1075.  
  1076.             if [ -z "$heap" ]; then
  1077.             
  1078.                 (
  1079.                 echo "/*" 
  1080.                 echo " * don't force inclusion of XtHeap"
  1081.                 echo " */"
  1082.                 echo "#define DONT_FORCE_HEAPSTUFF 1"
  1083.                 echo ""
  1084.                 ) >> ${CONFFILE}.s
  1085.         
  1086.                 break
  1087.             fi
  1088.  
  1089.         fi
  1090.     done
  1091.  
  1092.     if [ ! -s ${TMPFOUND} ]; then
  1093.         (
  1094.         echo "/*" 
  1095.         echo " * don't force inclusion of XtHeap"
  1096.         echo " */"
  1097.         echo "#define DONT_FORCE_HEAPSTUFF 1"
  1098.         echo ""
  1099.         ) >> ${CONFFILE}.s
  1100.     fi
  1101.  
  1102.     (
  1103.     echo ""
  1104.     echo "#endif  /* _SYSDEF_H */"
  1105.     echo ""
  1106.     ) >> ${CONFFILE}.s
  1107.  
  1108. fi
  1109.  
  1110. #
  1111. # if we guessed at any of the settings, tell the user about it
  1112. #
  1113. if grep "\*GUESS\*" ${CONFFILE} ${CONFFILE}.s > /dev/null 2>&1; then
  1114.     echo ""
  1115.     echo "    Warning: There were some settings that I could not determine"
  1116.     echo "             the correct values for and so I have guessed at the"
  1117.     echo "             correct settings.  You should review the .configure"
  1118.     echo "             and .configure.s files and review the settings to"
  1119.     echo "             make sure they are correct.  The settings that were"
  1120.     echo "             guessed at will be marked with '/* *GUESS* */'"
  1121.     echo ""
  1122.     echo "             See the PROBLEMS file for a description of what the"
  1123.     echo "             settings are supposed to be"
  1124.     echo ""
  1125.     echo "             Most of the time you can ignore this warning and"
  1126.     echo "             just continue with the compilation of the library"
  1127.     echo "             and have no problems."
  1128.     echo ""
  1129.     echo "             Once you determine that the settings are correct, you"
  1130.     echo "             can remove the GUESS flags and you will no longer get"
  1131.     echo "             this warning when building the library"
  1132.     echo ""
  1133. fi
  1134.  
  1135. #
  1136. # Create malloc.h with the new settings
  1137. #
  1138. ed malloc.h.org <<ended > /dev/null 2>&1
  1139. /^DATATYPES_MARKER/
  1140. d
  1141. . r ${CONFFILE}
  1142. w malloc.h
  1143. q
  1144. ended
  1145.  
  1146. #
  1147. # and now add in the system definitions
  1148. #
  1149. cp ${CONFFILE}.s sysdefs.h
  1150.  
  1151. #
  1152. # and now handle the memset and memcpy routines (if it hasn't been done
  1153. # already)
  1154. #
  1155. if [ ! -s ${CONFFILE}.O ]; then
  1156.  
  1157.     #
  1158.     # find compiler for testing modified modules Note that we only use cc
  1159.     # or gcc for this step because we think that these are the only usefull
  1160.     # compilers to perform this step
  1161.     #
  1162.     rm -f ${TMPCC}
  1163.     for compiler in cc gcc
  1164.     do
  1165.         for dir in ${DIRLIST}
  1166.         do
  1167.             if [ -s ${dir}/${compiler} ]; then
  1168.                 echo "${dir}/${compiler}" > ${TMPCC}
  1169.                 break
  1170.             fi
  1171.         done
  1172.         if [ -s ${TMPCC} ]; then
  1173.             break;
  1174.         fi
  1175.     done
  1176.  
  1177.     cc=`cat ${TMPCC} < /dev/null`
  1178.  
  1179.     #
  1180.     # find libc.a
  1181.     #
  1182.     for i in $LIBDIRS
  1183.     do
  1184.         if [ -s $i/libc.a ]; then
  1185.         
  1186.             LIBC=$i/libc.a
  1187.             break
  1188.         
  1189.         fi
  1190.     done
  1191.  
  1192.     ar xv ${LIBC} memcpy.o memset.o memmove.o > /dev/null 2>&1
  1193.  
  1194.     #
  1195.     # If at least one of the modules were found, build the changestr module
  1196.     #
  1197.     if [ -s memset.o -o -s memcpy.o  -o -s memmove.o ]; then
  1198.  
  1199.         ${cc} -DCHANGESTR cctest.c -o changestr > /dev/null 2>&1
  1200.  
  1201.     fi
  1202.  
  1203.     if [ -s memmove.o ]; then
  1204.         TESTPGMS="memset memmove"
  1205.     else
  1206.         TESTPGMS="memset memcpy"
  1207.     fi
  1208.  
  1209.     #
  1210.     # if we found memset.o
  1211.     #
  1212.     for i in ${TESTPGMS}
  1213.     do
  1214.         #
  1215.         # get the name of the target
  1216.         #
  1217.         case $i in
  1218.             memmove|memcpy)
  1219.                 tgtstr=DataMC
  1220.                 tgtfile=datamc
  1221.                 def=TESTDATAMC
  1222.                 ;;
  1223.             memset)
  1224.                 tgtstr=DataMS
  1225.                 tgtfile=datams
  1226.                 def=TESTDATAMS
  1227.                 ;;
  1228.         esac
  1229.  
  1230.         rm -f ${tgtfile}.O
  1231.  
  1232.         if [ -s ${i}.o ]; then
  1233.  
  1234.             #
  1235.             # change the file
  1236.             #
  1237.             chmod +w ${i}.o
  1238.             ./changestr ${i}.o ${i} ${tgtstr}
  1239.  
  1240.             if [ $? = 0 ]; then
  1241.         
  1242.                 #
  1243.                 # test new memset module
  1244.                 # 
  1245.                 rm -f cctest
  1246.                 ${cc} -D${def} cctest.c -o cctest ${i}.o  \
  1247.                     > /dev/null 2>&1
  1248.  
  1249.                 if [ -s cctest ];  then
  1250.                     output=`./cctest`
  1251.                 else
  1252.                     output=0
  1253.                 fi
  1254.             else
  1255.                 output=0
  1256.             fi
  1257.  
  1258.             #
  1259.             # if the output from the command is correct then
  1260.             # save the .o file in DataMS.O so that the
  1261.             # makefile knows to use it
  1262.             #
  1263.             if [ "x${output}" = "xx   yyy" ]; then
  1264.             
  1265.                 #
  1266.                 # move the object module so the makefile
  1267.                 # knows to use it
  1268.                 #
  1269.                 rm -f ${tgtfile}.O
  1270.                 mv ${i}.o ${tgtfile}.O
  1271.                 rm -f ${i}.o
  1272.         
  1273.             fi
  1274.  
  1275.             #
  1276.             # clean up after ourselves
  1277.             #
  1278.             rm -f ${i}.o
  1279.  
  1280.         fi
  1281.  
  1282.     done
  1283.  
  1284.     echo "Configured .O files at `date`" >> ${CONFFILE}.O
  1285.  
  1286. fi
  1287.  
  1288. rm -f changestr
  1289.  
  1290. #
  1291. # clean up after ourselves
  1292. #
  1293. rm  -f ${TMPDIR}/CF$$* cctest cctest.o ${CCFILE}.[co] a.out
  1294.