Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpdecimal: Use absolute path in install names #23767

Merged
merged 1 commit into from
May 1, 2024

Conversation

ryandesign
Copy link
Contributor

Description

Closes: https://trac.macports.org/ticket/69870

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 12.7.4 21H1123 x86_64
Xcode 14.2 14C18

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL in commit message?
  • checked your Portfile with port lint --nitpick?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?
  • checked that the Portfile's most important variants haven't been broken?

@macportsbot
Copy link

Notifying maintainers:
@Schamschula for port mpdecimal.

@macportsbot macportsbot added maintainer: open Affects an openmaintainer port by: member Created by a member with commit rights labels Apr 30, 2024
@Schamschula
Copy link
Contributor

For unknown reasons, "due to too many changes"? seriously?, GitHub won't let me merge this.

@ryandesign ryandesign merged commit 7179002 into macports:master May 1, 2024
4 checks passed
@ryandesign ryandesign deleted the mpdecimal branch May 1, 2024 03:29
@skrah
Copy link

skrah commented May 3, 2024

I would like to merge this into mpdecimal upstream. Are the libdir changes in libmpdec/Makefile and libmpdec++/Makefile necessary? libdir is unconditionally set to the configure value.

If at all possible, I'd like to keep libdir only in the top level Makefile, but perhaps I'm overlooking something here.

@ryandesign
Copy link
Contributor Author

Are the libdir changes in libmpdec/Makefile and libmpdec++/Makefile necessary?

Yes.

libdir is unconditionally set to the configure value.

My changes set CONFIGURE_LDFLAGS to include -install_name \$(libdir)/$LIBSONAME:

+ CONFIGURE_LDFLAGS="-dynamiclib $FPIC -install_name \$(libdir)/$LIBSONAME -compatibility_version 4.0 -current_version 4.0.0"

The means the value that ends up in libmpdec/Makefile is -install_name $(libdir)/libmpdec.4.dylib. libdir needs to be defined in that Makefile for that to work. A configure script's default value for libdir is ${exec_prefix}/lib so exec_prefix needs to be defined in that Makefile too. The default value for exec_prefix is ${prefix} so prefix needs to be defined in the Makefile too.

I could change the configure script to use -install_name $libdir/$LIBSONAME so that the configure script's value of $libdir would be used, but what ends up in the libmpdec/Makefile then is -install_name ${exec_prefix}/lib/libmpdec.4.dylib which still won't work unless exec_prefix and prefix are defined in libmpdec/Makefile.

If you used automake and libtool the intricacies of library creation would be handled for you…

@skrah
Copy link

skrah commented May 4, 2024

Yes, there does not seem to be a way to reliably and fully expand libdir in configure itself. So I'll have to do it the GNU way.

Automake and libtool have their own issues. Libtool (I think) is somewhat unmaintained and does not fully handle the library creation like I (and others) want it on AIX. It is always a tradeoff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
by: member Created by a member with commit rights maintainer: open Affects an openmaintainer port
4 participants