home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / perl / Perl / x2p / cflags.SH < prev    next >
Text File  |  1995-12-08  |  2KB  |  89 lines

  1. case $CONFIG in
  2. '')
  3.     if test -f config.sh; then TOP=.;
  4.     elif test -f ../config.sh; then TOP=..;
  5.     elif test -f ../../config.sh; then TOP=../..;
  6.     elif test -f ../../../config.sh; then TOP=../../..;
  7.     elif test -f ../../../../config.sh; then TOP=../../../..;
  8.     else
  9.         echo "Can't find config.sh."; exit 1
  10.     fi
  11.     . $TOP/config.sh
  12.     ;;
  13. esac
  14. : This forces SH files to create target in same directory as SH file.
  15. : This is so that make depend always knows where to find SH derivatives.
  16. case "$0" in
  17. */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  18. esac
  19. echo "Extracting x2p/cflags (with variable substitutions)"
  20. : This section of the file will have variable substitutions done on it.
  21. : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
  22. : Protect any dollar signs and backticks that you do not want interpreted
  23. : by putting a backslash in front.  You may delete these comments.
  24. rm -f cflags
  25. $spitshell >cflags <<!GROK!THIS!
  26. !GROK!THIS!
  27.  
  28. : In the following dollars and backticks do not need the extra backslash.
  29. $spitshell >>cflags <<'!NO!SUBS!'
  30. case $CONFIG in
  31. '')
  32.     if test -f config.sh; then TOP=.;
  33.     elif test -f ../config.sh; then TOP=..;
  34.     elif test -f ../../config.sh; then TOP=../..;
  35.     elif test -f ../../../config.sh; then TOP=../../..;
  36.     elif test -f ../../../../config.sh; then TOP=../../../..;
  37.     else
  38.         echo "Can't find config.sh."; exit 1
  39.     fi
  40.     . $TOP/config.sh
  41.     ;;
  42. esac
  43.  
  44. also=': '
  45. case $# in
  46. 1) also='echo 1>&2 "      CCCMD = "'
  47. esac
  48.  
  49. case $# in
  50. 0) set *.c; echo "The current C flags are:" ;;
  51. esac
  52.  
  53. set `echo "$* " | sed 's/\.[oc] / /g'`
  54.  
  55. for file do
  56.  
  57.     case "$#" in
  58.     1) ;;
  59.     *) echo $n "    $file.c    $c" ;;
  60.     esac
  61.  
  62.     : allow variables like str_cflags to be evaluated
  63.  
  64.     eval 'eval ${'"${file}_cflags"'-""}'
  65.  
  66.     : or customize here
  67.  
  68.     case "$file" in
  69.     a2p) ;;
  70.     a2py) ;;
  71.     hash) ;;
  72.     str) ;;
  73.     util) ;;
  74.     walk) ;;
  75.     *) ;;
  76.     esac
  77.  
  78.     ccflags="`echo $ccflags | sed -e 's/-DEMBED//'`"
  79.  
  80.     echo "$cc -c $ccflags $optimize $large $split"
  81.     eval "$also "'"$cc -c $ccflags $optimize $large $split"'
  82.  
  83.     . $TOP/config.sh
  84.  
  85. done
  86. !NO!SUBS!
  87. chmod 755 cflags
  88. $eunicefix cflags
  89.