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 7876693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:12:25+00:00 2026-06-03T03:12:25+00:00

I am writing a small library and want to make it accessible using autotools

  • 0

I am writing a small library and want to make it accessible using autotools with automake 1.11. The only interesting outcome is the library libfoo.so.

I wrote a unit test for the library which I want be executed during the make process or when running make check. I don not want the unit test to appear in $PREFIX/foo/bin/.

How do I achieve these goals?

  • 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-03T03:12:25+00:00Added an answer on June 3, 2026 at 3:12 am

    As the automake manual describes, you use the "check_" prefix. Let’s say the library is built under the directory src/, and the unit tests are under tests/ – then in the tests/Makefile.am file:

    check_PROGRAMS = unit_test
    
    unit_test_SOURCES = unit_test.c
    unit_test_LDADD = $(top_builddir)/src/libfoo.la
    

    I assume you’re using libtool of course. This takes care of linking, dynamic paths, etc., if you’re building a shared library.

    You should also have a look at the use of the TESTS variable in automake.

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

Sidebar

Related Questions

I am in the process of writing a small javascript library to make form
all. I'm pretty new to C++, and I'm writing a small library (mostly for
I'm writing a small Ruby command-line application that uses fileutils from the standard library
For a while, I've been using a small collection of files I wrote making
I am writing a small library with which enums in C++ should get easier.
I'm writing a small library that takes a FILE * pointer as input. If
i'm writing a small library that writes data out to a file. some of
I'm writing a small library in C++ that I need to be able to
I'm re-writing a small C math library of mine that will end up as
I'm currently writing a small online game using c# XNA and lidgren and I

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.