diff --git a/Makefile.am b/Makefile.am index 4b5a5fd..581fe1e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,32 +27,21 @@ SUBDIRS = po # directories definition sharedir = $(pkgdatadir) -pycdir = $(sharedir)/policies -moddir = $(sharedir)/modules +policiesdir = $(sharedir)/policies +plugindir = $(sharedir)/plugins +moduledir = $(plugindir)/extras localedir = @datadir@/locale testsdir = $(pkgdatadir)/tests #define empty global variables bin_PROGRAMS = -mod_LTLIBRARIES = -mod_PYTHON = +plugin_LTLIBRARIES = noinst_HEADERS = pkglib_LTLIBRARIES = EXTRA_DIST = MAINTAINERCLEANFILES = MOSTLYCLEANFILES = -# ############################################################ -# -# additional rules -# -# ############################################################ - -# swig implementation wrapper files generation for Python: -%_wrap.cc : %.i - test -d "$(@D)" || mkdir -p -- "$(@D)" - $(SWIG) $(SWIG_PYTHON_OPT) -o $@ $< - # ############################################################ # # extra dist, cleanup and automake/aclocal flags @@ -127,8 +116,9 @@ pkglib_LTLIBRARIES += src/backend/libbackend.la src_backend_libbackend_la_CPPFLAGS = \ -I@top_srcdir@ \ - -DPYCDIR="\"$(pycdir)\"" \ - -DMODDIR="\"$(moddir)\"" \ + -DPOLDIR="\"$(policiesdir)\"" \ + -DPLUGDIR="\"$(plugindir)\"" \ + -DMODDIR="\"$(moduledir)\"" \ -DLOCALEDIR="\"$(localedir)\"" \ $(PYTHON_CPPFLAGS) \ $(GLIBMM_CFLAGS) @@ -184,8 +174,8 @@ bin_PROGRAMS += sgpemv2 sgpemv2_CPPFLAGS = \ -I@top_srcdir@ \ - -DPYCDIR="\"$(pycdir)\"" \ - -DMODDIR="\"$(moddir)\"" \ + -DPLUGDIR="\"$(plugindir)\"" \ + -DMODDIR="\"$(moduledir)\"" \ -DLOCALEDIR="\"$(localedir)\"" \ $(CAIRO_CFLAGS) \ $(GTKMM_CFLAGS) \ @@ -230,12 +220,14 @@ noinst_HEADERS += \ # # ############################################################ -mod_LTLIBRARIES += src/backend/pyloader/libpyloader.la +pyloaderdir = $(moduledir)/pyloader + +plugin_LTLIBRARIES += src/backend/pyloader/libpyloader.la src_backend_pyloader_libpyloader_la_CPPFLAGS = \ -I@top_srcdir@ \ - -DPYCDIR="\"$(pycdir)\"" \ - -DMODDIR="\"$(moddir)\"" \ + -DPOLDIR="\"$(policiesdir)\"" \ + -DMODDIR="\"$(pyloaderdir)\"" \ -DLOCALEDIR="\"$(localedir)\"" \ $(PYTHON_CPPFLAGS) \ $(GLIBMM_CFLAGS) @@ -262,7 +254,7 @@ noinst_HEADERS += \ src/backend/pyloader/python_policy.hh \ src/backend/pyloader/python_policy_manager.hh -mod_PYTHON += \ +pyloader_PYTHON = \ src/backend/pyloader/Abstract.py \ src/backend/pyloader/Policy.py \ src/backend/pyloader/ScriptAdapter.py @@ -276,11 +268,13 @@ mod_PYTHON += \ proxies = src/backend/pyloader/sgpem.py wrappers = src/backend/pyloader/sgpem_wrap.cc -mod_LTLIBRARIES += _sgpem.la -mod_PYTHON += $(proxies) +pyloader_LTLIBRARIES = _sgpem.la +pyloader_PYTHON += $(proxies) # static pattern rule -$(proxies): %.py : %.i +$(proxies) $(wrappers) : src/backend/pyloader/sgpem.i + test -d "$(@D)" || mkdir -p -- "$(@D)" + $(SWIG) $(SWIG_PYTHON_OPT) -o $@ $< _sgpem_la_INTERFACES = src/backend/pyloader/sgpem.i @@ -318,7 +312,7 @@ noinst_HEADERS += \ # ############################################################ # built-in policies -pyc_PYTHON = \ +policies_PYTHON = \ src/builtin-policies/fcfs.py \ src/builtin-policies/sjf.py @@ -334,8 +328,8 @@ tests_PROGRAMS = src/testsuite/test-python_loader src_testsuite_test_python_loader_CPPFLAGS = \ -I@top_srcdir@/src \ - -DPYCDIR="\"$(pycdir)\"" \ - -DMODDIR="\"$(moddir)\"" \ + -DPOLDIR="\"$(policiesdir)\"" \ + -DMODDIR="\"$(pyloaderdir)\"" \ $(PYTHON_CPPFLAGS) \ $(GLIBMM_CFLAGS) \ $(GTHREAD_CFLAGS) diff --git a/src/backend/pyloader/python_policy_manager.cc b/src/backend/pyloader/python_policy_manager.cc index d4091cf..4be5d0a 100644 --- a/src/backend/pyloader/python_policy_manager.cc +++ b/src/backend/pyloader/python_policy_manager.cc @@ -71,7 +71,7 @@ PythonPolicyManager::init() // FIXME: find better way to achieve this. PyRun_SimpleString("import sys\n" - "sys.path[:0] = [ '" MODDIR "', '" PYCDIR "' ]\n"); + "sys.path[:0] = [ '" MODDIR "', '" POLDIR "' ]\n"); // Okay, here we go. // Black magic at work. diff --git a/src/main.cc b/src/main.cc index 56920d0..1c5beb7 100644 --- a/src/main.cc +++ b/src/main.cc @@ -64,7 +64,7 @@ main(int argc, char* argv[]) // appropriate PluginManager class in the backend, // and the Makefile fixed accordingly using Glib::Module; - std::string pyloader_path = Module::build_path(MODDIR, "pyloader"); + std::string pyloader_path = Module::build_path(PLUGDIR, "pyloader"); Module pyloader(pyloader_path); std::cerr << Module::get_last_error() << std::endl; assert(pyloader);