s48_dynamic_externals.m4 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ### s48_dynamic_externals.m4 --- S48_DYNAMIC_EXTERNALS macro -*- Autoconf -*-
  2. # serial 1
  3. dnl
  4. dnl
  5. dnl
  6. AC_DEFUN([S48_DYNAMIC_EXTERNALS], [dnl
  7. dnl
  8. AC_CHECK_PROGS([LD], [ld cc gcc])
  9. AC_MSG_CHECKING([compile and link flags for dynamic externals])
  10. DYNAMIC_EXTERNALS_LDFLAGS_IN_PLACE=""
  11. case "$host_os" in
  12. hpux* )
  13. dnl +z means position-independent code
  14. DYNAMIC_EXTERNALS_CFLAGS='+z -D_HPUX_SOURCE'
  15. DYNAMIC_EXTERNALS_LDFLAGS='-b'
  16. ;;
  17. aix* )
  18. DYNAMIC_EXTERNALS_CFLAGS=''
  19. dnl -bM:SRE means shared object
  20. dnl -brtl means run-time linking is enabled
  21. dnl -bnoentry means no default entry point
  22. DYNAMIC_EXTERNALS_LDFLAGS='-bM:SRE -brtl -bI:\$(incdir)/scheme48.exp -bnoentry -bE:\$(incdir)/scheme48-external.exp -lc'
  23. DYNAMIC_EXTERNALS_LDFLAGS_IN_PLACE='-bM:SRE -brtl -bI:\$(srcdir)/c/scheme48.exp -bnoentry -bE:\$(srcdir)/c/scheme48-external.exp -lc'
  24. ;;
  25. darwin*|macosx* )
  26. DYNAMIC_EXTERNALS_CFLAGS='-fno-common'
  27. DYNAMIC_EXTERNALS_LDFLAGS="$CFLAGS $LDFLAGS -bundle -flat_namespace -undefined suppress"
  28. dnl linker workaround for MacOSX
  29. LD="$CC"
  30. ;;
  31. solaris* )
  32. DYNAMIC_EXTERNALS_CFLAGS="$PIC"
  33. dnl -G means shared object
  34. DYNAMIC_EXTERNALS_LDFLAGS="$LDFLAGS -G"
  35. LD="$CC"
  36. ;;
  37. linux* )
  38. dnl various Linuxen link in strange stuff we don't know about,
  39. dnl but gcc does
  40. LD="$CC"
  41. DYNAMIC_EXTERNALS_CFLAGS="$PIC"
  42. DYNAMIC_EXTERNALS_LDFLAGS="-shared $LDFLAGS"
  43. ;;
  44. cygwin* )
  45. LD="$CC"
  46. DYNAMIC_EXTERNALS_CFLAGS=""
  47. DYNAMIC_EXTERNALS_LDFLAGS='-shared $(bindir)/scheme48vm.a'
  48. DYNAMIC_EXTERNALS_LDFLAGS_IN_PLACE='-shared $(srcdir)/scheme48vm.a'
  49. ;;
  50. * )
  51. DYNAMIC_EXTERNALS_CFLAGS="$PIC"
  52. DYNAMIC_EXTERNALS_LDFLAGS='-shared'
  53. ;;
  54. esac
  55. if test -z "$DYNAMIC_EXTERNALS_LDFLAGS_IN_PLACE"; then
  56. DYNAMIC_EXTERNALS_LDFLAGS_IN_PLACE="$DYNAMIC_EXTERNALS_LDFLAGS"
  57. fi
  58. AC_MSG_RESULT([$DYNAMIC_EXTERNALS_CFLAGS, $DYNAMIC_EXTERNALS_LDFLAGS])
  59. ])dnl
  60. ### s48_dynamic_externals.m4 ends here