home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / libg++-2.6-fsf.lha / libg++-2.6 / libg++ / configure.in < prev    next >
Text File  |  1994-03-18  |  5KB  |  151 lines

  1. # This file is a shell script fragment that supplies the information
  2. # necessary to tailor a template configure script into the configure
  3. # script appropriate for this directory.  For more information, check
  4. # any existing configure script.
  5.  
  6. configdirs="genclass no-stream old-stream src tests gperf utils etc test-install"
  7. srctrigger=libg++.texi
  8. srcname="GNU C++ Class Library"
  9.  
  10. # per-host:
  11.  
  12. # per-target:
  13.  
  14. package_makefile_frag=Make.pack
  15.  
  16.     echo "# Warning this fragment is automatically generated" >temp.mt
  17.     rootme=`pwd`
  18.     export rootme
  19. #    CC=${CC-`if [ -f ${rootme}/../gcc/xgcc ] ; \
  20. #            then echo ${rootme}/../gcc/xgcc -B${rootme}/../gcc/ ; \
  21. #            else echo gcc ; fi`}
  22.     CONFIG_NM=${CONFIG_NM-nm}
  23.  
  24.     # The Bourne shell writes "command not found" to /dev/tty, so if we get
  25.     # a usage message on stderr, we have the program.
  26.     #
  27.     # ksh and zsh write "command not found" to stderr, but test -n does not
  28.     # want any output if there is no program.  So we use the `type' builtin
  29.     # instead for them (and bash).
  30.     if test "$RANDOM" = "$RANDOM"; then
  31.       checkfor='test -n "`$checkprog $checkargs 2>&1`"'
  32.     else
  33.       checkfor='type $checkprog >/dev/null'
  34.     fi
  35.  
  36.     echo checking for ranlib
  37.     checkprog=ranlib checkargs=/dev/null
  38.     if [ -n "$RANLIB" ] ; then
  39.         echo "RANLIB = ${RANLIB}" >>temp.mt
  40.     elif (eval $checkfor) >/dev/null 2>&1 ; then
  41.         # Use default value set in Makefile
  42.         echo "# RANLIB = ranlib" >>temp.mt
  43.     else
  44.         echo "RANLIB = true" >>temp.mt
  45.     fi
  46.  
  47. #    echo checking if -nostdinc++ flag works
  48. #    echo "int foo;" >temp.c
  49. #    echo "# Use -nostdinc++ flag if your version of gcc understands it."\
  50. #        >>temp.mt
  51. #    if [ "`${CC} -c -nostdinc++ temp.c 2>&1`" = "" ]; then
  52.         echo 'NOSTDINC = -nostdinc++' >>temp.mt
  53. #    else
  54. #        echo 'NOSTDINC = # -nostdinc++' >>temp.mt
  55. #    fi
  56.  
  57.     # Check if we have reasonable include files:
  58. #cat >temp.c <<'EOF'
  59. ##include <unistd.h>
  60. ##include <stdarg.h>
  61. ##include <stdio.h>
  62. ##include <string.h>
  63. ##include <stdlib.h>
  64. #int call() { return 0; }
  65. #int main()
  66. #{
  67. #  call(fclose);
  68. #  call(rename);
  69. #  return call(memcmp);
  70. #}
  71. #EOF
  72. #    if [ -s "`${CC} -o temp temp.c 2>&1`" ] ; then true
  73. #    else
  74. #        # Include files look tolerable
  75. #        echo 'WRAP_C_INCLUDES =' >>temp.mt
  76. #    fi
  77.  
  78.     # Some recent systems wrap extern "C" around function declarations
  79.     # in the system C header files.  Unfortunately, some systems
  80.     # (such as Irix) miss the extern "C" in curses.h, say,
  81.     # though they have it in *most* of the header files,
  82.     # so it is hard to test for this automatically.
  83. #    echo "(checking if C include files have 'extern" '"C"'"')"
  84. #    echo '#include <unistd.h>' >temp.c
  85. #    if ${CC} -E -D__cplusplus temp.c | grep 'extern "C"' 2>&1 >/dev/null ; then
  86. #        echo 'WRAP_C_INCLUDES =' >>temp.mt
  87. #    else
  88.  
  89.             echo '
  90. # If the C include files are C++-ready (with extern "C"), uncomment next line:
  91. # WRAP_C_INCLUDES =' >>temp.mt
  92.  
  93. echo '
  94. # Flags to pass to gen-params when building _G_config.h.
  95. # For example: G_CONFIG_ARGS = size_t="unsigned long"
  96. G_CONFIG_ARGS =' >>temp.mt
  97.  
  98. rm -f temp.c temp.o temp
  99.  
  100. case "${target}" in
  101.   i[34]86-*-linux) my_target=linux ;;
  102.   *-*-solaris2*)   my_target=solaris2 ;;
  103.   *-*-solaris)     my_target=solaris2 ;;
  104.   *-*-*)           my_target=${target_cpu}
  105. esac
  106.  
  107. target_makefile_frag=config/${my_target}.mt
  108. if [ -f ${srcdir}/${target_makefile_frag} ] ; then
  109.   echo "Appending ${srcdir}/${target_makefile_frag} to target-mkfrag"
  110.   echo "# Following fragment copied from ${srcdir}/${target_makefile_frag}" >>temp.mt
  111.   cat ${srcdir}/${target_makefile_frag} >>temp.mt
  112. fi
  113.  
  114. ${moveifchange} temp.mt target-mkfrag
  115.  
  116. TOLIBGXX=
  117. ALL='$(TARGETLIB) rest-in-parallel'
  118. MOSTLYCLEAN='*.o core \#* temp.c stamp-$(TARGETLIB) dummy.out dummy.[Cc] TMP a.out'
  119. CLEAN='.stmp-* _G_config.h $(TARGETLIB)'
  120. DISTCLEAN='config.status Makefile target-mkfrag'
  121. INFO_FILES=libg++
  122. INFO_SUBDIRS='$(SUBDIRS)'
  123.  
  124. # If cross-compiling, don't configure gperf or test-install, since
  125. # they do not work (gperf and utils will get built by the target
  126. # compiler, which is confusing, and test-install will try to execute
  127. # programs built by the target compiler, which can not be done).
  128. if [ ${host} != ${target} ] ; then
  129.   configdirs=`echo ${configdirs} | sed -e 's/gperf//' -e 's/test-install//' -e 's/utils//'`
  130. fi
  131.  
  132. (. ${srcdir}/config.shared) >${package_makefile_frag}
  133.  
  134. # post-target:
  135.  
  136. # If cross-compiling, don't build gperf or the utils.  They
  137. # will get built by the target compiler, which is confusing.
  138. # We cannot test the installation.  We install in $(tooldir).
  139. if [ ${host} != ${target} ] ; then
  140.     sed \
  141.     -e 's|INSTALLDIR.*=.*$|INSTALLDIR = $(tooldir)/lib|' \
  142.     -e 's|GPERF.*=.*gperf|GPERF = # gperf|' \
  143.     -e 's|TEST_INSTALL[     ]*=.*$|TEST_INSTALL = |' \
  144.     -e 's|UTILS[     ]*=.*$|UTILS =|' \
  145.     -e 's|LIBIBERTY =.*$|LIBIBERTY = xiberty|' \
  146.     Makefile >Makefile.tem
  147.     mv -f Makefile.tem Makefile
  148. fi
  149.  
  150. rm -f ${package_makefile_frag}
  151.