Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Python agent build and install #15

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ org_lttng_ust_agent_jul_LttngLogHandler.h
org_lttng_ust_agent_log4j_LttngLogAppender.h

# Python agent
liblttng-ust-python-agent/lttngust/__init__.py
liblttng-ust-python-agent/**/*.pyc
liblttng-ust-python-agent/build
liblttng-ust-python-agent/install_files.txt
liblttng-ust-python-agent/setup.py
python-lttngust/lttngust/__init__.py
python-lttngust/**/*.pyc
python-lttngust/build
python-lttngust/setup.py
3 changes: 2 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SUBDIRS = . include snprintf libringbuffer liblttng-ust-comm \
liblttng-ust-fork \
liblttng-ust-libc-wrapper \
liblttng-ust-cyg-profile \
liblttng-ust-python-agent \
tools

if HAVE_DLINFO
Expand All @@ -21,7 +22,7 @@ SUBDIRS += liblttng-ust-java-agent
endif

if BUILD_PYTHON_AGENT
SUBDIRS += liblttng-ust-python-agent
SUBDIRS += python-lttngust
endif

SUBDIRS += tests doc
Expand Down
13 changes: 7 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,9 @@ AC_CONFIG_FILES([
liblttng-ust-libc-wrapper/Makefile
liblttng-ust-cyg-profile/Makefile
liblttng-ust-python-agent/Makefile
liblttng-ust-python-agent/setup.py
liblttng-ust-python-agent/lttngust/__init__.py
python-lttngust/Makefile
python-lttngust/setup.py
python-lttngust/lttngust/__init__.py
tools/Makefile
tests/Makefile
tests/hello/Makefile
Expand All @@ -410,10 +411,10 @@ AC_CONFIG_FILES([

# Create link for python agent for the VPATH guru.
AC_CONFIG_LINKS([
liblttng-ust-python-agent/lttngust/agent.py:liblttng-ust-python-agent/lttngust/agent.py
liblttng-ust-python-agent/lttngust/cmd.py:liblttng-ust-python-agent/lttngust/cmd.py
liblttng-ust-python-agent/lttngust/debug.py:liblttng-ust-python-agent/lttngust/debug.py
liblttng-ust-python-agent/lttngust/loghandler.py:liblttng-ust-python-agent/lttngust/loghandler.py
python-lttngust/lttngust/agent.py:python-lttngust/lttngust/agent.py
python-lttngust/lttngust/cmd.py:python-lttngust/lttngust/cmd.py
python-lttngust/lttngust/debug.py:python-lttngust/lttngust/debug.py
python-lttngust/lttngust/loghandler.py:python-lttngust/lttngust/loghandler.py
])

AC_OUTPUT
Expand Down
30 changes: 2 additions & 28 deletions liblttng-ust-python-agent/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,34 +1,8 @@
# tracepoint provider
AM_CPPFLAGS = $(PYTHON_INCLUDE) -I$(top_srcdir)/include/ \
# tracepoint provider: always built/installed (does not depend on Python per se)
AM_CPPFLAGS = -I$(top_srcdir)/include/ \
-I$(top_builddir)/include/
AM_CFLAGS = -fno-strict-aliasing
lib_LTLIBRARIES = liblttng-ust-python-agent.la
liblttng_ust_python_agent_la_SOURCES = lttng_ust_python.c lttng_ust_python.h
liblttng_ust_python_agent_la_LIBADD = -lc -llttng-ust \
-L$(top_builddir)/liblttng-ust/.libs

# Use setup.py for the installation instead of Autoconf.
# This ease the installation process and assure a *pythonic*
# installation.
agent_path=lttngust
all-local:
$(PYTHON) setup.py build --verbose

install-exec-local:
@opts="--prefix=$(prefix) --verbose --no-compile $(DISTSETUPOPTS)"; \
if [ "$(DESTDIR)" != "" ]; then \
opts="$$opts --root=$(DESTDIR)"; \
fi; \
$(PYTHON) setup.py install $$opts;

clean-local:
rm -rf build

uninstall-local:
rm -rf $(DESTDIR)$(pkgpythondir)

EXTRA_DIST=$(agent_path)

# Remove automake generated file before dist
dist-hook:
rm -rf $(distdir)/$(agent_path)/__init__.py
25 changes: 25 additions & 0 deletions python-lttngust/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use setup.py for the installation instead of Autoconf.
# This ease the installation process and assure a *pythonic*
# installation.
agent_path=lttngust
all-local:
$(PYTHON) setup.py build --verbose

install-exec-local:
@opts="--prefix=$(prefix) --verbose --no-compile $(DISTSETUPOPTS)"; \
if [ "$(DESTDIR)" != "" ]; then \
opts="$$opts --root=$(DESTDIR)"; \
fi; \
$(PYTHON) setup.py install $$opts;

clean-local:
rm -rf build

uninstall-local:
rm -rf $(DESTDIR)$(pkgpythondir)

EXTRA_DIST=$(agent_path)

# Remove automake generated file before dist
dist-hook:
rm -rf $(distdir)/$(agent_path)/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,20 @@

from distutils.core import setup, Extension


setup(name='lttngust',
version='@PACKAGE_VERSION@',
description='Lttng ust agent',
description='LTTng-UST Python agent',
packages=['lttngust'],
package_dir={'lttngust': 'lttngust'},
options={'build': {'build_base': 'build'}})
options={'build': {'build_base': 'build'}},
url='http://lttng.org',
license='LGPL-2.1',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3'
'Topic :: System :: Logging',
])