1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
dnl Process this file with autoconf to produce a configure script.
dnl
dnl Copyright (c) 2010-2017 Henrique de Moraes Holschuh
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
AC_PREREQ([2.69])
AC_INIT([iucode_tool], [2.1.1],
[https://gitlab.com/iucode-tool/iucode-tool/issues],
[iucode-tool],
[https://gitlab.com/iucode-tool/iucode-tool/wikis/home])
AC_COPYRIGHT([Copyright (c) 2010-2017 Henrique de Moraes Holschuh])
AC_CONFIG_SRCDIR([iucode_tool.c])
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([1.11 gnu no-dist-gzip dist-xz -Wall])
AC_CONFIG_HEADERS([iucode_tool_config.h])
dnl Before we get to the C compiler...
AC_USE_SYSTEM_EXTENSIONS
dnl Checks for programs
AC_PROG_CC
dnl Checks for headers
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h unistd.h time.h cpuid.h])
dnl Other important checks
AC_C_BIGENDIAN([AC_ERROR([This program does not work on big-endian systems])])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STAT
AC_CHECK_FUNCS([memset strcasecmp strdup strerror strrchr strtoul timegm])
dnl important system extensions
AC_SYS_LARGEFILE
AC_CHECK_FUNCS([flockfile fgets_unlocked])
dnl -----------------
dnl Configure options
dnl -----------------
AC_ARG_WITH([default-kernel-device],
[AS_HELP_STRING([--with-default-kernel-device=PATH],
[default microcode device (/dev/cpu/microcode)])],
[MICROCODE_DEVICE_DEFAULT="$withval"],
[MICROCODE_DEVICE_DEFAULT="/dev/cpu/microcode"])
AC_DEFINE_UNQUOTED(MICROCODE_DEVICE_DEFAULT, "$MICROCODE_DEVICE_DEFAULT",[Path to kernel microcode device])
AC_SUBST(MICROCODE_DEVICE_DEFAULT)
AC_ARG_WITH([default-firmware-dir],
[AS_HELP_STRING([--with-default-firmware-dir=PATH],
[default firmware loader directory (/lib/firmware/intel-ucode)])],
[MICROCODE_DIR_DEFAULT="$withval"],
[MICROCODE_DIR_DEFAULT="/lib/firmware/intel-ucode"])
AC_DEFINE_UNQUOTED(MICROCODE_DIR_DEFAULT, "$MICROCODE_DIR_DEFAULT",[Path to the kernel microcode firmware directory])
AC_SUBST(MICROCODE_DIR_DEFAULT)
AC_ARG_WITH([cpuid-device-base],
[AS_HELP_STRING([--with-cpuid-device-base=PATH_FORMAT],
[per-cpu cpuid device path (/dev/cpu/%u/cpuid)])],
[CPUID_DEVICE_BASE="$withval"],
[CPUID_DEVICE_BASE="/dev/cpu/%u/cpuid"])
AC_DEFINE_UNQUOTED(CPUID_DEVICE_BASE, "$CPUID_DEVICE_BASE",[fprintf base string to the per-cpu cpuid device])
AC_SUBST(CPUID_DEVICE_BASE)
AC_ARG_ENABLE([cpuid-device],
[AS_HELP_STRING([--enable-cpuid-device],
[use Linux cpuid device and check all cores])],
[AC_DEFINE(USE_CPUID_DEVICE, [], [Scan every core using Linux cpuid device])])
AC_ARG_ENABLE([valgrind-build],
[AS_HELP_STRING([--enable-valgrind-build],
[build for valgrind testing])],
[AC_DEFINE(VALGRIND_BUILD, [], [Valgrind-friendly build])])
dnl --------------------------
dnl autoconf output generation
dnl --------------------------
AC_CONFIG_FILES([Makefile iucode_tool.8])
AC_OUTPUT
|