gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

install_name for libraries and frameworks on OS X


From: Blake Nicholson
Subject: install_name for libraries and frameworks on OS X
Date: Mon, 12 May 2008 14:17:15 -0400

I plan to apply the following patch to gnustep-make, but would like to see if anyone has any feedback against doing so first. The purpose of this patch is to set the install_name on Mac OS X to an absolute (rather than relative) path for libraries and frameworks. My reason for doing this is that with the current gnustep-make, if you use a file system layout other than apple on OS X, you will not be able to launch applications from the Dock.

I see 3 different possible solutions to this problem (my suggested patch is option 3):

1) Require any user on OS X to use the apple filesystem layout, and no longer set DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH in GNUstep.sh (neither one is necessary as all libraries and frameworks are put in locations that are already searched when a filesystem of 'apple' is used). For more info on why the apple filesystem layout works without setting the DYLD environment variables, see:

http://developer.apple.com/documentation/DeveloperTools/Conceptual/DynamicLibraries/Articles/DynamicLibraryUsageGuidelines.html#/ /apple_ref/doc/uid/TP40001928-SW12
[http://tinyurl.com/anr4m]

and also

http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Tasks/InstallingFrameworks.html#/ /apple_ref/doc/uid/20002261-97184-TPXREF101
[http://tinyurl.com/eogrc]

2) Allow users of OS X to use any filesystem layout, but gnustep-make needs to create a ~/.MacOSX/environment.plist file to contain the same environment settings as are set by GNUstep.sh. The environment.plist file is necessary so applications launched from the Dock will have the same environment (including DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH) as applications launched from Terminal.

3) Apply my patch so that the install_name for libraries and frameworks is absolute, rather than relative. This is by far the most common way it is done on OS X 10.4 and 10.5 (I'm not sure about earlier versions of the OS). In fact, I do not know of any public libraries or frameworks that do it any other way.

Note that my patch does not prevent the use of GNUSTEP_INSTALLATION_DOMAIN. The person building the library or framework can still specify the domain and the install_name will be set appropriately.

Please let me know if you see any problems with my patch or if you recommend any adjustments to it. I am far from a gnustep-make master, and appreciate any suggestions others may have.


Thanks,
Blake


Index: Instance/library.make
===================================================================
--- Instance/library.make       (revision 26514)
+++ Instance/library.make       (working copy)
@@ -236,9 +236,15 @@
 LIB_LINK_VERSION_FILE = $(VERSION_LIBRARY_FILE)
 LIB_LINK_SONAME_FILE = $(SONAME_LIBRARY_FILE)
 LIB_LINK_FILE = $(LIBRARY_FILE)
-LIB_LINK_INSTALL_NAME = $(SONAME_LIBRARY_FILE)
 LIB_LINK_INSTALL_DIR = $(FINAL_LIBRARY_INSTALL_DIR)

+ifeq ($(findstring darwin, $(GNUSTEP_TARGET_OS)), darwin)
+  # On Mac OS X, set install_name to the absolute path to the library
+ LIB_LINK_INSTALL_NAME = $(LIB_LINK_INSTALL_DIR)/$ (SONAME_LIBRARY_FILE)
+else
+  LIB_LINK_INSTALL_NAME = $(SONAME_LIBRARY_FILE)
+endif
+
 #
 # Internal targets
 #
Index: Instance/framework.make
===================================================================
--- Instance/framework.make     (revision 26514)
+++ Instance/framework.make     (working copy)
@@ -307,8 +307,13 @@
 ifneq ($(DYLIB_INSTALL_NAME_BASE),)
LIB_LINK_INSTALL_NAME = $(DYLIB_INSTALL_NAME_BASE)/$ (FRAMEWORK_FILE_NAME)
 else
-  # Use a relative path for easy relocation.
- LIB_LINK_INSTALL_NAME = $(GNUSTEP_INSTANCE).framework/$ (GNUSTEP_INSTANCE)
+  ifeq ($(findstring darwin, $(GNUSTEP_TARGET_OS)), darwin)
+ # On Mac OS X, set install_name to the absolute path to the framework
+    LIB_LINK_INSTALL_NAME = $(LIB_LINK_INSTALL_DIR)/$(GNUSTEP_INSTANCE)
+  else
+    # Use a relative path for easy relocation.
+ LIB_LINK_INSTALL_NAME = $(GNUSTEP_INSTANCE).framework/$ (GNUSTEP_INSTANCE)
+  endif
 endif







reply via email to

[Prev in Thread] Current Thread [Next in Thread]