apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject svn commit: r748890 - in /apr/apr/branches/1.4.x: ./ build/jlibtool.c
Date Sat, 28 Feb 2009 17:28:33 GMT
Author: jerenkrantz
Date: Sat Feb 28 17:28:33 2009
New Revision: 748890

URL: http://svn.apache.org/viewvc?rev=748890&view=rev
Log:
Merge r748888 from trunk.

Modified:
    apr/apr/branches/1.4.x/   (props changed)
    apr/apr/branches/1.4.x/build/jlibtool.c

Propchange: apr/apr/branches/1.4.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Feb 28 17:28:33 2009
@@ -1 +1 @@
-/apr/apr/trunk:733052
+/apr/apr/trunk:733052,748888

Modified: apr/apr/branches/1.4.x/build/jlibtool.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/build/jlibtool.c?rev=748890&r1=748889&r2=748890&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/build/jlibtool.c (original)
+++ apr/apr/branches/1.4.x/build/jlibtool.c Sat Feb 28 17:28:33 2009
@@ -64,7 +64,7 @@
 #  define RANLIB "ranlib"
 #  define PIC_FLAG "-fPIC -fno-common"
 #  define SHARED_OPTS "-dynamiclib"
-#  define MODULE_OPTS "-bundle"
+#  define MODULE_OPTS "-bundle -dynamic"
 #  define DYNAMIC_LINK_OPTS "-flat_namespace"
 #  define DYNAMIC_LINK_UNDEFINED "-undefined suppress"
 #  define dynamic_link_version_func darwin_dynamic_link_function
@@ -697,6 +697,44 @@
 #endif
 }
 
+/* returns just a file's name without the path */
+const char *jlibtool_basename(const char *fullpath)
+{
+    const char *name = strrchr(fullpath, '/');
+
+    if (name == NULL) {
+        name = strrchr(fullpath, '\\');
+    }
+
+    if (name == NULL) {
+        name = fullpath;
+    } else {
+        name++;
+    }
+
+    return name;
+}
+
+/* returns just a file's name without path or extension */
+const char *nameof(const char *fullpath)
+{
+    const char *name;
+    const char *ext;
+
+    name = jlibtool_basename(fullpath);
+    ext = strrchr(name, '.');
+
+    if (ext) {
+        char *trimmed;
+        trimmed = malloc(ext - name + 1);
+        strncpy(trimmed, name, ext - name);
+        trimmed[ext-name] = 0;
+        return trimmed;
+    }
+
+    return name;
+}
+
 /* version_info is in the form of MAJOR:MINOR:PATCH */
 const char *darwin_dynamic_link_function(const char *version_info)
 {
@@ -749,14 +787,19 @@
 {
     char *newarg, *newext;
 
-    newarg = (char *)malloc(strlen(name) + 10);
+    newarg = (char *)malloc(strlen(name) + 11);
     strcpy(newarg, ".libs/");
 
     if (genlib == 2 && strncmp(name, "lib", 3) == 0) {
         name += 3;
     }
 
-    strcat(newarg, name);
+    if (genlib == 2) {
+        strcat(newarg, jlibtool_basename(name));
+    }
+    else {
+        strcat(newarg, name);
+    }
 
     newext = strrchr(newarg, '.') + 1;
 
@@ -1138,44 +1181,6 @@
 #endif
 }
 
-/* returns just a file's name without the path */
-const char *jlibtool_basename(const char *fullpath)
-{
-    const char *name = strrchr(fullpath, '/');
-
-    if (name == NULL) {
-        name = strrchr(fullpath, '\\');
-    }
-
-    if (name == NULL) {
-        name = fullpath;
-    } else {
-        name++;
-    }
-
-    return name;
-}
-
-/* returns just a file's name without path or extension */
-const char *nameof(const char *fullpath)
-{
-    const char *name;
-    const char *ext;
-
-    name = jlibtool_basename(fullpath);
-    ext = strrchr(name, '.');
-
-    if (ext) {
-        char *trimmed;
-        trimmed = malloc(ext - name + 1);
-        strncpy(trimmed, name, ext - name);
-        trimmed[ext-name] = 0;
-        return trimmed;
-    }
-
-    return name;
-}
-
 int explode_static_lib(command_t *cmd_data, const char *lib)
 {
     count_chars tmpdir_cc, libname_cc;
@@ -1528,6 +1533,10 @@
                     /* Aha, we should try to link both! */
                     cmd_data->install_path = argv[++a];
                     argused = 1;
+                } else if (strcmp(arg+1, "release") == 0) {
+                    /* Store for later deciphering */
+                    cmd_data->version_info = argv[++a];
+                    argused = 1;
                 } else if (strcmp(arg+1, "version-info") == 0) {
                     /* Store for later deciphering */
                     cmd_data->version_info = argv[++a];
@@ -1894,7 +1903,11 @@
             clear_count_chars(cmd_data->program_opts);
 
             append_count_chars(cmd_data->program_opts, cmd_data->arglist);
-            if (cmd_data->output != otModule) {
+            if (cmd_data->output == otModule) {
+#ifdef MODULE_OPTS
+                push_count_chars(cmd_data->program_opts, MODULE_OPTS);
+#endif
+            } else {
 #ifdef SHARED_OPTS
                 push_count_chars(cmd_data->program_opts, SHARED_OPTS);
 #endif
@@ -1903,11 +1916,6 @@
                              dynamic_link_version_func(cmd_data->version_info));
 #endif
             }
-            if (cmd_data->output == otModule) {
-#ifdef MODULE_OPTS
-                push_count_chars(cmd_data->program_opts, MODULE_OPTS);
-#endif
-            }
             add_dynamic_link_opts(cmd_data, cmd_data->program_opts);
 
             rv = run_command(cmd_data, cmd_data->shared_opts.normal);



Mime
View raw message