Skip to content

Commit

Permalink
improve mysql lib detection, thanks Aki Tuomi and Kees Monshouwer, ag…
Browse files Browse the repository at this point in the history
…ain closes #458

git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@3019 d19b8d6e-7fed-0310-83ef-9ca221ded41b
  • Loading branch information
Peter van Dijk committed Jan 4, 2013
1 parent be6c6b3 commit 258d3f8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
24 changes: 12 additions & 12 deletions configure.ac
Expand Up @@ -450,20 +450,19 @@ then
AC_MSG_ERROR([Did not find the mysql library dir in '$MYSQL_lib_check'])
fi
case "$MYSQL_libdir" in
/usr/lib ) MYSQL_lib="" ;;
/* ) MYSQL_lib=-L$MYSQL_libdir; LDFLAGS="$MYSQL_lib $LDFLAGS";;
* ) AC_MSG_ERROR([The MySQL library directory ($MYSQL_libdir) must be an absolute path.]) ;;
/*) MYSQL_lib="-L$MYSQL_libdir -lmysqlclient"
;;
*) AC_MSG_ERROR([The MySQL library directory ($MYSQL_libdir) must be an absolute path.])
;;
esac

AC_SUBST(MYSQL_lib)

AC_MSG_RESULT([$MYSQL_libdir])
AC_MSG_CHECKING([for MySQL include directory])
AC_SUBST(MYSQL_lib)
AC_MSG_CHECKING([for MySQL include directory])
MYSQL_inc=
for m in $MYSQL_inc_check; do
if test -d "$m" && test -f "$m/mysql.h"
then
MYSQL_inc=-I$m
MYSQL_inc="$m"
break
fi
done
Expand All @@ -472,14 +471,15 @@ then
fi

case "$MYSQL_inc" in
/* ) ;;
* ) AC_MSG_ERROR([The MySQL include directory ($MYSQL_inc) must be an absolute path.]) ;;
/*) AC_MSG_RESULT($MYSQL_inc)
;;
*) AC_MSG_ERROR([The MySQL include directory ($MYSQL_inc) must be an absolute path.])
;;
esac
AC_MSG_RESULT([$MYSQL_inc])
MYSQL_inc="-I$MYSQL_inc"
fi
AC_SUBST(MYSQL_lib)
AC_SUBST(MYSQL_inc)
# LIBS="$LIBS -lmysqlclient"
fi


Expand Down
2 changes: 1 addition & 1 deletion modules/gmysqlbackend/Makefile.am
Expand Up @@ -9,7 +9,7 @@ libgmysqlbackend_la_SOURCES=gmysqlbackend.cc gmysqlbackend.hh \
smysql.hh smysql.cc


libgmysqlbackend_la_LDFLAGS=-module -avoid-version -lmysqlclient
libgmysqlbackend_la_LDFLAGS=-module -avoid-version $(MYSQL_lib)

# -Wl,-Bstatic -lpq++ -lpq -Wl,-Bdynamic -lssl -lcrypt -lcrypto

Expand Down
2 changes: 1 addition & 1 deletion modules/mydnsbackend/Makefile.am
Expand Up @@ -3,5 +3,5 @@ INCLUDES=@MYSQL_inc@
lib_LTLIBRARIES = libmydnsbackend.la
EXTRA_DIST=OBJECTFILES OBJECTLIBS
libmydnsbackend_la_SOURCES=mydnsbackend.cc mydnsbackend.hh
libmydnsbackend_la_LDFLAGS=-module -avoid-version @MYSQL_lib@ -lmysqlclient
libmydnsbackend_la_LDFLAGS=-module -avoid-version @MYSQL_lib@

4 changes: 2 additions & 2 deletions pdns/Makefile.am
Expand Up @@ -69,7 +69,7 @@ ednssubnet.cc ednssubnet.hh cachecleaner.hh json.cc json.hh

#
pdns_server_LDFLAGS=@moduleobjects@ @modulelibs@ @DYNLINKFLAGS@ @LIBDL@ @THREADFLAGS@ $(BOOST_SERIALIZATION_LDFLAGS) -rdynamic
pdns_server_LDADD= ext/polarssl-1.1.2/library/libpolarssl.a $(BOOST_SERIALIZATION_LIBS) $(LUA_LIBS) $(SQLITE3_LIBS) $(LIBCURL_LIBS)
pdns_server_LDADD= ext/polarssl-1.1.2/library/libpolarssl.a $(BOOST_SERIALIZATION_LIBS) $(LUA_LIBS) $(SQLITE3_LIBS) $(LIBCURL_LIBS) $(MYSQL_lib)

if BOTAN110
pdns_server_SOURCES += botan110signers.cc botansigners.cc
Expand Down Expand Up @@ -106,7 +106,7 @@ pdnssec_SOURCES=pdnssec.cc dbdnsseckeeper.cc sstuff.hh dnsparser.cc dnsparser.hh


pdnssec_LDFLAGS=@moduleobjects@ @modulelibs@ @DYNLINKFLAGS@ @LIBDL@ @THREADFLAGS@ $(BOOST_PROGRAM_OPTIONS_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS)
pdnssec_LDADD= ext/polarssl-1.1.2/library/libpolarssl.a $(BOOST_PROGRAM_OPTIONS_LIBS) $(BOOST_SERIALIZATION_LIBS) $(SQLITE3_LIBS) $(LIBCURL_LIBS)
pdnssec_LDADD= ext/polarssl-1.1.2/library/libpolarssl.a $(BOOST_PROGRAM_OPTIONS_LIBS) $(BOOST_SERIALIZATION_LIBS) $(SQLITE3_LIBS) $(LIBCURL_LIBS) $(MYSQL_lib)

if BOTAN110
pdnssec_SOURCES += botan110signers.cc botansigners.cc
Expand Down

0 comments on commit 258d3f8

Please sign in to comment.