From 3edc0e9efca0944f7e658389ae8f10f0a2453bcb Mon Sep 17 00:00:00 2001 From: Alexandre Rostovtsev Date: Wed, 8 Aug 2012 13:56:42 -0400 Subject: [PATCH] Allow the getopt command to be customized at configure time On BSD, Darwin, etc. the system getopt(1) does not support linux-utils getopt's long options. On such systems, one will want to choose a different getopt(1) implementation, for example /usr/bin/getopt-long. https://bugs.freedesktop.org/show_bug.cgi?id=53264 --- configure.ac | 7 +++++++ util/rarian-sk-update.in | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index ebddf05..21f9187 100644 --- a/configure.ac +++ b/configure.ac @@ -36,6 +36,10 @@ AC_ARG_WITH([convert-dir], [AC_HELP_STRING([--with-convert-dir=], [Chose a specific path to convert when installed [default=/share/omf]])], , with_convert_dir="$prefix/share/omf") +AC_ARG_WITH([getopt], + [AC_HELP_STRING([--with-getopt=], + [Choose a getopt(1) command compatible with the linux-utils getopt [default=]])], , + with_getopt="getopt") DISTCHECK_CONFIGURE_FLAGS="--disable-skdb-update" AC_SUBST(DISTCHECK_CONFIGURE_FLAGS) @@ -49,6 +53,9 @@ fi echo conv dir is $with_convert_dir +GETOPT="$with_getopt" +AC_SUBST([GETOPT]) + if test "x$enable_installed" = "xyes"; then AC_DEFINE(ENABLE_INSTALL, 1, [turn on Installed Mode]) AM_CONDITIONAL(ENABLE_INSTALL, true) diff --git a/util/rarian-sk-update.in b/util/rarian-sk-update.in index 8a26a9a..7aa491b 100755 --- a/util/rarian-sk-update.in +++ b/util/rarian-sk-update.in @@ -264,7 +264,7 @@ process_directory () # They are inherited from scrollkeeper :( # We use TEMP as set -- seems to nuke the return value of getopt -TEMP=`getopt -u -n$(basename $0) -o "o:r:p:vqnhV" \ +TEMP=`@GETOPT@ -u -n$(basename $0) -o "o:r:p:vqnhV" \ -- "$@"` \ || print_usage -- 1.7.8.6