summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2001-04-29 07:19:40 +0000
committerbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2001-04-29 07:19:40 +0000
commitdfe3bdcc529451b1ba7f87881c0c844462f6378b (patch)
tree02a292be9816bcaea698e52049d45ea211ee2ca3 /build
parentb29953c201bf6d1c385b6f771916bdce75d0292e (diff)
downloadlibapr-dfe3bdcc529451b1ba7f87881c0c844462f6378b.tar.gz
Make --mode=install work for OS/2 DLLs.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61561 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build')
-rw-r--r--build/aplibtool.c54
1 files changed, 39 insertions, 15 deletions
diff --git a/build/aplibtool.c b/build/aplibtool.c
index a549294c7..8436b8b8f 100644
--- a/build/aplibtool.c
+++ b/build/aplibtool.c
@@ -119,6 +119,7 @@ char *shell_esc(const char *str);
void cleanup_tmp_dirs(cmd_data_t *cmd_data);
void generate_def_file(cmd_data_t *cmd_data);
char *nameof(char *fullpath);
+char *truncate_dll_name(char *path);
int main(int argc, char *argv[])
@@ -290,7 +291,14 @@ bool parse_input_file_name(char *arg, cmd_data_t *cmd_data)
strcat(newarg, name);
ext = strrchr(newarg, '.') + 1;
- strcpy(ext, STATIC_LIB_EXT);
+
+ if (shared && cmd_data->mode == mInstall) {
+ strcpy(ext, DYNAMIC_LIB_EXT);
+ newarg = truncate_dll_name(newarg);
+ } else {
+ strcpy(ext, STATIC_LIB_EXT);
+ }
+
cmd_data->arglist[cmd_data->num_args++] = newarg;
return true;
}
@@ -361,25 +369,14 @@ bool parse_output_file_name(char *arg, cmd_data_t *cmd_data)
strcat(newarg, arg);
newext = strrchr(newarg, '.') + 1;
strcpy(newext, shared ? DYNAMIC_LIB_EXT : STATIC_LIB_EXT);
- cmd_data->arglist[cmd_data->num_args++] = newarg;
#ifdef TRUNCATE_DLL_NAME
if (shared) {
- /* Cut DLL name down to 8 characters after removing any mod_ prefix */
- int len = ext - name - 1;
- char *newname = strrchr(newarg, '/') + 1;
-
- if (strncmp(newname, "mod_", 4) == 0) {
- strcpy(newname, newname + 4);
- len -= 4;
- }
-
- if (len > 8) {
- strcpy(newname + 8, strchr(newname, '.'));
- }
+ newarg = truncate_dll_name(newarg);
}
#endif
+ cmd_data->arglist[cmd_data->num_args++] = newarg;
cmd_data->output_name = newarg;
return true;
}
@@ -487,7 +484,7 @@ void post_parse_fixup(cmd_data_t *cmd_data)
}
#endif
- if (shared) {
+ if (shared && (cmd_data->output_type == otObject || cmd_data->output_type == otDynamicLibrary)) {
cmd_data->arglist[cmd_data->num_args++] = SHARE_SW;
}
}
@@ -740,3 +737,30 @@ char *nameof(char *fullpath)
return name;
}
+
+
+
+char *truncate_dll_name(char *path)
+{
+ /* Cut DLL name down to 8 characters after removing any mod_ prefix */
+ char *tmppath = strdup(path);
+ char *newname = strrchr(tmppath, '/') + 1;
+ char *ext = strrchr(tmppath, '.');
+ int len;
+
+ if (ext == NULL)
+ return tmppath;
+
+ len = ext - newname;
+
+ if (strncmp(newname, "mod_", 4) == 0) {
+ strcpy(newname, newname + 4);
+ len -= 4;
+ }
+
+ if (len > 8) {
+ strcpy(newname + 8, strchr(newname, '.'));
+ }
+
+ return tmppath;
+}