ciao Mario,
On Friday 04 August 2006 20:29, Mario Torre wrote:
> ...
> For the configure patch (any non trivial commit), I need approval so I
> have not committed it also.
>
> I wait feedback :)
i'm attaching another alternative to the default-preferences-peer option which
covers all existing three alternatives for the preferences factory
implementation we already have, plus allows for different/new ones if we
decide not to refer to them symbolically.
i tested configure:
* without the option altogether,
* with just enable-default-preferences-peer,
* with enable-default-preferences-peer=file, and
* with enable-default-preferences-peer=gnu.java.util.prefs.MemoryBasedFactory
and they all do the right thing; i.e. the java.utils.prefs.PreferencesFactory
file in META-INF/services/ contains the correct class name.
the help string makes it clear what the acceptable values for this option are:
--enable-default-preferences-peer=peer type or class name
specify one of: "gconf" [default] for a GConf based
backend, "file" for a file based one, "memory" for a
transient one, or a fully qualified class name
implementing java.util.prefs.PreferencesFactory
cheers;
rsn
Index: configure.ac
===================================================================
RCS file: /cvsroot/classpath/classpath/configure.ac,v
retrieving revision 1.176
diff -u -r1.176 configure.ac
--- configure.ac 2 Aug 2006 23:28:12 -0000 1.176
+++ configure.ac 4 Aug 2006 12:34:18 -0000
@@ -85,13 +85,16 @@
dnl -----------------------------------------------------------
dnl Default Preference Backend
dnl -----------------------------------------------------------
-AC_ARG_ENABLE(default-preferences-peer,
- AS_HELP_STRING([--enable-default-preferences-peer],
- [fully qualified class name of default Preferences API Backend]))
-DEFAULT_PREFS_PEER=$enable_default_preferences_peer
-if test "$DEFAULT_PREFS_PEER" = ""; then
- DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory
-fi
+AC_ARG_ENABLE([default-preferences-peer],
+ [AS_HELP_STRING([--enable-default-preferences-peer[=peer type or class name]],
+ [specify one of: "gconf" [default] for a GConf based backend, "file" for a file based one, "memory" for a transient one, or a fully qualified class name implementing java.util.prefs.PreferencesFactory])],
+ [case "${enableval}" in
+ file) DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory ;;
+ gconf) DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory ;;
+ memory) DEFAULT_PREFS_PEER=gnu.java.util.prefs.MemoryBasedFactory ;;
+ *) DEFAULT_PREFS_PEER=${enableval} ;;
+ esac],
+ [DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory])
dnl AC_SUBST(DEFAULT_PREFS_PEER)
dnl -----------------------------------------------------------