home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl560.zip / hints / svr5.sh < prev    next >
Text File  |  1999-12-07  |  8KB  |  222 lines

  1. # svr5 hints, System V Release 5.x (UnixWare 7)
  2. # mods after mail fm Andy Dougherty
  3. # Reworked by hops@sco.com Sept/Oct 1999 for UW7.1 platform support 
  4. #   Boyd Gerber, gerberb@zenez.com 1999/09/21 for threads support.
  5. # Originally taken from svr4 hints.sh  21-Sep-98 hops@sco.com
  6. # which was version of 1996/10/25 by Tye McQueen, tye@metronet.com
  7.  
  8. # Use Configure -Dusethreads to enable threads.
  9. # Use Configure -Dcc=gcc to use gcc.
  10. case "$cc" in
  11. *gcc*)
  12.     #  "$gccversion" not set yet
  13.     vers=`gcc -v 2>&1 | sed -n -e 's@.*version \([^ ][^ ]*\) .*@\1@p'`
  14.     case $vers in
  15.     *2.95*)
  16.          ccflags='-fno-strict-aliasing'
  17.         # More optimisation provided in gcc-2.95 causes miniperl to segv.
  18.         # -fno-strict-aliasing is supposed to correct this but 
  19.         # if it doesn't and you get segv when the build runs miniperl then 
  20.         # disable optimisation as below
  21.         #  optimize=' '
  22.         ;;
  23.     esac
  24.     ;;  
  25. esac
  26.  
  27. # Hardwire the processor to 586 for consistancy with autoconf
  28. # archname='i586-svr5'
  29. #  -- seems this is generally disliked by perl porters so leave it to float
  30.  
  31. # Our default setup excludes anything from /usr/ucblib (and consequently dbm)
  32. # as later modules assume symbols found are available in shared libs 
  33. # On svr5 these are static archives which causes problems for
  34. # dynamic modules loaded later (and ucblib is a bad dream anyway)
  35. # However there is a dbm library built from the ucb sources outside ucblib
  36. # at http://www.sco.com/skunkware (installing into /usr/local) so if we
  37. # detect this we'll use it. You can change the default
  38. # (to allow ucblib and its dbm or disallowing non ucb dbm) by 
  39. # changing 'want_*' config values below to '' to disable or otherwise to enable
  40.  
  41. #    Leave leading tabs so Configure doesn't propagate variables to config.sh
  42.  
  43.     want_ucb=''        # don't use anything from /usr/ucblib - icky
  44.     want_dbm='yes'        # use dbm if can find library in /usr/local/lib
  45.     want_gdbm='yes'        # use gdbm if can find library in /usr/local/lib
  46.     want_udk70=''        # link with old static libc pieces
  47.             # link with udk70 if building on 7.1 abd want resulting binary 
  48.             # to run on uw7.0* - it will link in referenced static symbols 
  49.             # of libc that are (now) in the shared libc.so on 7.1 but were 
  50.             # not there in 7.0.
  51.             # There are still scenarios where this is still insufficient so 
  52.             # overall it is preferable to get ptf7051e 
  53.             #   ftp://ftp.sco.com/SLS/ptf7051e.Z
  54.             # installed on any/all 7.0 systems and leave the above unset.
  55.  
  56. if [ "$want_ucb" ] ; then 
  57.     ldflags= '-L/usr/ucblib'
  58.     ccflags='-I/usr/ucbinclude'
  59.     # /usr/ccs/include and /usr/ccs/lib are used implicitly by cc as reqd
  60. else
  61.     libswanted=`echo " $libswanted " | sed -e 's/ ucb / /'`
  62.     glibpth=`echo " $glibpth " | sed -e 's/ \/usr\/ucblib / /'`
  63.  
  64.     # If see libdbm in /usr/local and not overidden assume its the 
  65.     # non ucblib rebuild from skunkware  and use it
  66.     if [ ! -f /usr/local/lib/libdbm.so -o ! "$want_dbm" ] ; then
  67.         i_dbm='undef'
  68.         libswanted=`echo " $libswanted " | sed -e 's/ dbm / /'`
  69.     fi
  70. fi
  71.  
  72. if [ ! "$want_gdbm" ] ; then 
  73.    i_gdbm='undef'
  74.    libswanted=`echo " $libswanted " | sed -e 's/ gdbm / /'`
  75. fi
  76.  
  77.  
  78. # Don't use problematic libraries:
  79. #   libmalloc.a - Probably using Perl's malloc() anyway.
  80. #   libc:  on UW7 don't want -lc explicitly as native cc gives warnings/errors
  81. libswanted=`echo " $libswanted " | sed -e 's/ malloc / /' -e 's/ c / /'`
  82.  
  83. # remove /shlib and /lib from library search path as both symlink to /usr/lib
  84. # where runtime shared libc is 
  85. glibpth=`echo " $glibpth " | sed -e 's/ \/shlib / /' -e 's/ \/lib / /`
  86.  
  87. # Don't use BSD emulation pieces (/usr/ucblib) regardless
  88. # these would probably be autonondetected anyway but ...
  89. d_Gconvert='gcvt((x),(n),(b))'    # Try gcvt() before gconvert().
  90. d_bcopy='undef' d_bcmp='undef'  d_bzero='undef'  d_safebcpy='undef'
  91. d_index='undef' d_killpg='undef' d_getprior='undef' d_setprior='undef'
  92. d_setlinebuf='undef' 
  93. d_setregid='undef' d_setreuid='undef'  # -- in /usr/lib/libc.so.1
  94.  
  95.  
  96. # Broken C-Shell tests (Thanks to Tye McQueen):
  97. # The OS-specific checks may be obsoleted by the this generic test.
  98.     sh_cnt=`sh -c 'echo /*' | wc -c`
  99.     csh_cnt=`csh -f -c 'glob /*' 2>/dev/null | wc -c`
  100.     csh_cnt=`expr 1 + $csh_cnt`
  101. if [ "$sh_cnt" -ne "$csh_cnt" ]; then
  102.     echo "You're csh has a broken 'glob', disabling..." >&2
  103.     d_csh='undef'
  104. fi
  105.  
  106. # Unixware-specific problems.  UW7 give correctname with uname -s
  107. # UnixWare has a broken csh.  (This might already be detected above).
  108. # Configure can't detect memcpy or memset on Unixware 2 or 7
  109. #
  110. #    Leave leading tabs on the next two lines so Configure doesn't 
  111. #    propagate these variables to config.sh
  112.     uw_ver=`uname -v`
  113.     uw_isuw=`uname -s 2>&1`
  114.  
  115. if [ "$uw_isuw" = "UnixWare" ]; then
  116.    case $uw_ver in
  117.    7.1*)
  118.     d_csh='undef'
  119.     d_memcpy='define'
  120.     d_memset='define'
  121.     stdio_cnt='((fp)->__cnt)'
  122.     d_stdio_cnt_lval='define'
  123.     stdio_ptr='((fp)->__ptr)'
  124.     d_stdio_ptr_lval='define'
  125.  
  126.         d_bcopy='define'    # In /usr/lib/libc.so.1
  127.         d_setregid='define' #  " 
  128.         d_setreuid='define' #  " 
  129.  
  130.         if [ -f /usr/ccs/lib/libcudk70.a -a "$want_udk70" ] ; then
  131.             libswanted=" $libswanted cudk70"
  132.         fi
  133.     ;;
  134.    7*)
  135.     d_csh='undef'
  136.     d_memcpy='define'
  137.     d_memset='define'
  138.     stdio_cnt='((fp)->__cnt)'
  139.     d_stdio_cnt_lval='define'
  140.     stdio_ptr='((fp)->__ptr)'
  141.     d_stdio_ptr_lval='define'
  142.     ;;
  143.    esac
  144. fi
  145. # End of Unixware-specific tests.
  146.  
  147. ###############################################################
  148. # Dynamic loading section: Is default so it should just happen.
  149. # set below to explicitly force.
  150. # usedl='define'
  151. # dlext='so'
  152. # dlsrc='dl_dlopen.xs'
  153. #
  154. # ccdlflags : must tell the linker to export all global symbols
  155. # cccdlflags: must tell the compiler to generate relocatable code
  156. # lddlflags : must tell the linker to output a shared library
  157.  
  158. # use shared perl lib    
  159. useshrplib='true'
  160.  
  161. case "$cc" in
  162.        *gcc*)
  163.            ccdlflags='-Xlinker -Bexport '
  164.            cccdlflags='-fpic'
  165.            lddlflags='-G '
  166.         ;;
  167.  
  168.         *)
  169.            ccdlflags='-Wl,-Bexport'
  170.            cccdlflags='-Kpic'
  171.            lddlflags='-G -Wl,-Bexport'
  172.         ;;
  173. esac
  174.  
  175. ############################################################################
  176. # Thread support
  177. # use Configure -Dusethreads to enable
  178. # This script UU/usethreads.cbu will get 'called-back' by Configure 
  179. # after it has prompted the user for whether to use threads.
  180. cat > UU/usethreads.cbu <<'EOCBU'
  181. case "$usethreads" in
  182. $define|true|[yY]*)
  183.         ccflags="$ccflags"
  184.         shift
  185.         libswanted="$*"
  186.   case "$cc" in
  187.        *gcc*)
  188.            ccflags="-D_REENTRANT $ccflags -fpic -pthread"
  189.            cccdlflags='-fpic'
  190.            lddlflags='-pthread -G '
  191.         ;;
  192.         *)
  193.            ccflags="-D_REENTRANT $ccflags -KPIC -Kthread"
  194.            ccdlflags='-Kthread -Wl,-Bexport'
  195.            cccdlflags='-KPIC -Kthread'
  196.            lddlflags='-G -Kthread -Wl,-Bexport '
  197.             ldflags='-Kthread'
  198.         ;;
  199.   esac
  200. esac
  201. EOCBU
  202.  
  203.  
  204. d_suidsafe='define'    # "./Configure -d" can't figure this out easily
  205.  
  206. ################## final caveat msgs to builder ###############
  207. cat <<'EOM' >&4
  208.  
  209. If you wish to use dynamic linking, you must use 
  210.     LD_LIBRARY_PATH=`pwd`; export LD_LIBRARY_PATH
  211. or
  212.     setenv LD_LIBRARY_PATH `pwd`
  213. before running make.
  214.  
  215. If you are using shared libraries from /usr/local/lib
  216. for libdbm or libgdbm you may need to set
  217.     LD_RUN_PATH=/usr/local/lib; export LD_RUN_PATH
  218. in order for Configure to compile the simple test program
  219.  
  220. EOM
  221.