]> git.saurik.com Git - wxWidgets.git/commitdiff
library installation base name and wxMac resources file base name
authorGilles Depeyrot <gilles_depeyrot@mac.com>
Thu, 9 Jan 2003 20:57:31 +0000 (20:57 +0000)
committerGilles Depeyrot <gilles_depeyrot@mac.com>
Thu, 9 Jan 2003 20:57:31 +0000 (20:57 +0000)
must be identical in order for the resource file to be found

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18647 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

configure
configure.in
src/mac/app.cpp
src/mac/carbon/app.cpp

index 539072267617878dbffb457e0243cfee30b08f7d..7fa81beee5eb54cd3ed9c9040fac5f8b81f7c157 100755 (executable)
--- a/configure
+++ b/configure
@@ -14733,7 +14733,7 @@ for ac_dir in $SEARCH_LIB /usr/lib;
         GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lwine$mesa_link$xpm_link -lXxf86dga -lXxf86vm -lSM -lICE -lXext -lXmu -lX11 -lncurses"
         TOOLKIT=MSW
         GUIDIST=MSW_DIST
-        TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXWINE__"
+        TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WINE__"
     fi
 
     if test "$wxUSE_MOTIF" = 1; then
@@ -15911,8 +15911,8 @@ case "${host}" in
         WX_LIBRARY_LINK2_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}"
 
                         if test "$wxUSE_MAC" = 1; then
-                        WX_RESOURCES_MACOSX_ASCII="lib${WX_LIBRARY}.r"
-            WX_RESOURCES_MACOSX_DATA="lib${WX_LIBRARY}.rsrc"
+                                    WX_RESOURCES_MACOSX_ASCII="lib${WX_LIBRARY}.${WX_CURRENT}.r"
+            WX_RESOURCES_MACOSX_DATA="lib${WX_LIBRARY}.${WX_CURRENT}.rsrc"
         fi
         ;;
 esac
@@ -16076,7 +16076,7 @@ echo "$ac_t""$wx_cv_prog_icc" 1>&6
         CXXFLAGS="$CXXFLAGS -fno-common"
                                         SHARED_LD="\${top_srcdir}/distrib/mac/shared-ld-sh -undefined suppress -flat_namespace -o"
         PIC_FLAG="-dynamic -fPIC"
-        SONAME_FLAGS="-compatibility_version ${WX_RELEASE} -current_version ${WX_VERSION} -install_name \$(libdir)/${WX_LIBRARY_LINK1}"
+                                SONAME_FLAGS="-compatibility_version ${WX_RELEASE} -current_version ${WX_VERSION} -install_name \$(libdir)/${WX_LIBRARY_LINK1}"
         SONAME_FLAGS_GL="-compatibility_version ${WX_RELEASE} -current_version ${WX_VERSION} -install_name \$(libdir)/${WX_LIBRARY_LINK1_GL}"
       ;;
 
index 85cf1fb72ab325c88fb78ead71696e400fc3899b..c3cff18cd4ecedd92ddcc675bf11bbd6203ef171 100644 (file)
@@ -2781,9 +2781,10 @@ case "${host}" in
         dnl Under Mac OS X, we should build real frameworks instead of simple
         dnl dynamic shared libraries (in order to embed the resources)
         if test "$wxUSE_MAC" = 1; then
-            dnl the name of the resources file for wxMac
-            WX_RESOURCES_MACOSX_ASCII="lib${WX_LIBRARY}.r"
-            WX_RESOURCES_MACOSX_DATA="lib${WX_LIBRARY}.rsrc"
+            dnl base name of the resource file for wxMac must be the same
+            dnl as library installation base name (-install_name)
+            WX_RESOURCES_MACOSX_ASCII="lib${WX_LIBRARY}.${WX_CURRENT}.r"
+            WX_RESOURCES_MACOSX_DATA="lib${WX_LIBRARY}.${WX_CURRENT}.rsrc"
         fi
         ;;
 esac
