-dnl AUTOCONF configuration for CLN
-dnl
-dnl configure.ac ---<autoconf>--->> configure
-dnl
-dnl configure ---<sh>--->> config.status
-dnl --->> include/cln/config.h
-dnl cln-config.in --->> cln-config
-dnl Makefile.in --->> Makefile
-dnl src/Makefile.in --->> src/Makefile
-dnl
-dnl Makefile ---<make>--->> libcln.a
-dnl
-dnl
-AC_INIT(src/integer/gcd/cl_I_gcd.cc)
-AC_CONFIG_AUX_DIR(autoconf)
-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)
-AC_PROG_MAKE_SET
-dnl This piece of sed script replaces every line containing '@subdir@'
-dnl by several consecutive lines, each referencing one subdir.
-extrasub="$extrasub"'
-/@subdir@/{
-h
-g
-s/@subdir@/src/
-p
-g
-s/@subdir@/tests/
-p
-g
-s/@subdir@/benchmarks/
-p
-g
-s/@subdir@/examples/
-p
-g
-s/@subdir@/doc/
-p
-d
-}
-'
-dnl
+dnl run autoreconf -iv to produce the configure script.
+
+m4_define([cl_version_major], [1])
+m4_define([cl_version_minor], [3])
+m4_define([cl_version_patchlevel], [0])
+m4_define([cl_version], [cl_version_major.cl_version_minor.cl_version_patchlevel])
+
+dnl Libtool's library version information for CLN.
+dnl (Not to be confused with CLN's release version.)
+dnl Making new releases:
+dnl * increment CL_REVISION,
+dnl * if any functions/classes have been added, removed or changed, increment
+dnl CL_CURRENT and set CL_REVISION to 0,
+dnl * if any functions/classes have been added, increment CL_AGE,
+dnl * if backwards compatibility has been broken, set CL_AGE to 0.
+dnl $(CL_CURRENT):$(CL_REVISION):$(CL_AGE) results in
+dnl libcln.so.$(CL_CURRENT)-$(CL_AGE)
+m4_define([cl_current], [6])
+m4_define([cl_revision], [0])
+m4_define([cl_age], [0])
+m4_define([cl_lt_version], [cl_current:cl_revision:cl_age])
+
+AC_INIT([cln], cl_version)
+AC_PREREQ(2.59)
+AC_CONFIG_SRCDIR(src/integer/gcd/cl_I_gcd.cc)
+AC_CONFIG_AUX_DIR([autoconf])
+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)
+AM_INIT_AUTOMAKE([foreign 1.10 dist-bzip2])
+AH_TOP([#ifndef _CL_CONFIG_H])
+AH_TOP([#define _CL_CONFIG_H])
+AH_TOP([#include "cln/host_cpu.h"])
+AH_TOP([/* prevents cln/config.h from being included, so no macro gets redefined */])
+AH_TOP([#define _CL_CONFIG_PUBLIC_H])
+AH_TOP([/* prevents cln/version.h from being included, so no macro gets redefined */])
+AH_TOP([#define _CL_VERSION_H])
+AH_BOTTOM([#endif /* _CL_CONFIG_H */])
+