Loading ...
Sorry, an error occurred while loading the content.

quoting problem in generating pathdef.c

Expand Messages
  • AIDA Shinra
    Hello, On my FreeBSD-current box pathdef.c is not properly generated due to in PERL_CFLAGS: -DAPPLLIB_EXP= /usr/local/lib/perl5/5.6.1/BSDPAN all_cflags in
    Message 1 of 2 , Feb 3, 2003
    • 0 Attachment
      Hello,

      On my FreeBSD-current box pathdef.c is not properly generated due to
      '"' in PERL_CFLAGS:
      -DAPPLLIB_EXP="/usr/local/lib/perl5/5.6.1/BSDPAN"

      all_cflags in my broken pathdef.c is:
      "...-DAPPLIB_EXP="/usr/local/lib/perl5/5.6.1"..."

      We need to replace '"' to '\"' to prevent it. Following patch does
      it. QUOTESED is dirty but the result of make's limitation.

      Index: vim/src/Makefile
      diff -u vim/src/Makefile:1.3.4.1 vim/src/Makefile:1.5
      --- vim/src/Makefile:1.3.4.1 Sat Jan 25 07:23:11 2003
      +++ vim/src/Makefile Sat Jan 25 07:43:16 2003
      @@ -1961,16 +1961,17 @@
      auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in
      CC="$(CC) $(ALL_CFLAGS)" srcdir=$(srcdir) sh $(srcdir)/osdef.sh

      +QUOTESED = sed -e 's/"/\\"/g' -e 's/\\"/"/' -e 's/\\";$$/";/'
      auto/pathdef.c: Makefile auto/config.mk
      -@echo creating $@
      -@echo '/* pathdef.c */' > $@
      -@echo '/* This file is automatically created by Makefile' >> $@
      -@echo ' * DO NOT EDIT! Change Makefile only. */' >> $@
      -@echo '#include "vim.h"' >> $@
      - -@echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> $@
      - -@echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> $@
      - -@echo 'char_u *all_cflags = (char_u *)"$(CC) -c -I$(srcdir) $(ALL_CFLAGS)";' >> $@
      - -@echo 'char_u *all_lflags = (char_u *)"$(CC) $(ALL_LIB_DIRS) $(LDFLAGS) -o $(VIMTARGET) $(ALL_LIBS) ";' >> $@
      + -@echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' | $(QUOTESED) >> $@
      + -@echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' | $(QUOTESED) >> $@
      + -@echo 'char_u *all_cflags = (char_u *)"$(CC) -c -I$(srcdir) $(ALL_CFLAGS)";' | $(QUOTESED) >> $@
      + -@echo 'char_u *all_lflags = (char_u *)"$(CC) $(ALL_LIB_DIRS) $(LDFLAGS) -o $(VIMTARGET) $(ALL_LIBS) ";' | $(QUOTESED) >> $@
      -@echo 'char_u *compiled_user = (char_u *)"' | tr -d $(NL) >> $@
      -@if test -n "$(COMPILEDBY)"; then \
      echo "$(COMPILEDBY)" | tr -d $(NL) >> $@; \
    • Bram Moolenaar
      ... Looks like a good patch to me. I ll include it. Thanks! -- Laughing helps. It s like jogging on the inside. /// Bram Moolenaar -- Bram@Moolenaar.net --
      Message 2 of 2 , Feb 3, 2003
      • 0 Attachment
        Shinra Aida wrote:

        > On my FreeBSD-current box pathdef.c is not properly generated due to
        > '"' in PERL_CFLAGS:
        > -DAPPLLIB_EXP="/usr/local/lib/perl5/5.6.1/BSDPAN"
        >
        > all_cflags in my broken pathdef.c is:
        > "...-DAPPLIB_EXP="/usr/local/lib/perl5/5.6.1"..."
        >
        > We need to replace '"' to '\"' to prevent it. Following patch does
        > it. QUOTESED is dirty but the result of make's limitation.

        Looks like a good patch to me. I'll include it.

        Thanks!

        --
        Laughing helps. It's like jogging on the inside.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
      Your message has been successfully submitted and would be delivered to recipients shortly.