AC_INIT([openhantek-extractfw], [0.7.0], [oliver.haag@gmail.com]) AC_CONFIG_SRCDIR([extractfw.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/hantek" AC_SUBST(hantekfirmwaredir) AC_CONFIG_FILES( [Makefile] [90-hantek.rules] ) AC_OUTPUT