summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am20
-rw-r--r--configure.ac35
2 files changed, 26 insertions, 29 deletions
diff --git a/Makefile.am b/Makefile.am
index 8ac1d8d0f3..7b4753d300 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3905,7 +3905,7 @@ _journal_la_SOURCES = \
_journal_la_CFLAGS = \
$(AM_CFLAGS) \
-fvisibility=default \
- $(PYTHON_CFLAGS)
+ $(PYTHON_DEVEL_CFLAGS)
_journal_la_LDFLAGS = \
$(AM_LDFLAGS) \
@@ -3914,7 +3914,7 @@ _journal_la_LDFLAGS = \
-avoid-version
_journal_la_LIBADD = \
- $(PYTHON_LIBS) \
+ $(PYTHON_DEVEL_LIBS) \
libsystemd-journal.la
id128_la_SOURCES = \
@@ -3926,7 +3926,7 @@ id128_la_SOURCES = \
id128_la_CFLAGS = \
$(AM_CFLAGS) \
-fvisibility=default \
- $(PYTHON_CFLAGS) \
+ $(PYTHON_DEVEL_CFLAGS) \
-I$(top_builddir)/src/python-systemd
id128_la_LDFLAGS = \
@@ -3936,7 +3936,7 @@ id128_la_LDFLAGS = \
-avoid-version
id128_la_LIBADD = \
- $(PYTHON_LIBS) \
+ $(PYTHON_DEVEL_LIBS) \
libsystemd-id128.la
_daemon_la_SOURCES = \
@@ -3947,7 +3947,7 @@ _daemon_la_SOURCES = \
_daemon_la_CFLAGS = \
$(AM_CFLAGS) \
-fvisibility=default \
- $(PYTHON_CFLAGS) \
+ $(PYTHON_DEVEL_CFLAGS) \
-I$(top_builddir)/src/python-systemd
_daemon_la_LDFLAGS = \
@@ -3957,7 +3957,7 @@ _daemon_la_LDFLAGS = \
-avoid-version
_daemon_la_LIBADD = \
- $(PYTHON_LIBS) \
+ $(PYTHON_DEVEL_LIBS) \
libsystemd-daemon.la
_reader_la_SOURCES = \
@@ -3968,7 +3968,7 @@ _reader_la_SOURCES = \
_reader_la_CFLAGS = \
$(AM_CFLAGS) \
-fvisibility=default \
- $(PYTHON_CFLAGS)
+ $(PYTHON_DEVEL_CFLAGS)
_reader_la_LDFLAGS = \
$(AM_LDFLAGS) \
@@ -3977,7 +3977,7 @@ _reader_la_LDFLAGS = \
-avoid-version
_reader_la_LIBADD = \
- $(PYTHON_LIBS) \
+ $(PYTHON_DEVEL_LIBS) \
libsystemd-journal.la \
libsystemd-id128.la \
libsystemd-shared.la \
@@ -3991,7 +3991,7 @@ login_la_SOURCES = \
login_la_CFLAGS = \
$(AM_CFLAGS) \
-fvisibility=default \
- $(PYTHON_CFLAGS)
+ $(PYTHON_DEVEL_CFLAGS)
login_la_LDFLAGS = \
$(AM_LDFLAGS) \
@@ -4000,7 +4000,7 @@ login_la_LDFLAGS = \
-avoid-version
login_la_LIBADD = \
- $(PYTHON_LIBS) \
+ $(PYTHON_DEVEL_LIBS) \
libsystemd-journal.la \
libsystemd-login.la \
libsystemd-shared.la \
diff --git a/configure.ac b/configure.ac
index 759073a2c1..4e8c573ab3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -144,11 +144,10 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
--param=ssp-buffer-size=4])
AC_SUBST([OUR_CFLAGS], $with_cflags)
-AS_CASE([$CFLAGS], [*-O[[12345g\ ]]*], [
- CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
- -Wp,-D_FORTIFY_SOURCE=2])], [
- python_extra_cflags=-Wp,-U_FORTIFY_SOURCE
- AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
+AS_CASE([$CFLAGS], [*-O[[12345g\ ]]*],
+ [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
+ -Wp,-D_FORTIFY_SOURCE=2])],
+ [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
AC_SUBST([OUR_CPPFLAGS], $with_cppflags)
CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
@@ -162,8 +161,6 @@ AC_SUBST([OUR_LDFLAGS], $with_ldflags)
# ------------------------------------------------------------------------------
# we use python to build the man page index, and for systemd-python
have_python=no
-have_python_devel=no
-
AC_ARG_WITH([python],
[AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
@@ -178,16 +175,16 @@ AS_IF([test "x$PYTHON_BINARY" = "x"],
[PYTHON_BINARY=/usr/bin/python])])
AC_ARG_VAR(PYTHON_BINARY, [Python binary used to launch installed scripts])
-AS_IF([test "x$with_python" != "xno"], [
- AC_PATH_PROG(PYTHON_CONFIG, python${PYTHON_VERSION}-config)
- AS_IF([test -n "$PYTHON_CONFIG"], [
- have_python_devel=yes
- PYTHON_CFLAGS="$($PYTHON_CONFIG --cflags) $python_extra_cflags"
- PYTHON_LIBS="$($PYTHON_CONFIG --ldflags)"
- AC_SUBST(PYTHON_CFLAGS)
- AC_SUBST(PYTHON_LIBS)
- AC_PATH_PROGS(SPHINX_BUILD, sphinx-build-${PYTHON_VERSION} sphinx-build)
- ])
+have_python_devel=no
+AC_ARG_ENABLE(python_devel, AS_HELP_STRING([--disable-python-devel], [Do not build python modules]))
+AS_IF([test "x$enable_python_devel" != "xno"], [
+ PKG_CHECK_MODULES([PYTHON_DEVEL], [python-${PYTHON_VERSION}],
+ [have_python_devel=yes],
+ [PKG_CHECK_MODULES([PYTHON_DEVEL], [python],
+ [have_python_devel=yes],
+ [have_python_devel=no])])
+ AS_IF([test "x$have_python_devel" = xno -a "x$enable_python_devel" = xyes],
+ [AC_MSG_ERROR([*** python-devel support requested but libraries not found])])
])
AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
@@ -1039,6 +1036,6 @@ AC_MSG_RESULT([
CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
- PYTHON_CFLAGS: ${PYTHON_CFLAGS}
- PYTHON_LIBS: ${PYTHON_LIBS}
+ PYTHON_CFLAGS: ${PYTHON_DEVEL_CFLAGS}
+ PYTHON_LIBS: ${PYTHON_DEVEL_LIBS}
])