From af4781d12060f78d4b8631a2ba81e1f0cd9fc431 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Thu, 14 May 2020 10:50:36 +1000 Subject: Use case statement for wildcard check and error early if can't find apxs. --- configure | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 7fd7d1e..c1c77c1 100755 --- a/configure +++ b/configure @@ -1938,22 +1938,27 @@ XCODE_BIN_PATTERN="${XCODE_PREFIX}.*/usr/bin/" if test -x "${APXS}"; then APXS_CC=`${APXS} -q CC` APXS_LIBTOOL=`${APXS} -q LIBTOOL | sed -e "s/ .*$//"` - if [[ ${APXS_CC} = ${XCODE_PREFIX}* ]]; then - if test ! -x ${XCODE_CC}; then - cat "${APXS_LIBTOOL}" | sed -e \ - "s%${XCODE_BIN_PATTERN}%/usr/bin/%" > ./libtool - cat "${APXS}" | sed -e "s%get_vars(\"CC\")%\"/usr/bin/cc\"%" \ - -e 's%^my $libtool = .*;%my $libtool = \"./libtool\";%' > ./apxs - else - cat "${APXS_LIBTOOL}" | sed -e \ - "s%OSX10.[0-9][0-9]*.xctoolchain%XcodeDefault.xctoolchain%" > ./libtool - cat "${APXS}" | sed -e "s%get_vars(\"CC\")%\"${XCODE_CC}\"%" \ - -e 's%^my $libtool = .*;%my $libtool = \"./libtool\";%' > ./apxs - fi - - chmod +x ./apxs ./libtool - APXS=./apxs - fi + case ${APXS_CC} in + ${XCODE_PREFIX}*) + if test ! -x ${XCODE_CC}; then + cat "${APXS_LIBTOOL}" | sed -e \ + "s%${XCODE_BIN_PATTERN}%/usr/bin/%" > ./libtool + cat "${APXS}" | sed -e "s%get_vars(\"CC\")%\"/usr/bin/cc\"%" \ + -e 's%^my $libtool = .*;%my $libtool = \"./libtool\";%' > ./apxs + else + cat "${APXS_LIBTOOL}" | sed -e \ + "s%OSX10.[0-9][0-9]*.xctoolchain%XcodeDefault.xctoolchain%" > ./libtool + cat "${APXS}" | sed -e "s%get_vars(\"CC\")%\"${XCODE_CC}\"%" \ + -e 's%^my $libtool = .*;%my $libtool = \"./libtool\";%' > ./apxs + fi + + chmod +x ./apxs ./libtool + APXS=./apxs + ;; + *) + esac +else + as_fn_error $? "Apache tool 'apxs' or 'apxs2' is required to build mod_wsgi." "$LINENO" 5 fi -- cgit v1.2.1