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.

177 lines
5.3 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
25 years ago
25 years ago
25 years ago
  1. dnl AUTOCONF configuration for CLN
  2. dnl
  3. dnl configure.ac ---<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_AUX_DIR(autoconf)
  16. 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)
  17. AC_PROG_MAKE_SET
  18. dnl This piece of sed script replaces every line containing '@subdir@'
  19. dnl by several consecutive lines, each referencing one subdir.
  20. extrasub="$extrasub"'
  21. /@subdir@/{
  22. h
  23. g
  24. s/@subdir@/src/
  25. p
  26. g
  27. s/@subdir@/tests/
  28. p
  29. g
  30. s/@subdir@/benchmarks/
  31. p
  32. g
  33. s/@subdir@/examples/
  34. p
  35. g
  36. s/@subdir@/doc/
  37. p
  38. d
  39. }
  40. '
  41. dnl
  42. dnl checks for programs
  43. dnl
  44. AC_PROG_CC
  45. dnl sets variable CC
  46. AC_PROG_CPP
  47. dnl sets variable CPP
  48. AC_PROG_CXX
  49. dnl sets variable CXX
  50. AC_PROG_CXXCPP
  51. dnl sets variable CXXCPP
  52. CL_AS_UNDERSCORE
  53. dnl sets variable AS_UNDERSCORE, DEFS ASM_UNDERSCORE
  54. AC_PROG_RANLIB
  55. dnl sets variable RANLIB
  56. AC_PROG_INSTALL
  57. dnl sets variables INSTALL, INSTALL_DATA, INSTALL_PROGRAM
  58. dnl
  59. dnl check for host type
  60. dnl
  61. CL_CANONICAL_HOST(autoconf)
  62. dnl sets variables host, host_cpu, host_vendor, host_os
  63. CL_CANONICAL_HOST_CPU
  64. dnl DEFS __${host_cpu}__
  65. dnl
  66. dnl check for build configuration
  67. dnl
  68. PACKAGE=cln
  69. dnl libtool wants PACKAGE
  70. AC_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=3
  81. CL_REVISION=1
  82. CL_AGE=0
  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=7
  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_LONGLONG
  105. dnl DEFS HAVE_LONGLONG
  106. CL_LONGDOUBLE
  107. dnl DEFS HAVE_LONGDOUBLE
  108. CL_GLOBAL_CONSTRUCTORS
  109. dnl DEFS CL_GLOBAL_CONSTRUCTOR_PREFIX, CL_GLOBAL_DESTRUCTOR_PREFIX
  110. dnl
  111. dnl checks for header files
  112. dnl
  113. AC_CHECK_HEADERS([unistd.h])
  114. dnl DEFS HAVE_UNISTD_H if exist unistd.h
  115. dnl
  116. dnl checks for typedefs
  117. dnl
  118. dnl
  119. dnl checks for functions and declarations
  120. dnl
  121. CL_ALLOCA
  122. dnl set variable ALLOCA, DEFS NO_ALLOCA
  123. CL_FPU_CONTROL
  124. dnl DEFS HAVE_FPU_CONTROL_T, HAVE_SETFPUCW
  125. CL_GETTIMEOFDAY
  126. dnl DEFS HAVE_GETTIMEOFDAY, GETTIMEOFDAY_DOTS, GETTIMEOFDAY_TZP_T
  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. AC_C_CHAR_UNSIGNED
  137. dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
  138. test -d 'include/cln' || mkdir -p 'include/cln'
  139. CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,include/cln/intparam.h,cl_cv_file_intparam_h)
  140. dnl builds include/cln/intparam.h
  141. CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,include/cln/floatparam.h,cl_cv_file_floatparam_h)
  142. dnl builds include/cln/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. CL_GMP_SET_UINTD
  158. AC_DEFINE(CL_USE_GMP)
  159. else
  160. AC_MSG_WARN([disabling external GNU MP library])
  161. fi
  162. dnl
  163. dnl That's it.
  164. dnl
  165. for f in 'tests/.gdbinit'; do
  166. if test '!' -f "$f"; then
  167. echo "creating $f"
  168. changequote(,)dnl
  169. g=`echo "$f" | sed -e 's,/[^/]*$,,'`
  170. changequote([,])dnl
  171. test "$g" = "$f" || test -d "$g" || mkdir "$g"
  172. cp "$srcdir/$f" "$f"
  173. fi
  174. done
  175. AC_OUTPUT([Makefile src/Makefile tests/Makefile benchmarks/Makefile examples/Makefile doc/Makefile cln-config cln-config.1 cln.spec cln.pc], [chmod +x cln-config])