From: Harlan Stenn Date: Fri, 24 Jun 2011 07:02:21 +0000 (-0400) Subject: Implement --with-locfile=filename configure argument X-Git-Tag: NTP_4_2_7P187~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ba0ec3e164e9bcb4402d2ab0f104cd27b018f9d;p=thirdparty%2Fntp.git Implement --with-locfile=filename configure argument bk: 4e04367dwwPNYuNIm1Emc4RCkxLgsA --- diff --git a/ChangeLog b/ChangeLog index 474a01739..842df5089 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ * [Bug 1954] Fix typos in [s]bin_PROGRAMS in ntpd/Makefile.am. +* Implement --with-locfile=filename configure argument. If filename is + empty we'll look under loc/ for a good fit. If the filename contains + a / character, it will be treated as a "normal" pathname. Otherwise, + that explicit file will be searched for under loc/ . (4.2.7p186) 2011/06/23 Released by Harlan Stenn * [Bug 1950] Control installation of event_rpcgen.py. * Update .point-changed-filelist for the new man pages. diff --git a/scripts/genLocInfo b/scripts/genLocInfo index b584dc6cd..31cb54994 100755 --- a/scripts/genLocInfo +++ b/scripts/genLocInfo @@ -1,61 +1,29 @@ #! /bin/sh -case "$1" in - -v) - V= ;; - *) V=": " ;; -esac - -PATH=$PATH:sntp/libevent/build-aux - -RC=0 - -# Figure out which loc/* file we want to use. -# -# Either start parsing them from least- to most-specific, -# or just grab the one we like best. - -set `scripts/cvo.sh @osname@ @osver@` || exit 1 +args=`getopt f:v $*` +set -- $args -CVO_OSNAME=$1 -CVO_OSVER=$2 - -x=$CVO_OSVER LF= +RC=0 +V=": " -while true +for i do - case "$x" in - '') break ;; - esac - lf=loc/$CVO_OSNAME$x -${V}echo "Looking for <$lf>" >&2 - if test -f $lf - then - LF=$lf - break - fi - case "$x" in - *.*) x=`echo $x | sed -e 's/\.[^.]*$//'` ;; - *) x= ;; + case "$i" in + -f) locfile="$2" ; shift ;; + -v) V= ; shift ;; + --) shift ; break ;; esac done -case "$LF" in - '') - lf=loc/$CVO_OSNAME -${V}echo "Looking for <$lf>" >&2 - if test -f $lf - then - LF=$lf - fi + +case "$locfile" in + */*) + LF=$locfile ;; -esac -# This might be a good place to see if uname returns "Linux", -# and if so, use a generic file for that. -case "$LF" in '') - lf=loc/legacy -${V}echo "Looking for <$lf>" >&2 + ;; + *) + lf=loc/$LOCFILE if test -f $lf then LF=$lf @@ -63,10 +31,63 @@ ${V}echo "Looking for <$lf>" >&2 ;; esac +# If we have a file to use (ie, LF is not empty) then look for one. case "$LF" in '') - echo "No loc/XXX file found!" >&2 - exit 1 + PATH=$PATH:sntp/libevent/build-aux + set `scripts/cvo.sh @osname@ @osver@` || exit 1 + + CVO_OSNAME=$1 + CVO_OSVER=$2 + + x=$CVO_OSVER + + while true + do + case "$x" in + '') break ;; + esac +lf=loc/$CVO_OSNAME$x +${V}echo "Looking for <$lf>" >&2 + if test -f $lf + then + LF=$lf + break + fi + case "$x" in + *.*) x=`echo $x | sed -e 's/\.[^.]*$//'` ;; + *) x= ;; + esac + done + case "$LF" in + '') + lf=loc/$CVO_OSNAME +${V}echo "Looking for <$lf>" >&2 + if test -f $lf + then + LF=$lf + fi + ;; + esac + # This might be a good place to see if uname returns "Linux", + # and if so, use a generic file for that. + case "$LF" in + '') + lf=loc/legacy +${V}echo "Looking for <$lf>" >&2 + if test -f $lf + then + LF=$lf + fi + ;; + esac + + case "$LF" in + '') + echo "No loc/XXX file found!" >&2 + exit 1 + ;; + esac ;; esac diff --git a/sntp/m4/ntp_locinfo.m4 b/sntp/m4/ntp_locinfo.m4 index 004ed572a..4b479cd7d 100644 --- a/sntp/m4/ntp_locinfo.m4 +++ b/sntp/m4/ntp_locinfo.m4 @@ -6,9 +6,21 @@ dnl - man section (1, 1m, 1M, 8) AC_DEFUN([NTP_LOCINFO], [ +AC_ARG_WITH( + [locfile], + [AS_HELP_STRING( + [--with-locfile], + [os-specific or "legacy"] + )], + [ans=$withval], + [ans=] +) +# HMS: the following is wrong... +ntp_cv_locfile=$ans + AC_MSG_CHECKING([for installation directory, man sections, and man format]) -( cd $ac_abs_confdir && scripts/genLocInfo ) > genLocInfo.i 2>genLocInfo.err +( cd $ac_abs_confdir && scripts/genLocInfo -f "$ntp_cv_locfile" ) > genLocInfo.i 2>genLocInfo.err . ./genLocInfo.i case "$GENLOCINFO" in