[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Remove ugly duplication of directories searched for include files

From: Kobayashi Noritada <nori1_at_dolphin.c.u-tokyo.ac.jp>
Date: 2006-05-25 19:01:35 CEST

Hi,

In the Makefile for Subversion, some directories searched for include files
are specified redundantly, since...:

* SWIG_PY_INCLUDES includes SWIG_INCLUDES.
  COMPILE_PY_WRAPPER includes both of those two options.
* SWIG_RB_COMPILE includes SWIG_RB_INCLUDES, which includes SWIG_INCLUDES.
  COMPILE_SWIG_RB includes SWIG_RB_COMPILE and SWIG_RB_INCLUDES, and
  COMPILE_RB_WRAPPER includes SWIG_RB_COMPILE, SWIG_INCLUDES, and
  SWIG_RB_INCLUDES.

Actually, when I run
'make -W subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
-n subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.lo',
I find 28 '-I'-s in the resulting one line and the 80x20 terminal screen is
filled with that line... :-)
It may not be harmful but is ugly.
Here is a patch to fix it.
Please check it.

Thanks,

-nori

[[[
Remove ugly duplication of directories searched for include files.
Problem scenario:
1. SWIG_PY_INCLUDES includes SWIG_INCLUDES.
   SWIG_RB_COMPILE includes SWIG_RB_INCLUDES, which includes SWIG_INCLUDES.
2. COMPILE_PY_WRAPPER includes both of SWIG_PY_INCLUDES and SWIG_INCLUDES.
   COMPILE_SWIG_RB includes SWIG_RB_COMPILE and SWIG_RB_INCLUDES.
   COMPILE_RB_WRAPPER includes SWIG_RB_COMPILE, SWIG_INCLUDES, and
   SWIG_RB_INCLUDES.

* Makefile.in
  (COMPILE_PY_WRAPPER): Remove SWIG_INCLUDES, which is included in
  SWIG_PY_COMPILE.
  (COMPILE_RB_WRAPPER): Remove SWIG_INCLUDES, which is included in
  SWIG_RB_COMPILE.
* build/ac-macros/swig.m4 (SVN_FIND_SWIG): Remove SWIG_RB_INCLUDES from
  SWIG_RB_COMPILE.
]]]

Index: Makefile.in
===================================================================
--- Makefile.in (revision 19807)
+++ Makefile.in (working copy)
@@ -162,8 +162,8 @@
 LINK_APACHE_MOD = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS) -rpath $(APACHE_LIBEXECDIR) -avoid-version -module $(APACHE_LDFLAGS)
 
 # Compilation of SWIG-generated C source code
-COMPILE_PY_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_PY_COMPILE) $(CPPFLAGS) $(SWIG_INCLUDES) $(SWIG_PY_INCLUDES) -prefer-pic -c -o $@
-COMPILE_RB_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_RB_COMPILE) $(CPPFLAGS) $(SWIG_INCLUDES) $(SWIG_RB_INCLUDES) -prefer-pic -c -o $@
+COMPILE_PY_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_PY_COMPILE) $(CPPFLAGS) $(SWIG_PY_INCLUDES) -prefer-pic -c -o $@
+COMPILE_RB_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_RB_COMPILE) $(CPPFLAGS) $(SWIG_RB_INCLUDES) -prefer-pic -c -o $@
 
 # these commands link the wrapper objects into an extension library/module
 LINK_PY_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=link $(SWIG_PY_LINK) $(SWIG_LDFLAGS) -rpath $(swig_pydir) -avoid-version -module
Index: build/ac-macros/swig.m4
===================================================================
--- build/ac-macros/swig.m4 (revision 19807)
+++ build/ac-macros/swig.m4 (working copy)
@@ -175,7 +175,7 @@
     SWIG_RB_INCLUDES="\$(SWIG_INCLUDES) $svn_cv_ruby_includes"
 
     AC_CACHE_CHECK([how to compile Ruby extensions], [svn_cv_ruby_compile],[
- svn_cv_ruby_compile="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(CC)), %q( ), Config::CONFIG.fetch(%q(CFLAGS))'` \$(SWIG_RB_INCLUDES)"
+ svn_cv_ruby_compile="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(CC)), %q( ), Config::CONFIG.fetch(%q(CFLAGS))'`"
     ])
     SWIG_RB_COMPILE="$svn_cv_ruby_compile"
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu May 25 19:02:15 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.