-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconfigure.ac
More file actions
153 lines (135 loc) · 3.76 KB
/
configure.ac
File metadata and controls
153 lines (135 loc) · 3.76 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([ltfs-plugins], [0.1], [manu@netbsd.org])
AC_CONFIG_SRCDIR([src/tape_drivers/netbsd/ltotape/ltotape.c])
AC_CONFIG_MACRO_DIRS([m4])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AC_CONFIG_HEADERS([config.h])
AC_PROG_CC
AC_PROG_CC_C99
AM_PROG_CC_C_O
AM_PROG_AR
AC_PROG_LIBTOOL
# Detecting target OS
case "${target_os}" in
linux*)
target_linux=yes
;;
darwin*)
target_mac=yes
;;
netbsd*)
target_netbsd=yes
;;
*)
AC_MSG_ERROR(["OS $target_os is not supported"])
;;
esac
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h inttypes.h stdlib.h string.h sys/file.h sys/ioctl.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_CHECK_FUNCS([memset strerror strstr])
dnl
dnl Check for pkg-config
dnl
if test -z "$PKG_CONFIG"
then
AC_PATH_PROG(PKG_CONFIG, pkg-config, [no])
fi
if test "x${PKG_CONFIG}" = "xno"
then
AC_MSG_ERROR([pkg-config was not found])
fi
dnl
dnl Check for genrb
dnl
AC_PATH_PROG(GENRB, genrb, no)
if test "x${GENRB}" = "xno"
then
AC_MSG_ERROR([genrb was not found])
fi
dnl
dnl Check for pkgdata
dnl
AC_PATH_PROG(PKGDATA, pkgdata, no)
if test "x${PKGDATA}" = "xno"
then
AC_MSG_ERROR([pkgdata was not found])
fi
dnl
dnl Check for ICU
dnl
ICU_MODULE_CFLAGS="`icu-config --cppflags 2> /dev/null`";
ICU_MODULE_LIBS="`icu-config --ldflags 2> /dev/null`";
if test -z "$ICU_MODULE_LIBS"
then
PKG_CHECK_MODULES([ICU_MODULE], [icu >= 0.21])
fi
AC_MSG_CHECKING([use latest ICU])
AC_ARG_ENABLE([icu_6x],
[AS_HELP_STRING([--enable-icu-6x],[Support handling of ICU 6x functions])],
[icu_6x=$enableval],
[icu_6x=no]
)
AC_MSG_RESULT([$icu_6x])
if test "x${icu_6x}" = "xyes"
then
AC_MSG_CHECKING(for ICU version)
ICU_MODULE_VERSION="`icu-config --version 2> /dev/null`";
if test "${ICU_MODULE_VERSION%%.*}" -ge "60"
then
AM_EXTRA_CPPFLAGS="${AM_EXTRA_CPPFLAGS} -D ICU6x"
fi
AC_MSG_RESULT([$ICU_MODULE_VERSION])
fi
dnl
dnl interface checker
dnl
AC_MSG_CHECKING([No driver build, only check backend I/F])
AC_ARG_ENABLE([checkonly],
[AS_HELP_STRING([--enable-checkonly],[No driver build, only check backend I/F])],
[checkonly=$enableval],
[checkonly=no]
)
AC_MSG_RESULT([$checkonly])
dnl
dnl test for ENOMEDIUM
dnl
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <errno.h>],[
#ifndef ENOMEDIUM
#error no ENOMEDIUM
#endif])],[],[AM_CPPFLAGS="${AM_CPPFLAGS} -DENOMEDIUM=EAGAIN"])
if test "x${target_linux}" = "xyes"
then
AM_CPPFLAGS="-D_GNU_SOURCE"
fi
AM_CPPFLAGS="${AM_CPPFLAGS} `${PKG_CONFIG} --cflags ltfs`"
AM_CPPFLAGS="${AM_CPPFLAGS} `${PKG_CONFIG} --cflags fuse`"
AM_CPPFLAGS="${AM_CPPFLAGS} -DIBM_LTFS_BUILD -DGENERIC_OEM_BUILD"
AM_CPPFLAGS="${AM_CPPFLAGS} ${ICU_MODULE_CFLAGS}"
AM_CONDITIONAL([PLATFORM_LINUX], [test "x${target_linux}" = "xyes"])
AM_CONDITIONAL([PLATFORM_MAC], [test "x${target_mac}" = "xyes"])
AM_CONDITIONAL([PLATFORM_NETBSD], [test "x${target_netbsd}" = "xyes"])
AM_CONDITIONAL([CHECKONLY], [test "x${checkonly}" = "xyes"])
AM_CONDITIONAL([CHK_MESSAGE], [test "x${use_msg_check}" = "xyes"])
AC_SUBST(CFLAGS)
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_EXTRA_CPPFLAGS)
AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_LDFLAGS)
AC_CONFIG_FILES([Makefile messages/Makefile
src/tape_drivers/generic/dummy/Makefile
src/tape_drivers/linux/ltotape/Makefile
src/tape_drivers/osx/ltotape/Makefile
src/tape_drivers/netbsd/ltotape/Makefile])
AC_OUTPUT