2 # Process this file with autoconf to produce a configure script.
4 # This file is part of libatasmart.
6 # Copyright 2008 Lennart Poettering
8 # libatasmart is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU Lesser General Public License as
10 # published by the Free Software Foundation, either version 2.1 of the
11 # License, or (at your option) any later version.
13 # libatasmart is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Lesser General Public License for more details.
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with libatasmart. If not, If not, see
20 # <http://www.gnu.org/licenses/>.
24 AC_INIT([libatasmart], 0.17, [mzyvongnfzneg (at) 0pointer (dot) net])
25 AC_CONFIG_SRCDIR([atasmart.c])
26 AC_CONFIG_HEADERS([config.h])
27 AC_CONFIG_MACRO_DIR(m4)
29 AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
31 AC_SUBST(PACKAGE_URL, [http://git.0pointer.de/?p=libatasmart.git])
33 AC_SUBST(LIBATASMART_VERSION_INFO, [4:3:0])
37 AM_SILENT_RULES([yes])
39 if type -p stow > /dev/null && test -d /usr/local/stow ; then
40 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
41 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
44 #### Checks for programs. ####
50 AC_PROG_GCC_TRADITIONAL
52 AC_USE_SYSTEM_EXTENSIONS
61 AC_LANG_CONFTEST([int main(int argc, char*argv[]) {}])
62 $CC -c conftest.c $CFLAGS "$1" -o conftest.o > /dev/null 2> /dev/null
68 # If using GCC specify some additional parameters
69 if test "x$GCC" = "xyes" ; then
71 # We use gnu99 instead of c99 because many have interpreted the standard
72 # in a way that int64_t isn't defined on non-64 bit platforms.
73 DESIRED_FLAGS="-std=gnu99 -Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -ffast-math"
75 for flag in $DESIRED_FLAGS ; do
76 AC_MSG_CHECKING([whether $CC accepts $flag])
77 if test_gcc_flag $flag ; then
78 CFLAGS="$CFLAGS $flag"
79 CXXFLAGS="$CXXFLAGS $flag"
87 #### libtool stuff ####
91 #### Checks for header files. ####
97 AC_CHECK_HEADERS([sys/poll.h])
100 AC_CHECK_HEADERS([sys/ioctl.h])
101 AC_CHECK_HEADERS([byteswap.h])
103 #### Typdefs, structures, etc. ####
109 AC_CHECK_TYPES(ssize_t, , [AC_DEFINE([ssize_t], [signed long],
110 [Define ssize_t if it is not done by the standard libs.])])
115 #### Large File-Support (LFS) ####
119 PKG_CHECK_MODULES([LIBUDEV], [libudev >= 143])
121 ###################################
123 ###################################
133 ---{ $PACKAGE_NAME $VERSION }---
136 sysconfdir: ${sysconfdir}
137 localstatedir: ${localstatedir}