git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sibi Siddharthan <sibisiddharthan.github@gmail.com>
To: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
Cc: Sibi Siddharthan via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH v2 08/11] cmake: added checks for struct stat and libiconv
Date: Fri, 15 May 2020 00:01:20 +0530	[thread overview]
Message-ID: <CAKiG+9Xu2OMnj9JghEbzD358ZdcR6vw5XdswAqimrZWWXLHvJA@mail.gmail.com> (raw)
In-Reply-To: <20200514153140.GB1939@danh.dev>

On Thu, May 14, 2020 at 9:01 PM Đoàn Trần Công Danh
<congdanhqx@gmail.com> wrote:
>
> On 2020-05-12 16:50:51+0000, Sibi Siddharthan via GitGitGadget <gitgitgadget@gmail.com> wrote:
> > From: Sibi Siddharthan <sibisiddharthan.github@gmail.com>
> >
> > The CMake script now checks whether st_blocks is a member of struct stat
> > and set the compile definition NO_ST_BLOCKS_IN_STRUCT_STAT accordingly.
> >
> > The check for whether ICONV_OMITS_BOM is also added as requested by Danh.
>
> Please don't write my name in the commit message like this.
> This maybe rephased to:
>
>         While we're as it, add the check for ICONV_OMITS_BOM.

Sure, will remove your name from the message.
I added it because gitgitgadget PR bot suggested it as a good practice.

