From patchwork Sun Feb 3 11:54:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Donnelly X-Patchwork-Id: 217744 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 9B6EE2C008C for ; Sun, 3 Feb 2013 22:54:23 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sourceware.org; s=default; x=1360497264; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Subscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=rwHU7ieWaHs+2znQO5Dsx4kVK5k=; b=NZJLBZW1TGQKBY+ ozlLq8Vn8J5+j4UNJapJNsv/8lzOu9S8F06oTjiBjTV1LDGxVVqlbqMvaqH1Zl+W wGkhxSwHWSJ6gcuu/32/pmkTdvg3BwtVTheEQ86V0rrH3jV2caeDpX6Baz3+LMVZ xcvM3hkwV7Wva+Duv6GZoT9Shjz4= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=sourceware.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:X-Received:Received:Date:Message-ID:Subject:From:To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Subscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Vn88zkB+R++FjoYiW9WSbmE8IAlA/iMcopBCPhlQa2IghWxh59opdbSBKfWjdZ m9VlbGEeLmIznHBw984RH7/yuhPd91WEZfbXzh92M/an/9+Yb5RNFLXfzYAIcert AwhOzLBwcGhaJO68xSED8Gcuv6m6qdL8764Rxv7Pv/svI=; Received: (qmail 10559 invoked by alias); 3 Feb 2013 11:54:21 -0000 Received: (qmail 10538 invoked by uid 22791); 3 Feb 2013 11:54:20 -0000 X-SWARE-Spam-Status: No, hits=-3.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KAM_STOCKGEN, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-lb0-f178.google.com (HELO mail-lb0-f178.google.com) (209.85.217.178) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 03 Feb 2013 11:54:16 +0000 Received: by mail-lb0-f178.google.com with SMTP id n1so5758751lba.23 for ; Sun, 03 Feb 2013 03:54:14 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.112.26.169 with SMTP id m9mr6958190lbg.116.1359892454715; Sun, 03 Feb 2013 03:54:14 -0800 (PST) Received: by 10.112.2.168 with HTTP; Sun, 3 Feb 2013 03:54:14 -0800 (PST) Date: Sun, 3 Feb 2013 11:54:14 +0000 Message-ID: Subject: [PATCH v3] Enable building menuconfig on MinGW-w64/MSYS From: Ray Donnelly To: crossgcc@sourceware.org X-IsSubscribed: yes Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Delivered-To: mailing list crossgcc@sourceware.org changeset: 3177:a1d828096ac4 tag: tip user: Ray Donnelly date: Fri Feb 01 23:14:54 2013 +0000 files: Makefile.in configure.ac kconfig/Makefile kconfig/confdata.c kconfig/symbol.c description: Enable building menuconfig on MinGW-w64/MSYS Signed-off-by: Ray Donnelly --- For unsubscribe information see http://sourceware.org/lists.html#faq diff -r 20f2459b97bf -r a1d828096ac4 Makefile.in --- a/Makefile.in Mon Jan 28 21:53:18 2013 +0100 +++ b/Makefile.in Fri Feb 01 23:14:54 2013 +0000 @@ -71,6 +71,8 @@ export LIBS := @LIBS@ export curses_hdr := @ac_ct_curses_hdr@ export gettext := @gettext@ +export mkdir_one_arg := @ac_cv_mkdir_takes_one_arg@ +export build_os := @build_os@ # config options to push down to kconfig KCONFIG:= @kconfig_options@ diff -r 20f2459b97bf -r a1d828096ac4 configure.ac --- a/configure.ac Mon Jan 28 21:53:18 2013 +0100 +++ b/configure.ac Fri Feb 01 23:14:54 2013 +0000 @@ -82,6 +82,7 @@ # ... but refuse --target AS_IF([test -n "$target_alias"], AC_MSG_ERROR([--target is not allowed])) +AC_SUBST([build_os]) # Allow program name tranformation (--program-{prefix,suffix,transform-name}) AC_ARG_PROGRAM @@ -370,6 +371,22 @@ [sublibdir="/ct-ng.\${VERSION}" subdocdir="/ct-ng.\${VERSION}"]) +#---------------------------------------- +# Check whether mkdir takes one argument +AC_SUBST([ac_cv_mkdir_takes_one_arg]) +AC_CACHE_VAL([ac_cv_mkdir_takes_one_arg], + [AC_CHECK_FUNCS([mkdir _mkdir]) + AC_CACHE_CHECK([whether mkdir takes one argument], + [ac_cv_mkdir_takes_one_arg], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#if HAVE_UNISTD_H +# include +#endif + ]], + [[mkdir (".");]])], + [ac_cv_mkdir_takes_one_arg=yes],[ac_cv_mkdir_takes_one_arg=no])])]) + #-------------------------------------------------------------------- # Finally, generate the output file(s) #-------------------------------------------------------------------- diff -r 20f2459b97bf -r a1d828096ac4 kconfig/Makefile --- a/kconfig/Makefile Mon Jan 28 21:53:18 2013 +0100 +++ b/kconfig/Makefile Fri Feb 01 23:14:54 2013 +0000 @@ -7,6 +7,15 @@ # Build flags CFLAGS = -DCONFIG_=\"CT_\" -DPACKAGE="\"crosstool-NG $(VERSION)\"" + +ifeq ($(mkdir_one_arg),yes) +CFLAGS += -DMKDIR_TAKES_ONE_ARG +endif + +ifeq ($(build_os),mingw32) +MCONF_MINGW32_LDFLAGS = -lintl -lregex -liconv +endif + LDFLAGS = # Compiler flags to use gettext @@ -41,7 +50,7 @@ mconf_OBJ = $(patsubst %.c,%.o,$(mconf_SRC)) mconf_DEP = $(patsubst %.c,%.dep,$(mconf_SRC)) $(mconf_OBJ) $(mconf_DEP): CFLAGS += $(NCURSES_CFLAGS) $(INTL_CFLAGS) -mconf: LDFLAGS += $(NCURSES_LDFLAGS) +mconf: LDFLAGS += $(NCURSES_LDFLAGS) $(MCONF_MINGW32_LDFLAGS) # What's needed to build 'nconf' nconf_SRC = nconf.c nconf.gui.c diff -r 20f2459b97bf -r a1d828096ac4 kconfig/confdata.c --- a/kconfig/confdata.c Mon Jan 28 21:53:18 2013 +0100 +++ b/kconfig/confdata.c Fri Feb 01 23:14:54 2013 +0000 @@ -16,6 +16,10 @@ #define LKC_DIRECT_LINK #include "lkc.h" +#ifdef MKDIR_TAKES_ONE_ARG +#define mkdir(_n,_p) mkdir((_n)) +#endif + static void conf_warning(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); diff -r 20f2459b97bf -r a1d828096ac4 kconfig/symbol.c --- a/kconfig/symbol.c Mon Jan 28 21:53:18 2013 +0100 +++ b/kconfig/symbol.c Fri Feb 01 23:14:54 2013 +0000 @@ -7,7 +7,12 @@ #include #include #include -#include +#if defined(__MINGW32__) +# define UTS_RELEASE "1.0.17(0.48/3/2)" +#else +# include +# define UTS_RELEASE uts.release +#endif #define LKC_DIRECT_LINK #include "lkc.h" @@ -46,19 +51,23 @@ void sym_init(void) { struct symbol *sym; +#ifndef __MINGW32__ struct utsname uts; +#endif static bool inited = false; if (inited) return; inited = true; - uname(&uts); +#ifndef __MINGW32__ + uname(&uts); +#endif sym = sym_lookup("UNAME_RELEASE", 0); sym->type = S_STRING; sym->flags |= SYMBOL_AUTO; - sym_add_default(sym, uts.release); + sym_add_default(sym, UTS_RELEASE); } enum symbol_type sym_get_type(struct symbol *sym)