qthreads.m4 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. dnl Autoconf macros for configuring the QuickThreads package
  2. dnl Jim Blandy <jimb@red-bean.com> --- July 1998
  3. dnl
  4. dnl Copyright (C) 1998, 1999 Free Software Foundation, Inc.
  5. dnl
  6. dnl This file is part of GUILE.
  7. dnl
  8. dnl GUILE is free software; you can redistribute it and/or modify
  9. dnl it under the terms of the GNU General Public License as
  10. dnl published by the Free Software Foundation; either version 2, or
  11. dnl (at your option) any later version.
  12. dnl
  13. dnl GUILE is distributed in the hope that it will be useful, but
  14. dnl WITHOUT ANY WARRANTY; without even the implied warranty of
  15. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. dnl GNU General Public License for more details.
  17. dnl
  18. dnl You should have received a copy of the GNU General Public
  19. dnl License along with GUILE; see the file COPYING. If not, write
  20. dnl to the Free Software Foundation, Inc., 59 Temple Place, Suite
  21. dnl 330, Boston, MA 02111-1307 USA
  22. dnl QTHREADS_CONFIGURE configures the QuickThreads package. The QT
  23. dnl sources should be in $srcdir/qt. If configuration succeeds, this
  24. dnl macro creates the appropriate symlinks in the qt object directory,
  25. dnl and sets the following variables, used in building libqthreads.a:
  26. dnl QTHREAD_LTLIBS --- set to libqthreads.la if configuration
  27. dnl succeeds, or the empty string if configuration fails.
  28. dnl qtmd_h, qtmds_s, qtmdc_c, qtdmdb_s --- the names of the machine-
  29. dnl dependent source files.
  30. dnl qthread_asflags --- flags to pass to the compiler when processing
  31. dnl assembly-language files.
  32. dnl
  33. dnl It also sets the following variables, which describe how clients
  34. dnl can link against libqthreads.a:
  35. dnl THREAD_PACKAGE --- set to "QT" if configuration succeeds, or
  36. dnl the empty string if configuration fails.
  37. dnl THREAD_LIBS_LOCAL --- linker options for use in this source tree
  38. dnl THREAD_LIBS_INSTALLED --- linker options for use after this package
  39. dnl is installed
  40. dnl It would be nice if all thread configuration packages for Guile
  41. dnl followed the same conventions.
  42. dnl
  43. dnl All of the above variables will be substituted into Makefiles in
  44. dnl the usual autoconf fashion.
  45. dnl
  46. dnl We distinguish between THREAD_LIBS_LOCAL and
  47. dnl THREAD_LIBS_INSTALLED because the thread library might be in
  48. dnl this tree, and be built using libtool. This means that:
  49. dnl 1) when building other executables in this tree, one must
  50. dnl pass the relative path to the ../libfoo.la file, but
  51. dnl 2) once the whole package has been installed, users should
  52. dnl link using -lfoo.
  53. dnl Normally, we only care about the first case, but since the
  54. dnl guile-config script needs to give users all the flags they need
  55. dnl to link programs against guile, the GUILE_WITH_THREADS macro
  56. dnl needs to supply the second piece of information as well.
  57. dnl
  58. dnl This whole thing is a little confused about what ought to be
  59. dnl done in the top-level configure script, and what ought to be
  60. dnl taken care of in the subdirectory. For example, qtmds_s and
  61. dnl friends really ought not to be even mentioned in the top-level
  62. dnl configure script, but here they are.
  63. AC_DEFUN([QTHREADS_CONFIGURE],[
  64. AC_REQUIRE([AC_PROG_LN_S])
  65. AC_MSG_CHECKING(QuickThreads configuration)
  66. changequote(,)dnl We use [ and ] in a regexp in the case
  67. THREAD_PACKAGE=QT
  68. qthread_asflags=''
  69. case "$host" in
  70. i[3456]86-*-*)
  71. port_name=i386
  72. qtmd_h=md/i386.h
  73. qtmds_s=md/i386.s
  74. qtmdc_c=md/null.c
  75. qtdmdb_s=
  76. case "$host" in
  77. *-*-netbsd* )
  78. ## NetBSD needs to be told to pass the assembly code through
  79. ## the C preprocessor. Other GCC installations seem to do
  80. ## this by default, but NetBSD's doesn't. We could get the
  81. ## same effect by giving the file a name ending with .S
  82. ## instead of .s, but I don't see how to tell automake to do
  83. ## that.
  84. qthread_asflags='-x assembler-with-cpp'
  85. ;;
  86. esac
  87. ;;
  88. mips-sgi-irix[56]*)
  89. port_name=irix
  90. qtmd_h=md/mips.h
  91. qtmds_s=md/mips-irix5.s
  92. qtmdc_c=md/null.c
  93. qtdmdb_s=md/mips_b.s
  94. ;;
  95. mips-*-*)
  96. port_name=mips
  97. qtmd_h=md/mips.h
  98. qtmds_s=md/mips.s
  99. qtmdc_c=md/null.c
  100. qtdmdb_s=md/mips_b.s
  101. ;;
  102. sparc-*-sunos*)
  103. port_name=sparc-sunos
  104. qtmd_h=md/sparc.h
  105. qtmds_s=md/_sparc.s
  106. qtmdc_c=md/null.c
  107. qtdmdb_s=md/_sparc_b.s
  108. ;;
  109. sparc-*-*)
  110. port_name=sparc
  111. qtmd_h=md/sparc.h
  112. qtmds_s=md/sparc.s
  113. qtmdc_c=md/null.c
  114. qtdmdb_s=md/sparc_b.s
  115. ;;
  116. alpha*-*-*)
  117. port_name=alpha
  118. qtmd_h=md/axp.h
  119. qtmds_s=md/axp.s
  120. qtmdc_c=md/null.c
  121. qtdmdb_s=md/axp_b.s
  122. ;;
  123. *)
  124. echo "Unknown configuration; threads package disabled"
  125. THREAD_PACKAGE=""
  126. ;;
  127. esac
  128. changequote([, ])
  129. # Did configuration succeed?
  130. if test -n "$THREAD_PACKAGE"; then
  131. AC_MSG_RESULT($port_name)
  132. QTHREAD_LTLIBS=libqthreads.la
  133. THREAD_LIBS_LOCAL="../qt/libqthreads.la"
  134. THREAD_LIBS_INSTALLED="-lqthreads"
  135. else
  136. AC_MSG_RESULT(none; disabled)
  137. fi
  138. AC_SUBST(QTHREAD_LTLIBS)
  139. AC_SUBST(qtmd_h)
  140. AC_SUBST(qtmds_s)
  141. AC_SUBST(qtmdc_c)
  142. AC_SUBST(qtdmdb_s)
  143. AC_SUBST(qthread_asflags)
  144. AC_SUBST(THREAD_PACKAGE)
  145. AC_SUBST(THREAD_LIBS_LOCAL)
  146. AC_SUBST(THREAD_LIBS_INSTALLED)
  147. ])