Jeff Garzik | 32c8037 | 2005-10-25 01:56:48 -0400 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script. |
John W. Linville | 76c4682 | 2019-09-23 14:13:22 -0400 | [diff] [blame] | 2 | AC_INIT(ethtool, 5.3, netdev@vger.kernel.org) |
Jeff Garzik | 32c8037 | 2005-10-25 01:56:48 -0400 | [diff] [blame] | 3 | AC_PREREQ(2.52) |
| 4 | AC_CONFIG_SRCDIR([ethtool.c]) |
| 5 | AM_INIT_AUTOMAKE([gnu]) |
| 6 | AC_CONFIG_HEADERS([ethtool-config.h]) |
| 7 | |
| 8 | AM_MAINTAINER_MODE |
| 9 | |
| 10 | dnl Checks for programs. |
| 11 | AC_PROG_CC |
| 12 | AC_PROG_GCC_TRADITIONAL |
Ben Hutchings | cfe91ed | 2011-10-31 18:42:29 +0000 | [diff] [blame] | 13 | AM_PROG_CC_C_O |
Kevin Locke | 9b80264 | 2019-04-19 18:16:21 -0600 | [diff] [blame] | 14 | PKG_PROG_PKG_CONFIG |
Jeff Garzik | 32c8037 | 2005-10-25 01:56:48 -0400 | [diff] [blame] | 15 | |
| 16 | dnl Checks for libraries. |
| 17 | |
| 18 | dnl Checks for header files. |
Jeff Garzik | 32c8037 | 2005-10-25 01:56:48 -0400 | [diff] [blame] | 19 | |
| 20 | dnl Checks for typedefs, structures, and compiler characteristics. |
Ben Hutchings | 4f1d68d | 2010-11-23 15:46:55 +0000 | [diff] [blame] | 21 | AC_MSG_CHECKING([whether <linux/types.h> defines big-endian types]) |
| 22 | AC_TRY_COMPILE([#include <linux/types.h>], |
| 23 | [__be16 foo;__be32 bar;], |
| 24 | [AC_MSG_RESULT(yes) |
| 25 | AC_DEFINE([HAVE_BE_TYPES], [1], |
| 26 | [Define to 1 if <linux/types.h> defines big-endian types])], |
| 27 | [AC_MSG_RESULT(no)]) |
Jeff Garzik | 32c8037 | 2005-10-25 01:56:48 -0400 | [diff] [blame] | 28 | |
| 29 | dnl Checks for library functions. |
| 30 | AC_HEADER_STDC |
| 31 | AC_CHECK_FUNCS(socket strtol) |
| 32 | |
Florian Fainelli | 875616d | 2014-02-27 15:43:01 -0800 | [diff] [blame] | 33 | dnl Check for options |
| 34 | AC_ARG_ENABLE(pretty-dump, |
Ben Hutchings | 9832a4c | 2014-04-21 22:51:46 +0100 | [diff] [blame] | 35 | [ --enable-pretty-dump enable registers, EEPROM and SFP pretty dumps (enabled by default)], |
| 36 | , |
| 37 | enable_pretty_dump=yes) |
| 38 | if test x$enable_pretty_dump = xyes; then |
| 39 | AC_DEFINE(ETHTOOL_ENABLE_PRETTY_DUMP, 1, |
| 40 | [Define this to enable register, EEPROM and SFP pretty dumps.]) |
| 41 | fi |
| 42 | AM_CONDITIONAL([ETHTOOL_ENABLE_PRETTY_DUMP], [test x$enable_pretty_dump = xyes]) |
Florian Fainelli | 875616d | 2014-02-27 15:43:01 -0800 | [diff] [blame] | 43 | |
Kevin Locke | 9b80264 | 2019-04-19 18:16:21 -0600 | [diff] [blame] | 44 | AC_ARG_WITH([bash-completion-dir], |
| 45 | AS_HELP_STRING([--with-bash-completion-dir[=PATH]], |
| 46 | [Install the bash-completion script in this directory. @<:@default=yes@:>@]), |
| 47 | [], |
| 48 | [with_bash_completion_dir=yes]) |
| 49 | AS_IF([test "x$with_bash_completion_dir" = xyes], |
| 50 | [AC_MSG_CHECKING([for bash-completion directory]) |
| 51 | dnl Attempt to use pkg-config completionsdir variable with given $prefix. |
| 52 | dnl This matches distcheck expectation that all files install to $prefix. |
| 53 | dnl It works with /usr and /usr/local (for default $XDG_DATA_DIRS) but |
| 54 | dnl may install to directory not used by bash-completion in other cases. |
| 55 | dnl See: https://lore.kernel.org/netdev/20190417025333.GA28674@kevinolos/ |
| 56 | AS_IF([test "x$PKG_CONFIG" != x \ |
| 57 | && bash_completion_prefix=`"$PKG_CONFIG" --print-errors --variable=prefix bash-completion 2>&AS_MESSAGE_LOG_FD` \ |
| 58 | && bash_completion_dir=`"$PKG_CONFIG" --print-errors --variable=completionsdir bash-completion 2>&AS_MESSAGE_LOG_FD`], |
| 59 | [bash_completion_dir="${bash_completion_dir#"$bash_completion_prefix"}" |
| 60 | bash_completion_dir="${bash_completion_dir#/}" |
| 61 | BASH_COMPLETION_DIR='${prefix}'/"$bash_completion_dir"], |
| 62 | [BASH_COMPLETION_DIR='${datadir}/bash-completion/completions']) |
| 63 | AC_MSG_RESULT([$BASH_COMPLETION_DIR])], |
| 64 | [BASH_COMPLETION_DIR="$with_bash_completion_dir"]) |
| 65 | AC_SUBST([BASH_COMPLETION_DIR]) |
| 66 | AM_CONDITIONAL([ENABLE_BASH_COMPLETION], |
| 67 | [test "x$with_bash_completion_dir" != xno]) |
| 68 | |
Ben Hutchings | f5259c1 | 2011-01-10 15:29:58 +0000 | [diff] [blame] | 69 | AC_CONFIG_FILES([Makefile ethtool.spec ethtool.8]) |
Jeff Garzik | 32c8037 | 2005-10-25 01:56:48 -0400 | [diff] [blame] | 70 | AC_OUTPUT |