On Feb 9, 2009, at 22:52, Bradley Giesbrecht wrote:
On Feb 9, 2009, at 8:41 PM, Ryan Schmidt wrote:
On Feb 9, 2009, at 22:34, Bradley Giesbrecht wrote:
On Feb 9, 2009, at 4:18 PM, Ryan Schmidt wrote:
On Feb 9, 2009, at 17:53, Ryan Schmidt wrote:
You could prepend ${prefix}/lib/mysql5/bin to the PATH. That's
where the program "mysql_config" lives.
configure.env-append PATH=${prefix}/lib/mysql5/bin:$env(PATH)
The reason it then still doesn't work is because libzdb is
calling mysql_config incorrectly. As you note, it uses
"mysql_config --libs $LDFLAGS". It is not correct to put
"$LDFLAGS" at the end of that command invocation. The correct
way to call it is just "mysql_config --libs". It works for you
on the command line because LDFLAGS is empty by default, but
MacPorts fills it with a value, so when run within MacPorts, it
fails. If you look in the config.log, you see that mysql_config
is printing its usage message, showing that the way it is being
used is not correct. Attached is a Portfile and patch that work
for me. You should send the patchfile to the author of libzdb.
In the Portfile, I also added a dependency on mysql5, and added
configure arguments to disable postgresql and sqlite. If you
want to enable postgresql or sqlite, remove the corresponding
configure argument and add the required dependency.
I had a more complex Portfile which I trimmed down before posting
to make it simple to try.
I guess I'm old school that way.
The patch Portfile attached to your email removed the patch file.
I like it but it didn't work.
If I add the patch and remove the $LDFLAGS in the patch
"mysql_config --libs $LDFLAGS" to "mysql_config --libs" it works.
But... the Portfile I attached said
patchfiles patch-configure
And I attached my revised patch-configure which said
- LDFLAGS=`mysql_config --libs $LDFLAGS`
- CPPFLAGS=`mysql_config --include $CPPFLAGS`
+ LDFLAGS="`mysql_config --libs` $LDFLAGS"
+ CPPFLAGS="`mysql_config --include` $CPPFLAGS"
to fix the problem with calling mysql_config. My Portfile also
fixed the PATH in the configure phase with
configure.env-append PATH=${prefix}/lib/mysql5/bin:$env(PATH)
so that mysql_config could be found. I tested this before
attaching it to the email and it worked for me as sent.
Reading your comment " It is not correct to put "$LDFLAGS" at the
end of that command invocation." and without looking in
"config.log" personally I assumed you meant to remove the
"$LDFLAGS" from "mysql_config --libs $LDFLAGS" in the patch.
I just copied your revised Portfile and patch-configure file and
ran "port clean --all" and "port configure" and it failed.
Altering the patch to remove ""$LDFLAGS"" fixed the configure
problems.
Anyways, without looking at the configure.log I believe you are
right and that is very cool. I will pass your/our patch upstream.
LDFLAGS should not be inside the backticks, but should presumably be
outside the backticks. The way the developer had it, he was saying
"set LDFLAGS to the value of the program invocation `mysql_config --
libs $LDFLAGS`" and that's not a valid invocation of mysql_config if
$LDFLAGS is nonempty. I changed it to say "set LDFLAGS to the value
of the program invocation `mysql_config --libs` and then a space and
then whatever was already in $LDFLAGS" which I think is what the
developer was trying to say, but maybe he never tested with LDFLAGS
nonempty.
I just tried again with the files I sent earlier and it works fine.
Make a directory libzdb, put Portfile in it, make a files directory
in it, put patch-configure in the files directory, cd to the libzdb
directory, and run port -d configure. For me it says:
checking for mysql... checking for mysql_init in -lmysqlclient... yes
checking mysql version... checking mysql.h usability... yes
checking mysql.h presence... yes
checking for mysql.h... yes
ok
And then
| SQLite3: DISABLED |
| Mysql: ENABLED |
| PostgreSQL: DISABLED |
I've attached my debug log so you can compare it to yours; maybe that
will point out what's different.
DEBUG: Changing to port directory: /private/tmp/libzdb
DEBUG: setting option os.universal_supported to yes
DEBUG: org.macports.load registered provides 'load', a pre-existing procedure.
Target override will not be provided
DEBUG: org.macports.distfiles registered provides 'distfiles', a pre-existing
procedure. Target override will not be provided
DEBUG: adding the default universal variant
DEBUG: Requested variant darwin is not provided by port libzdb.
DEBUG: Requested variant i386 is not provided by port libzdb.
DEBUG: Requested variant macosx is not provided by port libzdb.
DEBUG: Changing to port directory: /private/tmp/libzdb
DEBUG: setting option os.universal_supported to yes
DEBUG: org.macports.load registered provides 'load', a pre-existing procedure.
Target override will not be provided
DEBUG: org.macports.distfiles registered provides 'distfiles', a pre-existing
procedure. Target override will not be provided
DEBUG: adding the default universal variant
DEBUG: Requested variant darwin is not provided by port libzdb.
DEBUG: Requested variant i386 is not provided by port libzdb.
DEBUG: Requested variant macosx is not provided by port libzdb.
DEBUG: Found port in file:///Users/rschmidt/macports/dports/databases/mysql5
DEBUG: Changing to port directory:
/Users/rschmidt/macports/dports/databases/mysql5
DEBUG: setting option os.universal_supported to yes
DEBUG: org.macports.load registered provides 'load', a pre-existing procedure.
Target override will not be provided
DEBUG: org.macports.distfiles registered provides 'distfiles', a pre-existing
procedure. Target override will not be provided
DEBUG: adding the default universal variant
DEBUG: Requested variant darwin is not provided by port mysql5.
DEBUG: Requested variant i386 is not provided by port mysql5.
DEBUG: Requested variant macosx is not provided by port mysql5.
DEBUG: Searching for dependency: mysql5
DEBUG: Found Dependency: receipt exists for mysql5
DEBUG: Executing org.macports.main (libzdb)
---> Fetching libzdb
DEBUG: Executing org.macports.fetch (libzdb)
---> libzdb-2.3.tar.gz doesn't seem to exist in
/mp/var/macports/distfiles/libzdb
DEBUG: Pinging www.tildeslash.com...
DEBUG: Pinging leopard.local...
DEBUG: Pinging niceg4.local...
DEBUG: Pinging seven0.local...
DEBUG: Pinging distfiles.macports.org...
DEBUG: Pinging trd.no.distfiles.macports.org...
DEBUG: Pinging arn.se.distfiles.macports.org...
DEBUG: www.tildeslash.com ping time is 153.673
DEBUG: leopard.local ping time is 10000
DEBUG: niceg4.local ping time is 10000
DEBUG: seven0.local ping time is 42.205
DEBUG: distfiles.macports.org ping time is 10000
DEBUG: trd.no.distfiles.macports.org ping time is 171.962
DEBUG: arn.se.distfiles.macports.org ping time is 151.386
---> Attempting to fetch libzdb-2.3.tar.gz from
http://seven0.local/distfiles/libzdb
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
DEBUG: Fetching failed:: HTTP response code said error
---> Attempting to fetch libzdb-2.3.tar.gz from
http://arn.se.distfiles.macports.org/libzdb
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
DEBUG: Fetching failed:: HTTP response code said error
---> Attempting to fetch libzdb-2.3.tar.gz from
http://www.tildeslash.com/libzdb/dist/
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 590k 0 1133 0 0 2749 0 0:03:40 --:--:-- 0:03:40 2749
6 590k 6 41617 0 0 30640 0 0:00:19 0:00:01 0:00:18 42749
37 590k 37 219k 0 0 96153 0 0:00:06 0:00:02 0:00:04 113k
81 590k 81 483k 0 0 134k 0 0:00:04 0:00:03 0:00:01 152k
94 590k 94 558k 0 0 129k 0 0:00:04 0:00:04 --:--:-- 143k
100 590k 100 590k 0 0 129k 0 0:00:04 0:00:04 --:--:-- 142k
---> Verifying checksum(s) for libzdb
DEBUG: Executing org.macports.checksum (libzdb)
---> Checksumming libzdb-2.3.tar.gz
DEBUG: Correct (md5) checksum for libzdb-2.3.tar.gz
DEBUG: Correct (sha1) checksum for libzdb-2.3.tar.gz
DEBUG: Correct (rmd160) checksum for libzdb-2.3.tar.gz
---> Extracting libzdb
DEBUG: Executing org.macports.extract (libzdb)
---> Extracting libzdb-2.3.tar.gz
DEBUG: setting option extract.args to
/mp/var/macports/distfiles/libzdb/libzdb-2.3.tar.gz
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.4'
DEBUG: Assembled command: 'cd "/mp/var/macports/build/_private_tmp_libzdb/work"
&& gzip -dc /mp/var/macports/distfiles/libzdb/libzdb-2.3.tar.gz |
/usr/bin/gnutar --no-same-owner -xf -'
DEBUG: Executing org.macports.patch (libzdb)
---> Applying patches to libzdb
---> Applying /private/tmp/libzdb/files/patch-configure
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.4'
DEBUG: Assembled command: 'cd
"/mp/var/macports/build/_private_tmp_libzdb/work/libzdb-2.3" && patch -p0'
patching file configure
---> Configuring libzdb
DEBUG: Using compiler 'Mac OS X gcc 4.0'
DEBUG: Executing org.macports.configure (libzdb)
DEBUG: Environment: CFLAGS='-O2' CPPFLAGS='-I/mp/include' CXXFLAGS='-O2'
MACOSX_DEPLOYMENT_TARGET='10.4' CPP='/usr/bin/cpp-4.0' CXX='/usr/bin/g++-4.0'
F90FLAGS='-O2' LDFLAGS='-L/mp/lib' FCFLAGS='-O2' OBJC='/usr/bin/gcc-4.0'
INSTALL='/usr/bin/install -c' OBJCFLAGS='-O2' FFLAGS='-O2'
PATH='/mp/lib/mysql5/bin:/mp/bin:/mp/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin'
CC='/usr/bin/gcc-4.0'
DEBUG: Assembled command: 'cd
"/mp/var/macports/build/_private_tmp_libzdb/work/libzdb-2.3" && ./configure
--prefix=/mp --without-postgresql --without-sqlite'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /mp/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... /usr/bin/gcc-4.0
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc-4.0 accepts -g... yes
checking for /usr/bin/gcc-4.0 option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of /usr/bin/gcc-4.0... none
checking how to run the C preprocessor... /usr/bin/cpp-4.0
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether /usr/bin/gcc-4.0 needs -traditional... no
checking for re2c... no
checking for flex... /mp/bin/flex
checking build system type... i386-apple-darwin8.11.1
checking host system type... i386-apple-darwin8.11.1
checking for a sed that does not truncate output... /mp/bin/gsed
checking for ld used by /usr/bin/gcc-4.0...
/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld) is GNU
ld... no
checking for /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld option to reload
object files... -r
checking for BSD-compatible nm... /usr/bin/nm -p
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking whether we are using the GNU C++ compiler... yes
checking whether /usr/bin/g++-4.0 accepts -g... yes
checking dependency style of /usr/bin/g++-4.0... none
checking how to run the C++ preprocessor... /usr/bin/g++-4.0 -E
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether accepts -g... no
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm -p output from /usr/bin/gcc-4.0 object...
ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if /usr/bin/gcc-4.0 supports -fno-rtti -fno-exceptions... no
checking for /usr/bin/gcc-4.0 option to produce PIC... -fno-common
checking if /usr/bin/gcc-4.0 PIC flag -fno-common works... yes
checking if /usr/bin/gcc-4.0 static flag -static works... no
checking if /usr/bin/gcc-4.0 supports -c -o file.o... yes
checking whether the /usr/bin/gcc-4.0 linker
(/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin8.11.1 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by /usr/bin/g++-4.0...
/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld) is GNU
ld... no
checking whether the /usr/bin/g++-4.0 linker
(/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld) supports shared libraries... yes
checking for /usr/bin/g++-4.0 option to produce PIC... -fno-common
checking if /usr/bin/g++-4.0 PIC flag -fno-common works... yes
checking if /usr/bin/g++-4.0 static flag -static works... no
checking if /usr/bin/g++-4.0 supports -c -o file.o... yes
checking whether the /usr/bin/g++-4.0 linker
(/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin8.11.1 dyld
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for pthread_create in -lpthread... yes
checking for mysql... checking for mysql_init in -lmysqlclient... yes
checking mysql version... checking mysql.h usability... yes
checking mysql.h presence... yes
checking for mysql.h... yes
ok
checking for compress in -lz... yes
checking for postgresql... no
checking for SQLite3... sqlite=no
checking for ANSI C header files... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether byte ordering is bigendian... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating test/Makefile
config.status: creating src/xconfig.h
config.status: executing depfiles commands
+------------------------------------------------------------+
| License: |
| This is Open Source Software and use is subject to the GNU |
| GENERAL PUBLIC LICENSE with exceptions, available in this |
| distribution in the files COPYING and EXCEPTIONS. |
| |
| By continuing this installation process, you are bound by |
| the terms of this license agreement. If you do not agree |
| with the terms of this license, you must abort the |
| installation process at this point. |
+------------------------------------------------------------+
| The Zild Database Library is configured as follows: |
| |
| Optimized: DISABLED |
| Protected: DISABLED |
| Profiling: DISABLED |
| Zild: DISABLED |
| Unit Tests Build: ENABLED |
| |
| SQLite3: DISABLED |
| Mysql: ENABLED |
| PostgreSQL: DISABLED |
+------------------------------------------------------------+
_______________________________________________
macports-dev mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev