I built ctypes-python for the first time today. It didn't pick up my
"apr" and "apr-util" locations automatically, and this patch fixes that.

[[[
Fix a problem in the automatic finding of 'apr-1-config' by
'make ctypes-python'.

* build/ac-macros/apr.m4
  (SVN_LIB_APR): Set the 'SVN_APR_CONFIG' substitution variable to the path
    of the 'apr-1-config' program.

* build/ac-macros/aprutil.m4
  (SVN_LIB_APRUTIL): Set the 'SVN_APRUTIL_CONFIG' substitution variable to
    the path of the 'apu-1-config' program.

* build/run_ctypesgen.sh
  Receive in arguments 9 and 10 the paths to the apr-config and apu-config
  executables, instead of their "prefix" directories, thus eliminating the
  incorrect assumption that they would be found in '<prefix>/bin'.
  The <exec-prefix> in which these are found is not necessarily <prefix>; in
  the Ubuntu 'libapr1' package that I am using, for example, <prefix> is
  empty and <exec-prefix> is '/usr'. (apr-1-config can tell us <prefix> but
  not <exec-prefix>; anyway, we already had to know its path and name to get
  that information out of it, so let's use what we knew.)
  This also eliminates the needless assumption that the config script is
  called 'apr-1-config' rather than, say, 'apr-config'.

* Makefile.in
  (ctypes-python): Pass SVN_APR_CONFIG and SVN_APRUTIL_CONFIG, instead of
    their generic 'prefix' directories, to run_ctypesgen.sh.
]]]

- Julian

Fix a problem in the automatic finding of 'apr-1-config' by
'make ctypes-python'.

* build/ac-macros/apr.m4
  (SVN_LIB_APR): Set the 'SVN_APR_CONFIG' substitution variable to the path
    of the 'apr-1-config' program.

* build/ac-macros/aprutil.m4
  (SVN_LIB_APRUTIL): Set the 'SVN_APRUTIL_CONFIG' substitution variable to
    the path of the 'apu-1-config' program.

* build/run_ctypesgen.sh
  Receive in arguments 9 and 10 the paths to the apr-config and apu-config
  executables, instead of their "prefix" directories, thus eliminating the
  incorrect assumption that they would be found in '<prefix>/bin'.
  The <exec-prefix> in which these are found is not necessarily <prefix>; in
  the Ubuntu 'libapr1' package that I am using, for example, <prefix> is
  empty and <exec-prefix> is '/usr'. (apr-1-config can tell us <prefix> but
  not <exec-prefix>; anyway, we already had to know its path and name to get
  that information out of it, so let's use what we knew.)
  This also eliminates the needless assumption that the config script is
  called 'apr-1-config' rather than, say, 'apr-config'.

* Makefile.in
  (ctypes-python): Pass SVN_APR_CONFIG and SVN_APRUTIL_CONFIG, instead of
    their generic 'prefix' directories, to run_ctypesgen.sh.
--This line, and those below, will be ignored--

Index: build/ac-macros/apr.m4
===================================================================
--- build/ac-macros/apr.m4	(revision 884899)
+++ build/ac-macros/apr.m4	(working copy)
@@ -112,6 +112,7 @@ AC_DEFUN(SVN_LIB_APR,
   fi
 
   AC_SUBST(SVN_APR_PREFIX)
+  AC_SUBST(SVN_APR_CONFIG, ["$apr_config"])
   AC_SUBST(SVN_APR_INCLUDES)
   AC_SUBST(SVN_APR_LIBS)
   AC_SUBST(SVN_APR_SHLIB_PATH_VAR)
Index: build/ac-macros/aprutil.m4
===================================================================
--- build/ac-macros/aprutil.m4	(revision 884899)
+++ build/ac-macros/aprutil.m4	(working copy)
@@ -111,6 +111,7 @@ AC_DEFUN(SVN_LIB_APRUTIL,
   SVN_APRUTIL_LIBS="`SVN_REMOVE_STANDARD_LIB_DIRS($SVN_APRUTIL_LIBS)`"
 
   AC_SUBST(SVN_APRUTIL_INCLUDES)
+  AC_SUBST(SVN_APRUTIL_CONFIG, ["$apu_config"])
   AC_SUBST(SVN_APRUTIL_LIBS)
   AC_SUBST(SVN_APRUTIL_PREFIX)
 
Index: build/run_ctypesgen.sh
===================================================================
--- build/run_ctypesgen.sh	(revision 884899)
+++ build/run_ctypesgen.sh	(working copy)
@@ -34,8 +34,8 @@ abs_srcdir="$6"
 abs_builddir="$7"
 
 svn_libdir="$8"
-apr_prefix="$9"
-apu_prefix="${10}"
+apr_config="$9"
+apu_config="${10}"
 
 cp_relpath="subversion/bindings/ctypes-python"
 output="$cp_relpath/svn_all.py"
@@ -49,9 +49,6 @@ else
 fi
 
 ### most of this should be done at configure time and passed in
-apr_config="$apr_prefix/bin/apr-1-config"
-apu_config="$apr_prefix/bin/apu-1-config"
-
 apr_cppflags="`$apr_config --includes --cppflags`"
 apr_include_dir="`$apr_config --includedir`"
 apr_ldflags="`$apr_config --ldflags --link-ld`"
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 884899)
+++ Makefile.in	(working copy)
@@ -151,8 +151,10 @@ JAVAHL_INCLUDES= @JNI_INCLUDES@ -I$(abs_
 
 SVN_APR_INCLUDES = @SVN_APR_INCLUDES@
 SVN_APR_PREFIX = @SVN_APR_PREFIX@
+SVN_APR_CONFIG = @SVN_APR_CONFIG@
 SVN_APRUTIL_INCLUDES = @SVN_APRUTIL_INCLUDES@
 SVN_APRUTIL_PREFIX = @SVN_APRUTIL_PREFIX@
+SVN_APRUTIL_CONFIG = @SVN_APRUTIL_CONFIG@
 
 SVN_APR_MEMCACHE_PREFIX = @SVN_APR_MEMCACHE_PREFIX@
 SVN_APR_MEMCACHE_INCLUDES = @SVN_APR_MEMCACHE_INCLUDES@
@@ -810,7 +812,7 @@ install-swig-rb-doc:
 
 # ctypes-python make targets
 ctypes-python: local-all
-	$(abs_srcdir)/build/run_ctypesgen.sh "$(LT_EXECUTE)" "$(CPPFLAGS)" "$(EXTRA_CTYPES_LDFLAGS)" "$(PYTHON)" "$(CTYPESGEN)" "$(abs_srcdir)" "$(abs_builddir)" "$(libdir)" "$(SVN_APR_PREFIX)" "$(SVN_APRUTIL_PREFIX)"
+	$(abs_srcdir)/build/run_ctypesgen.sh "$(LT_EXECUTE)" "$(CPPFLAGS)" "$(EXTRA_CTYPES_LDFLAGS)" "$(PYTHON)" "$(CTYPESGEN)" "$(abs_srcdir)" "$(abs_builddir)" "$(libdir)" "$(SVN_APR_CONFIG)" "$(SVN_APRUTIL_CONFIG)"
 
 install-ctypes-python: ctypes-python
 	cd $(CTYPES_PYTHON_SRC_DIR); \

Reply via email to