From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 64A4E6DE1203 for ; Tue, 22 Aug 2017 15:44:26 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.032 X-Spam-Level: X-Spam-Status: No, score=0.032 tagged_above=-999 required=5 tests=[AWL=-0.198, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yOBHYhScPxQo for ; Tue, 22 Aug 2017 15:44:23 -0700 (PDT) Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by arlo.cworth.org (Postfix) with ESMTPS id EA3A16DE11D4 for ; Tue, 22 Aug 2017 15:44:15 -0700 (PDT) Received: by mail-wm0-f48.google.com with SMTP id r187so3638930wma.0 for ; Tue, 22 Aug 2017 15:44:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1EdcPNJiMdZ/V5ZLwfU+gn/YiMjbVoSmOyYmbAFZcio=; b=RtWEXL/aznXOaomTj3Uh6fLOQhtaIlhpUgxWhChHlolXFqb+xPW1CxuzYrHMI18pCk wUJPtYoshNqjqJRb47VMrLAQYKzeqOC5byZGR8n9YFUn6DmO0bAOWBm+49TfejStkyaE PQXX9HqaWpw6S3sqhr6mKCzm/SfYk1Q6+HxBzNcx9Y5w72VRIdVk4MCSPfbIbBNom4jA Jguya5B+mezfDbOu5AYOOhdZ+tHeJMHoJWVOgx62jimbvTiTNnRH8McX6XPk57D5L0AP LZXdDf3ROWM0bu9Fan/522KsR2i5Hpih4MoWypS+8QeKQeMBgzojN4UqjKBQ8jQOCz+s FBKg== X-Gm-Message-State: AHYfb5iH5cMN/i4sUsDEYe3H9vSkWVLcu5CZo++DiFbNfcM9aK6/knru gbsoOIOwDD6+BMjX3Qw= X-Received: by 10.28.20.10 with SMTP id 10mr290859wmu.118.1503441854158; Tue, 22 Aug 2017 15:44:14 -0700 (PDT) Received: from home.thecybershadow.net ([89.28.117.31]) by smtp.gmail.com with ESMTPSA id e137sm491385wma.29.2017.08.22.15.44.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Aug 2017 15:44:13 -0700 (PDT) From: Vladimir Panteleev To: notmuch@notmuchmail.org Cc: Vladimir Panteleev Subject: [PATCH 4/8] configure: Refactor uname parsing into a case statement Date: Tue, 22 Aug 2017 22:43:35 +0000 Message-Id: <20170822224339.22601-5-notmuch@thecybershadow.net> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170822224339.22601-1-notmuch@thecybershadow.net> References: <20170822224339.22601-1-notmuch@thecybershadow.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Aug 2017 22:44:26 -0000 From: Vladimir Panteleev This will allow matching unames using patterns. --- configure | 101 +++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 54 insertions(+), 47 deletions(-) diff --git a/configure b/configure index c5e2ffed..17ac67bb 100755 --- a/configure +++ b/configure @@ -650,59 +650,66 @@ libdir_in_ldconfig=0 printf "Checking which platform we are on... " uname=$(uname) -if [ $uname = "Darwin" ] ; then - printf "Mac OS X.\n" - platform=MACOSX - linker_resolves_library_dependencies=0 -elif [ $uname = "SunOS" ] ; then - printf "Solaris.\n" - platform=SOLARIS - linker_resolves_library_dependencies=0 -elif [ $uname = "FreeBSD" ] ; then - printf "FreeBSD.\n" - platform=FREEBSD - linker_resolves_library_dependencies=0 -elif [ $uname = "OpenBSD" ] ; then - printf "OpenBSD.\n" - platform=OPENBSD - linker_resolves_library_dependencies=0 -elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then - printf "%s\n" "$uname" - platform="$uname" - linker_resolves_library_dependencies=1 - - printf "Checking for %s in ldconfig... " "$libdir_expanded" - ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p') - # Separate ldconfig_paths only on newline (not on any potential - # embedded space characters in any filenames). Note, we use a - # literal newline in the source here rather than something like: - # - # IFS=$(printf '\n') - # - # because the shell's command substitution deletes any trailing newlines. - IFS=" +case "$uname" in + Darwin) + printf "Mac OS X.\n" + platform=MACOSX + linker_resolves_library_dependencies=0 + ;; + SunOS) + printf "Solaris.\n" + platform=SOLARIS + linker_resolves_library_dependencies=0 + ;; + FreeBSD) + printf "FreeBSD.\n" + platform=FREEBSD + linker_resolves_library_dependencies=0 + ;; + OpenBSD) + printf "OpenBSD.\n" + platform=OPENBSD + linker_resolves_library_dependencies=0 + ;; + Linux|GNU) + printf "%s\n" "$uname" + platform="$uname" + linker_resolves_library_dependencies=1 + + printf "Checking for %s in ldconfig... " "$libdir_expanded" + ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p') + # Separate ldconfig_paths only on newline (not on any potential + # embedded space characters in any filenames). Note, we use a + # literal newline in the source here rather than something like: + # + # IFS=$(printf '\n') + # + # because the shell's command substitution deletes any trailing newlines. + IFS=" " - for path in $ldconfig_paths; do - if [ "$path" = "$libdir_expanded" ]; then - libdir_in_ldconfig=1 + for path in $ldconfig_paths; do + if [ "$path" = "$libdir_expanded" ]; then + libdir_in_ldconfig=1 + fi + done + IFS=$DEFAULT_IFS + if [ "$libdir_in_ldconfig" = '0' ]; then + printf "No (will set RPATH)\n" + else + printf "Yes\n" fi - done - IFS=$DEFAULT_IFS - if [ "$libdir_in_ldconfig" = '0' ]; then - printf "No (will set RPATH)\n" - else - printf "Yes\n" - fi -else - printf "Unknown.\n" - platform="$uname" - linker_resolves_library_dependencies=0 - cat <