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

[Msys2] It will always install to /usr regardless of whether PREFIX is set or not #108

Closed
ghost opened this issue Oct 4, 2023 · 8 comments

Comments

@ghost
Copy link

ghost commented Oct 4, 2023

@lcn2 For unknown reasons, it will always install to /usr regardless of whether PREFIX is set or not. Please have a look at it. Thank you.

Originally posted by @iahung2 in #105 (comment)

@lcn2
Copy link
Owner

lcn2 commented Oct 4, 2023

Please 🙏 run make debug and attach the resulting log file so we can better understand your situation and environment.

UPDATE 0

Meanwhile we will investigate more this evening.

@ghost
Copy link
Author

ghost commented Oct 4, 2023

debug.out.txt

@ghost
Copy link
Author

ghost commented Oct 4, 2023

@lcn2 Have you found anything wrong in the makefiles?

@lcn2
Copy link
Owner

lcn2 commented Oct 5, 2023

@lcn2 Have you found anything wrong in the makefiles?

We did find Makefile problems that were fixed in addressing issue #112.

In regards to where calc installs:

For non-macOS hosts, the default for installation is under /usr/bin, /usr/lib, /usr/share/calc and /usr/include/calc.

The Makefile.config contains some relevant comments:

# Where to install calc related things
#
# ${BINDIR}             where to install calc binary files
# ${LIBDIR}             where calc link library (*.a) files are installed
# ${CALC_SHAREDIR}      where to install calc help, .cal, startup, config files
# ${CALC_INCDIR}        where the calc include files are installed
#
# NOTE: The install rule prepends installation paths with ${T}, which
#       by default is empty.  If ${T} is non-empty, then installation
#       locations will be relative to the ${T} directory.
#
# NOTE: If you change LIBDIR to a non-standard location, you will need
#       to make changes to your execution environment so that executables
#       will search LIBDIR when they are resolving dynamic shared libraries.
#
#       On OS X, this means you need to export $DYLD_LIBRARY_PATH
#       to include the LIBDIR path in the value.
#
#       On Linux and BSD, this means you need to export $LD_LIBRARY_PATH
#       to include the LIBDIR path in the value.
#
#       You might be better off not changing LIBDIR in the first place.
#
# If in doubt, for non-macOS hosts set:
#
#       BINDIR= /usr/bin
#       LIBDIR= /usr/lib
#       CALC_SHAREDIR= /usr/share/calc
#       CALC_INCDIR= /usr/include/calc
#
# Or if you prefer everything under /usr/local:
#
#       BINDIR= /usr/local/bin
#       LIBDIR= /usr/local/lib
#       CALC_SHAREDIR= /usr/local/share/calc
#       CALC_INCDIR= /usr/local/include/calc
#
# However, if you are on macOS then set:
#
#       BINDIR= ${PREFIX}/bin
#       LIBDIR= ${PREFIX}/lib
#       CALC_SHAREDIR= ${PREFIX}/share/calc
#       CALC_INCDIR= ${PREFIX}/include/calc
#
#       NOTE: Starting with macOS El Capitan OS X 10.11, root by default
#             could not mkdir under system locations, so macOS must now
#             use the ${PREFIX} tree.

@lcn2
Copy link
Owner

lcn2 commented Oct 5, 2023

As we do not know when or where your source was obtained, here is how you can be sure that you can uninstall calc fro the default locations:

make uninstall BINDIR=/usr/bin LIBDIR=/usr/lib CALC_SHAREDIR=/usr/share/calc CALC_INCDIR=/usr/include/calc

Here is how you can force calc to install under /usr/local:

make clobber all install BINDIR=/usr/local/bin LIBDIR=/usr/local/lib CALC_SHAREDIR=/usr/local/share/calc CALC_INCDIR=/usr/local/include/calc

Of course, you will need the appropriate permissions on those directories to uninstall and install.

@lcn2
Copy link
Owner

lcn2 commented Oct 5, 2023

With commit b54f68a we added comments to Makefile.local about how you can force calc to install under /usr/local, regardless of the system.

In particular, if you add these lines to Makefile.local (or uncomment the recently added lines):

BINDIR:= /usr/local/bin
LIBDIR:= /usr/local/lib
CALC_SHAREDIR:= /usr/local/share/calc
CALC_INCDIR:= /usr/local/include/calc

You will get what you want "by default" without having to add the above mentioned 4 args to your make commands.

@lcn2
Copy link
Owner

lcn2 commented Oct 5, 2023

So alas, this is not a bug, but a feature as they say.

We hope the above will help.

As an added bonus. we have added a TODO for calc version 3 to "improve how someone can control where calc installs things". See the TODO list in issue #103.

We will now close this issue, but feel free to add comments or questions to this issue if you are still having problems with where calc installs things.

@lcn2 lcn2 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2023
@lcn2
Copy link
Owner

lcn2 commented Oct 5, 2023

See also comment discussion #105 7197014.

Sorry, @iahung2 for the confusion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant