summaryrefslogtreecommitdiff
path: root/libcrypt
diff options
context:
space:
mode:
Diffstat (limited to 'libcrypt')
-rw-r--r--libcrypt/Makefile.in11
-rw-r--r--libcrypt/crypt_stub.c30
2 files changed, 40 insertions, 1 deletions
diff --git a/libcrypt/Makefile.in b/libcrypt/Makefile.in
index 40a73d1c8..d93e6abab 100644
--- a/libcrypt/Makefile.in
+++ b/libcrypt/Makefile.in
@@ -16,7 +16,14 @@ libcrypt_FULL_NAME := libcrypt-$(VERSION).so
libcrypt_DIR := $(top_srcdir)libcrypt
libcrypt_OUT := $(top_builddir)libcrypt
-libcrypt_SRC := $(wildcard $(libcrypt_DIR)/*.c)
+ifeq ($(UCLIBC_HAS_CRYPT_IMPL),y)
+CSRC := crypt.c des.c md5.c
+endif
+ifeq ($(UCLIBC_HAS_CRYPT_STUB),y)
+CSRC := crypt_stub.c
+endif
+
+libcrypt_SRC := $(addprefix $(libcrypt_DIR)/,$(CSRC))
libcrypt_OBJ := $(patsubst $(libcrypt_DIR)/%.c,$(libcrypt_OUT)/%.o,$(libcrypt_SRC))
ifeq ($(DOPIC),y)
@@ -26,8 +33,10 @@ libcrypt-a-y := $(libcrypt_OBJ)
endif
libcrypt-so-y := $(libcrypt_OBJ:.o=.os)
+ifeq ($(UCLIBC_HAS_CRYPT),y)
lib-a-y += $(top_builddir)lib/libcrypt.a
lib-so-y += $(top_builddir)lib/libcrypt.so
+endif
objclean-y += libcrypt_clean
ifeq ($(DOMULTI),n)
diff --git a/libcrypt/crypt_stub.c b/libcrypt/crypt_stub.c
new file mode 100644
index 000000000..76645a046
--- /dev/null
+++ b/libcrypt/crypt_stub.c
@@ -0,0 +1,30 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * crypt() for uClibc
+ * Copyright (C) 2008 by Erik Andersen <andersen@uclibc.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define __FORCE_GLIBC
+#include <crypt.h>
+#include <unistd.h>
+#include "libcrypt.h"
+#include <syscall.h>
+
+char *crypt(const char *key attribute_unused, const char *salt attribute_unused)
+{
+ __set_errno(ENOSYS);
+ return NULL;
+}
+
+void
+setkey(const char *key attribute_unused)
+{
+ __set_errno(ENOSYS);
+}
+
+void
+encrypt(char *block attribute_unused, int flag attribute_unused)
+{
+ __set_errno(ENOSYS);
+}