diff --git a/Makefile b/Makefile index 573c44c33..56d491077 100644 --- a/Makefile +++ b/Makefile @@ -58,8 +58,15 @@ else endif ifeq ($(OSNAME), Darwin) - @echo "Because absolute path issue, $(LIBDYNNAME) may not work under this directory." - @echo "Thus, you need run \"make PREFIX=/your_installation_path/ install\"." + @echo "WARNING: If you plan to use the dynamic library $(LIBDYNNAME), you must run:" + @echo + @echo "\"make PREFIX=/your_installation_path/ install\"." + @echo + @echo "(or set PREFIX in Makefile.rule and run make install." + @echo "If you want to move the .dylib to a new location later, make sure you change" + @echo "the internal name of the dylib with:" + @echo + @echo "install_name_tool -id /new/absolute/path/to/$(LIBDYNNAME) $(LIBDYNNAME)" endif @echo @echo "To install the library, you can run \"make PREFIX=/path/to/your/installation install\"." diff --git a/Makefile.install b/Makefile.install index 1fbb2c430..5b5895c1c 100644 --- a/Makefile.install +++ b/Makefile.install @@ -48,9 +48,9 @@ ifeq ($(OSNAME), NetBSD) -cp $(LIBSONAME) $(PREFIX) -ln -fs $(PREFIX)/$(LIBSONAME) $(PREFIX)/libopenblas.so endif -ifeq ($(OSNAME), Darwin) +ifeq ($(OSNAME), Darwin) -cp $(LIBDYNNAME) $(PREFIX) - -install_name_tool -add_rpath $(PREFIX)/$(LIBDYNNAME) $(PREFIX)/$(LIBDYNNAME) + -install_name_tool -id $(PREFIX)/$(LIBDYNNAME) $(PREFIX)/$(LIBDYNNAME) -ln -fs $(PREFIX)/$(LIBDYNNAME) $(PREFIX)/libopenblas.dylib endif ifeq ($(OSNAME), WINNT) diff --git a/exports/Makefile b/exports/Makefile index 0a2f3184f..08f496501 100644 --- a/exports/Makefile +++ b/exports/Makefile @@ -85,7 +85,7 @@ libgoto_hpl.def : gensymbol perl ./gensymbol win2khpl $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) > $(@F) $(LIBDYNNAME) : ../$(LIBNAME) osx.def - $(CC) $(CFLAGS) -all_load -headerpad_max_install_names -install_name `pwd`/../$(LIBDYNNAME) -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB) + $(CC) $(CFLAGS) -all_load -headerpad_max_install_names -install_name $(CURDIR)/../$(LIBDYNNAME) -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB) symbol.$(SUFFIX) : symbol.S $(CC) $(CFLAGS) -c -o $(@F) $^