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

  1. #!/bin/sh
  2. case $CONFIG in
  3. '')
  4.     if 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.     elif test -f ../../../../config.sh; then TOP=../../../..;
  9.     else
  10.         echo "Can't find config.sh."; exit 1
  11.     fi
  12.     . $TOP/config.sh
  13.     ;;
  14. esac
  15.  
  16. perltype=''
  17. optdebug=''    # ensure -g used if building a -DDEBUGGING libperl
  18. case $# in
  19. 2) case $1 in
  20.     *perl.*)    perltype='';;
  21.     *perld.*)   perltype='-DDEBUGGING'; optdebug='-g' ;;
  22.     *perle.*)   perltype='-DEMBED';;
  23.     *perlde.*)  perltype='-DDEBUGGING -DEMBED'; optdebug='-g' ;;
  24.     *perlm.*)   perltype='-DEMBED -DMULTIPLICITY';;
  25.     *perldm.*)  perltype='-DDEBUGGING -DEMBED -DMULTIPLICITY'; optdebug='-g' ;;
  26.     esac
  27.     shift ;;
  28. esac
  29.  
  30. also=': '
  31. case $# in
  32. 1) also='echo 1>&2 "      CCCMD = "'
  33. esac
  34.  
  35. case $# in
  36. 0) set *.c; echo "The current C flags are:" ;;
  37. esac
  38.  
  39. set `echo "$* " | sed 's/\.[oc] / /g'`
  40.  
  41. for file do
  42.  
  43.     case "$#" in
  44.     1) ;;
  45.     *) echo $n "    $file.c    $c" ;;
  46.     esac
  47.  
  48.     : allow variables like toke_cflags to be evaluated
  49.  
  50.     eval 'eval ${'"${file}_cflags"'-""}'
  51.  
  52.     : or customize here
  53.  
  54.     case "$file" in
  55.     DB_File) ;;
  56.     GDBM_File) ;;
  57.     NDBM_File) ;;
  58.     ODBM_File) ;;
  59.     POSIX) ;;
  60.     SDBM_File) ;;
  61.     av) ;;
  62.     deb) ;;
  63.     dl) ;;
  64.     doio) ;;
  65.     doop) ;;
  66.     dump) ;;
  67.     gv) ;;
  68.     hv) ;;
  69.     main) ;;
  70.     malloc) ;;
  71.     mg) ;;
  72.     miniperlmain) ;;
  73.     op) ;;
  74.     perl) ;;
  75.     perlmain) ;;
  76.     perly) ;;
  77.     pp) ;;
  78.     pp_ctl) ;;
  79.     pp_hot) ;;
  80.     pp_sys) ;;
  81.     regcomp) ;;
  82.     regexec) ;;
  83.     run) ;;
  84.     scope) ;;
  85.     sv) ;;
  86.     taint) ;;
  87.     toke) ;;
  88.     usersub) ;;
  89.     util) ;;
  90.     *) ;;
  91.     esac
  92.  
  93.     if test "X$optdebug" != "X"; then
  94.         optimize="$optdebug"
  95.     fi
  96.  
  97.     echo "$cc -c $ccflags $optimize $perltype $large $split"
  98.     eval "$also "'"$cc -c $ccflags $optimize $perltype $large $split"'
  99.  
  100.     . $TOP/config.sh
  101.  
  102. done
  103.