1 # -*- Autoconf -*- 2 # Process this file with autoconf to produce a configure script. 3 4 AC_PREREQ([2.68]) 5 6 # Get version from file VERSION 7 m4_define([f2fs_tools_version], m4_esyscmd([sed -n '1p' VERSION | tr -d '\n'])) 8 m4_define([f2fs_tools_date], m4_esyscmd([sed -n '2p' VERSION | tr -d '\n'])) 9 m4_define([f2fs_tools_gitdate], 10 m4_esyscmd([git log -1 --pretty=format:%ci 2> /dev/null])) 11 12 AC_INIT([F2FS tools], [f2fs_tools_version], 13 [linux-f2fs-devel (a] lists.sourceforge.net]) 14 15 AC_DEFINE([F2FS_TOOLS_VERSION], "f2fs_tools_version", [f2fs-tools version]) 16 AC_DEFINE([F2FS_MAJOR_VERSION], m4_bpatsubst(f2fs_tools_version, 17 [\([0-9]*\)\(\w\|\W\)*], [\1]), 18 [Major version for f2fs-tools]) 19 AC_DEFINE([F2FS_MINOR_VERSION], m4_bpatsubst(f2fs_tools_version, 20 [\([0-9]*\).\([0-9]*\)\(\w\|\W\)*], [\2]), 21 [Minor version for f2fs-tools]) 22 23 AC_CHECK_FILE(.git, 24 AC_DEFINE([F2FS_TOOLS_DATE], 25 "m4_bpatsubst(f2fs_tools_gitdate, 26 [\([0-9-]*\)\(\w\|\W\)*], [\1])", 27 [f2fs-tools date based on Git commits]), 28 AC_DEFINE([F2FS_TOOLS_DATE], 29 "f2fs_tools_date", 30 [f2fs-tools date based on Source releases])) 31 32 AC_CONFIG_SRCDIR([config.h.in]) 33 AC_CONFIG_HEADER([config.h]) 34 AC_CONFIG_MACRO_DIR([m4]) 35 AC_CONFIG_AUX_DIR([build-aux]) 36 AM_INIT_AUTOMAKE([foreign tar-pax dist-xz]) 37 38 AC_CHECK_HEADERS_ONCE([ 39 fcntl.h 40 mntent.h 41 stdlib.h 42 string.h 43 unistd.h 44 sys/ioctl.h 45 sys/mount.h 46 ]) 47 48 # Checks for programs. 49 AC_PROG_CC 50 AC_PROG_LIBTOOL 51 AC_PATH_PROG([LDCONFIG], [ldconfig], 52 [AC_MSG_ERROR([ldconfig not found])], 53 [$PATH:/sbin]) 54 55 # Checks for libraries. 56 PKG_CHECK_MODULES([libuuid], [uuid]) 57 58 # Checks for header files. 59 AC_CHECK_HEADERS([linux/fs.h fcntl.h mntent.h stdlib.h string.h \ 60 sys/ioctl.h sys/mount.h unistd.h]) 61 62 # Checks for typedefs, structures, and compiler characteristics. 63 AC_C_INLINE 64 AC_TYPE_INT32_T 65 AC_TYPE_INT8_T 66 AC_TYPE_SIZE_T 67 68 # Checks for library functions. 69 AC_FUNC_GETMNTENT 70 AC_CHECK_FUNCS_ONCE([ 71 getmntent 72 memset 73 ]) 74 75 # Install directories 76 AC_PREFIX_DEFAULT([/usr]) 77 AC_SUBST([sbindir], [/sbin]) 78 AC_SUBST([sysconfdir], [/etc]) 79 AC_SUBST([localstatedir], [/var]) 80 AC_CONFIG_FILES([ 81 Makefile 82 man/Makefile 83 lib/Makefile 84 mkfs/Makefile 85 fsck/Makefile 86 tools/Makefile 87 ]) 88 89 AC_OUTPUT 90