From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 3765 invoked from network); 19 Jun 2023 08:21:19 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 19 Jun 2023 08:21:19 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1687162879; b=LMrOWoTFpd5jGDmc+tVx0dNg4tZITRLcVDyAQvb8ueGEjdpouoJjd0itiCOZ3mLfs8Go/g+Cj1 i7uwTiwtj1e9fIeVE4muENutiPJyUVYXxppZjweCyTIgn9S4O+WlEqcgKdaQuNqLpF6jL7+pGp egxltK2iae9pyb2mDuNKakjwk9I3wSkdzx1oQu3sgMU+DXfEGvU+3v7l0zao1c7BD+u4nLVAzx kXCeITBP3lEqN/B2aXd/4BYK0aK5XM3YNF1JbwBUnBlW6M+aavrYF7mWWjeHTYF1bUTjRZJfS4 WNFjqG7Ui/ydvIilleqfd+xYfad1yYQlajb3LPhxRABU/g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd10011-bg.im.kddi.ne.jp) smtp.remote-ip=222.227.83.11; dmarc=none header.from=kba.biglobe.ne.jp; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1687162879; bh=ZDjpQyhHvlHfYJfsn2w4EUJnFou57bysjF9v7p1gytA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Message-ID:In-Reply-To:To:References:Date:Subject: MIME-Version:Content-Transfer-Encoding:Content-Type:From:DKIM-Signature; b=agGvNOypMnlv1Awa7jSWmsKXWcL981bWSbnxYU8HiGgvgn73MeG/oqqumQS5cVq+tQzNzzZJtn 08GB8c88XHK4l4YH3Lbpp5V/V+RyqqAL6tl2vgONbC0/4hoMq1aguUoPPT446PJxkhA+Usb8L5 MGLj9BYuzih8631Rj651lvFXDsEFqWPqMB6XPOVSB2Yh7psIB7nTrEo4+KYtYRzqHGsmaD7lGF 8SEHsOa/n9RTL7jo5wbt7U+4cpjE5FjL8Eqb0ikqMpITlDWYjn3nr+4GB2h7tfUqf9MK4mXb5a 3Uq4wDvf0za5/M0P5vifU2ZNOjxs2nzwPlfltjpx6qKS9g==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-Id:In-Reply-To:To:References: Date:Subject:Mime-Version:Content-Transfer-Encoding:Content-Type:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=7JefrGofInW4I+Sz3QiB70SBRNqILuIbzKtK4sUoRfE=; b=EFenan2MQalmLBJaxnXn4bpT/n LWYPejdCFk/gRlsNhqXJe/6KV4cErIKLhmtYtwvZJA4UG6WPl1CbWDBlhorwcENG3q+txpXLgTpIJ N9T73lSPldgbV9IMrFKIxa286S72sM/U/t7SCTpjKjKi0m64Qt5J+bXbyZyaUQ6n32lB8Ay1ngZ49 VhIVKZytgB9Qy+8/u66GRUB732fOezRhmsoyJfRMs6ApxL8nS2wclvzu2tEhnr4T+WfiRIP3kyJjg oaOVf+pnInZhczV2aqh9wJ09VjCx1kXXMypj8UY8YkU3JCu3jmzB4eV67z0l7a7HbvmfBdPzzmQuM S+Fw+04g==; Received: by zero.zsh.org with local id 1qBA8P-00056M-Ul; Mon, 19 Jun 2023 08:21:14 +0000 Authentication-Results: zsh.org; iprev=pass (snd10011-bg.im.kddi.ne.jp) smtp.remote-ip=222.227.83.11; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd10011-bg.im.kddi.ne.jp ([222.227.83.11]:14880 helo=dfmta0018.biglobe.ne.jp) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1qBA7p-0004m1-Qo; Mon, 19 Jun 2023 08:20:39 +0000 Received: from mail.biglobe.ne.jp by omta0018.biglobe.ne.jp with ESMTP id <20230619082030959.FUQA.63353.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Mon, 19 Jun 2023 17:20:30 +0900 From: Jun T Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: PATCH: migrate pcre module to pcre2 Date: Mon, 19 Jun 2023 17:20:29 +0900 References: <81584-1683329746.147485@6Tk5.mCsC.BbNC> <40C90E7D-9435-4803-8185-C92E2C637003@kba.biglobe.ne.jp> To: zsh-workers@zsh.org In-Reply-To: <40C90E7D-9435-4803-8185-C92E2C637003@kba.biglobe.ne.jp> Message-Id: <321D363A-50E5-4BF1-81F3-7F71EC34069A@kba.biglobe.ne.jp> X-Mailer: Apple Mail (2.3445.104.21) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 51877 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: > 2023/06/13 16:35, I wrote >=20 > Or is it better to set enable_pcre=3Dno in configure.ac > if pcre2-config is not available? I think this is better. Availability of pcre2-config need not be checked in two places. Moreover, currently, pcre2-config is called at configure.ac:956 even if it doesn't exist. PCRECONF is renamed PCRE_CONFIG. User can override PCRE_CONFIG as ./configure --enable-pcre PCRE_CONFIG=3D/path/to/pcre2-conf if pcre2-config is not in PATH. oldcflags is removed because it is not used anywhere. diff --git a/Src/Modules/pcre.mdd b/Src/Modules/pcre.mdd index 6eb3c691b..3e1579117 100644 --- a/Src/Modules/pcre.mdd +++ b/Src/Modules/pcre.mdd @@ -1,5 +1,5 @@ name=3Dzsh/pcre -link=3D`if test x$enable_pcre =3D xyes && (pcre-config --version = >/dev/null 2>/dev/null); then echo dynamic; else echo no; fi` +link=3D`if test x$enable_pcre =3D xyes; then echo dynamic; else echo = no; fi` load=3Dno =20 autofeatures=3D"b:pcre_compile b:pcre_study b:pcre_match" diff --git a/configure.ac b/configure.ac index ba76f9a60..c5263035e 100644 --- a/configure.ac +++ b/configure.ac @@ -440,6 +440,17 @@ dnl Do you want to look for pcre support? AC_ARG_ENABLE(pcre, AS_HELP_STRING([--enable-pcre],[enable the search for the pcre2 library = (may create run-time library dependencies)])) =20 +AC_ARG_VAR(PCRE_CONFIG, [pathname of pcre2-config if it is not in = PATH]) +if test "x$enable_pcre" =3D xyes; then + AC_CHECK_PROG([PCRE_CONFIG], pcre2-config, pcre2-config) + if test "x$PCRE_CONFIG" =3D x; then + enable_pcre=3Dno + AC_MSG_WARN([pcre2-config not found: pcre module is disabled.]) + AC_MSG_NOTICE( + [Set PCRE_CONFIG to pathname of pcre2-config if it is not in = PATH.]) + fi +fi + dnl Do you want to look for capability support? AC_ARG_ENABLE(cap, AS_HELP_STRING([--enable-cap],[enable the search for POSIX capabilities = (may require additional headers to be added by hand)])) @@ -655,15 +666,12 @@ AC_HEADER_DIRENT AC_HEADER_STAT AC_HEADER_SYS_WAIT =20 -oldcflags=3D"$CFLAGS" -if test x$enable_pcre =3D xyes; then -AC_CHECK_PROG([PCRECONF], pcre2-config, pcre2-config) dnl pcre2-config --cflags may produce a -I output which needs to go = into dnl CPPFLAGS else configure's preprocessor tests don't pick it up, dnl producing a warning. -if test "x$ac_cv_prog_PCRECONF" =3D xpcre2-config; then - CPPFLAGS=3D"$CPPFLAGS `pcre2-config --cflags`" -fi +if test "x$enable_pcre" =3D xyes; then + CPPFLAGS=3D"`$PCRE_CONFIG --cflags` $CPPFLAGS" + AC_CHECK_HEADERS([pcre2.h],,,[#define PCRE2_CODE_UNIT_WIDTH 8]) fi =20 AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h = \ @@ -675,7 +683,6 @@ AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h = termcap.h termio.h \ netinet/in_systm.h langinfo.h wchar.h stddef.h \ sys/stropts.h iconv.h ncurses.h ncursesw/ncurses.h \ ncurses/ncurses.h) -AC_CHECK_HEADERS([pcre2.h],,,[#define PCRE2_CODE_UNIT_WIDTH 8]) if test x$dynamic =3D xyes; then AC_CHECK_HEADERS(dlfcn.h) AC_CHECK_HEADERS(dl.h) @@ -952,10 +959,6 @@ if test "x$ac_found_iconv" =3D "xyes"; then [Define as const if the declaration of iconv() needs const.]) fi =20 -if test x$enable_pcre =3D xyes; then - LIBS=3D"`$ac_cv_prog_PCRECONF --libs8` $LIBS" -fi - dnl --------------------- dnl CHECK TERMCAP LIBRARY dnl --------------------- @@ -1316,7 +1319,6 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal = \ pathconf sysconf \ tgetent tigetflag tigetnum tigetstr setupterm initscr = resize_term \ getcchar setcchar waddwstr wget_wch win_wch = use_default_colors \ - pcre2_compile_8 \ nl_langinfo \ erand48 open_memstream \ posix_openpt \ @@ -1371,6 +1373,11 @@ if test x$zsh_cv_func_realpath_accepts_null =3D = xyes; then AC_DEFINE(REALPATH_ACCEPTS_NULL) fi =20 +if test x$enable_pcre =3D xyes; then + LIBS=3D"`$PCRE_CONFIG --libs8` $LIBS" + AC_CHECK_FUNCS(pcre2_compile_8) +fi + if test x$enable_cap =3D xyes; then AC_CHECK_FUNCS(cap_get_proc) fi