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.

162 lines
4.6 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_DISABLE_SHARED
  69. AM_PROG_LIBTOOL
  70. dnl CLN library version information.
  71. dnl
  72. dnl Making new releases:
  73. dnl CLN_MICRO_VERSION += 1;
  74. dnl CLN_INTERFACE_AGE += 1;
  75. dnl CLN_BINARY_AGE += 1;
  76. dnl if any functions have been added, set CLN_INTERFACE_AGE to 0.
  77. dnl if backwards compatibility has been broken,
  78. dnl set CLN_BINARY_AGE and CLN_INTERFACE_AGE to 0.
  79. dnl CLN_MAJOR_VERSION=1
  80. dnl CLN_MINOR_VERSION=0
  81. dnl CLN_MICRO_VERSION=4
  82. dnl CLN_INTERFACE_AGE=1
  83. dnl CLN_BINARY_AGE=1
  84. dnl sets variable LIBTOOL
  85. dnl
  86. dnl checks for compiler characteristics
  87. dnl
  88. AC_LANG_CPLUSPLUS
  89. dnl
  90. CL_BOOL
  91. dnl DEFS HAVE_BOOL, bool
  92. CL_LONGLONG
  93. dnl DEFS HAVE_LONGLONG
  94. CL_LONGDOUBLE
  95. dnl DEFS HAVE_LONGDOUBLE
  96. CL_TEMPLATE_NULL
  97. dnl DEFS HAVE_TEMPLATE_NULL
  98. CL_GLOBAL_CONSTRUCTORS
  99. dnl DEFS CL_GLOBAL_CONSTRUCTOR_PREFIX, CL_GLOBAL_DESTRUCTOR_PREFIX
  100. dnl
  101. dnl checks for header files
  102. dnl
  103. CL_UNISTD_H
  104. dnl DEFS HAVE_UNISTD_H if exist unistd.h
  105. dnl
  106. dnl checks for typedefs
  107. dnl
  108. dnl
  109. dnl checks for functions and declarations
  110. dnl
  111. CL_ALLOCA
  112. dnl set variable ALLOCA, DEFS NO_ALLOCA
  113. CL_FPU_CONTROL
  114. dnl DEFS HAVE_FPU_CONTROL_T, HAVE_SETFPUCW
  115. CL_GETTIMEOFDAY
  116. dnl DEFS HAVE_GETTIMEOFDAY, GETTIMEOFDAY_DOTS, GETTIMEOFDAY_TZP_T
  117. CL_FTIME
  118. dnl DEFS HAVE_FTIME
  119. CL_TIMES_CLOCK
  120. dnl DEFS HAVE_TIMES_CLOCK
  121. CL_RUSAGE
  122. dnl DEFS HAVE_SYS_RESOURCE_H, HAVE_GETRUSAGE, HAVE_SYS_TIMES_H
  123. CL_PERROR
  124. dnl DEFS HAVE_PERROR_DECL
  125. dnl
  126. dnl checks for compiler characteristics
  127. dnl
  128. CL_CHAR_UNSIGNED
  129. dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
  130. test -d 'include' || mkdir 'include'
  131. CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,include/cl_intparam.h,cl_cv_file_intparam_h)
  132. dnl builds include/cl_intparam.h
  133. CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,include/cl_floatparam.h,cl_cv_file_floatparam_h)
  134. dnl builds include/cl_floatparam.h
  135. dnl
  136. dnl interfacing to GNU gmp (must be at least version 3)
  137. dnl
  138. AC_ARG_WITH(gmp, [ --with-gmp use external fast GNU gmp low-level functions])
  139. if test "$with_gmp" = yes; then
  140. AC_CHECK_HEADER(gmp.h, , with_gmp="no")
  141. dnl mpn_divexact_by3 was introduced in gmp3 and the symbol has a leading `__g':
  142. AC_CHECK_LIB(gmp, __gmpn_divexact_by3, , with_gmp="no")
  143. fi
  144. if test "$with_gmp" = yes; then
  145. AC_DEFINE(CL_USE_GMP)
  146. else
  147. AC_MSG_WARN([disabling external gmp])
  148. fi
  149. dnl
  150. dnl That's it.
  151. dnl
  152. for f in 'tests/.gdbinit'; do
  153. if test '!' -f "$f"; then
  154. echo "creating $f"
  155. changequote(,)dnl
  156. g=`echo "$f" | sed -e 's,/[^/]*$,,'`
  157. changequote([,])dnl
  158. test "$g" = "$f" || test -d "$g" || mkdir "$g"
  159. cp "$srcdir/$f" "$f"
  160. fi
  161. done
  162. AC_OUTPUT(Makefile src/Makefile tests/Makefile benchmarks/Makefile examples/Makefile doc/Makefile)