apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Whitlock" <jcscoob...@gmail.com>
Subject Configure Support for Mac Universal Builds
Date Mon, 23 Apr 2007 22:58:53 GMT
Hi All,
    In my quest to build a Universal binary of Subversion I have found an
issue with apr-util not handling LDFLAGS settings properly.  To explain,
let's look at my problem.  When I use the following configure script call,
not all of the linker flags are being passed:

./configure --prefix=/Users/jwhitlock/dev/subversion_binary/binary/apr-util
--with-apr=/Users/jwhitlock/dev/subversion_binary/binary/apr
--with-berkeley-db=/Users/jwhitlock/dev/subversion_binary/binary/bdb
--without-pgsql --without-sqlite3 --without-sqlite2
--disable-dependency-tracking CFLAGS="-O -g -isysroot
/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"

What happens is the "-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" flags
are not passed and I get the following error:

ld: Undefined symbols:
_fegetround referenced from libSystem expected to be defined in
/usr/lib/system/libmathCommon.A.dylib
/usr/bin/libtool: internal link edit command failed
lipo: can't figure out the architecture type of: /var/tmp//ccPKIOat.out
make[1]: *** [libaprutil-1.la] Error 1
make: *** [all-recursive] Error 1

To prove my theory, here is the problematic libtool call:

/bin/sh /Users/jwhitlock/dev/subversion_binary/binary/apr/build-1/libtool
--silent --mode=link  gcc   -O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-arch i386 -arch ppc -DHAVE_CONFIG_H -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK
-no-cpp-precomp   -I/Users/jwhitlock/dev/subversion_binary/sources/httpd-
2.2.4/srclib/apr-util/include
-I/Users/jwhitlock/dev/subversion_binary/sources/httpd-2.2.4/srclib/apr-util/include/private
-I/Users/jwhitlock/dev/subversion_binary/binary/apr/include/apr-1
-I/Users/jwhitlock/dev/subversion_binary/binary/bdb/include
-I/Users/jwhitlock/dev/subversion_binary/sources/httpd-2.2.4/srclib/apr-util/xml/expat/lib
-version-info 2:8:2   -arch i386 -arch ppc -o libaprutil-1.la -rpath
/Users/jwhitlock/dev/subversion_binary/binary/apr-util/lib
buckets/apr_buckets_pipe.lo buckets/apr_buckets_flush.lo
buckets/apr_buckets_alloc.lo buckets/apr_buckets_pool.lo
buckets/apr_buckets_socket.lo buckets/apr_buckets_heap.lo
buckets/apr_buckets_simple.lo buckets/apr_buckets_file.lo
buckets/apr_buckets.lo buckets/apr_buckets_mmap.lo
buckets/apr_buckets_eos.lo buckets/apr_brigade.lo
buckets/apr_buckets_refcount.lo crypto/apr_sha1.lo crypto/uuid.lo
crypto/getuuid.lo crypto/apr_md5.lo crypto/apr_md4.lo dbm/apr_dbm.lo
dbm/apr_dbm_berkeleydb.lo dbm/apr_dbm_gdbm.lo dbm/apr_dbm_ndbm.lo
dbm/apr_dbm_sdbm.lo dbm/sdbm/sdbm_pair.lo dbm/sdbm/sdbm.lo
dbm/sdbm/sdbm_hash.lo dbm/sdbm/sdbm_lock.lo encoding/apr_base64.lo
hooks/apr_hooks.lo ldap/apr_ldap_url.lo ldap/apr_ldap_option.lo
ldap/apr_ldap_init.lo misc/apr_reslist.lo misc/apu_version.lo
misc/apr_date.lo misc/apr_rmm.lo misc/apr_queue.lo uri/apr_uri.lo
xml/apr_xml.lo strmatch/apr_strmatch.lo xlate/xlate.lo dbd/apr_dbd.lo
dbd/apr_dbd_sqlite2.lo dbd/apr_dbd_sqlite3.lo dbd/apr_dbd_pgsql.lo
-lpthread -L/Users/jwhitlock/dev/subversion_binary/binary/bdb/lib
-L/Users/jwhitlock/dev/subversion_binary/sources/httpd-2.2.4/srclib/apr-util/xml/expat/lib
-ldb-4.5 /Users/jwhitlock/dev/subversion_binary/sources/httpd-2.2.4/srclib/apr-util/xml/expat/lib/libexpat.la
-liconv /Users/jwhitlock/dev/subversion_binary/binary/apr/lib/libapr-1.la-lpthread

When I add the missing libtool flags to the end of the libtool call above,
apr-util links properly as a universal library.  The better way to do this
is to update the Makefile and append the missing flags to the
APRUTIL_LDFLAGS.

Now that we are on the same page, how does one verify that this worthy of a
bug report or feature request?  I really think this should be documented
since it appears that the LDFLAGS passed to configure, or as an environment
variable for that matter, are disregarded.  Where do we go from here?

Take care,

Jeremy

Mime
View raw message