aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt6
-rw-r--r--src/compat.c9
-rw-r--r--src/environment.c2
3 files changed, 14 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8a0a69a..b9dc7f7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -4,7 +4,11 @@ include_directories(
)
add_executable(spm spm.c config.c compat.c deps.c fs.c rpath.c find.c shell.c archive.c str.c relocation.c install.c config_global.c manifest.c checksum.c extern/url.c version_spec.c spm_build.c mime.c internal_cmd.c environment.c mirrors.c strlist.c shlib.c)
-target_link_libraries(spm rt crypto ssl curl)
+
+target_link_libraries(spm crypto ssl curl)
+if (LINUX)
+ target_link_libraries(spm rt)
+endif()
if(MSVC)
target_compile_options(spm PRIVATE /W4 /WX)
diff --git a/src/compat.c b/src/compat.c
index 062c939..5fd2cc4 100644
--- a/src/compat.c
+++ b/src/compat.c
@@ -13,4 +13,11 @@ char *strsep(char **sp, char *sep)
*sp = p;
return(s);
}
-#endif \ No newline at end of file
+#endif
+
+#ifndef HAVE_REALLOCARRAY
+#include <stdlib.h>
+void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) {
+ return realloc(__ptr, __nmemb * __size);
+}
+#endif
diff --git a/src/environment.c b/src/environment.c
index b56b8de..f8d4fdb 100644
--- a/src/environment.c
+++ b/src/environment.c
@@ -395,4 +395,4 @@ void runtime_free(RuntimeEnv *env) {
return;
}
strlist_free(env);
-} \ No newline at end of file
+}