Add macro make_build in spec file
[platform/upstream/dosfstools.git] / configure.ac
1 # configure.ac for dosfstools
2 # Copyright (C) 2015  Andreas Bombe <aeb@debian.org>
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 AC_INIT([dosfstools], [4.2])
18 AC_SUBST([RELEASE_DATE], [2021-01-31])
19 AM_INIT_AUTOMAKE([1.11 foreign subdir-objects parallel-tests])
20
21 AC_ARG_ENABLE([compat-symlinks],
22         [AS_HELP_STRING([--enable-compat-symlinks],
23                       [install symlinks for legacy names of the tools])],
24         [case "${enableval}" in
25         yes) symlinks=true ;;
26         no)  symlinks=false ;;
27         *)   AC_MSG_ERROR([bad value ${enableval} for --enable-compat-symlinks]) ;;
28         esac],
29         [symlinks=false])
30 AM_CONDITIONAL([COMPAT_SYMLINKS], [test x$symlinks = xtrue])
31
32 AC_ARG_ENABLE([atari-check],
33         [AS_HELP_STRING([--enable-atari-check],
34                       [enable legacy check to let tools switch to Atari mode
35                        when they detect they are running on 68k Atari
36                        hardware (Linux only)])],
37         [case "${enableval}" in
38         yes) AC_SUBST(CHECKATARI, [1])
39              AC_DEFINE(CONF_CHECK_ATARI) ;;
40         no)  AC_SUBST(CHECKATARI, [0]) ;;
41         *)   AC_MSG_ERROR([bad value ${enableval} for --enable-atari-check]) ;;
42         esac],
43         [AC_SUBST(CHECKATARI, [0])])
44
45 AC_USE_SYSTEM_EXTENSIONS
46
47 AC_PROG_CC
48 AC_PROG_LN_S
49
50 AC_SYS_LARGEFILE
51
52 AC_CHECK_HEADERS([\
53                   err.h \
54                   linux/fd.h \
55                   linux/hdreg.h \
56                   linux/version.h \
57                   linux/loop.h \
58                   sys/disk.h \
59                   sys/disklabel.h \
60                   sys/ioccom.h \
61                   sys/mkdev.h \
62                   sys/queue.h \
63                   ])
64
65 AC_CHECK_HEADERS([endian.h sys/endian.h libkern/OSByteOrder.h])
66
67 AC_CHECK_FUNCS([vasprintf])
68
69 AC_CHECK_DECLS([getmntent], [], [], [[#include <mntent.h>]])
70 AC_CHECK_DECLS([getmntinfo], [], [], [[#include <sys/mount.h>]])
71
72 # optional iconv support
73 AC_ARG_WITH([iconv], AS_HELP_STRING([--without-iconv], [build without iconv support]))
74 if test "x$with_iconv" != "xno"; then
75         AM_ICONV
76 fi
77
78 # xxd (distributed with vim) is used in the testsuite
79 AC_CHECK_PROG([XXD_FOUND], [xxd], [yes])
80
81 # check if automake is 1.11 or 1.12 for using a workaround for the parallel test harness
82 # (we check for a minimum version of 1.11 above, so these are the only two values to check)
83 AM_CONDITIONAL(AUTOMAKE_TEST_COMPAT, test $am__api_version = 1.11 -o $am__api_version = 1.12)
84
85 AC_CONFIG_FILES([Makefile src/Makefile src/version.h
86                  manpages/Makefile manpages/mkfs.fat.8
87                  manpages/fsck.fat.8 manpages/fatlabel.8
88                  tests/Makefile])
89 AC_OUTPUT