Ad Widget

Collapse

[1.3.6] Changeset 4054 prevents compiling with MySQL on linux 64 bits, patch provided

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Farzad FARID
    Member
    • Apr 2007
    • 79

    #1

    [1.3.6] Changeset 4054 prevents compiling with MySQL on linux 64 bits, patch provided

    Hi Zabbix team,

    Note: post updated to also include the Net-SNMP compilation problem.

    Zabbix 1.3.6 (rev 4081) compiles and works correctly on a 32 bits Linux with MySQL and Net-SNMP (tested on Debian Etch), but the configure phase stops with an error on a 64 bits Linux (tested with Fedora Core 5 64 bits).

    The faulty patch is the revision 4054 of files "m4/ax_lib_mysql.m4" and "m4/netsnmp.m4". I haven't fully analyzed and understood this patch, but one thing is obvious: if --enable-static is not provided, the piece of code that sets MYSQL_LDFLAGS and MYSQL_LIBS is not executed

    This revision works seamlessly on a 32 bits linux, but on an 64 bits Linux somes library paths must absolutely be set, and the bug is triggered. The obvious patch is to remove the "if" that tests for "enable-static" in "m4/ax_lib_mysql.m4".

    Here is a tested patch, it compiles on Debian 32 bits and FC5 64 bits.

    Code:
    Index: m4/ax_lib_mysql.m4
    ===================================================================
    --- m4/ax_lib_mysql.m4  (révision 4081)
    +++ m4/ax_lib_mysql.m4  (copie de travail)
    @@ -84,7 +84,6 @@
    
                 MYSQL_CFLAGS="`$MYSQL_CONFIG --cflags`"
    
    -            if test "x$enable_static" = "xyes"; then
                    _full_libmysql_libs="`$MYSQL_CONFIG --libs`"
    
                    for i in $_full_libmysql_libs; do
    @@ -100,7 +99,6 @@
                        ;;
                        esac
                    done
    -            fi
    
                    _save_mysql_libs="${LIBS}"
                    _save_mysql_ldflags="${LDFLAGS}"
    Index: m4/netsnmp.m4
    ===================================================================
    --- m4/netsnmp.m4       (révision 4081)
    +++ m4/netsnmp.m4       (copie de travail)
    @@ -67,22 +67,19 @@
                            esac
                    done
    
    -               if test "x$enable_static" = "xyes"; then
    -                       _full_libnetsnmp_libs="`$_libnetsnmp_config --libs` -lcrypto"
    +               _full_libnetsnmp_libs="`$_libnetsnmp_config --libs` -lcrypto"
    +               for i in $_full_libnetsnmp_libs; do
    +                       case $i in
    +                               -lnetsnmp)
    +                       ;;
    +                               -l*)
    +                                       _lib_name="`echo "$i" | cut -b3-`"
    +                                       SNMP_LIBS="$SNMP_LIBS $i"
    
    -                       for i in $_full_libnetsnmp_libs; do
    -                               case $i in
    -                                       -lnetsnmp)
    -                               ;;
    -                                       -l*)
    -                                               _lib_name="`echo "$i" | cut -b3-`"
    -                                               SNMP_LIBS="$SNMP_LIBS $i"
    +                       ;;
    +                       esac
    +               done
    
    -                               ;;
    -                               esac
    -                       done
    -               fi
    -
                    _save_netsnmp_libs="${LIBS}"
                    _save_netsnmp_ldflags="${LDFLAGS}"
                    _save_netsnmp_cflags="${CFLAGS}"
    Regards.
    Last edited by Farzad FARID; 02-05-2007, 17:02. Reason: Patch extension to also handle Net-SNMP compilation
  • liedekef
    Junior Member
    • May 2005
    • 10

    #2
    I agree, on fedora the path is /usr/lib/mysql for mysql libs (even for 32-bit) and this also triggers the bug.

    Comment

    • liedekef
      Junior Member
      • May 2005
      • 10

      #3
      btw, this should probably be in the "patches" forum ...

      Comment

      • Farzad FARID
        Member
        • Apr 2007
        • 79

        #4
        Originally posted by liedekef
        btw, this should probably be in the "patches" forum ...
        Yes, I know made a mistake when choosing the forum yesterday.. I reposted the patch in a correct form (file attachement) in the "Zabbix patches" forum: http://www.zabbix.com/forum/showthread.php?t=5938

        Regards

        Comment

        Working...