{"thread":{"id":"32939","subject":"[PATCH] Bugfix: undefined htmldir in config.mak.autogen","startedAt":"2013-02-19T11:23:29Z","lastAt":"2013-02-20T12:30:52Z","messageCount":9,"participants":["Jiang Xin","Junio C Hamano","Stefano Lattarini","John Keeping"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"209810","messageId":"1be0a520b99fbfecd7255c1d26753015612856b3.1361272864.git.worldhello.net@gmail.com","threadId":"32939","inReplyTo":null,"subject":"[PATCH] Bugfix: undefined htmldir in config.mak.autogen","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2013-02-19T11:23:29Z","receivedAt":"2013-02-19T11:23:29Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Html documents will be installed to root dir (/) no matter what prefix\nis set, if run these commands before `make` and `make install-html`:\n\n    $ make configure\n    $ ./configure --prefix=<PREFIX>\n\nAfter the installation, all the html documents will copy to rootdir (/),\nand:\n\n    $ git --html-path\n    <PREFIX>\n\n    $ git help -w something\n    fatal: '<PREFIX>': not a documentation directory.\n\nThis is because the variable \"htmldir\" points to a undefined variable\n\"$(docdir)\" in file \"config.mak.autogen\", which is generated by running\n`./configure`. This bug comes from commit fc1c541 (Honor configure's\nhtmldir switch), since v1.8.1.3-537-g1d321.\n\nAdd the required two variables \"PACKAGE_TARNAME\" and \"docdir\" to file\n\"config.mak.in\" will resolve this problem.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\n---\n config.mak.in | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/config.mak.in b/config.mak.in\nindex d7c49..fa02bd 100644\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -8,6 +8,7 @@ LDFLAGS = @LDFLAGS@\n AR = @AR@\n TAR = @TAR@\n DIFF = @DIFF@\n+PACKAGE_TARNAME = @PACKAGE_TARNAME@\n #INSTALL = @INSTALL@\t\t# needs install-sh or install.sh in sources\n \n prefix = @prefix@\n@@ -17,6 +18,7 @@ gitexecdir = @libexecdir@/git-core\n datarootdir = @datarootdir@\n template_dir = @datadir@/git-core/templates\n sysconfdir = @sysconfdir@\n+docdir = @docdir@\n \n mandir = @mandir@\n htmldir = @htmldir@\n-- \n1.8.2.rc0.18.g63af42f.dirty\n"},{"id":"209854","messageId":"7vfw0s5dbv.fsf@alter.siamese.dyndns.org","threadId":"32939","inReplyTo":"1be0a520b99fbfecd7255c1d26753015612856b3.1361272864.git.worldhello.net@gmail.com","subject":"Re: [PATCH] Bugfix: undefined htmldir in config.mak.autogen","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-19T19:11:00Z","receivedAt":"2013-02-19T19:11:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> Html documents will be installed to root dir (/) no matter what prefix\n> is set, if run these commands before `make` and `make install-html`:\n>\n>     $ make configure\n>     $ ./configure --prefix=<PREFIX>\n>\n> After the installation, all the html documents will copy to rootdir (/),\n> and:\n>\n>     $ git --html-path\n>     <PREFIX>\n>\n>     $ git help -w something\n>     fatal: '<PREFIX>': not a documentation directory.\n>\n> This is because the variable \"htmldir\" points to a undefined variable\n> \"$(docdir)\" in file \"config.mak.autogen\", which is generated by running\n> `./configure`. This bug comes from commit fc1c541 (Honor configure's\n> htmldir switch), since v1.8.1.3-537-g1d321.\n>\n> Add the required two variables \"PACKAGE_TARNAME\" and \"docdir\" to file\n> \"config.mak.in\" will resolve this problem.\n>\n> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>\n> ---\n\nWho references PACKAGE_TARNAME and how is the symbol used?\n\n>  config.mak.in | 2 ++\n>  1 file changed, 2 insertions(+)\n>\n> diff --git a/config.mak.in b/config.mak.in\n> index d7c49..fa02bd 100644\n> --- a/config.mak.in\n> +++ b/config.mak.in\n> @@ -8,6 +8,7 @@ LDFLAGS = @LDFLAGS@\n>  AR = @AR@\n>  TAR = @TAR@\n>  DIFF = @DIFF@\n> +PACKAGE_TARNAME = @PACKAGE_TARNAME@\n>  #INSTALL = @INSTALL@\t\t# needs install-sh or install.sh in sources\n>  \n>  prefix = @prefix@\n> @@ -17,6 +18,7 @@ gitexecdir = @libexecdir@/git-core\n>  datarootdir = @datarootdir@\n>  template_dir = @datadir@/git-core/templates\n>  sysconfdir = @sysconfdir@\n> +docdir = @docdir@\n>  \n>  mandir = @mandir@\n>  htmldir = @htmldir@\n"},{"id":"209870","messageId":"7v8v6j52qf.fsf@alter.siamese.dyndns.org","threadId":"32939","inReplyTo":"1be0a520b99fbfecd7255c1d26753015612856b3.1361272864.git.worldhello.net@gmail.com","subject":"Re: [PATCH] Bugfix: undefined htmldir in config.mak.autogen","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-19T22:59:52Z","receivedAt":"2013-02-19T22:59:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> Html documents will be installed to root dir (/) no matter what prefix\n> is set, if run these commands before `make` and `make install-html`:\n>\n>     $ make configure\n>     $ ./configure --prefix=<PREFIX>\n>\n> After the installation, all the html documents will copy to rootdir (/),\n> and:\n>\n>     $ git --html-path\n>     <PREFIX>\n>\n>     $ git help -w something\n>     fatal: '<PREFIX>': not a documentation directory.\n\nI am not sure if this description is correct.  The generated configure\nseems to set\n\n\tdatarootdir='${prefix}/share'\n\thtmldir='${docdir}'\n        docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'\n\nso it is likely you would get not <PREFIX> but <PREFIX>/share, no?\n\nIn the main Makefile, we set htmldir to \"share/doc/git-doc\" and that\nis supposed to be relative to PREFIX, so the above will be wrong in\nmultiple ways (it is an absolute path with <PREFIX>/ in front, and\nit ends not with share/doc/git-doc but with share/doc/git).\n\nAnd the worst part is that having to know that the file needs to\nexport docdir and PACKAGE_TARNAME feels to me that we are tying\nourselves to too much detail in the internal implementation detail\nof versions of autoconf we happen to have for testing this change.\n\nI am inclined to suggest that we probably should\n\n * revert fc1c5415d69d (Honor configure's htmldir switch,\n   2013-02-02); and\n\n * fix generated \"./configure --help\" not to suggest that --htmldir\n   can be overriden from its command line;\n\ninstead of piling on a broken \"fix\" like this one top of it.\n"},{"id":"209871","messageId":"7v4nh750v3.fsf@alter.siamese.dyndns.org","threadId":"32939","inReplyTo":"7v8v6j52qf.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Bugfix: undefined htmldir in config.mak.autogen","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-19T23:40:16Z","receivedAt":"2013-02-19T23:40:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Jiang Xin <worldhello.net@gmail.com> writes:\n>\n>> Html documents will be installed to root dir (/) no matter what prefix\n>> is set, if run these commands before `make` and `make install-html`:\n>>\n>>     $ make configure\n>>     $ ./configure --prefix=<PREFIX>\n>>\n>> After the installation, all the html documents will copy to rootdir (/),\n>> and:\n>>\n>>     $ git --html-path\n>>     <PREFIX>\n>>\n>>     $ git help -w something\n>>     fatal: '<PREFIX>': not a documentation directory.\n>\n> I am not sure if this description is correct.  The generated configure\n> seems to set\n>\n> \tdatarootdir='${prefix}/share'\n> \thtmldir='${docdir}'\n>       docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'\n>\n> so it is likely you would get not <PREFIX> but <PREFIX>/share, no?\n\nThis was a mis-diag; without docdir mentioned in config.mak.in, we\ndo not even get that far, and htmldir will end up being empty, and\nthe runtime code adds <PREFIX> to it in system_path().  What I was\ndescribing was what happens when you only mention @docdir@ but not\nPACKAGE_TARNAME in the file.\n\n> And the worst part is that having to know that the file needs to\n> export docdir and PACKAGE_TARNAME feels to me that we are tying\n> ourselves to too much detail in the internal implementation detail\n> of versions of autoconf we happen to have for testing this change.\n\nThis still stands. It really feels wrong that this file has to be\naware of such an implementation detail of autoconf.  But as an\ninterim workaround, setting these two otherwise unused variables may\nbe the best we could do.\n\nI am not sure if such a layout can be actually used for installing,\nthough.  Didn't we see some issues around the relativeness of\nhtmldir and mandir vs passing them down to Documentation/Makefile,\nor is it not an issue when ./configure and config.mak.autogen is\nused?\n"},{"id":"209875","messageId":"CANYiYbF0C2qormAWNVhHm45TVQ6woECD7u1cCxxNuwyZxziNpw@mail.gmail.com","threadId":"32939","inReplyTo":"7v4nh750v3.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Bugfix: undefined htmldir in config.mak.autogen","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2013-02-20T01:39:46Z","receivedAt":"2013-02-20T01:39:46Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2013/2/20 Junio C Hamano <gitster@pobox.com>:\n> Junio C Hamano <gitster@pobox.com> writes:\n>>> After the installation, all the html documents will copy to rootdir (/),\n>>> and:\n>>>\n>>>     $ git --html-path\n>>>     <PREFIX>\n>>>\n>>>     $ git help -w something\n>>>     fatal: '<PREFIX>': not a documentation directory.\n>>\n>> I am not sure if this description is correct.  The generated configure\n>> seems to set\n>>\n>>       datarootdir='${prefix}/share'\n>>       htmldir='${docdir}'\n>>       docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'\n>>\n>> so it is likely you would get not <PREFIX> but <PREFIX>/share, no?\n>\n> This was a mis-diag; without docdir mentioned in config.mak.in, we\n> do not even get that far, and htmldir will end up being empty, and\n> the runtime code adds <PREFIX> to it in system_path().  What I was\n> describing was what happens when you only mention @docdir@ but not\n> PACKAGE_TARNAME in the file.\n\nI also doubt about it after sleep, so I check it again:\n\n    ## gettext is installed in non-standard location on Mac\n    $ export CFLAGS=-I/usr/local/include; export LDFLAGS=-L/usr/local/lib\n    $ make config\n    $ ./configure --prefix=/opt/git/v1.8.2\n    $ make && sudo make install\n    ## already symlink /opt/git/v1.8.2/bin/* to /usr/local/bin/\n    $ git --html-path\n    /opt/git/v1.8.2/\n    $ git help -w help\n    fatal: '/opt/git/v1.8.2/': not a documentation directory.\n\n>> And the worst part is that having to know that the file needs to\n>> export docdir and PACKAGE_TARNAME feels to me that we are tying\n>> ourselves to too much detail in the internal implementation detail\n>> of versions of autoconf we happen to have for testing this change.\n\nI am not familiar with autoconf. After clone autoconf and check,\nI cannot find a neat way to change \"htmldir\" default location to\nuse ${datarootdir} (just like mandir).\nIn file \"lib/autoconf/general.m4\", there are:\n\n    AC_SUBST([docdir],         [m4_ifset([AC_PACKAGE_TARNAME],\n                 ['${datarootdir}/doc/${PACKAGE_TARNAME}'],\n                 ['${datarootdir}/doc/${PACKAGE}'])])dnl\n    ...\n    AC_SUBST([htmldir],        ['${docdir}'])dnl\n    ...\n    AC_SUBST([pdfdir],         ['${docdir}'])dnl\n    ...\n    AC_SUBST([mandir],         ['${datarootdir}/man'])dnl\n\n> This still stands. It really feels wrong that this file has to be\n> aware of such an implementation detail of autoconf.  But as an\n> interim workaround, setting these two otherwise unused variables may\n> be the best we could do.\n>\n> I am not sure if such a layout can be actually used for installing,\n> though.  Didn't we see some issues around the relativeness of\n> htmldir and mandir vs passing them down to Documentation/Makefile,\n> or is it not an issue when ./configure and config.mak.autogen is\n> used?\n\n\n-- \n蒋鑫\n\n北京群英汇信息技术有限公司\n邮件: worldhello.net@gmail.com\n网址: http://www.ossxp.com/\n博客: http://www.worldhello.net/\n微博: http://weibo.com/gotgit/\n电话: 010-51262007, 18601196889\n"},{"id":"209896","messageId":"512487CB.3050908@gmail.com","threadId":"32939","inReplyTo":"CANYiYbF0C2qormAWNVhHm45TVQ6woECD7u1cCxxNuwyZxziNpw@mail.gmail.com","subject":"Re: [PATCH] Bugfix: undefined htmldir in config.mak.autogen","fromName":"Stefano Lattarini","fromEmail":"stefano.lattarini@gmail.com","sentAt":"2013-02-20T08:22:35Z","receivedAt":"2013-02-20T08:22:35Z","isPatch":true,"sender":{"key":"stefano.lattarini@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1429199?v=4"},"body":"On 02/20/2013 02:39 AM, Jiang Xin wrote:\n>\n> [SNIP]\n> \n> I am not familiar with autoconf. After clone autoconf and check,\n> I cannot find a neat way to change \"htmldir\" default location to\n> use ${datarootdir} (just like mandir).\n>\nThis one-line change should be enough to do what you want:\n\n  diff --git a/configure.ac b/configure.ac\n  index 1991258..2bfbec9 100644\n  --- a/configure.ac\n  +++ b/configure.ac\n  @@ -149,6 +149,8 @@ AC_CONFIG_SRCDIR([git.c])\n   config_file=config.mak.autogen\n   config_in=config.mak.in\n\n  +AC_SUBST([htmldir], ['${datarootdir}'])\n  +\n   GIT_CONF_SUBST([AUTOCONFIGURED], [YesPlease])\n\n   # Directories holding \"saner\" versions of common or POSIX binaries.\n\nNot sure whether this a good idea though (I haven't really followed the\ndiscussion); but it is easily doable.\n\nHTH,\n  Stefano\n"},{"id":"209903","messageId":"20130220094240.GB5011@serenity.lan","threadId":"32939","inReplyTo":"7v4nh750v3.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Bugfix: undefined htmldir in config.mak.autogen","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-02-20T09:42:41Z","receivedAt":"2013-02-20T09:42:41Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Tue, Feb 19, 2013 at 03:40:16PM -0800, Junio C Hamano wrote:\n> I am not sure if such a layout can be actually used for installing,\n> though.  Didn't we see some issues around the relativeness of\n> htmldir and mandir vs passing them down to Documentation/Makefile,\n> or is it not an issue when ./configure and config.mak.autogen is\n> used?\n\nIf these variables are set explicitly in config.mak.autogen (or indeed\nconfig.mak) then these values should override the ones calculated in the\nMakefiles so that we avoid that problem - the problem occurs if the\nrelative paths from the top-level Makefile are exported to\nDocumentation/Makefile.\n\n\nJohn\n"},{"id":"209905","messageId":"CANYiYbHpEd8kgv2nPvJgDvNLhzHbYJ8uN2gLNWWwCWvrVExpBA@mail.gmail.com","threadId":"32939","inReplyTo":"512487CB.3050908@gmail.com","subject":"Re: [PATCH] Bugfix: undefined htmldir in config.mak.autogen","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2013-02-20T10:42:59Z","receivedAt":"2013-02-20T10:42:59Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":" 2013/2/20 Stefano Lattarini <stefano.lattarini@gmail.com>:\n> On 02/20/2013 02:39 AM, Jiang Xin wrote:\n>>\n>> [SNIP]\n>>\n>> I am not familiar with autoconf. After clone autoconf and check,\n>> I cannot find a neat way to change \"htmldir\" default location to\n>> use ${datarootdir} (just like mandir).\n>>\n> This one-line change should be enough to do what you want:\n>\n>   diff --git a/configure.ac b/configure.ac\n>   index 1991258..2bfbec9 100644\n>   --- a/configure.ac\n>   +++ b/configure.ac\n>   @@ -149,6 +149,8 @@ AC_CONFIG_SRCDIR([git.c])\n>    config_file=config.mak.autogen\n>    config_in=config.mak.in\n>\n>   +AC_SUBST([htmldir], ['${datarootdir}'])\n>   +\n>    GIT_CONF_SUBST([AUTOCONFIGURED], [YesPlease])\n>\n\nIf changed like that, set:\n\n     AC_SUBST([htmldir], ['${datarootdir}/doc/git-doc'])\n\nIn the generated \"configure\" file, this instruction will be inserted\nafter the option_parse block (not before), and will override what\nthe user provided by running \"./configure --htmldir=DOCDIR\".\n\nBTW, add \"docdir = @docdir@\" to \"config.mak.in\", also let\n\"./configure --docdir=DIR\" works properly.\n\n-- \nJiang Xin\n"},{"id":"209910","messageId":"5124C1FC.6050004@gmail.com","threadId":"32939","inReplyTo":"CANYiYbHpEd8kgv2nPvJgDvNLhzHbYJ8uN2gLNWWwCWvrVExpBA@mail.gmail.com","subject":"Re: [PATCH] Bugfix: undefined htmldir in config.mak.autogen","fromName":"Stefano Lattarini","fromEmail":"stefano.lattarini@gmail.com","sentAt":"2013-02-20T12:30:52Z","receivedAt":"2013-02-20T12:30:52Z","isPatch":true,"sender":{"key":"stefano.lattarini@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1429199?v=4"},"body":"On 02/20/2013 11:42 AM, Jiang Xin wrote:\n>  2013/2/20 Stefano Lattarini <stefano.lattarini@gmail.com>:\n>> On 02/20/2013 02:39 AM, Jiang Xin wrote:\n>>>\n>>> [SNIP]\n>>>\n>>> I am not familiar with autoconf. After clone autoconf and check,\n>>> I cannot find a neat way to change \"htmldir\" default location to\n>>> use ${datarootdir} (just like mandir).\n>>>\n>> This one-line change should be enough to do what you want:\n>>\n>>   diff --git a/configure.ac b/configure.ac\n>>   index 1991258..2bfbec9 100644\n>>   --- a/configure.ac\n>>   +++ b/configure.ac\n>>   @@ -149,6 +149,8 @@ AC_CONFIG_SRCDIR([git.c])\n>>    config_file=config.mak.autogen\n>>    config_in=config.mak.in\n>>\n>>   +AC_SUBST([htmldir], ['${datarootdir}'])\n>>   +\n>>    GIT_CONF_SUBST([AUTOCONFIGURED], [YesPlease])\n>>\n> \n> If changed like that, set:\n> \n>      AC_SUBST([htmldir], ['${datarootdir}/doc/git-doc'])\n> \n> In the generated \"configure\" file, this instruction will be inserted\n> after the option_parse block (not before), and will override what\n> the user provided by running \"./configure --htmldir=DOCDIR\".\n>\nYikes, you're right.  Scratch my suggestion then; the issue should\nprobably be brought up on the autoconf mailing list.  Albeit I think\nit is by design that autoconf doesn't let a package to override the\ndefaults for installation directory: this way, the end users can\nexpect consistent, well-documented defaults for all autoconf-based\npackages.\n\n\n> BTW, add \"docdir = @docdir@\" to \"config.mak.in\", also let\n> \"./configure --docdir=DIR\" works properly.\n> \n\nThanks, and sorry for the noise,\n  Stefano\n"}]}