-#if test "$PTHREADLIB" != "-lpthread"; then
-# AC_MSG_ERROR(failed: I need posix threads, pthread)
-#fi
-
-dnl Converts the ARCH to be the same as dpkg
+dnl if test "$PTHREADLIB" != "-lpthread"; then
+dnl AC_MSG_ERROR(failed: I need posix threads, pthread)
+dnl fi
+
+dnl Check for DB2
+AC_CHECK_HEADER(db2/db.h,
+ [AC_CHECK_LIB(db2,db_open,
+ [AC_DEFINE(HAVE_DB2) DB2LIB="-ldb2"])])
+AC_SUBST(DB2LIB)
+
+dnl Converts the ARCH to be something singular for this general CPU family
+dnl This is often the dpkg architecture string.