Add GPIO class

This class will be used for accessing GPIOs off of the
UCD90160 to check for PGOOD faults, and also later for
isolating GPU overtemps and PGOOD faults down to the specific
GPU that failed.

The FileDescriptor class is used by the GPIO class to manage
the lifetime of the GPIO file handles.

The class only supports reading a GPIO value.  At this point
there is no requirement for doing writes.

This class was copied from phosphor-gpio-monitor/gpio-util.

Change-Id: Iee276aed67e1cba549c3070c08238ab5f621c320
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/configure.ac b/configure.ac
index ed31491..28719bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,6 +17,13 @@
 AX_CXX_COMPILE_STDCXX_14([noext])
 AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
 
+# Download gpio.h from github if necessary.
+AC_CHECK_HEADER(linux/gpio.h,[HAVE_LINUX_GPIO_H=""],[HAVE_LINUX_GPIO_H="-I linux/gpio.h"])
+AS_IF([test "$HAVE_LINUX_GPIO_H" != ""],
+    AC_MSG_WARN([Could not find linux/gpio.h: Attempting to download locally for building from https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/gpio.h])
+    AC_SUBST([BT_BMC_DL],[`mkdir -p linux;wget https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/gpio.h -O linux/gpio.h`])
+)
+
 PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,
     AC_MSG_ERROR(["Requires sdbusplus package."]))
 PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\