Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8130339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:40:31+00:00 2026-06-06T08:40:31+00:00

I’m working on a project in C++ where I’d wish to implement the ability

  • 0

I’m working on a project in C++ where I’d wish to implement the ability to add plugins. The compilation process is handled by Autotools. I’ve managed to set the file structure correct, and both the main project and the plugins are compiled, but for some reason the plugins are omitted when running make install. When compiling and installing the plugins separately it works fine. Am I missing something here, or why are the plugins not installed from the top folder?

configure.ac

AC_PREREQ(2.58)
AC_INIT([Net Responsibility],[3.1r323],[contact@netresponsibility.com])
AC_SUBST([LIBTOOL_DEPS])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_SUBDIRS([plugins/defaultReport])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([scripts/m4])
AC_CANONICAL_SYSTEM
AC_LANG([C++])
AC_PREFIX_PROGRAM([make])

AM_INIT_AUTOMAKE([subdir-objects])

LT_PREREQ([2.2])
LT_INIT([shared])


# Checks for programs.
AC_PROG_CXX
AC_PROG_INSTALL

# Checks for header files.
AC_HEADER_STDC


...

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

Makefile.am

# Main library
lib_LTLIBRARIES = libNetResponsibility.la
libNetResponsibility_la_SOURCES = \
      @top_srcdir@/src/MainApplication.cpp\
      ...
libNetResponsibility_la_CPPFLAGS = $(cppFlags)
libNetResponsibility_la_LDFLAGS = -no-undefined $(ldFlags)

# Minimal executable
bin_PROGRAMS = net-responsibility
net_responsibility_SOURCES = @top_srcdir@/src/main.cpp
net_responsibility_LDADD = -lNetResponsibility

dist_pkgdata_DATA = \
      $(top_srcdir)/data/txt.xml\
      $(top_srcdir)/COPYING

dist_pkgdata_SCRIPTS = $(top_srcdir)/scripts/init.d
dist_noinst_SCRIPTS = $(top_srcdir)/scripts/postinst\
      $(top_srcdir)/scripts/prerm

AM_LDFLAGS = -L/usr/local/lib -L/usr/lib
ACLOCAL_AMFLAGS = -I scripts/m4

incDirs = -I$(top_srcdir)/include

ldFlags = -L/usr/local/lib -L/usr/lib

cppFlags = $(incDirs)\
           -DPKGDATADIR='$(pkgdatadir)'\
           -DPKGLIBDIR='$(pkglibdir)'\
           -DDATABASEDIR='$(databasedir)'\
           -DPIDDIR='$(piddir)'\
           @CPPFLAGS@

AM_CXXFLAGS = $(incDirs) @CXXFLAGS@
AM_CPPFLAGS = $(cppFlags)

EXTRA_DIST = $(top_srcdir)/lib $(top_srcdir)/include

SUBDIRS = . plugins/defaultReport

install: install-am postinst

uninstall: prerm uninstall-am postrm

postinst:
    $(top_srcdir)/scripts/postinst $(pkgdatadir) $(initdir)

prerm:
    $(top_srcdir)/scripts/prerm $(pkgdatadir) $(initdir)

postrm:
    rm -f $(piddir)/net-responsibility.pid
    rm -f $(pkgdatadir)/blacklist.xml
    rm -f $(pkgdatadir)/config.xml
    rm -rf $(pkgdatadir)/reports
    rm -f $(databasedir)/net-responsibility.db
    rm -f $(initdir)/net-responsibility

.PHONY: prerm postinst postrm

plugins/defaultReport/configure.ac

AC_PREREQ(2.58)
AC_INIT([Net Responsibility Plugin: Default Report],[0.1],[contact@netresponsibility.com])
AC_SUBST([LIBTOOL_DEPS])
AC_SUBST([nrlibdir], ["${libdir}/net-responsibility"])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_SRCDIR([src/Report.cpp])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_LANG([C++])
AC_PREFIX_PROGRAM([make])

AM_INIT_AUTOMAKE([subdir-objects])

LT_PREREQ([2.2])
LT_INIT([shared])

# Checks for programs.
AC_PROG_CXX
AC_PROG_INSTALL

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

plugins/defaultReport/Makefile.am

# General settings
ACLOCAL_AMFLAGS = -I m4

ldFlags = -L/usr/local/lib -L/usr/lib

AM_CXXFLAGS = @CXXFLAGS@

# Module specific settings
nrlib_LTLIBRARIES = defaultReport.la
defaultReport_la_SOURCES = \
   src/Report.cpp
defaultReport_la_LDFLAGS = -module -no-undefined $(ldFlags)
defaultReport_la_LIBADD = -lNetResponsibility
defaultReport_la_CPPFLAGS = -I../../include @CPPFLAGS@
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T08:40:34+00:00Added an answer on June 6, 2026 at 8:40 am

    You need to setup nrlibdir a little differently:

    plugins/defaultReport/configure.ac

    Remove this line:

    AC_SUBST([nrlibdir], ["${libdir}/net-responsibility"])
    

    plugins/defaultReport/Makefile.am

    Add this line before nrlib_LTLIBRARIES:

    nrlibdir=$(libdir)/net-responsibility
    

    This should help automake get make install right.

    EDIT: I actually tried it this time. In addition to the above changes, remove the
    install and uninstall targets in Makefile.am. You should be attaching the postinst, prerm and postrm targets to some other install hooks, perhaps something like:

    install-data-hook:
            $(top_srcdir)/scripts/postinst $(pkgdatadir) $(initdir)
    
    uninstall-local:
            $(top_srcdir)/scripts/prerm $(pkgdatadir) $(initdir)
    
    uninstall-hook:
            rm -f $(piddir)/net-responsibility.pid
            rm -f $(pkgdatadir)/blacklist.xml
            rm -f $(pkgdatadir)/config.xml
            rm -rf $(pkgdatadir)/reports
            rm -f $(databasedir)/net-responsibility.db
            rm -f $(initdir)/net-responsibility
    

    Would work instead of those targets.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.