You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

175 lines
5.1 KiB

25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
  1. dnl AUTOCONF configuration for CLN
  2. dnl Bruno Haible 8.1.1999
  3. dnl
  4. dnl configure.in ---<autoconf>--->> configure
  5. dnl
  6. dnl configure ---<sh>--->> config.status
  7. dnl --->> include/cl_config.h
  8. dnl Makefile.in --->> Makefile
  9. dnl src/Makefile.in --->> src/Makefile
  10. dnl
  11. dnl Makefile ---<make>--->> libcln.a
  12. dnl
  13. dnl
  14. AC_INIT(src/integer/gcd/cl_I_gcd.cc)
  15. AC_CONFIG_HEADER(include/cl_config.h src/base/cl_base_config.h src/base/cl_gmpconfig.h src/float/cl_float_config.h src/timing/cl_t_config.h)
  16. AC_PROG_MAKE_SET
  17. dnl This piece of sed script replaces every line containing '@subdir@'
  18. dnl by several consecutive lines, each referencing one subdir.
  19. extrasub="$extrasub"'
  20. /@subdir@/{
  21. h
  22. g
  23. s/@subdir@/src/
  24. p
  25. g
  26. s/@subdir@/tests/
  27. p
  28. g
  29. s/@subdir@/benchmarks/
  30. p
  31. g
  32. s/@subdir@/examples/
  33. p
  34. g
  35. s/@subdir@/doc/
  36. p
  37. d
  38. }
  39. '
  40. dnl
  41. dnl checks for programs
  42. dnl
  43. AC_PROG_CC
  44. dnl sets variable CC
  45. AC_PROG_CPP
  46. dnl sets variable CPP
  47. AC_PROG_CXX
  48. dnl sets variable CXX
  49. AC_PROG_CXXCPP
  50. dnl sets variable CXXCPP
  51. CL_AS_UNDERSCORE
  52. dnl sets variable AS_UNDERSCORE, DEFS ASM_UNDERSCORE
  53. CL_PROG_RANLIB
  54. dnl sets variable RANLIB
  55. CL_PROG_INSTALL
  56. dnl sets variables INSTALL, INSTALL_DATA, INSTALL_PROGRAM
  57. dnl
  58. dnl check for host type
  59. dnl
  60. CL_CANONICAL_HOST(autoconf)
  61. dnl sets variables host, host_cpu, host_vendor, host_os
  62. CL_CANONICAL_HOST_CPU
  63. dnl DEFS __${host_cpu}__
  64. dnl
  65. dnl check for build configuration
  66. dnl
  67. PACKAGE=cln
  68. AM_PROG_LIBTOOL
  69. dnl Libtool's library version information for CLN.
  70. dnl (Not to be confused with CLN's release version.)
  71. dnl Making new releases:
  72. dnl * increment CLN_REVISION,
  73. dnl * if any functions/classes have been added, removed or changed, increment
  74. dnl CLN_CURRENT and set CLN_REVISION to 0,
  75. dnl * if any functions/classes have been added, increment CLN_AGE,
  76. dnl * if backwards compatibility has been broken, set CLN_AGE to 0.
  77. CL_CURRENT=1
  78. CL_REVISION=0
  79. CL_AGE=0
  80. dnl make substitutions
  81. AC_SUBST(CL_CURRENT)
  82. AC_SUBST(CL_REVISION)
  83. AC_SUBST(CL_AGE)
  84. dnl release version
  85. CL_VERSION=1
  86. CL_VERSION_MINOR=1
  87. CL_VERSION_PATCHLEVEL=0
  88. dnl release version for cl_config.h, so it can be tested by the preprocessor
  89. AC_DEFINE_UNQUOTED(CL_VERSION, $CL_VERSION)
  90. AC_DEFINE_UNQUOTED(CL_VERSION_MINOR, $CL_VERSION_MINOR)
  91. AC_DEFINE_UNQUOTED(CL_VERSION_PATCHLEVEL, $CL_VERSION_PATCHLEVEL)
  92. dnl sets variable LIBTOOL
  93. dnl
  94. dnl checks for compiler characteristics
  95. dnl
  96. AC_LANG_CPLUSPLUS
  97. dnl
  98. CL_BOOL
  99. dnl DEFS HAVE_BOOL, bool
  100. CL_LONGLONG
  101. dnl DEFS HAVE_LONGLONG
  102. CL_LONGDOUBLE
  103. dnl DEFS HAVE_LONGDOUBLE
  104. CL_TEMPLATE_NULL
  105. dnl DEFS HAVE_TEMPLATE_NULL
  106. CL_GLOBAL_CONSTRUCTORS
  107. dnl DEFS CL_GLOBAL_CONSTRUCTOR_PREFIX, CL_GLOBAL_DESTRUCTOR_PREFIX
  108. dnl
  109. dnl checks for header files
  110. dnl
  111. CL_UNISTD_H
  112. dnl DEFS HAVE_UNISTD_H if exist unistd.h
  113. dnl
  114. dnl checks for typedefs
  115. dnl
  116. dnl
  117. dnl checks for functions and declarations
  118. dnl
  119. CL_ALLOCA
  120. dnl set variable ALLOCA, DEFS NO_ALLOCA
  121. CL_FPU_CONTROL
  122. dnl DEFS HAVE_FPU_CONTROL_T, HAVE_SETFPUCW
  123. CL_GETTIMEOFDAY
  124. dnl DEFS HAVE_GETTIMEOFDAY, GETTIMEOFDAY_DOTS, GETTIMEOFDAY_TZP_T
  125. CL_FTIME
  126. dnl DEFS HAVE_FTIME
  127. CL_TIMES_CLOCK
  128. dnl DEFS HAVE_TIMES_CLOCK
  129. CL_RUSAGE
  130. dnl DEFS HAVE_SYS_RESOURCE_H, HAVE_GETRUSAGE, HAVE_SYS_TIMES_H
  131. CL_PERROR
  132. dnl DEFS HAVE_PERROR_DECL
  133. dnl
  134. dnl checks for compiler characteristics
  135. dnl
  136. CL_CHAR_UNSIGNED
  137. dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
  138. test -d 'include' || mkdir 'include'
  139. CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,include/cl_intparam.h,cl_cv_file_intparam_h)
  140. dnl builds include/cl_intparam.h
  141. CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,include/cl_floatparam.h,cl_cv_file_floatparam_h)
  142. dnl builds include/cl_floatparam.h
  143. dnl
  144. dnl interfacing to GNU gmp (must be at least version 3)
  145. dnl
  146. AC_ARG_WITH(gmp, [ --with-gmp use external fast low-level functions from GNU MP 3.
  147. [default=yes]], ,with_gmp="yes")
  148. if test "$with_gmp" = yes; then
  149. CL_GMP_H_VERSION
  150. if test "$cl_cv_new_gmp_h" = no; then with_gmp="no"; fi
  151. if test "$with_gmp" = yes; then
  152. CL_GMP_CHECK
  153. if test "$cl_cv_new_libgmp" = no; then with_gmp="no"; fi
  154. fi
  155. fi
  156. if test "$with_gmp" = yes; then
  157. AC_DEFINE(CL_USE_GMP)
  158. else
  159. AC_MSG_WARN([disabling external GNU MP library])
  160. fi
  161. dnl
  162. dnl That's it.
  163. dnl
  164. for f in 'tests/.gdbinit'; do
  165. if test '!' -f "$f"; then
  166. echo "creating $f"
  167. changequote(,)dnl
  168. g=`echo "$f" | sed -e 's,/[^/]*$,,'`
  169. changequote([,])dnl
  170. test "$g" = "$f" || test -d "$g" || mkdir "$g"
  171. cp "$srcdir/$f" "$f"
  172. fi
  173. done
  174. AC_OUTPUT(Makefile src/Makefile tests/Makefile benchmarks/Makefile examples/Makefile doc/Makefile)