forked from OpenEZX/moto-boot-usb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
45 lines (36 loc) · 1.37 KB
/
Copy pathconfigure.ac
File metadata and controls
45 lines (36 loc) · 1.37 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
AC_PREREQ(2.60)
AC_INIT([moto-boot-usb], [0.3], [openezx-devel@lists.openezx.org])
AC_CONFIG_SRCDIR([src/moto-boot-usb.c])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([-Wall foreign])
# Test for new silent rules
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_ARG_WITH(kernel-dir,
AC_HELP_STRING([--with-kernel-dir=DIR], [location of kernel sources]),
[KERNEL_DIR=${withval}],
[KERNEL_DIR=/usr/src/linux])
AC_SUBST(KERNEL_DIR)
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
# Checks for libraries.
PKG_CHECK_MODULES([LIBUSB], libusb,,
AC_MSG_ERROR([*** Required libusb not installed ***]))
AC_CHECK_LIB([usb], [usb_init], [HAVE_LIBUSB=1])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdio.h stdlib.h unistd.h string.h getopt.h errno.h])
AC_CHECK_HEADERS([sys/types.h sys/stat.h sys/mman.h fcntl.h arpa/inet.h usb.h])
# We need the setup.h for the 'arm' architecture
AC_MSG_CHECKING([for asm/setup.h])
CPPFLAGS="-I$KERNEL_DIR/arch/arm/include -I$KERNEL_DIR/include"
LIBS="-lusb"
# Grepping for tag_mem32 should be safe, only 'arm' defines it
AC_EGREP_HEADER(tag_mem32, asm/setup.h,
[AC_MSG_RESULT(yes)],
[AC_MSG_FAILURE([Could not find kernel headers, use --with-kernel-dir=DIR option])])
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT