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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:35:46+00:00 2026-06-12T04:35:46+00:00

In my project that uses autoconf and automake, I have two executables, say foo

  • 0

In my project that uses autoconf and automake, I have two executables, say “foo” and “bar”. Suppose “foo.c” looks like

int main()
{
    exec ("bar");
    return 0;
}

I.e., “foo” uses “bar”. This works fine once I do./configure && make && make install. However, the autoconf provides an option to transform program names. For example, I could do ./configure --program-suffix=-2.0. Then “foo” and “bar” will be installed instead as

/usr/bin/foo-2.0
/usr/bin/bar-2.0

In that case, the reference to “bar” inside “foo” would be incorrect, because there will be no bar in the system (should be bar-2.0). Is there any way I can let autoconf/automake adjust this reference automatically?

  • 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-12T04:35:47+00:00Added an answer on June 12, 2026 at 4:35 am

    In your Makefile you may run the $(program_transform_name) sed script to create a header file with the final names.

    For instance, assuming your program names are foo and bar, create a names.h.in file containing:

    #define FOO_NAME "@foo-name@"
    #define BAR_NAME "@bar-name@"
    

    Then equip your Makefile.am to have rules to generate names.h from names.h.in:

    BUILT_SOURCES = names.h
    EXTRA_DIST = names.h.in
    
    edit = sed \
      -e 's/@foo-name@/'`echo foo | sed '$(program_transform_name)'`'/g;' \
      -e 's/@bar-name@/'`echo bar | sed '$(program_transform_name)'`'/g;'
    
    names.h: $(srcdir)/names.h.in Makefile
            $(edit) < $(srcdir)/names.h.in > $@
    

    and finally include names.h and use FOO_NAME and BAR_NAME in your source code.

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

Sidebar

Related Questions

I have a project that uses two third party libraries, both of which make
I have a project that uses two independent Android libraries. Each of them contains
I am making a project that uses Autoconf. I have the following in configure.ac
I have a newbie Linux programming question. Suppose I have a project that uses
Say you have a project that uses maven and a subversion repository. It consists
I've got a Subversion project that uses Gnu Autotools (i.e., automake, autoconf, and libtool)
I have a MVC project that uses foo.dll, but that foo.dll uses smu.dll so
I have a project that uses the serial port, and it requires two files
I have a Silverlight project that uses MVVM with Prism. I followed http://www.telerik.com/help/silverlight/patterns-and-practices-eventtocommand-prism.html I
I have a java project that uses JPA 2/Hibernate 3.5.6 for data access and

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.