zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: the transform saga, directories
@ 1999-12-06 16:31 Clint Adams
  1999-12-06 17:06 ` Zefram
  1999-12-06 18:39 ` Bart Schaefer
  0 siblings, 2 replies; 3+ messages in thread
From: Clint Adams @ 1999-12-06 16:31 UTC (permalink / raw)
  To: zsh-workers

This unfortunately brings back my make hack in order to
transform fndir and MODDIR.  I'm a little iffy about fndir since
it has its own configure switch and this makes the description
incorrect.

Index: configure.in
===================================================================
RCS file: /cvs/zsh/zsh/configure.in,v
retrieving revision 1.1.1.47
diff -u -r1.1.1.47 configure.in
--- configure.in	1999/12/06 04:33:04	1.1.1.47
+++ configure.in	1999/12/06 16:27:56
@@ -48,6 +48,15 @@
 dnl Handle --program-prefix, --program-suffix, etc.
 AC_ARG_PROGRAM
 
+u_ptn=`make -s -f - <<EOF
+all:
+	@echo ${program_transform_name}
+EOF
+`
+tzsh=`echo zsh | sed -e "${u_ptn}"`
+
+AC_SUBST(tzsh)dnl
+
 dnl Do you want to debug zsh?
 undefine([zsh-debug])dnl
 AC_ARG_ENABLE(zsh-debug,
@@ -214,10 +223,10 @@
 AC_ARG_ENABLE(fndir,
 [  --enable-fndir=DIR         where functions go (default DATADIR/zsh/functions)],
 [if test $enableval = yes; then
-  fndir=${datadir}/zsh/functions
+  fndir=${datadir}/${tzsh}/functions
 else
   fndir="$enableval"
-fi], [fndir=${datadir}/zsh/functions])
+fi], [fndir=${datadir}/${tzsh}/functions])
 
 undefine([function_subdirs])
 AC_ARG_ENABLE(function-subdirs,
Index: Config/defs.mk.in
===================================================================
RCS file: /cvs/zsh/zsh/Config/defs.mk.in,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 defs.mk.in
--- Config/defs.mk.in	1999/06/18 10:55:49	1.1.1.3
+++ Config/defs.mk.in	1999/12/06 16:27:56
@@ -33,7 +33,7 @@
 exec_prefix     = @exec_prefix@
 bindir          = @bindir@
 libdir          = @libdir@
-MODDIR          = $(libdir)/zsh/$(VERSION)
+MODDIR          = $(libdir)/@tzsh@/$(VERSION)
 infodir         = @infodir@
 mandir          = @mandir@
 fndir           = @fndir@
Index: Doc/Makefile.in
===================================================================
RCS file: /cvs/zsh/zsh/Doc/Makefile.in,v
retrieving revision 1.1.1.33
diff -u -r1.1.1.33 Makefile.in
--- Doc/Makefile.in	1999/12/06 04:40:27	1.1.1.33
+++ Doc/Makefile.in	1999/12/06 16:27:56
@@ -168,14 +168,15 @@
 install.man: $(MAN)
 	$(sdir_top)/mkinstalldirs $(DESTDIR)$(mandir)/man1
 	for file in $(MAN); do \
-	  tzsh=`echo $$file | sed '$(transform)'`; \
+	  tzsh=`echo zsh | sed '$(transform)'`; \
+	  tfile=`echo $$file | sed "s/zsh/$$tzsh/"`; \
 	  if test -f $$file; then \
-	    cp -f $$file $$tzsh; \
+	    cp -f $$file $$tfile; \
 	  elif test -f $(sdir)/$$file; then \
-	    cp -f $(sdir)/$$file $$tzsh; \
+	    cp -f $(sdir)/$$file $$tfile; \
 	  else :; \
 	  fi || exit 1; \
-	  $(INSTALL_DATA) $$tzsh $(DESTDIR)$(mandir)/man1 || exit 1; \
+	  $(INSTALL_DATA) $$tfile $(DESTDIR)$(mandir)/man1 || exit 1; \
 	done
 
 # install info pages, creating install directory if necessary
@@ -203,7 +204,8 @@
 uninstall.man:
 	for file in $(MAN); do \
 	  tzsh=`echo zsh | sed '$(transform)'`; \
-	  rm -f $(DESTDIR)$(mandir)/man1/$$tzsh; \
+	  tfile=`echo $$file | sed "s/zsh/$$tzsh/"`; \
+	  rm -f $(DESTDIR)$(mandir)/man1/$$tfile; \
 	done
 
 # uninstall info pages


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: the transform saga, directories
  1999-12-06 16:31 PATCH: the transform saga, directories Clint Adams
@ 1999-12-06 17:06 ` Zefram
  1999-12-06 18:39 ` Bart Schaefer
  1 sibling, 0 replies; 3+ messages in thread
From: Zefram @ 1999-12-06 17:06 UTC (permalink / raw)
  To: Clint Adams; +Cc: zsh-workers

Clint Adams wrote:
>This unfortunately brings back my make hack in order to
>transform fndir and MODDIR.  I'm a little iffy about fndir since
>it has its own configure switch and this makes the description
>incorrect.

fndir probably shouldn't have a configure switch.  And if it didn't then
you wouldn't need configure to do name transformation.

-zefram


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: the transform saga, directories
  1999-12-06 16:31 PATCH: the transform saga, directories Clint Adams
  1999-12-06 17:06 ` Zefram
@ 1999-12-06 18:39 ` Bart Schaefer
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 1999-12-06 18:39 UTC (permalink / raw)
  To: Clint Adams, zsh-workers

On Dec 6, 11:31am, Clint Adams wrote:
} Subject: PATCH: the transform saga, directories
}
} This unfortunately brings back my make hack in order to
} transform fndir and MODDIR.

