On Thu, Jul 04, 2013 at 10:41:45AM -0700, Bruce Korb wrote:
> On 07/04/13 09:40, Jack Howarth wrote:
>> Currently I am forced to manually patch fixincludes/fixinc.in to have the 
>> DIR passed to
>> --with-sysroot honored during the bootstrap. Thanks in advance for any help 
>> in getting
>> this oversight in fixincludes fixed for gcc 4.9.
>>              Jack
>
> I saw the bug report.  I find autotools sufficiently flexible that they
> are neigh on opaque.  I *think* you'll need:
>
>   AC_ARG_WITH([sysroot],
>     [the system include directory -- default: /usr/include],
>     [ AC_DEFINE_UNQUOTED([SYSTEM_INC_DIR], "$withval",
>           [system include directory])
>
>       [if test -d "$withval" ; then SYSTEM_INC_DIR=$withval
>        else AC_MSG_ERROR([provided value is not a directory: $withval]) ; 
> fi]],
>
>     [SYSTEM_INC_DIR=/usr/include])

Unfortunately there seems to be a syntax error related to the use of 
AC_MSG_ERROR. Both
your original change and the variation attached produce an error when I run 
autoreconf in
fixincludes...

% autoreconf -iv
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal 
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /sw/bin/autoconf-2.64
configure.ac:34: error: possibly undefined macro: AC_MSG_ERROR
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /sw/bin/autoconf-2.64 failed with exit status: 1

>
> and then replace the INPUTLIST definition with:
>
>   test $# -eq 0 && INPUTLIST="@SYSTEM_INC_DIR@" || INPUTLIST="$*"
>
> using "$@" is confusing and won't actually work:
>
>> $ set a b c\ d;echo $#;f="$@";set -- $f; echo $#
>> 3
>> 4
>
>
> Anyway, I *think* that works, but like I said, it's pretty opaque to me.
Index: fixincludes/configure.ac
===================================================================
--- fixincludes/configure.ac    (revision 200679)
+++ fixincludes/configure.ac    (working copy)
@@ -24,6 +24,18 @@
 # Determine the noncanonical target name, for directory use.
 ACX_NONCANONICAL_TARGET
 
+# Honor --with-sysroot
+AC_ARG_WITH([sysroot],
+  [the system include directory -- default: /usr/include],
+  [AC_DEFINE_UNQUOTED([SYSTEM_INC_DIR], "$withval",
+     [system include directory])
+  [if test -d "$withval" ; then
+    SYSTEM_INC_DIR=$withval
+  else
+    AC_MSG_ERROR([provided value is not a directory: $withval]); 
+  fi]],
+  [SYSTEM_INC_DIR=/usr/include])
+ 
 # Specify the local prefix
 local_prefix=
 AC_ARG_WITH(local-prefix,
Index: fixincludes/fixinc.in
===================================================================
--- fixincludes/fixinc.in       (revision 200679)
+++ fixincludes/fixinc.in       (working copy)
@@ -173,9 +173,9 @@
 #
 if test $# -eq 0
 then
-    INPUTLIST="/usr/include"
+    INPUTLIST="@SYSTEM_INC_DIR@"
 else
-    INPUTLIST="$@"
+    INPUTLIST="$*"
 fi
 
 for INPUT in ${INPUTLIST} ; do

Reply via email to