Opened 7 years ago

Closed 7 years ago

#2825 closed defect (fixed)

bind10 build fails "mysql.h: No such file"

Reported by: tmark Owned by: tmark
Priority: medium Milestone: Sprint-DHCP-20130328
Component: libdhcp Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

Using an explicit file path with the configure prefix causes the include of mysql.h to fail.

MySQL is installed on my Macbook in /opt/local, such that the mysql_config is located in /opt/local/lib/mysql55/bin. I set the configure option for dhcp as follows:

--with-dhcp-mysql=/opt/local/lib/mysql55/bin/mysql_config

Configure succeeds, but subsequent make fails with "mysql.h: No such file" error.

The issue apppear to be both the source file include and the -I include option are specifying a "mysql" subdirectory:

#include <mysql/mysql.h> (see mysql_lease_mgr.h)

and:

while the include -I value generated by configure appends "mysql" as shown below (excerpted from config.report):

MySQL: -I/opt/local/lib/mysql55/mysql -pipe -fno-strict-aliasing -g

-L/opt/local/lib/mysql55/mysql -lmysqlclient -pthread -lz -lm

Net effect is trying to find /opt/local/lib/mysql55/mysql/mysql/mysql.h. Too many "mysql"s.

Subtickets

Attachments (1)

test-suite.log (13.1 KB) - added by tmark 7 years ago.
dhcpsrv unit test log

Download all attachments as: .zip

Change History (9)

comment:1 Changed 7 years ago by tmark

  • Component changed from build system to libdhcp

Consensus is that the correct solution is to remove the prefix "mysql/" from the #include statements. The value reported by mysql_config will accurately reflect the correct include directory.

comment:2 Changed 7 years ago by jelte

  • Milestone changed from New Tasks to DHCP Outstanding Tasks

comment:3 Changed 7 years ago by stephen

  • Milestone changed from DHCP Outstanding Tasks to Sprint-DHCP-20130328

comment:4 Changed 7 years ago by tmark

  • Owner changed from UnAssigned to tmark
  • Status changed from new to accepted

Changed 7 years ago by tmark

dhcpsrv unit test log

comment:5 Changed 7 years ago by tmark

  • Owner changed from tmark to UnAssigned
  • Status changed from accepted to reviewing

I removed the "mysql/" prefix from the dhcpsrv source files. Re-ran configuration and it builds correctly. The MySQL unit tests also succeed barring two that are known to broken (see #2837). Attached is the test suite log.

I also verified that the MySQL files being used were correct:

Excerpt from config.log:

$ ./configure --prefix=/Users/tmark/toms_lab/var/test_1 --with-dhcp-mysql=/usr/local/mysql/bin/mysql_config --with-pythonpath=/opt/local/bin/python3.1 --with-gtest-source=/opt/gtest-1.6.0 --disable-silent-rules

:
:
MYSQL_CPPFLAGS='-I/usr/local/mysql/include -Os -g -fno-strict-aliasing -arch x86_64'
MYSQL_LIBS='-L/usr/local/mysql/lib -lmysqlclient'
#define HAVE_MYSQL 1

Output below from command line:

tmark@pegasus ~/build/bind10-tip (trac2825) $ ls -lt /usr/local/mysql
lrwxr-xr-x 1 root wheel 27 Feb 21 14:37 /usr/local/mysql -> mysql-5.6.10-osx10.7-x86_64

tmark@pegasus ~/build/bind10-tip (trac2825) $ locate mysql.h
/usr/local/mysql-5.6.10-osx10.7-x86_64/include/mysql.h

comment:6 Changed 7 years ago by stephen

  • Owner changed from UnAssigned to stephen

comment:7 Changed 7 years ago by stephen

  • Owner changed from stephen to tmark

Reviewed commit 4813e06cf4e0a9d9f453890557b639715e081eca

Looks OK, please merge into master. I think an entry should be made in ChangeLog. Something like:

xxx.    [bug]           tmark
        Modified "include" statements in DHCP MySQL lease manager code to
        fix build problems if MySQL is installed in a non-standard location.
        (Trac #2825, git 4813e06cf4e0a9d9f453890557b639715e081eca)

comment:8 Changed 7 years ago by tmark

  • Resolution set to fixed
  • Status changed from reviewing to closed

Changes merged in. ChangeLog? updated.

Note: See TracTickets for help on using tickets.