2
# Process this file with autoconf to produce a configure script.
3
# vim:tw=0:ts=8:sw=8:et
6
AC_INIT([biosdevname],[0.3.7],[Matt_Domsch@dell.com])
8
AC_USE_SYSTEM_EXTENSIONS
9
AC_CONFIG_SRCDIR([src/read_proc.c])
10
AC_CONFIG_HEADER([config.h])
15
# Checks for programs.
22
AC_CHECK_PROGS([READELF], [readelf])
23
AC_CHECK_FUNCS([realpath])
24
# Checks for libraries.
25
AC_CHECK_LIB([c], [snprintf])
26
# libz has to come before libpci because libpci needs it now.
27
AC_CHECK_LIB([z], [gzopen], [true],
28
[AC_MSG_ERROR([You must install zlib-devel (Fedora/Red Hat/SuSE), libzip-dev (Debian/Ubuntu), or equivalent])])
29
AC_CHECK_LIB([pci], [pci_alloc], [true],
30
[AC_MSG_ERROR([You must install pciutils-devel (Fedora/Red Hat/SuSE), pciutils-dev (Debian/Ubuntu), or equivalent])],
33
# Checks for header files.
36
AC_CHECK_HEADERS([fcntl.h limits.h locale.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/time.h syslog.h unistd.h])
37
AC_CHECK_HEADER([pci/pci.h], ,
38
[AC_MSG_ERROR([You must install pciutils-devel or equivalent])])
39
AC_CHECK_HEADER([zlib.h], ,
40
[AC_MSG_ERROR([You must install zlib-devel or equivalent])])
42
# Check for pci_dev.domain
43
AC_CHECK_MEMBERS([struct pci_dev.domain], , , [#include<pci/pci.h>])
45
# Checks for typedefs, structures, and compiler characteristics.
56
# Checks for library functions.
59
AC_PROG_GCC_TRADITIONAL
64
AC_FUNC_SELECT_ARGTYPES
67
AC_CHECK_FUNCS([dup2 gettimeofday memset munmap select socket strcasecmp strchr strdup strerror strncasecmp strpbrk strrchr strstr strtol strtoul])
69
# this is ugly, but accounts for SLES 10, Red Hat/Fedora, and Ubuntu
70
# handles default udev rules as of udev 114 or thereabouts
71
RULEDEST=/lib/udev/rules.d/71-biosdevname.rules
73
if [[ -e /etc/udev/rules.d/60-net.rules ]]; then
75
RULEDEST=/etc/udev/rules.d/60-biosdevname.rules
76
elif [[ -e /etc/udev/rules.d/31-network.rules ]]; then
78
RULEDEST=/etc/udev/rules.d/31-biosdevname.rules
79
elif [[ -e /etc/udev/rules.d/25-iftab.rules ]]; then
81
RULEDEST=/etc/udev/rules.d/25-biosdevname.rules
83
RULEDIR=$(dirname $RULEDEST)
84
AC_SUBST(RULEDEST, $RULEDEST)
85
AC_SUBST(RULEDIR, $RULEDIR)
87
echo "PACKAGE_NAME='$PACKAGE_NAME'" > version
88
echo "PACKAGE_VERSION='$PACKAGE_VERSION'" >> version
89
echo "PACKAGE_STRING='$PACKAGE_STRING'" >> version
91
AC_CONFIG_FILES([Makefile biosdevname.spec.fedora biosdevname.spec.suse])