1AC_INIT([libcpuid CPU Identification library], [0.5.1], [libcpuid-devel@lists.sourceforge.net], [libcpuid])
2AC_CONFIG_SRCDIR([libcpuid/libcpuid.h])
3AC_CONFIG_HEADERS([config.h])
4AC_CONFIG_MACRO_DIR([m4])
5AM_INIT_AUTOMAKE([-Wall dist-bzip2 dist-zip foreign])
6m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
7
8dnl Versioning scheme shamelessly copied from libexif.
9dnl Short walkthrough. C means CURRENT, A mean AGE, R means REVISION
10dnl 1) When you make a change that breaks binary compatibility, increment CURRENT, reset REVISION to 0 and:
11dnl   1.1) If the change doesn't remove or change interfaces, increment AGE, otherwise reset to 0.
12dnl 2) When you make just a source change that doesn't break binary compatibility, increment REVISION.
13dnl When you make a change that adds features, increment AGE, and set REVISION to 0
14dnl C:A:R
15dnl 10:0:0   Version 0.1.0
16dnl 11:0:0   Version 0.1.1: four more fields to cpu_raw_data_t
17dnl 11:0:1   Version 0.1.2: added cpu_msr* functions
18dnl 11:0:2   Version 0.1.3: added cpu_clock_by_ic() function
19dnl 11:0:3   Version 0.1.4: just an identification change, to reflect the detection table upgrades
20dnl 12:1:0   Version 0.2.0: two more fields to cpu_id_t
21dnl 12:1:1   Version 0.2.1: more processors support
22dnl 12:1:2   Version 0.2.2: more processors support, *BSD/Solaris support, updates to MSR stuff
23dnl 13:0:0   Version 0.3.0: increment max Intel leaf 04 entries to 8
24dnl 14:0:0   Version 0.4.0: add one more field per cpu_raw_data_t and cpu_id_t
25dnl 14:0:1   Version 0.4.1: DB updates, and a lot of rdmsr improvements
26dnl 15:0:0   Version 0.5.0: add one more field per cpu_raw_data_t (amd_fn8000001dh) and cpu_id_t l1_{data,instruction}_{assoc,cacheline}
27dnl 15:0:1   Version 0.5.1: DB updates
28LIBCPUID_CURRENT=15
29LIBCPUID_AGE=0
30LIBCPUID_REVISION=1
31AC_SUBST([LIBCPUID_AGE])
32AC_SUBST([LIBCPUID_REVISION])
33AC_SUBST([LIBCPUID_CURRENT])
34AC_SUBST([LIBCPUID_CURRENT_MIN],[`expr $LIBCPUID_CURRENT - $LIBCPUID_AGE`])
35LIBCPUID_VERSION_INFO="$LIBCPUID_CURRENT:$LIBCPUID_REVISION:$LIBCPUID_AGE"
36AC_SUBST([LIBCPUID_VERSION_INFO])
37
38
39AC_PROG_CC
40m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
41AC_C_CONST
42LT_INIT
43AM_CPPFLAGS="$CPPFLAGS"
44
45AC_CHECK_HEADERS([stdint.h])
46AC_CHECK_PROGS([DOXYGEN], [doxygen])
47AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
48
49AM_LDFLAGS="$LDFLAGS"
50if test "x$GCC" = "xyes"; then
51    AM_CFLAGS="$AM_CFLAGS -ansi -pedantic-error"
52    AM_CXXFLAGS="$AM_CXXFLAGS -ansi -pedantic-error"
53    AM_CPPFLAGS="$AM_CPPFLAGS -g -Wall -Wmissing-declarations -Wmissing-prototypes"
54    AM_LDFLAGS="$AM_LDFLAGS -g -Wall"
55fi
56
57
58AC_SUBST(AM_CPPFLAGS)
59AC_SUBST(AM_LDFLAGS)
60
61
62AC_CONFIG_FILES([
63  Makefile
64  libcpuid.pc
65  libcpuid/Makefile
66  cpuid_tool/Makefile
67  tests/Makefile
68  libcpuid/Doxyfile
69])
70AC_OUTPUT
71