home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / perl / Perl / hints / linux.sh < prev    next >
Encoding:
Text File  |  1995-06-02  |  3.6 KB  |  124 lines

  1. # hints/linux.sh
  2. # Original version by rsanders
  3. # Additional support by Kenneth Albanowski <kjahds@kjahds.com>
  4. #
  5. # ELF support by H.J. Lu <hjl@nynexst.com>
  6. # Additional info from Nigel Head <nhead@ESOC.bitnet>
  7. # and Kenneth Albanowski <kjahds@kjahds.com>
  8. #
  9. # Consolidated by Andy Dougherty <doughera@lafcol.lafayette.edu>
  10. #
  11. # Last updated Tue May 30 14:25:02 EDT 1995
  12. #
  13. # If you wish to use something other than 'gcc' for your compiler,
  14. # you should specify it on the Configure command line.  To use
  15. # gcc-elf, for exmample, type
  16. # ./Configure -Dcc=gcc-elf
  17.  
  18. # perl goes into the /usr tree.  See the Filesystem Standard
  19. # available via anonymous FTP at tsx-11.mit.edu in
  20. # /pub/linux/docs/linux-standards/fsstnd.
  21. # Allow a command line override, e.g. Configure -Dprefix=/foo/bar
  22. case "$prefix" in
  23. '') prefix='/usr' ;;
  24. esac
  25.  
  26. # Perl expects BSD style signal handling.
  27. # gcc-2.6.3 defines _G_HAVE_BOOL to 1, but doesn't actually supply bool.
  28. ccflags="-D__USE_BSD_SIGNAL -Dbool=char -DHAS_BOOL $ccflags"
  29.  
  30. # The following functions are gcc built-ins, but the Configure tests
  31. # may fail because they don't supply proper prototypes.
  32. # This should be fixed as of 5.001f.  I'd appreciate reports.
  33. d_memcmp=define
  34. d_memcpy=define
  35.  
  36. # Configure may fail to find lstat() since it's a static/inline
  37. # function in <sys/stat.h>.
  38. d_lstat=define
  39.  
  40. # Explanation?
  41. d_dosuid='define'
  42.  
  43. # I think Configure gets this right now, but I'd appreciate reports.
  44. malloctype='void *'
  45.  
  46. # Explanation?
  47. usemymalloc='n'
  48.  
  49. case "$optimize" in
  50. '') optimize='-O2' ;;
  51. esac
  52.  
  53. # Are we using ELF?  Thanks to Kenneth Albanowski <kjahds@kjahds.com>
  54. # for this test.
  55. cat >try.c <<'EOM'
  56. /* Test for whether ELF binaries are produced */
  57. #include <fcntl.h>
  58. #include <stdlib.h>
  59. main() {
  60.     char buffer[4];
  61.     int i=open("a.out",O_RDONLY);
  62.     if(i==-1)
  63.         exit(1); /* fail */
  64.     if(read(i,&buffer[0],4)<4)
  65.         exit(1); /* fail */
  66.     if(buffer[0] != 127 || buffer[1] != 'E' ||
  67.            buffer[2] != 'L' || buffer[3] != 'F')
  68.         exit(1); /* fail */
  69.     exit(0); /* succeed (yes, it's ELF) */
  70. }
  71. EOM
  72. if ${cc:-gcc} try.c >/dev/null 2>&1 && ./a.out; then
  73.     cat <<'EOM'
  74.  
  75. You appear to have ELF support.  I'll try to use it for dynamic loading.
  76. EOM
  77. else
  78.     cat <<'EOM'
  79.  
  80. You don't have an ELF gcc.  I will use dld if possible.  If you are
  81. using a version of DLD earlier than 3.2.6, or don't have it at all, you
  82. should probably upgrade. If you are forced to use 3.2.4, you should
  83. uncomment a couple of lines in hints/linux.sh and restart Configure so
  84. that shared libraries will be disallowed.
  85.  
  86. EOM
  87.     lddlflags="-r $lddlflags"
  88.     # These empty values are so that Configure doesn't put in the
  89.     # Linux ELF values.
  90.     ccdlflags=' '
  91.     cccdlflags=' '
  92.     so='sa'
  93.     dlext='o'
  94.     ## If you are using DLD 3.2.4 which does not support shared libs,
  95.     ## uncomment the next two lines:
  96.     #ldflags="-static"
  97.     #so='none'
  98. fi
  99.  
  100. rm -f try.c a.out
  101.  
  102. if /bin/bash -c exit; then
  103.   echo You appear to have a working bash. Good.
  104. else
  105.   cat << 'EOM'
  106. Warning: it would appear you have a defective bash shell installed. This is
  107. likely to give you a failure of op/exec test #5 during the test phase of the
  108. build, Upgrading to a recent version (1.14.4 or later) should fix the
  109. problem.
  110.  
  111. EOM
  112.  
  113. fi
  114.  
  115. # In addition, on some systems there is a problem with perl and NDBM, which
  116. # causes AnyDBM and NDBM_File to lock up. This is evidenced in the tests as
  117. # AnyDBM just freezing.  Currently we disable NDBM for all linux systems.
  118. # If someone can suggest a more robust test, that would be appreciated.
  119. # This will generate a harmless message:
  120. # Hmm...You had some extra variables I don't know about...I'll try to keep 'em.
  121. #    Propagating recommended variable d_dbm_open
  122. d_dbm_open=undef
  123.  
  124.