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.

148 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
  1. dnl run autoreconf -iv to produce the configure script.
  2. m4_define([cl_version_major], [1])
  3. m4_define([cl_version_minor], [3])
  4. m4_define([cl_version_patchlevel], [2])
  5. m4_define([cl_version], [cl_version_major.cl_version_minor.cl_version_patchlevel])
  6. dnl Libtool's library version information for CLN.
  7. dnl (Not to be confused with CLN's release version.)
  8. dnl Making new releases:
  9. dnl * increment cl_lt_revision,
  10. dnl * if any interfaces have been added, removed, or changed, then increment
  11. dnl cl_lt_current and set cl_lt_revision to 0,
  12. dnl * if any interfaces have been added, then increment cl_lt_age,
  13. dnl * if any interfaces have been removed, set cl_lt_age to 0.
  14. dnl (On many systems, $(cl_lt_current):$(cl_lt_revision):$(cl_lt_age) results in
  15. dnl libcln.so.$(cl_lt_current)-$(cl_lt_age).)
  16. m4_define([cl_lt_current], [6])
  17. m4_define([cl_lt_revision], [2])
  18. m4_define([cl_lt_age], [0])
  19. m4_define([cl_lt_version], [cl_lt_current:cl_lt_revision:cl_lt_age])
  20. AC_INIT([cln], cl_version)
  21. AC_PREREQ(2.59)
  22. AC_CONFIG_SRCDIR(src/integer/gcd/cl_I_gcd.cc)
  23. AC_CONFIG_AUX_DIR([autoconf])
  24. AC_CONFIG_MACRO_DIR([m4])
  25. AC_CONFIG_HEADERS(autoconf/cl_config.h include/cln/config.h include/cln/host_cpu.h include/cln/version.h src/base/cl_base_config.h src/base/cl_gmpconfig.h src/timing/cl_t_config.h)
  26. AM_INIT_AUTOMAKE([foreign 1.10 dist-bzip2])
  27. AH_TOP([#ifndef _CL_CONFIG_H])
  28. AH_TOP([#define _CL_CONFIG_H])
  29. AH_TOP([#include "cln/host_cpu.h"])
  30. AH_TOP([/* prevents cln/config.h from being included, so no macro gets redefined */])
  31. AH_TOP([#define _CL_CONFIG_PUBLIC_H])
  32. AH_TOP([/* prevents cln/version.h from being included, so no macro gets redefined */])
  33. AH_TOP([#define _CL_VERSION_H])
  34. AH_BOTTOM([#endif /* _CL_CONFIG_H */])
  35. dnl checks for programs
  36. dnl
  37. AC_PROG_CC
  38. dnl sets variable CC
  39. AC_PROG_CPP
  40. dnl sets variable CPP
  41. AC_PROG_CXX
  42. dnl sets variable CXX
  43. AC_PROG_CXXCPP
  44. dnl sets variable CXXCPP
  45. CL_AS_UNDERSCORE
  46. dnl sets variable AS_UNDERSCORE, DEFS ASM_UNDERSCORE
  47. CL_AS_NOEXECSTACK
  48. dnl sets variable ASMFLAGS
  49. AC_PROG_INSTALL
  50. dnl sets variables INSTALL, INSTALL_DATA, INSTALL_PROGRAM
  51. dnl
  52. dnl check for host type
  53. dnl
  54. CL_CANONICAL_HOST(autoconf)
  55. dnl sets variables host, host_cpu, host_vendor, host_os
  56. CL_CANONICAL_HOST_CPU
  57. dnl DEFS __${host_cpu}__
  58. case $host_os in
  59. *mingw*)
  60. AC_DISABLE_SHARED
  61. dnl Shared libraries are not supported on some platforms [yet]
  62. ;;
  63. *)
  64. AC_ENABLE_SHARED
  65. ;;
  66. esac
  67. AC_PROG_LIBTOOL
  68. dnl sets variable LIBTOOL
  69. LT_VERSION_INFO=cl_lt_version
  70. AC_SUBST(LT_VERSION_INFO)
  71. dnl release version
  72. CL_VERSION_MAJOR=cl_version_major
  73. CL_VERSION_MINOR=cl_version_minor
  74. CL_VERSION_PATCHLEVEL=cl_version_patchlevel
  75. dnl release version for cln/config.h, so it can be tested by the preprocessor
  76. AC_DEFINE_UNQUOTED(CL_VERSION_MAJOR, $CL_VERSION_MAJOR, [Major version number of CLN])
  77. AC_DEFINE_UNQUOTED(CL_VERSION_MINOR, $CL_VERSION_MINOR, [Minor version number of CLN])
  78. AC_DEFINE_UNQUOTED(CL_VERSION_PATCHLEVEL, $CL_VERSION_PATCHLEVEL, [Patchlevel version number of CLN])
  79. dnl concatenated release version
  80. CL_VERSION=cl_version
  81. AC_DEFINE_UNQUOTED(CL_VERSION, $CL_VERSION, [CLN release number])
  82. AC_SUBST(CL_VERSION)
  83. dnl checks for compiler characteristics
  84. dnl
  85. AC_LANG([C++])
  86. dnl
  87. CL_LONGLONG
  88. dnl DEFS HAVE_LONGLONG
  89. CL_LONGDOUBLE
  90. dnl DEFS HAVE_LONGDOUBLE
  91. dnl
  92. dnl checks for header files
  93. dnl
  94. AC_CHECK_HEADERS([unistd.h])
  95. dnl DEFS HAVE_UNISTD_H if exist unistd.h
  96. dnl
  97. dnl checks for typedefs
  98. dnl
  99. dnl
  100. dnl checks for functions and declarations
  101. dnl
  102. CL_ALLOCA
  103. dnl set variable ALLOCA, DEFS NO_ALLOCA
  104. CL_GETTIMEOFDAY
  105. dnl DEFS HAVE_GETTIMEOFDAY, GETTIMEOFDAY_DOTS, GETTIMEOFDAY_TZP_T
  106. ac_cv_func_ftime=no
  107. dnl don't use ftime(3) even if it's available
  108. CL_TIMES_CLOCK
  109. dnl DEFS HAVE_TIMES_CLOCK
  110. CL_RUSAGE
  111. dnl DEFS HAVE_SYS_RESOURCE_H, HAVE_GETRUSAGE, HAVE_SYS_TIMES_H
  112. CL_PERROR
  113. dnl DEFS HAVE_PERROR_DECL
  114. CL_ATTRIBUTE_FLATTEN
  115. dnl DEFS CL_HAVE_ATTRIBUTE_FLATTEN
  116. dnl
  117. dnl checks for compiler characteristics
  118. dnl
  119. AC_C_CHAR_UNSIGNED
  120. dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
  121. dnl Create a subdirectory in the ${top_builddir} to hold auto-generated
  122. dnl headers. This subdirectory does not exist when ${top_builddir} != ${top_srcdir}
  123. dnl (a.k.a. "VPATH build").
  124. if test ! -d include/cln; then
  125. AS_MKDIR_P([include/cln])
  126. fi
  127. CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,[CL_INTPARAM_CROSS],include/cln/intparam.h,cl_cv_file_intparam_h)
  128. dnl builds include/cln/intparam.h
  129. CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,[CL_FLOATPARAM_CROSS],include/cln/floatparam.h,cl_cv_file_floatparam_h)
  130. dnl builds include/cln/floatparam.h
  131. CL_LIBGMP
  132. dnl DEFS CL_USE_GMP, GMP_DEMANDS_UINTD_*
  133. CLNLIB_LIBS='-L${libdir} -lcln'
  134. AC_LIB_LINKFLAGS_FROM_LIBS([CLNLIB_RPATH], [$CLNLIB_LIBS])
  135. dnl
  136. dnl That's it.
  137. dnl
  138. AC_OUTPUT([Makefile src/Makefile tests/Makefile examples/Makefile doc/Makefile benchmarks/Makefile cln.spec cln.pc])