Hello Werner, On Tue, Sep 30 2014 at 08:02:24 AM, Werner LEMBERG <w...@gnu.org> wrote: >> -> So, should I try to support this old behavior (looking for >> libX11), or should I directly write something very simple, like >> looking for app-defaults in a few defaults directory like >> /usr/share/X11, /usr/lib/X11, /etc/X11 (this was my first >> intention) ? Note that the possibility to use --with-appresdir is >> still there. > > Basically, I don't care :-) > >> Second point, we had this whole discussion because the build system >> installed unconditionaly X11 resources in the main install tree, no >> matter what prefix you put, forcing the use of DESTDIR when calling >> 'make distcheck'. >> >> -> Should we keep this behaviour, or should we add the prefix to >> appresdir (I would favour this second option) ? > > Again, I don't care, as long as `configure' spits out the correct > message at the very end. Maybe it makes sense to add an entry to the > `NEWS' file. > > Given that we are going to use your branch soon, you can introduce the > new behaviour right now.
Here is a patch where I implement a very simple solution, just moving appresdir to $prefix/lib/X11/app-defaults. The behaviour of--with-appresdir is unchanged, so package maintainers should not be disturbed by this change. I've also updated the NEWS file, and the message at the end of configure. If it's OK, I'll commit this patch on master and report it on automake2. Regards,
diff --git a/NEWS b/NEWS index 566068b..4ad4b41 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,26 @@ This file describes recent user-visible changes in groff. Bug fixes are not described. There are more details in the man and info pages. +VERSION 1.22.3 +============== + +gxditview +--------- + +o X11 resources for gxditview, that were previously installed in + /usr/X11/lib/X11/app-defaults no matter which 'prefix' was set, are + now installed in appresdir=$prefix/lib/X11/app-defaults. If + appresdir is not a standard X11 resource directory, the environment + variable XFILESEARCHPATH should be set to this path. The standard + default directories depends on the system libXt. Common directories + include: + + /usr/lib/X11/app-defaults + /usr/share/X11/app-defaults + /etc/X11/app-defaults + + Note that if the option --with-appresdir is passed to configure, the + 'prefix' will not be added to 'appresdir'. VERSION 1.22.2 ============== diff --git a/configure b/configure index 07d7411..a94a541 100755 --- a/configure +++ b/configure @@ -5458,89 +5458,12 @@ if test "${with_appresdir+set}" = set; then : fi if test -z "$groff_no_x"; then - # Create an Imakefile, run `xmkmf', then `make'. - rm -f -r conftest.dir - if mkdir conftest.dir; then - cd conftest.dir - # Make sure to not put `make' in the Imakefile rules, - # since we grep it out. - cat >Imakefile <<'EOF' - -xlibdirs: - @echo 'groff_x_usrlibdir="${USRLIBDIR}"; groff_x_libdir="${LIBDIR}"' -EOF - - if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", - # which would confuse us. - eval `${MAKE-make} xlibdirs 2>/dev/null | grep -v make` - - # Open Windows `xmkmf' reportedly sets LIBDIR instead of USRLIBDIR. - for groff_extension in a so sl; do - if test ! -f $groff_x_usrlibdir/libX11.$groff_extension && - test -f $groff_x_libdir/libX11.$groff_extension; then - groff_x_usrlibdir=$groff_x_libdir - break - fi - done - fi - - cd .. - rm -f -r conftest.dir - fi - - # In case the test with `xmkmf' wasn't successful, try a suite of - # standard directories. Check `X11' before `X11Rn' because it is often - # a symlink to the current release. - groff_x_libdirs=' - /usr/X11/lib - /usr/X11R6/lib - /usr/X11R5/lib - /usr/X11R4/lib - - /usr/lib/X11 - /usr/lib/X11R6 - /usr/lib/X11R5 - /usr/lib/X11R4 - - /usr/local/X11/lib - /usr/local/X11R6/lib - /usr/local/X11R5/lib - /usr/local/X11R4/lib - - /usr/local/lib/X11 - /usr/local/lib/X11R6 - /usr/local/lib/X11R5 - /usr/local/lib/X11R4 - - /usr/X386/lib - /usr/x386/lib - /usr/XFree86/lib/X11 - - /usr/lib - /usr/local/lib - /usr/unsupported/lib - /usr/athena/lib - /usr/local/x11r5/lib - /usr/lpp/Xamples/lib - - /usr/openwin/lib - /usr/openwin/share/lib' - - if test -z "$groff_x_usrlibdir"; then - # We only test whether libX11 exists. - for groff_dir in $groff_x_libdirs; do - for groff_extension in a so sl; do - if test ! -r $groff_dir/libX11.$groff_extension; then - groff_x_usrlibdir=$groff_dir - break 2 - fi - done - done - fi - if test "x$with_appresdir" = "x"; then - appresdir=$groff_x_usrlibdir/X11/app-defaults + if test "x$prefix" = "xNONE"; then + appresdir=$ac_default_prefix/lib/X11/app-defaults + else + appresdir=$prefix/lib/X11/app-defaults + fi else appresdir=$with_appresdir fi @@ -12302,49 +12225,76 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi +echo " +${PACKAGE_NAME} version ${PACKAGE_VERSION} +---------------------------------------------------------------------- + Prefix : ${prefix} + Compiler : ${CC} ${CFLAGS} ${CPPFLAGS}" +if test "x$groff_no_x" = "xyes"; then +echo "\ + X11 support : no" +else +echo "\ + X11 support : yes + X11 resources dir : $appresdir" +fi +if test "x$doc" = x; then +echo "\ + Doc build : no" +else +echo "\ + Doc build : ${doc} " +fi +echo "\ +----------------------------------------------------------------------" + if test -z "$groff_no_x"; then if test "x$with_appresdir" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: + The application resource files for gxditview (GXditview and + GXditview-color) will be installed in: - The application resource files for gxditview will be installed as - - $appresdir/GXditview - - and - - $appresdir/GXditview-color + $appresdir (existing files will be saved by appending \`.old' to the file name). - To install them into a different directory, say, \`/etc/gxditview', - add \`--with-appresdir=/etc/gxditview' to the configure script - command line options and rerun it. The environment variable - \`APPLRESDIR' must then be set to \`/etc/' (note the trailing slash), - omitting the \`gxditview' part which is automatically appended by - the X11 searching routines for resource files. More details can be - found in the X(7) manual page. + To install them into a different directory, say, + \`/etc/X11/app-defaults', add + \`--with-appresdir=/etc/X11/app-defaults' to the configure script + command line options and rerun it (\`prefix' value has no effect on + --with-appresdir option). + + If the gxditview resources are installed in a directory that is not + one of the default X11 resources directories (common default + directories are /usr/lib/X11/app-defaults, + /usr/share/X11/app-defaults aren /etc/X11/app-defaults), you will + have to set the environment variable XFILESEARCHPATH to this + path. More details can be found in the X(7) manual page, or in \"X + Toolkit Intrinsics - C Language Interface manual\" " >&5 $as_echo "$as_me: + The application resource files for gxditview (GXditview and + GXditview-color) will be installed in: - The application resource files for gxditview will be installed as - - $appresdir/GXditview - - and - - $appresdir/GXditview-color + $appresdir (existing files will be saved by appending \`.old' to the file name). - To install them into a different directory, say, \`/etc/gxditview', - add \`--with-appresdir=/etc/gxditview' to the configure script - command line options and rerun it. The environment variable - \`APPLRESDIR' must then be set to \`/etc/' (note the trailing slash), - omitting the \`gxditview' part which is automatically appended by - the X11 searching routines for resource files. More details can be - found in the X(7) manual page. + To install them into a different directory, say, + \`/etc/X11/app-defaults', add + \`--with-appresdir=/etc/X11/app-defaults' to the configure script + command line options and rerun it (\`prefix' value has no effect on + --with-appresdir option). + + If the gxditview resources are installed in a directory that is not + one of the default X11 resources directories (common default + directories are /usr/lib/X11/app-defaults, + /usr/share/X11/app-defaults aren /etc/X11/app-defaults), you will + have to set the environment variable XFILESEARCHPATH to this + path. More details can be found in the X(7) manual page, or in \"X + Toolkit Intrinsics - C Language Interface manual\" " >&6;} fi fi diff --git a/configure.ac b/configure.ac index 8c7f98d..838c11b 100644 --- a/configure.ac +++ b/configure.ac @@ -169,4 +169,27 @@ AC_CONFIG_FILES([contrib/gdiffmk/tests/runtests], AC_CONFIG_FILES([test-groff], [chmod +x test-groff]) AC_OUTPUT +echo " +${PACKAGE_NAME} version ${PACKAGE_VERSION} +---------------------------------------------------------------------- + Prefix : ${prefix} + Compiler : ${CC} ${CFLAGS} ${CPPFLAGS}" +if test "x$groff_no_x" = "xyes"; then +echo "\ + X11 support : no" +else +echo "\ + X11 support : yes + X11 resources dir : $appresdir" +fi +if test "x$doc" = x; then +echo "\ + Doc build : no" +else +echo "\ + Doc build : ${doc} " +fi +echo "\ +----------------------------------------------------------------------" + GROFF_APPRESDIR_CHECK diff --git a/m4/groff.m4 b/m4/groff.m4 index f01f471..0c96ed4 100644 --- a/m4/groff.m4 +++ b/m4/groff.m4 @@ -1230,129 +1230,53 @@ AC_DEFUN([GROFF_APPRESDIR_OPTION], # # We ignore the `XAPPLRES' and `XUSERFILESEARCHPATH' environment variables. # -# The goal is to find the `root' of X11. Under most systems this is -# `/usr/X11/lib'. Application default files are then in -# `/usr/X11/lib/X11/app-defaults'. +# By default if --with-appresdir is not used, we will install the +# gxditview resources in $prefix/lib/X11/app-defaults # -# Based on autoconf's AC_PATH_X macro. +# Note that if --with-appresdir was passed to configure, no prefix is +# added to appresdir. AC_DEFUN([GROFF_APPRESDIR_DEFAULT], [if test -z "$groff_no_x"; then - # Create an Imakefile, run `xmkmf', then `make'. - rm -f -r conftest.dir - if mkdir conftest.dir; then - cd conftest.dir - # Make sure to not put `make' in the Imakefile rules, - # since we grep it out. - cat >Imakefile <<'EOF' - -xlibdirs: - @echo 'groff_x_usrlibdir="${USRLIBDIR}"; groff_x_libdir="${LIBDIR}"' -EOF - - if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", - # which would confuse us. - eval `${MAKE-make} xlibdirs 2>/dev/null | grep -v make` - - # Open Windows `xmkmf' reportedly sets LIBDIR instead of USRLIBDIR. - for groff_extension in a so sl; do - if test ! -f $groff_x_usrlibdir/libX11.$groff_extension && - test -f $groff_x_libdir/libX11.$groff_extension; then - groff_x_usrlibdir=$groff_x_libdir - break - fi - done - fi - - cd .. - rm -f -r conftest.dir - fi - - # In case the test with `xmkmf' wasn't successful, try a suite of - # standard directories. Check `X11' before `X11Rn' because it is often - # a symlink to the current release. - groff_x_libdirs=' - /usr/X11/lib - /usr/X11R6/lib - /usr/X11R5/lib - /usr/X11R4/lib - - /usr/lib/X11 - /usr/lib/X11R6 - /usr/lib/X11R5 - /usr/lib/X11R4 - - /usr/local/X11/lib - /usr/local/X11R6/lib - /usr/local/X11R5/lib - /usr/local/X11R4/lib - - /usr/local/lib/X11 - /usr/local/lib/X11R6 - /usr/local/lib/X11R5 - /usr/local/lib/X11R4 - - /usr/X386/lib - /usr/x386/lib - /usr/XFree86/lib/X11 - - /usr/lib - /usr/local/lib - /usr/unsupported/lib - /usr/athena/lib - /usr/local/x11r5/lib - /usr/lpp/Xamples/lib - - /usr/openwin/lib - /usr/openwin/share/lib' - - if test -z "$groff_x_usrlibdir"; then - # We only test whether libX11 exists. - for groff_dir in $groff_x_libdirs; do - for groff_extension in a so sl; do - if test ! -r $groff_dir/libX11.$groff_extension; then - groff_x_usrlibdir=$groff_dir - break 2 - fi - done - done - fi - if test "x$with_appresdir" = "x"; then - appresdir=$groff_x_usrlibdir/X11/app-defaults + if test "x$prefix" = "xNONE"; then + appresdir=$ac_default_prefix/lib/X11/app-defaults + else + appresdir=$prefix/lib/X11/app-defaults + fi else appresdir=$with_appresdir fi fi AC_SUBST([appresdir])]) - # Emit warning if --with-appresdir hasn't been used. AC_DEFUN([GROFF_APPRESDIR_CHECK], [if test -z "$groff_no_x"; then if test "x$with_appresdir" = "x"; then AC_MSG_NOTICE([ + The application resource files for gxditview (GXditview and + GXditview-color) will be installed in: - The application resource files for gxditview will be installed as - - $appresdir/GXditview - - and - - $appresdir/GXditview-color + $appresdir (existing files will be saved by appending `.old' to the file name). - To install them into a different directory, say, `/etc/gxditview', - add `--with-appresdir=/etc/gxditview' to the configure script - command line options and rerun it. The environment variable - `APPLRESDIR' must then be set to `/etc/' (note the trailing slash), - omitting the `gxditview' part which is automatically appended by - the X11 searching routines for resource files. More details can be - found in the X(7) manual page. + To install them into a different directory, say, + `/etc/X11/app-defaults', add + `--with-appresdir=/etc/X11/app-defaults' to the configure script + command line options and rerun it (`prefix' value has no effect on + --with-appresdir option). + + If the gxditview resources are installed in a directory that is not + one of the default X11 resources directories (common default + directories are /usr/lib/X11/app-defaults, + /usr/share/X11/app-defaults aren /etc/X11/app-defaults), you will + have to set the environment variable XFILESEARCHPATH to this + path. More details can be found in the X(7) manual page, or in "X + Toolkit Intrinsics - C Language Interface manual" ]) fi fi])
-- Bertrand Garrigues