]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Implement --with-locfile=filename configure argument
authorHarlan Stenn <stenn@ntp.org>
Fri, 24 Jun 2011 07:02:21 +0000 (03:02 -0400)
committerHarlan Stenn <stenn@ntp.org>
Fri, 24 Jun 2011 07:02:21 +0000 (03:02 -0400)
bk: 4e04367dwwPNYuNIm1Emc4RCkxLgsA

ChangeLog
scripts/genLocInfo
sntp/m4/ntp_locinfo.m4

index 474a01739d7429cf239a56e424e5dfe8e6878e4f..842df5089652556000b49130e0f16ce281921121 100644 (file)
--- 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 <stenn@ntp.org>
 * [Bug 1950] Control installation of event_rpcgen.py.
 * Update .point-changed-filelist for the new man pages.
index b584dc6cd67b2b3b7cf4e8f429f01ac7642925c2..31cb54994e5c479b08602783949fb42c5f92315e 100755 (executable)
@@ -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
 
index 004ed572a7426d4521596649b836a23e6028ee0b..4b479cd7dd260d214affa60498a19dbee96d24d4 100644 (file)
@@ -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