Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#5618 closed defect (fixed)

configure error with gcc 4.3.1 on Gentoo

Reported by: mythdev@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version: unknown
Severity: medium Keywords: configure
Cc: Ticket locked: no

Description

I recently compiled the new gcc-4.3.1 on my Gentoo system. Now the MythTV configure does not work anymore:

./configure: line 2885: test: /var/tmp/portage/sys-devel/gcc-4: integer expression expected

I added some debugging statements that show the following:

 gcc-version: /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/configure
4.3.1
 GCC_MAJOR: /var/tmp/portage/sys-devel/gcc-4
 GCC_MINOR: 3

running "gcc -v 2>&1 | grep version | cut -s -d' ' -f 3" returns the following result:

/var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/configure
4.3.1

running "gcc -v":

Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.1 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.1/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.1 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.1/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.1/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.1/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --enable-multilib --disable-libmudflap --disable-libssp --enable-cld --disable-libgcj --enable-languages=c,c++,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-pkgversion='Gentoo 4.3.1-r1 p1.1'
Thread model: posix
gcc version 4.3.1 (Gentoo 4.3.1-r1 p1.1)

I made the following adjustment to the script:

Index: configure
===================================================================
--- configure   (revision 18140)
+++ configure   (working copy)
@@ -2634,7 +2634,7 @@
 check_ldflags $LDLATEFLAGS

 # GCC version
-gcc_version=$($cc -v 2>&1 | grep version | cut -s -d' ' -f 3)
+gcc_version=$($cc -v 2>&1 | grep "gcc version" | cut -s -d' ' -f 3)
 GCC_MAJOR=$(echo ${gcc_version} | cut -s -d'.' -f1)
 GCC_MINOR=$(echo ${gcc_version} | cut -s -d'.' -f2)

Is this a problem with my setup? If so, I will try to fix it here. If not, is this a workable solution, since I am not sure if this always works correctly, but it works for me.

Hopefully this helps.

Attachments (1)

gcc_version_detection.patch (448 bytes) - added by mythdev@… 16 years ago.
Better patch (error suppression), based on http://vbox.innotek.de/changeset/8461

Download all attachments as: .zip

Change History (3)

comment:1 Changed 16 years ago by Janne Grunau

Resolution: fixed
Status: newclosed

fixed by [18141], more specific gcc version check

comment:2 Changed 16 years ago by mythdev@…

The committed fix does not work for localized gcc builds.

Localized gcc builds report something like:

$ gcc -v
Ingebouwde specs worden gebruikt.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.3.1 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.1/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.1 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.1/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.1/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.1/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-cld --disable-libgcj --with-arch=i686 --enable-languages=c,c++,treelang --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-pkgversion='Gentoo 4.3.1-r1 p1.1'
Thread model: posix
gcc versie 4.3.1 (Gentoo 4.3.1-r1 p1.1)

Therefore it is better to use "gcc -dumpversion": }}} $ gcc -dumpversion 4.3.1 }}}

Patch:

Index: configure
===================================================================
--- configure   (revision 18155)
+++ configure   (working copy)
@@ -2622,7 +2622,7 @@
 check_ldflags $LDLATEFLAGS

 # GCC version
-gcc_version=$($cc -v 2>&1 | grep "^gcc version" | cut -s -d' ' -f 3)
+gcc_version=$($cc -dumpversion 2>&1)
 GCC_MAJOR=$(echo ${gcc_version} | cut -s -d'.' -f1)
 GCC_MINOR=$(echo ${gcc_version} | cut -s -d'.' -f2)

Changed 16 years ago by mythdev@…

Attachment: gcc_version_detection.patch added

Better patch (error suppression), based on http://vbox.innotek.de/changeset/8461

Note: See TracTickets for help on using tickets.