diff options
author | nelson%bolyard.com <devnull@localhost> | 2009-06-17 23:01:52 +0000 |
---|---|---|
committer | nelson%bolyard.com <devnull@localhost> | 2009-06-17 23:01:52 +0000 |
commit | f038e637f77209663c42119f25f280f05ed754a1 (patch) | |
tree | 4db528867090347f2c837ab2600844741370722d | |
parent | 9288a0e96167829254ca8a9b5659bad0cb9fdc82 (diff) | |
download | nss-hg-f038e637f77209663c42119f25f280f05ed754a1.tar.gz |
Bug 483653: unable to build certutil.exe for fennec/winceNSS_3_12_4_FIPS2
Patch by Hiroyuki Ikezoe <ikezoe@clear-code.com>, r=nelson
-rw-r--r-- | security/coreconf/WINCE.mk | 2 | ||||
-rw-r--r-- | security/coreconf/rules.mk | 4 | ||||
-rw-r--r-- | security/nss/cmd/lib/config.mk | 4 | ||||
-rw-r--r-- | security/nss/cmd/lib/wincemain.c | 65 | ||||
-rw-r--r-- | security/nss/cmd/platlibs.mk | 4 |
5 files changed, 75 insertions, 4 deletions
diff --git a/security/coreconf/WINCE.mk b/security/coreconf/WINCE.mk index 8bef31c59..af23a8ee0 100644 --- a/security/coreconf/WINCE.mk +++ b/security/coreconf/WINCE.mk @@ -83,6 +83,8 @@ LIB_SUFFIX = lib DLL_SUFFIX = dll OS_DLLFLAGS += -DLL +EXTRA_EXE_LD_FLAGS += -ENTRY:mainWCRTStartup + ifdef BUILD_OPT # OS_CFLAGS += -MD OPTIMIZER += -O2 diff --git a/security/coreconf/rules.mk b/security/coreconf/rules.mk index 346302833..d3738c43a 100644 --- a/security/coreconf/rules.mk +++ b/security/coreconf/rules.mk @@ -273,7 +273,7 @@ alltags: $(PROGRAM): $(OBJS) $(EXTRA_LIBS) @$(MAKE_OBJDIR) ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) - $(MKPROG) $(subst /,\\,$(OBJS)) -Fe$@ -link $(LDFLAGS) $(subst /,\\,$(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)) + $(MKPROG) $(subst /,\\,$(OBJS)) -Fe$@ -link $(LDFLAGS) $(subst /,\\,$(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)) $(EXTRA_EXE_LD_FLAGS) ifdef MT if test -f $@.manifest; then \ $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \ @@ -373,7 +373,7 @@ $(OBJDIR)/$(PROG_PREFIX)%$(PROG_SUFFIX): $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX) @$(MAKE_OBJDIR) ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) $(MKPROG) $< -Fe$@ -link \ - $(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) + $(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(EXTRA_EXE_LD_FLAGS) ifdef MT if test -f $@.manifest; then \ $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \ diff --git a/security/nss/cmd/lib/config.mk b/security/nss/cmd/lib/config.mk index 665828c63..1c82d6487 100644 --- a/security/nss/cmd/lib/config.mk +++ b/security/nss/cmd/lib/config.mk @@ -45,3 +45,7 @@ SHARED_LIBRARY = IMPORT_LIBRARY = PROGRAM = +ifeq (WINCE,$(OS_ARCH)) +CSRCS += wincemain.c +endif + diff --git a/security/nss/cmd/lib/wincemain.c b/security/nss/cmd/lib/wincemain.c new file mode 100644 index 000000000..8bb4ca34c --- /dev/null +++ b/security/nss/cmd/lib/wincemain.c @@ -0,0 +1,65 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is the Netscape security libraries. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1994-2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifdef WINCE +#include <windows.h> + +int +wmain(int argc, WCHAR **wargv) +{ + char **argv; + int i, ret; + + argv = malloc(argc * sizeof(char*)); + + for (i = 0; i < argc; i++) { + int len = WideCharToMultiByte(CP_ACP, 0, wargv[i], -1, NULL, 0, 0, 0); + argv[i] = malloc(len * sizeof(char)); + WideCharToMultiByte(CP_ACP, 0, wargv[i], -1, argv[i], len, 0, 0); + } + + ret = main(argc, argv); + + for (i = 0; i < argc; i++) { + free(argv[i]); + } + free(argv); + + return ret; +} + +#endif + diff --git a/security/nss/cmd/platlibs.mk b/security/nss/cmd/platlibs.mk index 2c9b659a6..ab8024386 100644 --- a/security/nss/cmd/platlibs.mk +++ b/security/nss/cmd/platlibs.mk @@ -91,7 +91,7 @@ endif ifdef USE_STATIC_LIBS # can't do this in manifest.mn because OS_ARCH isn't defined there. -ifeq ($(OS_ARCH), WINNT) +ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH))) DEFINES += -DNSS_USE_STATIC_LIBS # $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS) @@ -211,7 +211,7 @@ endif else # USE_STATIC_LIBS # can't do this in manifest.mn because OS_ARCH isn't defined there. -ifeq ($(OS_ARCH), WINNT) +ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH))) # $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS) EXTRA_LIBS += \ |