@@ -2914,6 +2915,9 @@ if test "$wxUSE_SHARED" = "yes"; then
         dnl "-init _wxWindowsDylibInit" not useful with lazy linking solved
         SHARED_LD="\${top_srcdir}/distrib/mac/shared-ld-sh -undefined suppress -flat_namespace -o"
         PIC_FLAG="-dynamic -fPIC"
+        dnl library installation base name and wxMac resources file base name
+        dnl must be identical in order for the resource file to be found at
+        dnl run time in src/mac/app.cpp
         SONAME_FLAGS="-compatibility_version ${WX_RELEASE} -current_version ${WX_VERSION} -install_name \$(libdir)/${WX_LIBRARY_LINK1}"
         SONAME_FLAGS_GL="-compatibility_version ${WX_RELEASE} -current_version ${WX_VERSION} -install_name \$(libdir)/${WX_LIBRARY_LINK1_GL}"
       ;;
index c10922c3a9e6fe1bf94c90b9c4c64ea61144755b..51980c75643f82f21767340dffb3d5923a1f1a0e 100644 (file)
@@ -790,6 +790,9 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
             theModule = NSModuleForSymbol(theSymbol);
             theLibPath = NSLibraryNameForModule(theModule);
 
+            wxLogDebug( wxT("wxMac library installation name is '%s'"),
+                        theLibPath );
+
             // allocate copy to replace .dylib.* extension with .rsrc
             theResPath = strdup(theLibPath);
             if (theResPath != NULL) {
@@ -803,7 +806,8 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
                 // overwrite extension with ".rsrc"
                 strcpy(theExt, ".rsrc");
 
-                wxLogDebug( theResPath );
+                wxLogDebug( wxT("wxMac resources file name is '%s'"),
+                            theResPath );
 
                 theErr = FSPathMakeRef((UInt8 *) theResPath, &theResRef, false);
                 if (theErr != noErr) {
@@ -811,14 +815,18 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
                     theErr = FSPathMakeRef((UInt8 *) theName, &theResRef, false);
                 }
 
-                // free duplicated resource file path
-                free(theResPath);
-
                 // open the resource file
                 if (theErr == noErr) {
                     theErr = FSOpenResourceFile( &theResRef, 0, NULL, fsRdPerm,
                                                  &gSharedLibraryResource);
                 }
+                if (theErr != noErr) {
+                    wxLogDebug( wxT("unable to open wxMac resource file '%s'"),
+                                theResPath );
+                }
+
+                // free duplicated resource file path
+                free(theResPath);
             }
         }
 #endif /* __DARWIN__ */
index c10922c3a9e6fe1bf94c90b9c4c64ea61144755b..51980c75643f82f21767340dffb3d5923a1f1a0e 100644 (file)
@@ -790,6 +790,9 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
             theModule = NSModuleForSymbol(theSymbol);
             theLibPath = NSLibraryNameForModule(theModule);
 
+            wxLogDebug( wxT("wxMac library installation name is '%s'"),
+                        theLibPath );
+
             // allocate copy to replace .dylib.* extension with .rsrc
             theResPath = strdup(theLibPath);
             if (theResPath != NULL) {
@@ -803,7 +806,8 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
                 // overwrite extension with ".rsrc"
                 strcpy(theExt, ".rsrc");
 
-                wxLogDebug( theResPath );
+                wxLogDebug( wxT("wxMac resources file name is '%s'"),
+                            theResPath );
 
                 theErr = FSPathMakeRef((UInt8 *) theResPath, &theResRef, false);
                 if (theErr != noErr) {
@@ -811,14 +815,18 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
                     theErr = FSPathMakeRef((UInt8 *) theName, &theResRef, false);
                 }
 
-                // free duplicated resource file path
-                free(theResPath);
-
                 // open the resource file
                 if (theErr == noErr) {
                     theErr = FSOpenResourceFile( &theResRef, 0, NULL, fsRdPerm,
                                                  &gSharedLibraryResource);
                 }
+                if (theErr != noErr) {
+                    wxLogDebug( wxT("unable to open wxMac resource file '%s'"),
+                                theResPath );
+                }
+
+                // free duplicated resource file path
+                free(theResPath);
             }
         }
 #endif /* __DARWIN__ */