>
> > Signed-off-by: Sibi Siddharthan <sibisiddharthan.github@gmail.com>
> > ---
> >  CMakeLists.txt | 59 ++++++++++++++++++++++++++++++++++++++++++++++++--
> >  1 file changed, 57 insertions(+), 2 deletions(-)
> >
> > diff --git a/CMakeLists.txt b/CMakeLists.txt
> > index 4353080b708..975791c8b89 100644
> > --- a/CMakeLists.txt
> > +++ b/CMakeLists.txt
> > @@ -22,6 +22,7 @@ project(git
> >  include(CheckTypeSize)
> >  include(CheckCSourceRuns)
> >  include(CheckCSourceCompiles)
> > +include(CheckCSourceRuns)
> >  include(CheckIncludeFile)
> >  include(CheckFunctionExists)
> >  include(CheckSymbolExists)
> > @@ -128,7 +129,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
> >       include_directories(compat/win32)
> >       add_compile_definitions(HAVE_ALLOCA_H NO_POSIX_GOODIES NATIVE_CRLF NO_UNIX_SOCKETS WIN32
> >                               _CONSOLE DETECT_MSYS_TTY STRIP_EXTENSION=".exe"  NO_SYMLINK_HEAD UNRELIABLE_FSTAT
> > -                             NOGDI OBJECT_CREATION_MODE=1 __USE_MINGW_ANSI_STDIO=0 NO_ST_BLOCKS_IN_STRUCT_STAT
> > +                             NOGDI OBJECT_CREATION_MODE=1 __USE_MINGW_ANSI_STDIO=0
> >                               USE_NED_ALLOCATOR OVERRIDE_STRDUP MMAP_PREVENTS_DELETE USE_WIN32_MMAP
> >                               UNICODE _UNICODE HAVE_WPGMPTR ENSURE_MSYSTEM_IS_SET)
> >       list(APPEND compat_SOURCES compat/mingw.c compat/winansi.c compat/win32/path-utils.c
> > @@ -280,6 +281,11 @@ if(HAVE_CLOCK_MONOTONIC)
> >       add_compile_definitions(HAVE_CLOCK_MONOTONIC)
> >  endif()
> >
> > +#check for st_blocks in struct stat
> > +check_struct_has_member("struct stat" st_blocks "sys/stat.h" STRUCT_STAT_HAS_ST_BLOCKS)
> > +if(NOT STRUCT_STAT_HAS_ST_BLOCKS)
> > +     add_compile_definitions(NO_ST_BLOCKS_IN_STRUCT_STAT)
> > +endif()
> >
> >  #compile checks
> >  check_c_source_runs("
> > @@ -344,7 +350,6 @@ if(NOT HAVE_REGEX)
> >       add_compile_definitions(NO_REGEX NO_MBSUPPORT GAWK)
> >  endif()
> >
> > -
> >  check_c_source_compiles("
> >  #include <stddef.h>
> >  #include <sys/types.h>
> > @@ -368,6 +373,56 @@ if(HAVE_BSD_SYSCTL)
> >       add_compile_definitions(HAVE_BSD_SYSCTL)
> >  endif()
> >
> > +set(CMAKE_REQUIRED_LIBRARIES ${Iconv_LIBRARIES})
> > +set(CMAKE_REQUIRED_INCLUDES ${Iconv_INCLUDE_DIRS})
> > +
> > +check_c_source_compiles("
> > +#include <iconv.h>
> > +
> > +extern size_t iconv(iconv_t cd,
> > +             char **inbuf, size_t *inbytesleft,
> > +             char **outbuf, size_t *outbytesleft);
> > +
> > +int main(){return 0;}"
> > +HAVE_NEW_ICONV)
> > +if(HAVE_NEW_ICONV)
> > +     set(HAVE_OLD_ICONV 0)
> > +else()
> > +     set(HAVE_OLD_ICONV 1)
> > +endif()
> > +
> > +check_c_source_runs("
> > +#include <iconv.h>
> > +#if ${HAVE_OLD_ICONV}
> > +typedef const char *iconv_ibp;
> > +#else
> > +typedef char *iconv_ibp;
> > +#endif
> > +
> > +int main()
> > +{
> > +     int v;
> > +     iconv_t conv;
> > +     char in[] = \"a\"; iconv_ibp pin = in;
> > +     char out[20] = \"\"; char *pout = out;
> > +     size_t isz = sizeof in;
> > +     size_t osz = sizeof out;
> > +
> > +     conv = iconv_open(\"UTF-16\", \"UTF-8\");
> > +     iconv(conv, &pin, &isz, &pout, &osz);
> > +     iconv_close(conv);
> > +     v = (unsigned char)(out[0]) + (unsigned char)(out[1]);
> > +     return v != 0xfe + 0xff;
> > +}"
>
> I think the closing double-quote should be placed in a newline,
> in order to make sure the source file ended with newline,
> old C standard requires final newline.
>

Okay

Thank You,
Sibi Siddharthan

>
> --
> Danh

  reply	other threads:[~2020-05-14 18:31 UTC|newest]

Thread overview: 179+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24  4:01 [PATCH 0/8] CMake build system for git Sibi Siddharthan via GitGitGadget
2020-04-24  4:01 ` [PATCH 1/8] Introduce CMake support for configuring Git on Linux Sibi Siddharthan via GitGitGadget
2020-04-24 17:05   ` Danh Doan
2020-04-24 21:06     ` Sibi Siddharthan
2020-04-24 22:56       ` Danh Doan
2020-04-25  3:50         ` Sibi Siddharthan
2020-04-25 13:34     ` Johannes Schindelin
2020-04-25 17:07   ` brian m. carlson
2020-04-25 17:36     ` Randall S. Becker
2020-04-25 18:01       ` Philip Oakley
2020-04-25 18:11     ` Sibi Siddharthan
2020-04-24  4:01 ` [PATCH 2/8] cmake: generate the shell/perl/python scripts and templates, translations Sibi Siddharthan via GitGitGadget
2020-04-24 17:19   ` Danh Doan
2020-04-24 21:19     ` Sibi Siddharthan
2020-04-24  4:01 ` [PATCH 3/8] cmake: installation support for git Sibi Siddharthan via GitGitGadget
2020-04-24 17:23   ` Danh Doan
2020-04-24 21:24     ` Sibi Siddharthan
2020-04-24  4:01 ` [PATCH 4/8] cmake: support for testing git with ctest Sibi Siddharthan via GitGitGadget
2020-04-24 17:28   ` Danh Doan
2020-04-24 21:26     ` Sibi Siddharthan
2020-04-24  4:01 ` [PATCH 5/8] cmake: support for testing git when building out of the source tree Sibi Siddharthan via GitGitGadget
2020-04-24 17:34   ` Danh Doan
2020-04-24 21:32     ` Sibi Siddharthan
2020-04-24 23:09       ` Danh Doan
2020-04-25  3:57         ` Sibi Siddharthan
2020-04-24  4:01 ` [PATCH 6/8] cmake: support for building git on windows with mingw Sibi Siddharthan via GitGitGadget
2020-04-24 17:39   ` Philip Oakley
2020-04-24 20:29     ` Sibi Siddharthan
2020-04-25 11:37       ` Philip Oakley
2020-04-25 12:09         ` Sibi Siddharthan
2020-04-24  4:01 ` [PATCH 7/8] cmake: support for building git on windows with msvc and clang Sibi Siddharthan via GitGitGadget
2020-04-24 17:39   ` Danh Doan
2020-04-24 21:35     ` Sibi Siddharthan
2020-04-24  4:01 ` [PATCH 8/8] ci: modification of main.yml to use cmake for vs-build job Sibi Siddharthan via GitGitGadget
2020-04-24 17:45   ` Danh Doan
2020-04-24 21:41     ` Sibi Siddharthan
2020-04-24 21:44     ` Johannes Schindelin
2020-04-24 18:56 ` [PATCH 0/8] CMake build system for git Junio C Hamano
2020-04-24 19:50   ` Sibi Siddharthan
2020-04-24 21:43     ` Junio C Hamano
2020-04-25  4:09       ` Sibi Siddharthan
2020-04-25 12:56         ` Philip Oakley
2020-04-25 13:29           ` Johannes Schindelin
2020-04-25 14:12             ` Sibi Siddharthan
2020-04-25 14:28               ` Johannes Schindelin
2020-04-25 14:38                 ` Sibi Siddharthan
2020-04-25 14:49                   ` Johannes Schindelin
2020-04-25 14:57                     ` Sibi Siddharthan
2020-04-26  0:41                       ` Danh Doan
2020-04-26  4:30                         ` Sibi Siddharthan
2020-04-25 12:24       ` Johannes Schindelin
2020-04-27 20:08         ` Jeff King
2020-04-27 20:12           ` Jeff King
2020-04-28 13:52             ` Danh Doan
2020-04-28 21:07               ` Jeff King
2020-04-29  8:42                 ` Sibi Siddharthan
2020-05-01 19:32                   ` Johannes Schindelin
2020-05-02 14:31                     ` Sibi Siddharthan
2020-05-02 14:58                       ` Randall S. Becker
2020-05-02 15:48                       ` Junio C Hamano
2020-05-03 15:33                         ` Sibi Siddharthan
2020-05-03 17:21                           ` Junio C Hamano
2020-05-03 19:42                             ` Konstantin Tokarev
2020-05-03 19:50                               ` Junio C Hamano
2020-05-04 14:31                               ` Johannes Schindelin
2020-05-04 21:59                                 ` Konstantin Tokarev
2020-05-05  4:16                                   ` Sibi Siddharthan
2020-05-05  6:16                                     ` Junio C Hamano
2020-05-05 16:23                                       ` Sibi Siddharthan
2020-05-05 18:17                                         ` Junio C Hamano
2020-05-06 18:43                                           ` Sibi Siddharthan
2020-05-07 11:48                                             ` Đoàn Trần Công Danh
2020-05-06 21:27                                         ` Johannes Schindelin
2020-05-07 20:54                                   ` Johannes Schindelin
2020-05-02 13:21                   ` Danh Doan
2020-05-02 14:50                     ` Sibi Siddharthan
2020-05-02 15:02                       ` Danh Doan
2020-05-02 15:16                         ` Sibi Siddharthan
2020-04-27 21:17           ` Junio C Hamano
2020-04-27 21:56             ` Michal Suchánek
2020-04-27 22:09             ` Jeff King
2020-04-27 22:23               ` Elijah Newren
2020-04-27 23:16                 ` Junio C Hamano
2020-04-28  5:36                 ` Jeff King
2020-05-12 16:50 ` [PATCH v2 00/11] " Sibi Siddharthan via GitGitGadget
2020-05-12 16:50   ` [PATCH v2 01/11] Introduce CMake support for configuring Git on Linux Sibi Siddharthan via GitGitGadget
2020-05-12 20:59     ` Junio C Hamano
2020-05-13 20:21       ` Sibi Siddharthan
2020-05-12 16:50   ` [PATCH v2 02/11] cmake: generate the shell/perl/python scripts and templates, translations Sibi Siddharthan via GitGitGadget
2020-05-12 21:19     ` Junio C Hamano
2020-05-13 20:07       ` Sibi Siddharthan
2020-05-12 16:50   ` [PATCH v2 03/11] cmake: installation support for git Sibi Siddharthan via GitGitGadget
2020-05-12 16:50   ` [PATCH v2 04/11] cmake: support for testing git with ctest Sibi Siddharthan via GitGitGadget
2020-05-12 16:50   ` [PATCH v2 05/11] cmake: support for testing git when building out of the source tree Sibi Siddharthan via GitGitGadget
2020-05-12 16:50   ` [PATCH v2 06/11] cmake: support for building git on windows with mingw Sibi Siddharthan via GitGitGadget
2020-05-14 15:25     ` Đoàn Trần Công Danh
2020-05-14 18:27       ` Sibi Siddharthan
2020-05-12 16:50   ` [PATCH v2 07/11] cmake: support for building git on windows with msvc and clang Sibi Siddharthan via GitGitGadget
2020-05-12 16:50   ` [PATCH v2 08/11] cmake: added checks for struct stat and libiconv Sibi Siddharthan via GitGitGadget
2020-05-12 21:16     ` Junio C Hamano
2020-05-13 20:05       ` Sibi Siddharthan
2020-05-14  2:00         ` Junio C Hamano
2020-05-14 15:31     ` Đoàn Trần Công Danh
2020-05-14 18:31       ` Sibi Siddharthan [this message]
2020-05-12 16:50   ` [PATCH v2 09/11] cmake: relocated script file contrib/buildsystems Sibi Siddharthan via GitGitGadget
2020-05-12 21:09     ` Junio C Hamano
2020-05-13 20:08       ` Sibi Siddharthan
2020-05-12 16:50   ` [PATCH v2 10/11] cmake: parse the makefile for the sources Sibi Siddharthan via GitGitGadget
2020-05-12 21:03     ` Junio C Hamano
2020-05-13 19:57       ` Sibi Siddharthan
2020-05-13 20:23         ` Junio C Hamano
2020-05-12 16:50   ` [PATCH v2 11/11] ci: modification of main.yml to use cmake for vs-build job Sibi Siddharthan via GitGitGadget
2020-05-12 21:27     ` Junio C Hamano
2020-05-13 19:45       ` Sibi Siddharthan
2020-05-25 19:16         ` Sibi Siddharthan
2020-05-25 20:03           ` Junio C Hamano
2020-05-25 20:56             ` Sibi Siddharthan
2020-05-25 21:40               ` Johannes Schindelin
2020-05-29 13:40   ` [PATCH v3 0/8] CMake build system for git Sibi Siddharthan via GitGitGadget
2020-05-29 13:40     ` [PATCH v3 1/8] Introduce CMake support for configuring Git Sibi Siddharthan via GitGitGadget
2020-05-29 19:27       ` Junio C Hamano
2020-05-30 18:50         ` Sibi Siddharthan
2020-05-31 16:17           ` Junio C Hamano
2020-05-30  8:00             ` Johannes Schindelin
2020-05-30 13:17       ` Đoàn Trần Công Danh
2020-05-29 13:40     ` [PATCH v3 2/8] cmake: generate the shell/perl/python scripts and templates, translations Sibi Siddharthan via GitGitGadget
2020-05-29 19:27       ` Junio C Hamano
2020-05-30 18:56         ` Sibi Siddharthan
2020-06-08 20:07           ` Sibi Siddharthan
2020-06-08 22:10             ` Junio C Hamano
2020-05-29 13:40     ` [PATCH v3 3/8] cmake: installation support for git Sibi Siddharthan via GitGitGadget
2020-05-29 13:40     ` [PATCH v3 4/8] cmake: support for testing git with ctest Sibi Siddharthan via GitGitGadget
2020-05-30 13:49       ` Đoàn Trần Công Danh
2020-05-30 19:04         ` Sibi Siddharthan
2020-05-31  1:28           ` Đoàn Trần Công Danh
2020-05-29 13:40     ` [PATCH v3 5/8] cmake: support for testing git when building out of the source tree Sibi Siddharthan via GitGitGadget
2020-05-29 13:40     ` [PATCH v3 6/8] cmake: support for building git on windows with mingw Sibi Siddharthan via GitGitGadget
2020-05-29 13:40     ` [PATCH v3 7/8] cmake: support for building git on windows with msvc and clang Sibi Siddharthan via GitGitGadget
2020-05-30 14:08       ` Đoàn Trần Công Danh
2020-05-30 19:08         ` Sibi Siddharthan
2020-05-29 13:40     ` [PATCH v3 8/8] ci: modification of main.yml to use cmake for vs-build job Sibi Siddharthan via GitGitGadget
2020-05-30 14:14       ` Đoàn Trần Công Danh
2020-05-30 19:13         ` Sibi Siddharthan
2020-06-12 18:29     ` [PATCH v4 0/8] CMake build system for git Sibi Siddharthan via GitGitGadget
2020-06-12 18:29       ` [PATCH v4 1/8] Introduce CMake support for configuring Git Sibi Siddharthan via GitGitGadget
2020-06-15 14:00         ` Øystein Walle
2020-06-15 20:04           ` Sibi Siddharthan
2020-06-12 18:29       ` [PATCH v4 2/8] cmake: generate the shell/perl/python scripts and templates, translations Sibi Siddharthan via GitGitGadget
2020-06-12 18:29       ` [PATCH v4 3/8] cmake: installation support for git Sibi Siddharthan via GitGitGadget
2020-06-12 18:29       ` [PATCH v4 4/8] cmake: support for testing git with ctest Sibi Siddharthan via GitGitGadget
2020-06-15 14:02         ` Øystein Walle
2020-06-15 19:45           ` Sibi Siddharthan
2020-06-12 18:29       ` [PATCH v4 5/8] cmake: support for testing git when building out of the source tree Sibi Siddharthan via GitGitGadget
2020-06-12 18:29       ` [PATCH v4 6/8] cmake: support for building git on windows with mingw Sibi Siddharthan via GitGitGadget
2020-06-15 14:03         ` Øystein Walle
2020-06-15 19:47           ` Sibi Siddharthan
2020-06-18  4:43             ` Junio C Hamano
2020-06-18 19:55               ` Sibi Siddharthan
2020-06-18 20:08                 ` Junio C Hamano
2020-06-18 20:40                   ` Sibi Siddharthan
2020-06-18 21:00                     ` Junio C Hamano
2020-06-19 17:15                       ` Sibi Siddharthan
2020-06-19 17:29                         ` Junio C Hamano
2020-06-12 18:29       ` [PATCH v4 7/8] cmake: support for building git on windows with msvc and clang Sibi Siddharthan via GitGitGadget
2020-06-15 14:04         ` Øystein Walle
2020-06-15 19:56           ` Sibi Siddharthan
2020-06-12 18:29       ` [PATCH v4 8/8] ci: modification of main.yml to use cmake for vs-build job Sibi Siddharthan via GitGitGadget
2020-06-26 16:11       ` [PATCH v5 0/8] CMake build system for git Sibi Siddharthan via GitGitGadget
2020-06-26 16:11         ` [PATCH v5 1/8] Introduce CMake support for configuring Git Sibi Siddharthan via GitGitGadget
2020-06-26 16:11         ` [PATCH v5 2/8] cmake: generate the shell/perl/python scripts and templates, translations Sibi Siddharthan via GitGitGadget
2020-06-26 16:11         ` [PATCH v5 3/8] cmake: installation support for git Sibi Siddharthan via GitGitGadget
2020-06-26 16:11         ` [PATCH v5 4/8] cmake: support for testing git with ctest Sibi Siddharthan via GitGitGadget
2020-06-26 16:11         ` [PATCH v5 5/8] cmake: support for testing git when building out of the source tree Sibi Siddharthan via GitGitGadget
2020-06-26 16:11         ` [PATCH v5 6/8] cmake: support for building git on windows with mingw Sibi Siddharthan via GitGitGadget
2020-06-30  7:25           ` David Aguilar
2020-07-01 17:45             ` Sibi Siddharthan
2020-07-01 17:49               ` Sibi Siddharthan
2020-06-26 16:11         ` [PATCH v5 7/8] cmake: support for building git on windows with msvc and clang Sibi Siddharthan via GitGitGadget
2020-06-26 16:11         ` [PATCH v5 8/8] ci: modification of main.yml to use cmake for vs-build job Sibi Siddharthan via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKiG+9Xu2OMnj9JghEbzD358ZdcR6vw5XdswAqimrZWWXLHvJA@mail.gmail.com \
    --to=sibisiddharthan.github@gmail.com \
    --cc=congdanhqx@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).