On Mon, Jun 11, 2001 at 12:15:57PM -0500, [EMAIL PROTECTED] wrote:
> On Mon, Jun 11, 2001 at 10:19:26AM -0500, Dave Dykstra wrote:
> > On Sun, Jun 10, 2001 at 03:01:26AM -0500, [EMAIL PROTECTED] wrote:
> > > Patch to set RSYNC_NAME in rsync.h. It adds a new option to configure,
> > > --with-rsync-name, that takes a string that is used to replace
> > > RSYNC_NAME. The default is "rsync".
> > 
> > I kind of hate to pre-process all of rsync.h for just that one variable.
> > Isn't there some way to get autoheader to stick it into config.h.in?
> > Alternatively it could go into a -D as part of @CFLAGS@ in Makefile.in
> > but I'm not sure I care for that much either.
> 
> How about we #ifndef RSYNC_NAME in rsync.h and add -DRSYNC_NAME to
> @CPPFLAGS@? The one caveat to adding it to @CPPFLAGS@ rather than in
> rsync.h is that for your $PATH variable, you'll need to quote it. Not
> so if you have RSYNC_NAME in config.h or rsync.h.

I decided to go with putting RSYNC_PATH into config.h.  I see Martin
apparently started to use the RSYNC_NAME define for other purposes, and
besides the corresponding run-time option is --rsync-path.  The configure
option is --rsync-path.

Below is the patch.  I checked it in to the rsync CVS.

- Dave Dykstra


*** configure.in.O      Tue Jun 12 14:22:15 2001
--- configure.in        Tue Jun 12 14:22:44 2001
***************
*** 38,43 ****
--- 38,50 ----
  AC_ARG_WITH(included-popt,
          [  --with-included-popt    use bundled popt library, not from system])
  
+ AC_ARG_WITH(rsync-path,
+       [  --with-rsync-path=PATH  set rsync path used on server to PATH (default: 
+"rsync")],
+       [ RSYNC_PATH="$with_rsync_name" ],
+       [ RSYNC_PATH="rsync" ])
+ RSYNC_PATH="\"$RSYNC_PATH\""
+ AC_DEFINE_UNQUOTED(RSYNC_PATH, $RSYNC_PATH)
+ 
  dnl Checks for programs.
  AC_PROG_CC
  AC_PROG_INSTALL
*** acconfig.h.O        Tue Jun 12 14:22:15 2001
--- acconfig.h  Tue Jun 12 14:22:44 2001
***************
*** 15,18 ****
  #undef HAVE_SOCKETPAIR
  #undef HAVE_SECURE_MKSTEMP
  #undef HAVE_C99_VSNPRINTF
! 
--- 15,18 ----
  #undef HAVE_SOCKETPAIR
  #undef HAVE_SECURE_MKSTEMP
  #undef HAVE_C99_VSNPRINTF
! #undef RSYNC_PATH
*** options.c.O Tue Jun 12 14:22:15 2001
--- options.c   Tue Jun 12 14:22:44 2001
***************
*** 81,87 ****
  char *shell_cmd = NULL;
  char *log_format = NULL;
  char *password_file = NULL;
! char *rsync_path = RSYNC_NAME;
  char *backup_dir = NULL;
  int rsync_port = RSYNC_PORT;
  
--- 81,87 ----
  char *shell_cmd = NULL;
  char *log_format = NULL;
  char *password_file = NULL;
! char *rsync_path = RSYNC_PATH;
  char *backup_dir = NULL;
  int rsync_port = RSYNC_PORT;
  

Reply via email to