[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to force libtool to use CXX mode?
From: |
Bob Friesenhahn |
Subject: |
How to force libtool to use CXX mode? |
Date: |
Sun, 12 May 2024 16:01:12 -0500 |
User-agent: |
Mozilla Thunderbird |
I have expended quite a few days already (over a 6 month span) with
attempting to convince Automake to force libtool to link using the C++
compiler. I tried optionally adding an empty C++ source file to the
target build but this does not work because then Automake always assumes
C++ linkage, even if no C++ source files were included. I previously
encountered a libtool-related bug where it determines that the C
compiler needs -lm, but the C++ compiler does not, stripping the -lm and
resulting in a failed link.
Today I read this Automake manual page:
https://www.gnu.org/software/automake/manual/html_node/Libtool-Flags.html
and so I used the program_LIBTOOLFLAGS or library_LIBTOOLFLAGS to add
--tag=CXX to the options. I thought that this must be working.
I found that it is not working as desired. I end up with this bad case
for compiling C code (did not want to have the --tag=CXX!)
/bin/bash ./libtool --tag=CC --tag=CXX --mode=compile clang ...
and this command to link the C code using the C++ compiler (should be
clang++!)
/bin/bash ./libtool --tag=CC --tag=CXX --mode=link clang
Libtool misreports the tag it is using so it reports CCLD when the tag
is presumably overridden by CXX.
The end result fails.
Is there a way to solve this problem beyond replicating many modified
Makefile.in hunks into Makefile.am?
I am faced with backing out my attempt for yet another time. :-(
Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt
- How to force libtool to use CXX mode?,
Bob Friesenhahn <=