|
@@ -18,6 +18,20 @@ AC_LANG([C++])
|
|
|
AM_CONDITIONAL(USE_GXX, test "X${GXX}" = "Xyes")
|
|
|
AC_CHECK_DECL([__SUNPRO_CC], [SUNCXX="yes"], [SUNCXX="no"])
|
|
|
|
|
|
+# Linker options
|
|
|
+
|
|
|
+# check -R rather than gcc specific -rpath to be as portable as possible.
|
|
|
+AC_MSG_CHECKING([whether -R flag is available in linker])
|
|
|
+LDFLAGS_SAVED="$LDFLAGS"
|
|
|
+LDFLAGS="$LDFLAGS -R/usr/lib"
|
|
|
+AC_TRY_LINK([],[],
|
|
|
+ [ AC_MSG_RESULT(yes)
|
|
|
+ rpath_available=yes
|
|
|
+ ],[ AC_MSG_RESULT(no)
|
|
|
+ rpath_available=no
|
|
|
+ ])
|
|
|
+LDFLAGS=$LDFLAGS_SAVED
|
|
|
+
|
|
|
# OS dependent compiler flags
|
|
|
case "$host" in
|
|
|
*-solaris*)
|
|
@@ -83,6 +97,20 @@ else
|
|
|
AC_MSG_WARN([${PYTHON}-config does not exist or is not executable, so we could not detect python development environment. Your system may require an additional package (e.g. "python3-dev"). Alternatively, if you are sure you have python headers and libraries, define PYTHON_INCLUDES and PYTHON_LDFLAGS and run this script.])
|
|
|
fi
|
|
|
fi
|
|
|
+
|
|
|
+# Some OSes including NetBSD don't install libpython.so in a well known path.
|
|
|
+# To avoid requiring dynamic library path with our python wrapper loadable
|
|
|
+# modules, we embed the path to the modules when possible. We do this even
|
|
|
+# when the path is known in the common operational environment (e.g. when
|
|
|
+# it's stored in a common "hint" file) for simplicity.
|
|
|
+if test $rpath_available = yes; then
|
|
|
+ python_rpath=
|
|
|
+ for flag in ${PYTHON_LDFLAGS}; do
|
|
|
+ python_rpath="${python_rpath} `echo $flag | sed -ne 's/^\(\-L\)/-R/p'`"
|
|
|
+ done
|
|
|
+ PYTHON_LDFLAGS="${PYTHON_LDFLAGS} ${python_rpath}"
|
|
|
+fi
|
|
|
+
|
|
|
AC_SUBST(PYTHON_INCLUDES)
|
|
|
AC_SUBST(PYTHON_LDFLAGS)
|
|
|
|
|
@@ -91,9 +119,7 @@ CPPFLAGS="$CPPFLAGS ${PYTHON_INCLUDES}"
|
|
|
AC_CHECK_HEADERS([Python.h],, AC_MSG_ERROR([Missing Python.h]))
|
|
|
CPPFLAGS="$CPPFLAGS_SAVED"
|
|
|
|
|
|
-
|
|
|
-# Check for python library (not absolutely mandatory, but needed for
|
|
|
-# Boost.Python when we use it. See below.)
|
|
|
+# Check for python library. Needed for Python-wrapper libraries.
|
|
|
LDFLAGS_SAVED="$LDFLAGS"
|
|
|
LDFLAGS="$LDFLAGS $PYTHON_LDFLAGS"
|
|
|
python_bin="python${PYTHON_VERSION}"
|
|
@@ -102,6 +128,7 @@ if test $python_lib != "no"; then
|
|
|
PYTHON_LIB="-l$python_lib"
|
|
|
fi
|
|
|
AC_SUBST(PYTHON_LIB)
|
|
|
+LDFLAGS=$LDFLAGS_SAVED
|
|
|
|
|
|
# TODO: check for _sqlite3.py module
|
|
|
|
|
@@ -143,6 +170,7 @@ namespace isc {class Bar {Foo foo_;};} ],,
|
|
|
B10_CXXFLAGS="$B10_CXXFLAGS -Werror"],
|
|
|
[AC_MSG_RESULT(yes)])
|
|
|
CXXFLAGS="$CXXFLAGS_SAVED"
|
|
|
+
|
|
|
fi dnl GXX = yes
|
|
|
|
|
|
AM_CONDITIONAL(GCC_WERROR_OK, test $werror_ok = 1)
|
|
@@ -236,8 +264,6 @@ AC_HELP_STRING([--with-boost-lib=PATH],
|
|
|
fi])
|
|
|
AC_SUBST(BOOST_LDFLAGS)
|
|
|
|
|
|
-# Check availability of the Boost Python library
|
|
|
-
|
|
|
#
|
|
|
# Check availability of gtest, which will be used for unit tests.
|
|
|
#
|
|
@@ -487,8 +513,10 @@ Flags:
|
|
|
CXXFLAGS: $CXXFLAGS
|
|
|
B10_CXXFLAGS: $B10_CXXFLAGS
|
|
|
dnl includes too
|
|
|
- Boost Python: $BOOST_PYTHON_LIB
|
|
|
- SQLite: $SQLITE_CFLAGS
|
|
|
+ Python: ${PYTHON_INCLUDES}
|
|
|
+ ${PYTHON_LDFLAGS}
|
|
|
+ ${PYTHON_LIB}
|
|
|
+ SQLite: $SQLITE_CFLAGS
|
|
|
$SQLITE_LIBS
|
|
|
|
|
|
Features:
|