From: Junio C Hamano Date: Wed, 25 Apr 2018 04:29:01 +0000 (+0900) Subject: Merge branch 'es/fread-reads-dir-autoconf-fix' X-Git-Tag: v2.18.0-rc0~115 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/8b22d132434a1e8dbb1080edd8407dd5ea509068?hp=-c Merge branch 'es/fread-reads-dir-autoconf-fix' Small fix to the autoconf build procedure. * es/fread-reads-dir-autoconf-fix: configure.ac: fix botched FREAD_READS_DIRECTORIES check --- 8b22d132434a1e8dbb1080edd8407dd5ea509068 diff --combined configure.ac index 6f1fd9df35,e33b6c79c0..e11b7976ab --- a/configure.ac +++ b/configure.ac @@@ -241,6 -241,7 +241,6 @@@ AC_MSG_NOTICE([CHECKS for site configur # a bundled SHA1 routine optimized for PowerPC. # # Define NO_OPENSSL environment variable if you do not have OpenSSL. -# This also implies BLK_SHA1. # # Define OPENSSLDIR=/foo/bar if your openssl header and library files are in # /foo/bar/include and /foo/bar/lib directories. @@@ -249,70 -250,24 +249,70 @@@ AS_HELP_STRING([--with-openssl],[use Op AS_HELP_STRING([], [ARG can be prefix for openssl library and headers]), GIT_PARSE_WITH([openssl])) -# Define USE_LIBPCRE if you have and want to use libpcre. git-grep will be -# able to use Perl-compatible regular expressions. +# Define USE_LIBPCRE if you have and want to use libpcre. Various +# commands such as log and grep offer runtime options to use +# Perl-compatible regular expressions instead of standard or extended +# POSIX regular expressions. # -# Define LIBPCREDIR=/foo/bar if your libpcre header and library files are in +# USE_LIBPCRE is a synonym for USE_LIBPCRE2, define USE_LIBPCRE1 +# instead if you'd like to use the legacy version 1 of the PCRE +# library. Support for version 1 will likely be removed in some future +# release of Git, as upstream has all but abandoned it. +# +# Define LIBPCREDIR=/foo/bar if your PCRE header and library files are in # /foo/bar/include and /foo/bar/lib directories. # AC_ARG_WITH(libpcre, -AS_HELP_STRING([--with-libpcre],[support Perl-compatible regexes (default is NO)]) +AS_HELP_STRING([--with-libpcre],[synonym for --with-libpcre2]), + if test "$withval" = "no"; then + USE_LIBPCRE2= + elif test "$withval" = "yes"; then + USE_LIBPCRE2=YesPlease + else + USE_LIBPCRE2=YesPlease + LIBPCREDIR=$withval + AC_MSG_NOTICE([Setting LIBPCREDIR to $LIBPCREDIR]) + dnl USE_LIBPCRE2 can still be modified below, so don't substitute + dnl it yet. + GIT_CONF_SUBST([LIBPCREDIR]) + fi) + +AC_ARG_WITH(libpcre1, +AS_HELP_STRING([--with-libpcre1],[support Perl-compatible regexes via libpcre1 (default is NO)]) +AS_HELP_STRING([], [ARG can be also prefix for libpcre library and headers]), + if test "$withval" = "no"; then + USE_LIBPCRE1= + elif test "$withval" = "yes"; then + USE_LIBPCRE1=YesPlease + else + USE_LIBPCRE1=YesPlease + LIBPCREDIR=$withval + AC_MSG_NOTICE([Setting LIBPCREDIR to $LIBPCREDIR]) + dnl USE_LIBPCRE1 can still be modified below, so don't substitute + dnl it yet. + GIT_CONF_SUBST([LIBPCREDIR]) + fi) + +AC_ARG_WITH(libpcre2, +AS_HELP_STRING([--with-libpcre2],[support Perl-compatible regexes via libpcre2 (default is NO)]) AS_HELP_STRING([], [ARG can be also prefix for libpcre library and headers]), + if test -n "$USE_LIBPCRE2"; then + AC_MSG_ERROR([Only supply one of --with-libpcre or its synonym --with-libpcre2!]) + fi + + if test -n "$USE_LIBPCRE1"; then + AC_MSG_ERROR([Only supply one of --with-libpcre1 or --with-libpcre2!]) + fi + if test "$withval" = "no"; then - USE_LIBPCRE= + USE_LIBPCRE2= elif test "$withval" = "yes"; then - USE_LIBPCRE=YesPlease + USE_LIBPCRE2=YesPlease else - USE_LIBPCRE=YesPlease + USE_LIBPCRE2=YesPlease LIBPCREDIR=$withval AC_MSG_NOTICE([Setting LIBPCREDIR to $LIBPCREDIR]) - dnl USE_LIBPCRE can still be modified below, so don't substitute + dnl USE_LIBPCRE2 can still be modified below, so don't substitute dnl it yet. GIT_CONF_SUBST([LIBPCREDIR]) fi) @@@ -544,36 -499,21 +544,36 @@@ GIT_CONF_SUBST([NEEDS_SSL_WITH_CRYPTO] GIT_CONF_SUBST([NO_OPENSSL]) # -# Define USE_LIBPCRE if you have and want to use libpcre. git-grep will be -# able to use Perl-compatible regular expressions. +# Handle the USE_LIBPCRE1 and USE_LIBPCRE2 options potentially set +# above. # -if test -n "$USE_LIBPCRE"; then +if test -n "$USE_LIBPCRE1"; then GIT_STASH_FLAGS($LIBPCREDIR) AC_CHECK_LIB([pcre], [pcre_version], -[USE_LIBPCRE=YesPlease], -[USE_LIBPCRE=]) +[USE_LIBPCRE1=YesPlease], +[USE_LIBPCRE1=]) + +GIT_UNSTASH_FLAGS($LIBPCREDIR) + +GIT_CONF_SUBST([USE_LIBPCRE1]) + +fi + + +if test -n "$USE_LIBPCRE2"; then + +GIT_STASH_FLAGS($LIBPCREDIR) + +AC_CHECK_LIB([pcre2-8], [pcre2_config_8], +[USE_LIBPCRE2=YesPlease], +[USE_LIBPCRE2=]) GIT_UNSTASH_FLAGS($LIBPCREDIR) -GIT_CONF_SUBST([USE_LIBPCRE]) +GIT_CONF_SUBST([USE_LIBPCRE2]) fi @@@ -927,7 -867,7 +927,7 @@@ AC_RUN_IFELSE [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[ FILE *f = fopen(".", "r"); - return f)]])], + return f != NULL;]])], [ac_cv_fread_reads_directories=no], [ac_cv_fread_reads_directories=yes]) ])