On Sat, Oct 15, 2011 at 6:13 PM, Warren Young <mysqlpp@stripped> wrote:
> On 10/14/2011 8:43 AM, Adrian Cornish wrote:
>> +<cxxflags>@PTHREAD_CFLAGS@ -fPIC</cxxflags>
> Doesn't that tie us to GCC? Certainly that is by far the most common
> compiler for the autoconf case, but we've had reports on list in the past
> from AIX and Solaris native compiler users.
> You should turn this into an autoconf test. See config/socket_nsl.m4. It
> shows how to conditionally figure out if certain compiler flags are needed.
> Linker flags in that case, but the availability of -fPIC can be detected
> the same way.
I did some reading and it seems the best way to do this is with
libtool. Bakefile is supposed to set PIC flags when the target is a
DLL - which it is - so I am not sure why that is not working. The
variables are there in the Makefile.in
I modified configure.ac to use libtool - tested on Fedora 15 and it
works. It correctly adds -fPIC and -DPIC to compile lines
Also fixes a lot of autoconf warning by moving the bakefile.m4 file further down
The changes to bootstrap are to make sure autoconf links in copies of
all required files.
--- configure.ac (revision 2698)
+++ configure.ac (working copy)
@@ -18,6 +18,9 @@
+# Enable libtool to decide shared library compile flags (ie -fPIC)
# Break package version up into major, minor and bugfix components.
MYSQLPP_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -f1 -d.`
@@ -27,11 +30,9 @@
MYSQLPP_VERSION_BUGFIX=`echo $PACKAGE_VERSION | cut -f3 -d.`
+# Recommended by libtoolize
-# Include Bakefile macros
# Check for Standard C support
@@ -98,6 +99,8 @@
+# Include Bakefile macros
# Configure process complete; write out files generated from *.in.
--- bootstrap (revision 2698)
+++ bootstrap (working copy)
@@ -80,9 +80,7 @@
rm -f config.cache
mv autoconf_inc.m4 config > /dev/null 2>&1 # don't care if it fails
set -x &&
- aclocal -I config -I $BAKEFILE_M4 &&
- autoheader &&
- autoconf &&
+ autoreconf --install -I config -I $BAKEFILE_M4 &&
./configure $MAINT_FLAGS $* &&
make lib/querydef.h lib/ssqls.h &&
set +x &&