home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / libg++-2.6-fsf.lha / libg++-2.6 / xiberty / configure.in
Text File  |  1994-05-09  |  2KB  |  87 lines

  1. # This file is a shell script fragment that supplies the information
  2. # necessary for a configure script to process the program in
  3. # this directory.  For more information, look at ../configure.
  4.  
  5. configdirs=
  6. srctrigger=../libiberty/getopt1.c
  7. srcname="cross -liberty library"
  8. Makefile_in=../libiberty/Makefile.in
  9.  
  10. case "$srcdir" in
  11.     ".") ;;
  12.     *) srcdir=${srcdir}/../libiberty ;;
  13. esac
  14.  
  15. # per-host:
  16. # per-target:
  17.  
  18. files="../libiberty/alloca-norm.h"
  19. links="alloca-conf.h"
  20.  
  21. xhost=${target}
  22. xsrcdir=../libiberty/
  23. . ${srcdir}/../libiberty/config.table
  24. if test -n "${frag}" ; then
  25.   target_makefile_frag=../libiberty/config/${frag}
  26. fi
  27.  
  28. case "$srcdir" in
  29.     ".")
  30.     # Make sure we also make links to all the source files
  31.     source_files=`echo ../libiberty/*.[ch] ../libiberty/functions.def`
  32.     files="${files} ${source_files}"
  33.     source_links=`echo "$source_files" | sed -e 's|../libiberty/||g'`
  34.     links="${links} ${source_links}"
  35.     ;;
  36.     *)
  37.     ;;
  38. esac
  39.  
  40. # post-target:
  41.  
  42. # if we are candian crossing the we need to pick up host copies of
  43. # the tools, otherwise we can look in the current tree
  44. # but we shouldn't build xiberty if we're not canadian crossing.
  45. if [ "${host}" != "${target}" ] ; then
  46.     echo "CC = ${target_alias}-gcc" > Makefile.tem
  47.     echo "AR = ${target_alias}-ar " >> Makefile.tem
  48.     echo "RANLIB = ${target_alias}-ranlib " >> Makefile.tem
  49. else
  50.     echo "WHAT ?"
  51. fi    
  52.  
  53. echo Makefile.tem
  54. echo "INSTALL_DEST = tooldir" >> Makefile.tem
  55.  
  56. # If we are cross-compiling, assume we are building over newlib
  57. if [ "${host}" != "${target}" ] ; then
  58.   cat > Makefile.tem2 <<'!EOF!'
  59. HOST_OFILES = insque.o random.o strdup.o alloca.o
  60. CONFIG_H = xconfig.h
  61. NEEDED_LIST = xneeded-list
  62.  
  63. xconfig.h:
  64.     echo "#define NEED_sys_nerr 1" >xconfig.h
  65.     echo "#define NEED_sys_errlist 1" >>xconfig.h
  66.     echo "#define NEED_sys_siglist 1" >>xconfig.h
  67.     echo "#define NEED_psignal 1" >>xconfig.h
  68.  
  69. xneeded-list: Makefile
  70.     echo $(HOST_OFILES) >xneeded-list
  71. !EOF!
  72. fi
  73. sed -e "/^####/  r Makefile.tem" -e "/^####/  r Makefile.tem2" ${Makefile} > Makefile.tem3
  74. mv Makefile.tem3 ${Makefile}
  75. rm -f Makefile.tem Makefile.tem2
  76.  
  77. if [ "${srcdir}" = "." ] ; then
  78.   echo "EXTRA_LINKS = ${source_links}" >>Makefile
  79. fi
  80. mv Makefile Makefile.tmp
  81. # Patch 'install' and 'Makefile' rules in Makefile
  82. # (The latter is only needed when "$srcdir" = ".".)
  83. sed <Makefile.tmp -e '/INSTALL_DEST =/s/libdir/tooldir/' \
  84.   -e '/Makefile/s|(srcdir)/Makefile.in|(srcdir)/../libiberty/Makefile.in|' \
  85.   >Makefile
  86. rm -f Makefile.tmp
  87.