forked from guzu/hddtemp
-
Notifications
You must be signed in to change notification settings - Fork 7
/
configure.ac
79 lines (64 loc) · 2.22 KB
/
configure.ac
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
dnl Process this file with autoconf to produce a configure script.
# Initialization
AC_INIT([hddtemp], [0.4.2])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
# Determine the host and build type. The target is always a PIC.
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
# append the host alias to the tools for cross compiling
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(netinet/in.h)
AC_CHECK_HEADERS(linux/nvme_ioctl.h)
AC_CHECK_TYPE(in_addr_t, ,[AC_DEFINE_UNQUOTED([in_addr_t], [uint32_t], [Define to 'uint32_t' if <netinet/in.h> does not define.])], [#include <netinet/in.h>])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_STRUCT_TM
dnl internationalization macros
AM_GNU_GETTEXT_VERSION([0.19.6])
AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.6])
AM_GNU_GETTEXT([external])
dnl reasonable guesses for where stuff is installed
dnl if we don't do that now, the config.h will use ${prefix}
dnl for DEFAULT_DATABASE_PATH.
if test "x$prefix" = "xNONE"; then
prefix="/usr/local"
fi
if test "x$exec_prefix" = "xNONE"; then
exec_prefix=$prefix
fi
AC_MSG_CHECKING([Location of hddtemp.db])
DEFAULT_DATABASE_PATH=
#db_path=\"`eval echo ${datadir}`/misc/hddtemp.db\"
db_path=\"/usr/share/misc/hddtemp.db\"
AC_ARG_WITH(db_path,
[ --with-db-path=PATH \
Default location of hddtemp.db file [/usr/share/misc/hddtemp.db]],
[ if test -d "$withval"; then
AC_MSG_FAILURE([new file name for db-path])
fi
DEFAULT_DATABASE_PATH="\"$withval\""
],
[ DEFAULT_DATABASE_PATH="$db_path" ])
AC_MSG_RESULT($DEFAULT_DATABASE_PATH)
AC_DEFINE_UNQUOTED([DEFAULT_DATABASE_PATH], [$DEFAULT_DATABASE_PATH], [Default location of drive info database])
CFLAGS="$CFLAGS -Wall -W -Wcast-align"
# Substitute configuration variables
AC_CONFIG_FILES([Makefile \
po/Makefile.in \
src/Makefile \
doc/Makefile \
])
AC_OUTPUT
AC_MSG_RESULT([
hddtemp-$VERSION is now configured for $canonical_host_type
Build: $build
Host: $host
Source directory: $srcdir
Installation prefix: $prefix
C compiler: $CC $CFLAGS
])