This still doesn't really work.  The reason that you need the "make -f"
hack is because ${program_transform_name} has been processed so that
@program_tranform_name@ can appear in Makefiles even if part of the
transform introduces a $ or backslash into the name.  You're processing
that away by passing the string through make, and then not putting it
back again.

Here's some aczsh.m4 code that reverses and re-applies the autoconf sed
that's done on $program_transform_name.

We could at this point simplify {Src,Doc}/Makefile.in again to use @tzsh@
in a few (though not all) places, but I haven't done that here.

Index: aczsh.m4
===================================================================
@@ -595,3 +595,28 @@
   AC_DEFINE(HAVE_[]translit($2_$3, [ a-z], [_A-Z]))
 fi
 ])
+
+dnl
+dnl zsh_ARG_PROGRAM
+dnl   Handle AC_ARG_PROGRAM substitutions into other zsh configure macros.
+dnl   After processing this macro, the configure script may refer to
+dnl   and $tzsh_name, and @tzsh@ is defined for make substitutions.
+dnl
+
+AC_DEFUN(zsh_ARG_PROGRAM,
+[AC_ARG_PROGRAM
+# Un-double any \ or $ (doubled by AC_ARG_PROGRAM).
+cat <<\EOF_SED > conftestsed
+s,\\\\,\\,g; s,\$\$,$,g
+EOF_SED
+zsh_transform_name=`echo "${program_transform_name}" | sed -f conftestsed`
+rm -f conftestsed
+tzsh_name=`echo zsh | sed -e "${zsh_transform_name}"`
+# Double any \ or $ in the transformed name that results.
+cat <<\EOF_SED >> conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+tzsh=`echo ${tzsh_name} | sed -f conftestsed`
+rm -f conftestsed
+AC_SUBST(tzsh)dnl
+])
Index: configure.in
===================================================================
@@ -46,17 +46,8 @@
 dnl CHECKING COMMAND LINE OPTIONS
 dnl -----------------------------
 dnl Handle --program-prefix, --program-suffix, etc.
-AC_ARG_PROGRAM
+zsh_ARG_PROGRAM
 
-u_ptn=`make -s -f - <<EOF
-all:
-	@echo ${program_transform_name}
-EOF
-`
-tzsh=`echo zsh | sed -e "${u_ptn}"`
-
-AC_SUBST(tzsh)dnl
-
 dnl Do you want to debug zsh?
 undefine([zsh-debug])dnl
 AC_ARG_ENABLE(zsh-debug,
@@ -223,10 +214,10 @@
 AC_ARG_ENABLE(fndir,
 [  --enable-fndir=DIR         where functions go (default DATADIR/zsh/functions)],
 [if test $enableval = yes; then
-  fndir=${datadir}/${tzsh}/functions
+  fndir=${datadir}/${tzsh_name}/functions
 else
   fndir="$enableval"
-fi], [fndir=${datadir}/${tzsh}/functions])
+fi], [fndir=${datadir}/${tzsh_name}/functions])
 
 undefine([function_subdirs])
 AC_ARG_ENABLE(function-subdirs,


-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-12-06 18:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-06 16:31 PATCH: the transform saga, directories Clint Adams
1999-12-06 17:06 ` Zefram
1999-12-06 18:39 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).