Deepak Kodihalli | 2bba75d | 2016-11-30 00:46:49 -0600 | [diff] [blame] | 1 | AC_PREREQ([2.69]) |
| 2 | AC_INIT([openpower-vpd-parser], [1.0], [https://github.com/openbmc/openpower-vpd-parser/issues]) |
| 3 | |
| 4 | AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign dist-xz]) |
| 5 | AM_SILENT_RULES([yes]) |
| 6 | |
| 7 | # Checks for programs |
| 8 | AC_PROG_CXX |
| 9 | AM_PROG_AR |
| 10 | AC_PROG_INSTALL |
| 11 | AC_PROG_MAKE_SET |
| 12 | AM_PATH_PYTHON([2.7], |
| 13 | [AC_SUBST([PYTHON], [echo "$PYTHON"])], |
| 14 | [AC_MSG_ERROR([Could not find python-2.7 installed...python-2.7 is required])]) |
| 15 | |
Deepak Kodihalli | ae7b545 | 2017-02-06 05:05:56 -0600 | [diff] [blame] | 16 | PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\ |
| 17 | AC_MSG_ERROR(["Requires sdbusplus package."])) |
Deepak Kodihalli | c6e551b | 2017-02-17 07:39:50 -0600 | [diff] [blame] | 18 | PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\ |
| 19 | AC_MSG_ERROR(["Requires phosphor-logging package."])) |
Deepak Kodihalli | ae7b545 | 2017-02-06 05:05:56 -0600 | [diff] [blame] | 20 | |
Deepak Kodihalli | 2bba75d | 2016-11-30 00:46:49 -0600 | [diff] [blame] | 21 | # Surpress the --with-libtool-sysroot error |
| 22 | LT_INIT |
| 23 | |
| 24 | # Checks for typedefs, structures, and compiler characteristics. |
| 25 | AX_CXX_COMPILE_STDCXX_14([noext]) |
| 26 | AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS]) |
| 27 | |
| 28 | # Test cases require SDK so only build if we're told to (and SDK is available) |
| 29 | AC_ARG_ENABLE([oe-sdk], |
| 30 | AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.]) |
| 31 | ) |
| 32 | AC_ARG_VAR(OECORE_TARGET_SYSROOT, |
| 33 | [Path to the OE SDK SYSROOT]) |
| 34 | AS_IF([test "x$enable_oe_sdk" == "xyes"], |
| 35 | AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"], |
| 36 | AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk]) |
| 37 | ) |
| 38 | AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT]) |
| 39 | [ |
| 40 | testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib" |
| 41 | testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib" |
| 42 | testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`" |
| 43 | ] |
| 44 | AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags]) |
| 45 | ) |
| 46 | |
Deepak Kodihalli | cd6d241 | 2017-02-06 07:35:32 -0600 | [diff] [blame] | 47 | AS_IF([test "x$FRU_YAML" == "x"], [FRU_YAML="writefru.yaml"]) |
| 48 | FRUGEN="$PYTHON $srcdir/writefru.py -i $FRU_YAML" |
| 49 | AC_SUBST(FRUGEN) |
Deepak Kodihalli | c7b2a71 | 2017-02-17 00:58:39 -0600 | [diff] [blame^] | 50 | AS_IF([test "x$PROP_YAML" == "x"], [PROP_YAML="extra-properties-example.yaml"]) |
| 51 | PROPGEN="$PYTHON $srcdir/extra-properties.py -e $PROP_YAML" |
| 52 | AC_SUBST(PROPGEN) |
Deepak Kodihalli | cd6d241 | 2017-02-06 07:35:32 -0600 | [diff] [blame] | 53 | |
Deepak Kodihalli | 2bba75d | 2016-11-30 00:46:49 -0600 | [diff] [blame] | 54 | AC_CONFIG_HEADERS([config.h]) |
Deepak Kodihalli | 901c5d9 | 2016-11-30 05:19:45 -0600 | [diff] [blame] | 55 | AC_CONFIG_FILES([Makefile test/Makefile]) |
Deepak Kodihalli | 2bba75d | 2016-11-30 00:46:49 -0600 | [diff] [blame] | 56 | AC_OUTPUT |