This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug bootstrap/14760] New: A bug in configure{,.in} prevents using both --program-suffix and --program-prefix


Hello. 
 
When options like --program-suffix and --program-prefix are passed to configure 
script, they are normally converted to a sed program and then discarded, so 
when configure is called to subdirs, these options are not passed. 
 
This logic is implemented by the following code from configure.in: 
 
cat <<\EOF_SED > conftestsed 
s/ --no[[^ ]]* / / 
s/ --c[[a-z-]]*[[= ]][[^ ]]* / / 
s/ --sr[[a-z-]]*[[= ]][[^ ]]* / / 
s/ --ho[[a-z-]]*[[= ]][[^ ]]* / / 
s/ --bu[[a-z-]]*[[= ]][[^ ]]* / / 
s/ --t[[a-z-]]*[[= ]][[^ ]]* / / 
s/ --program-[[pst]][[a-z-]]*[[= ]][[^ ]]* / / 
s/ -cache-file[[= ]][[^ ]]* / / 
s/ -srcdir[[= ]][[^ ]]* / / 
s/ -host[[= ]][[^ ]]* / / 
s/ -build[[= ]][[^ ]]* / / 
s/ -target[[= ]][[^ ]]* / / 
s/ -program-prefix[[= ]][[^ ]]* / / 
s/ -program-suffix[[= ]][[^ ]]* / / 
s/ -program-transform-name[[= ]][[^ ]]* / / 
s/ [[^' -][^ ]*] / / 
s/^ *//;s/ *$// 
s,\$,$$,g 
EOF_SED 
sed -f conftestsed <<EOF_SED > conftestsed.out 
 ${ac_configure_args} 
EOF_SED 
baseargs=`cat conftestsed.out` 
rm -f conftestsed conftestsed.out 
 
If both --program-prefix and --program-suffix will be given, the corresponding 
regilar expression ' --program-[[pst]][[a-z-]]*[[= ]][[^ ]]* ' will catch only 
first of two, not touching the second. Since not-discarded option is already 
converted to a sed program, lated this will result in either prefix of suffix 
(what happens to be second) added twice to program names. 
 
This could be fixed trivially - just add 'g' modifier to corresponding line of 
the above sed program: 
 
--- configure.in.orig   2004-02-06 10:03:08.000000000 +0300 
+++ configure.in        2004-03-10 00:39:05.000000000 +0300 
@@ -1778,7 +1778,7 @@ 
 s/ --ho[[a-z-]]*[[= ]][[^ ]]* / / 
 s/ --bu[[a-z-]]*[[= ]][[^ ]]* / / 
 s/ --t[[a-z-]]*[[= ]][[^ ]]* / / 
-s/ --program-[[pst]][[a-z-]]*[[= ]][[^ ]]* / / 
+s/ --program-[[pst]][[a-z-]]*[[= ]][[^ ]]* / /g 
 s/ -cache-file[[= ]][[^ ]]* / / 
 s/ -srcdir[[= ]][[^ ]]* / / 
 s/ -host[[= ]][[^ ]]* / / 
 
I faced this problem when I worked with Debian gcc-3.4 source package to make 
it build cross-compilers. So I am reporting this against 3.4. However, most 
likely the same buglet is also there in other gcc branches.

-- 
           Summary: A bug in configure{,.in} prevents using both --program-
                    suffix and --program-prefix
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yoush at cs dot msu dot su
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14760


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]