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.

183 lines
5.5 KiB

25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
  1. dnl AUTOCONF configuration for CLN
  2. dnl
  3. dnl configure.in ---<autoconf>--->> configure
  4. dnl
  5. dnl configure ---<sh>--->> config.status
  6. dnl --->> include/cln/config.h
  7. dnl cln-config.in --->> cln-config
  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/cln/config.h include/cln/version.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. dnl libcln depends on libm
  68. PACKAGE=cln
  69. dnl libtool wants PACKAGE
  70. AM_PROG_LIBTOOL
  71. dnl sets variable LIBTOOL
  72. dnl Libtool's library version information for CLN.
  73. dnl (Not to be confused with CLN's release version.)
  74. dnl Making new releases:
  75. dnl * increment CL_REVISION,
  76. dnl * if any functions/classes have been added, removed or changed, increment
  77. dnl CL_CURRENT and set CL_REVISION to 0,
  78. dnl * if any functions/classes have been added, increment CL_AGE,
  79. dnl * if backwards compatibility has been broken, set CL_AGE to 0.
  80. CL_CURRENT=1
  81. CL_REVISION=1
  82. CL_AGE=1
  83. dnl make substitutions
  84. AC_SUBST(CL_CURRENT)
  85. AC_SUBST(CL_REVISION)
  86. AC_SUBST(CL_AGE)
  87. dnl release version
  88. CL_VERSION_MAJOR=1
  89. CL_VERSION_MINOR=1
  90. CL_VERSION_PATCHLEVEL=1
  91. dnl release version for cln/config.h, so it can be tested by the preprocessor
  92. AC_DEFINE_UNQUOTED(CL_VERSION_MAJOR, $CL_VERSION_MAJOR)
  93. AC_DEFINE_UNQUOTED(CL_VERSION_MINOR, $CL_VERSION_MINOR)
  94. AC_DEFINE_UNQUOTED(CL_VERSION_PATCHLEVEL, $CL_VERSION_PATCHLEVEL)
  95. dnl concatenated release version
  96. CL_VERSION=$CL_VERSION_MAJOR.$CL_VERSION_MINOR.$CL_VERSION_PATCHLEVEL
  97. AC_DEFINE_UNQUOTED(CL_VERSION, $CL_VERSION)
  98. AC_SUBST(CL_VERSION)
  99. dnl
  100. dnl checks for compiler characteristics
  101. dnl
  102. AC_LANG_CPLUSPLUS
  103. dnl
  104. CL_BOOL
  105. dnl DEFS HAVE_BOOL, bool
  106. CL_LONGLONG
  107. dnl DEFS HAVE_LONGLONG
  108. CL_LONGDOUBLE
  109. dnl DEFS HAVE_LONGDOUBLE
  110. CL_TEMPLATE_NULL
  111. dnl DEFS HAVE_TEMPLATE_NULL
  112. CL_GLOBAL_CONSTRUCTORS
  113. dnl DEFS CL_GLOBAL_CONSTRUCTOR_PREFIX, CL_GLOBAL_DESTRUCTOR_PREFIX
  114. dnl
  115. dnl checks for header files
  116. dnl
  117. CL_UNISTD_H
  118. dnl DEFS HAVE_UNISTD_H if exist unistd.h
  119. dnl
  120. dnl checks for typedefs
  121. dnl
  122. dnl
  123. dnl checks for functions and declarations
  124. dnl
  125. CL_ALLOCA
  126. dnl set variable ALLOCA, DEFS NO_ALLOCA
  127. CL_FPU_CONTROL
  128. dnl DEFS HAVE_FPU_CONTROL_T, HAVE_SETFPUCW
  129. CL_GETTIMEOFDAY
  130. dnl DEFS HAVE_GETTIMEOFDAY, GETTIMEOFDAY_DOTS, GETTIMEOFDAY_TZP_T
  131. CL_FTIME
  132. dnl DEFS HAVE_FTIME
  133. CL_TIMES_CLOCK
  134. dnl DEFS HAVE_TIMES_CLOCK
  135. CL_RUSAGE
  136. dnl DEFS HAVE_SYS_RESOURCE_H, HAVE_GETRUSAGE, HAVE_SYS_TIMES_H
  137. CL_PERROR
  138. dnl DEFS HAVE_PERROR_DECL
  139. dnl
  140. dnl checks for compiler characteristics
  141. dnl
  142. CL_CHAR_UNSIGNED
  143. dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
  144. test -d 'include/cln' || mkdir -p 'include/cln'
  145. CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,include/cln/intparam.h,cl_cv_file_intparam_h)
  146. dnl builds include/cln/intparam.h
  147. CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,include/cln/floatparam.h,cl_cv_file_floatparam_h)
  148. dnl builds include/cln/floatparam.h
  149. dnl
  150. dnl interfacing to GNU gmp (must be at least version 3)
  151. dnl
  152. AC_ARG_WITH(gmp, [ --with-gmp use external fast low-level functions from GNU MP 3.
  153. [default=yes]], ,with_gmp="yes")
  154. if test "$with_gmp" = yes; then
  155. CL_GMP_H_VERSION
  156. if test "$cl_cv_new_gmp_h" = no; then with_gmp="no"; fi
  157. if test "$with_gmp" = yes; then
  158. CL_GMP_CHECK
  159. if test "$cl_cv_new_libgmp" = no; then with_gmp="no"; fi
  160. fi
  161. fi
  162. if test "$with_gmp" = yes; then
  163. CL_GMP_SET_UINTD
  164. AC_DEFINE(CL_USE_GMP)
  165. else
  166. AC_MSG_WARN([disabling external GNU MP library])
  167. fi
  168. dnl
  169. dnl That's it.
  170. dnl
  171. for f in 'tests/.gdbinit'; do
  172. if test '!' -f "$f"; then
  173. echo "creating $f"
  174. changequote(,)dnl
  175. g=`echo "$f" | sed -e 's,/[^/]*$,,'`
  176. changequote([,])dnl
  177. test "$g" = "$f" || test -d "$g" || mkdir "$g"
  178. cp "$srcdir/$f" "$f"
  179. fi
  180. done
  181. AC_OUTPUT([Makefile src/Makefile tests/Makefile benchmarks/Makefile examples/Makefile doc/Makefile cln-config cln-config.1 cln.spec], [chmod +x cln-config])