configure.in 1.17 KB
AC_INIT([dsoextract], [0.6.2], [oliver.haag@gmail.com])
AC_CONFIG_SRCDIR([dsoextractfw.c])

# Generates a config.h
#AC_CONFIG_HEADERS([config.h])

# Silent make output if available
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

AM_INIT_AUTOMAKE

# Checks for programs.
AC_PROG_CC

# Checks for libraries.
AC_CHECK_LIB([bfd], [main], [], AC_MSG_ERROR([The bfd library is missing]))

# Checks for header files.
AC_CHECK_HEADERS([malloc.h string.h])

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.
AC_FUNC_MALLOC

# Add --with-firmware-dir= option
# FIXME According to Autoconf manual, we shouldn't do substitution that way but I'm not able to expand ${prefix} even using Makefile...
# SEE http://www.gnu.org/software/hello/manual/autoconf/External-Software.html
AC_ARG_WITH( [firmware-dir],
	[AC_HELP_STRING([--with-firmware-dir=DIR], [directory to install hantek firmwares [/usr/local/share]])],
	[with_firmware_dir=$(echo "$withval" | sed -e 's!/$!!')],
	[with_firmware_dir="/usr/local/share"],
)

hantekfirmwaredir="$with_firmware_dir/hantekdso"
AC_SUBST(hantekfirmwaredir)

AC_CONFIG_FILES(
	[Makefile]
	[90-hantek-dso.rules]
)

AC_OUTPUT