~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to config/pandora-plugin

Fixed the out-of-tree plugin file generation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
VERSION=$(PANDORA_RELEASE_VERSION)
133
133
 
134
134
pkgplugindir=$(libdir)/drizzle/plugin
135
 
EXTRA_DIST = %(rel_path)s/plugin.ini
 
135
EXTRA_DIST = plugin.ini
136
136
 
137
137
""" % plugin)
138
138
  if plugin['headers'] != "":
139
139
    plugin_file.write("noinst_HEADERS = %(headers)s\n" % plugin)
140
140
  if plugin['testsuite']:
141
141
    if plugin.has_key('testsuitedir') and plugin['testsuitedir'] != "":
142
 
      plugin_file.write("EXTRA_DIST += %(rel_path)s/%(testsuitedir)s\n" % plugin)
 
142
      plugin_file.write("EXTRA_DIST += %(testsuitedir)s\n" % plugin)
143
143
  plugin_file.write("""
144
144
pkgplugin_LTLIBRARIES=lib%(name)s_plugin.la
145
145
lib%(name)s_plugin_la_LDFLAGS=-module -avoid-version -rpath $(pkgplugindir) $(AM_LDFLAGS) %(ldflags)s $(GCOV_LIBS)
249
249
 
250
250
def expand_plugin_ini(plugin, plugin_dir):
251
251
    if plugin_dir == ".":
 
252
      plugin['rel_path']= plugin_dir
252
253
      plugin['unconditional']=True
253
254
    else:
 
255
      plugin['rel_path']= plugin_dir[len(top_srcdir)+len(os.path.sep):]
254
256
      plugin['unconditional']=False
255
 
    plugin['rel_path']= plugin_dir[len(top_srcdir)+len(os.path.sep):]
256
257
    # TODO: determine path to plugin dir relative to top_srcdir... append it to
257
258
    # source files if they don't already have it
258
259
    if plugin['sources'] == "":
259
260
      plugin['sources']="%s.cc" % plugin['name']
260
261
    new_sources=""
261
 
    for src in plugin['sources'].split():
262
 
      if not src.startswith(plugin['rel_path']):
263
 
        src= os.path.join(plugin['rel_path'], src)
264
 
        new_sources= "%s %s" % (new_sources, src)
265
 
    if new_sources != "":
266
 
      plugin['sources']= new_sources
 
262
    if plugin_dir != ".":
 
263
      for src in plugin['sources'].split():
 
264
        if not src.startswith(plugin['rel_path']):
 
265
          src= os.path.join(plugin['rel_path'], src)
 
266
          new_sources= "%s %s" % (new_sources, src)
 
267
      if new_sources != "":
 
268
        plugin['sources']= new_sources
267
269
    plugin['main_source']= plugin['sources'].split()[0]
268
270
    
269
 
    new_headers=""
270
 
    for header in plugin['headers'].split():
271
 
      if not header.startswith(plugin['rel_path']):
272
 
        header= os.path.join(plugin['rel_path'], header)
273
 
        new_headers= "%s %s" % (new_headers, header)
274
 
    plugin['headers']= new_headers
 
271
    if plugin_dir != ".":
 
272
      new_headers=""
 
273
      for header in plugin['headers'].split():
 
274
        if not header.startswith(plugin['rel_path']):
 
275
          header= os.path.join(plugin['rel_path'], header)
 
276
          new_headers= "%s %s" % (new_headers, header)
 
277
      plugin['headers']= new_headers
275
278
    
276
279
    # Make a yes/no version for autoconf help messages
277
280
    if plugin['load_by_default']:
457
460
if os.path.exists('plugin.ini'):
458
461
  # Are we in a plugin dir which wants to have a self-sufficient build system?
459
462
  plugin_list=['.']
 
463
 
460
464
  write_external_plugin()
461
465
else:
462
466
  plugin_list_file = ChangeProtectedFile(os.path.join('config', 'pandora-plugin.list'))