This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Add libidn/idn-stub-static.c
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 10 Sep 2012 06:46:42 -0700
- Subject: [PATCH] Add libidn/idn-stub-static.c
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
This patch adds libidn/idn-stub-static.c and uses it when
$(build-shared) isn't yes. OK to install?
Thanks.
H.J.
----
* libidn/Makefile (routines): Set to idn-stub if $(build-shared)
is yes, otherwise set to idn-stub-static.
* libidn/idn-stub-static.c: New file.
diff --git a/libidn/Makefile b/libidn/Makefile
index 8342c46..3bb49f3 100644
--- a/libidn/Makefile
+++ b/libidn/Makefile
@@ -19,7 +19,11 @@
subdir := libidn
+ifeq (yes,$(build-shared))
routines = idn-stub
+else
+routines = idn-stub-static
+endif
extra-libs = libcidn
extra-libs-others = $(extra-libs)
diff --git a/libidn/idn-stub-static.c b/libidn/idn-stub-static.c
new file mode 100644
index 0000000..e6abb6e
--- /dev/null
+++ b/libidn/idn-stub-static.c
@@ -0,0 +1,39 @@
+/* idn-stub-static.c --- Dummy stubs for libcidn.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Get NULL. */
+#include <stdio.h>
+
+/* Get specification for idna_to_ascii_lz. */
+#include "idna.h"
+
+/* Return IDNA_DLOPEN_ERROR when shared library is disabled. */
+
+int
+__idna_to_ascii_lz (const char *input, char **output, int flags)
+{
+ return IDNA_DLOPEN_ERROR;
+}
+
+/* Return IDNA_DLOPEN_ERROR when shared library is disabled. */
+
+int
+__idna_to_unicode_lzlz (const char *input, char **output, int flags)
+{
+ return IDNA_DLOPEN_ERROR;
+}