summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-05-18 00:14:28 +0400
committerIgor Pashev <pashev.igor@gmail.com>2013-05-19 18:23:32 +0400
commit48086e4b94f94b9e41d61406129b92078b65fdf1 (patch)
tree3b5ac464ea88e0fbc5ee4810df002647a57fe4d0 /configure.ac
parent213d4f4f0d053d779dd43aa3ed1b6e256569ce16 (diff)
downloadiscsit-48086e4b94f94b9e41d61406129b92078b65fdf1.tar.gz
Portable versionupstream/1.0
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac80
1 files changed, 80 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..e9ef57e
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,80 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+dnl Written by Igor Pashev <pashev.igor@gmail.com>
+dnl
+dnl The author has placed this work in the Public Domain,
+dnl thereby relinquishing all copyrights. Everyone is free
+dnl to use, modify, republish, sell or give away this work
+dnl The author has placed this work in the Public Domain,
+dnl thereby relinquishing all copyrights. Everyone is free
+dnl to use, modify, republish, sell or give away this work
+dnl without prior consent from anybody.
+
+AC_PREREQ([2.69])
+AC_INIT([iscsit], [1.0], [pashev.igor@gmail.com])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_SRCDIR([usr/src/lib/libiscsit/common/libiscsit.c])
+AM_INIT_AUTOMAKE([foreign dist-xz])
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.16.1])
+
+
+AC_ARG_ENABLE([progs], AS_HELP_STRING([--disable-progs], [build only the libiscsit library]))
+AM_CONDITIONAL([ENABLE_PROGS], [test x$enable_progs != xno])
+
+# Checks for programs.
+AC_PROG_CC_C99
+LT_INIT
+AX_PTHREAD([], AC_MSG_ERROR([requires pthread]))
+
+AC_MSG_CHECKING([how to pass version script to the linker ($LD)])
+VERSION_SCRIPT_FLAGS=none
+if $LD --help 2>&1 | grep "version-script" >/dev/null 2>/dev/null; then
+ VERSION_SCRIPT_FLAGS=-Wl,--version-script=
+elif $LD --help 2>&1 | grep "M mapfile" >/dev/null 2>/dev/null; then
+ VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
+fi
+AC_MSG_RESULT([$VERSION_SCRIPT_FLAGS])
+AC_SUBST(VERSION_SCRIPT_FLAGS)
+AM_CONDITIONAL([USE_VERSION_SCRIPT], [test "$VERSION_SCRIPT_FLAGS" != none])
+
+if test $with_gnu_ld = yes ; then
+ LDFLAGS_AS_NEEDED="-Wl,--as-needed"
+ LDFLAGS_NO_UNDEFINED="-Wl,--no-undefined"
+fi
+AC_SUBST([LDFLAGS_AS_NEEDED])
+AC_SUBST([LDFLAGS_NO_UNDEFINED])
+
+# Checks for header files.
+AC_CHECK_HEADERS([secdb.h auth_attr.h sys/systeminfo.h sys/iscsi_protocol.h sys/iscsit/isns_protocol.h], [], [
+ AC_MSG_ERROR([Required system headers not found])
+ ])
+
+AC_CHECK_HEADERS([libstmf.h libnvpair.h libscf.h uuid/uuid.h], [], [
+ AC_MSG_ERROR([Required library headers not found])
+ ])
+
+# Checks for libraries.
+AC_CHECK_LIB([nvpair], [nvlist_alloc], [], [
+ AC_MSG_ERROR([libnvpair not found])
+ ])
+AC_CHECK_LIB([scf], [smf_get_state], [], [
+ AC_MSG_ERROR([libscf not found])
+ ])
+AC_CHECK_LIB([uuid], [uuid_generate_random], [], [
+ AC_MSG_ERROR([libuuid not found])
+ ])
+AC_CHECK_LIB([stmf], [stmfSetProviderDataProt], [], [
+ AC_MSG_ERROR([libstmf not found])
+ ])
+
+# Checks for typedefs, structures, and compiler characteristics.
+
+# Checks for library functions.
+AC_SEARCH_LIBS([inet_pton], [nsl])
+AC_SEARCH_LIBS([chkauthattr], [secdb])
+
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([po/Makefile.in])
+AC_OUTPUT
+