@@ -5,14 +5,31 @@ AC_PREREQ([2.69])
55AC_INIT ( [ ltfs-plugins] ,
[ 0.1] ,
[ [email protected] ] ) 66AC_CONFIG_SRCDIR ( [ src/tape_drivers/netbsd/ltotape/ltotape.c] )
77AC_CONFIG_MACRO_DIRS([ m4] )
8- AC_CONFIG_MACRO_DIR ( [ m4] )
8+ AC_CONFIG_MACRO_DIR ( [ m4] )
99AC_CANONICAL_TARGET
1010AM_INIT_AUTOMAKE ( [ -Wall -Werror foreign subdir-objects] )
1111AC_CONFIG_HEADERS ( [ config.h] )
1212AC_PROG_CC
13+ AC_PROG_CC_C99
14+ AM_PROG_CC_C_O
1315AM_PROG_AR
1416AC_PROG_LIBTOOL
1517
18+ # Detecting target OS
19+ case "${target_os}" in
20+ linux*)
21+ target_linux=yes
22+ ;;
23+ darwin*)
24+ target_mac=yes
25+ ;;
26+ netbsd*)
27+ target_netbsd=yes
28+ ;;
29+ *)
30+ AC_MSG_ERROR ( [ "OS $target_os is not supported"] )
31+ ;;
32+ esac
1633
1734# Checks for header files.
1835AC_CHECK_HEADERS ( [ fcntl.h inttypes.h stdlib.h string.h sys/file.h sys/ioctl.h unistd.h] )
@@ -28,15 +45,15 @@ AC_TYPE_UINT8_T
2845# Checks for library functions.
2946AC_CHECK_FUNCS ( [ memset strerror strstr] )
3047
31- dnl
48+ dnl
3249dnl Check for pkg-config
33- dnl
34- if test -z "$PKG_CONFIG"
50+ dnl
51+ if test -z "$PKG_CONFIG"
3552then
36- AC_PATH_PROG ( PKG_CONFIG , pkg-config , [ no] )
37- fi
53+ AC_PATH_PROG ( PKG_CONFIG , pkg-config , [ no] )
54+ fi
3855if test "x${PKG_CONFIG}" = "xno"
39- then
56+ then
4057 AC_MSG_ERROR ( [ pkg-config was not found] )
4158fi
4259
@@ -48,13 +65,13 @@ if test "x${GENRB}" = "xno"
4865then
4966 AC_MSG_ERROR ( [ genrb was not found] )
5067fi
51-
52- dnl
68+
69+ dnl
5370dnl Check for pkgdata
54- dnl
71+ dnl
5572AC_PATH_PROG ( PKGDATA , pkgdata , no )
5673if test "x${PKGDATA}" = "xno"
57- then
74+ then
5875 AC_MSG_ERROR ( [ pkgdata was not found] )
5976fi
6077
87104 AC_MSG_RESULT ( [ $ICU_MODULE_VERSION] )
88105fi
89106
107+ dnl
108+ dnl interface checker
109+ dnl
110+ AC_MSG_CHECKING ( [ No driver build, only check backend I/F] )
111+ AC_ARG_ENABLE ( [ checkonly] ,
112+ [ AS_HELP_STRING ( [ --enable-checkonly] ,[ No driver build, only check backend I/F] ) ] ,
113+ [ checkonly=$enableval] ,
114+ [ checkonly=no]
115+ )
116+ AC_MSG_RESULT ( [ $checkonly] )
117+
90118dnl
91119dnl test for ENOMEDIUM
92120dnl
@@ -95,39 +123,30 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <errno.h>],[
95123#error no ENOMEDIUM
96124#endif] ) ] ,[ ] ,[ AM_CPPFLAGS="${AM_CPPFLAGS} -DENOMEDIUM=EAGAIN"] )
97125
126+ if test "x${target_linux}" = "xyes"
127+ then
128+ AM_CPPFLAGS="-D_GNU_SOURCE"
129+ fi
98130
99131AM_CPPFLAGS="${AM_CPPFLAGS} `${PKG_CONFIG} --cflags ltfs`"
100132AM_CPPFLAGS="${AM_CPPFLAGS} `${PKG_CONFIG} --cflags fuse`"
101133AM_CPPFLAGS="${AM_CPPFLAGS} -DIBM_LTFS_BUILD -DGENERIC_OEM_BUILD"
102134AM_CPPFLAGS="${AM_CPPFLAGS} ${ICU_MODULE_CFLAGS}"
103135
104- case "${target_os}" in
105- linux*)
106- target_linux=yes
107- ;;
108- darwin*)
109- host_mac=yes
110- ;;
111- netbsd*)
112- target_netbsd=yes
113- ;;
114- *)
115- AC_MSG_ERROR ( [ "OS $target_os is not supported"] )
116- ;;
117- esac
118-
119136AM_CONDITIONAL([ PLATFORM_LINUX] , [ test "x${target_linux}" = "xyes"] )
120137AM_CONDITIONAL([ PLATFORM_MAC] , [ test "x${target_mac}" = "xyes"] )
121138AM_CONDITIONAL([ PLATFORM_NETBSD] , [ test "x${target_netbsd}" = "xyes"] )
139+ AM_CONDITIONAL([ CHECKONLY] , [ test "x${checkonly}" = "xyes"] )
122140AM_CONDITIONAL([ CHK_MESSAGE] , [ test "x${use_msg_check}" = "xyes"] )
123141
124142AC_SUBST ( CFLAGS )
125143AC_SUBST ( AM_CPPFLAGS )
126144AC_SUBST ( AM_EXTRA_CPPFLAGS )
127145AC_SUBST ( AM_CFLAGS )
128- AC_SUBST ( AM_LDFLAGS )
146+ AC_SUBST ( AM_LDFLAGS )
129147
130- AC_CONFIG_FILES ( [ Makefile messages/Makefile
148+ AC_CONFIG_FILES ( [ Makefile messages/Makefile
149+ src/tape_drivers/generic/dummy/Makefile
131150 src/tape_drivers/linux/ltotape/Makefile
132151 src/tape_drivers/osx/ltotape/Makefile
133152 src/tape_drivers/netbsd/ltotape/Makefile] )
0 commit comments