[tpop3d-discuss] configure options for mysql

Kevin Bonner keb at pa.net
Fri, 27 Dec 2002 19:30:51 -0500


I am currently testing tpop3d 1.4.2 on a server with mysql RPM's installe=
d.  I=20
had a problem where the mysql libraries and headers were not installed in=
 the=20
proper locations for the configure script to detect them.  Instead of=20
cluttering my system with symlinks, I decided to create a patch so that o=
ne=20
can specify the location of the libraries and headers.  The defaults I ch=
ose=20
will not change the way the configure script currently behaves (using=20
/usr/include/mysql for includes and /usr/lib/mysql for libraries).  The=20
following is an example of how to specify these options:

=2E/configure --enable-auth-mysql --with-mysql-include-dir=3D/usr/include=
/mysql=20
--with-mysql-lib-dir=3D/usr/lib

Below are patches for 1.4.2 and CVS versions.  For both, you need to run =
the=20
bootstrap script so that it creates the configure script again.  Please l=
et=20
me know if there are any problems I may have overlooked.

Thanks,
Kevin Bonner

<1.4.2 patch>
diff -urN tpop3d-1.4.2.orig/configure.in tpop3d-1.4.2/configure.in
--- tpop3d-1.4.2.orig/configure.in=09Thu Jun 27 16:08:46 2002
+++ tpop3d-1.4.2/configure.in=09Fri Dec 27 19:00:57 2002
@@ -62,13 +62,21 @@
     [enable_auth_mysql=3D$enableval],
     [enable_auth_mysql=3D"no"])
=20
-AC_ARG_WITH(mysql-root,
-        [    --with-mysql-root=3DDIR     Set root of MySQL distribution =
used by=20
auth_mysql.
-                              Should contain include/mysql/mysql.h and
-                              lib/mysql/libmysqlclient.so [default=3D/us=
r]
+AC_ARG_WITH(mysql-include-dir,
+        [  --with-mysql-include-dir=3DDIR     Set MySQL include director=
y
+                                   Should contain mysql.h
+                                   [default=3D/usr/include/mysql]
 ],
-    [mysql_root=3D$withval],
-    [mysql_root=3D"/usr"])
+    [mysql_include_dir=3D$withval],
+    [mysql_include_dir=3D"/usr/include/mysql"])
+
+AC_ARG_WITH(mysql-lib-dir,
+        [  --with-mysql-lib-dir=3DDIR         Set MySQL library director=
y
+                                   Should contain libmysqlclient.so
+                                   [default=3D/usr/lib/mysql]
+],
+    [mysql_lib_dir=3D$withval],
+    [mysql_lib_dir=3D"/usr/lib/mysql"])
=20
 AC_ARG_ENABLE(auth-ldap,
         [  --enable-auth-ldap      Enable authentication against an LDAP=
=20
directory.
@@ -344,9 +352,9 @@
 dnl Set up stuff for auth-mysql.
 if test x"$enable_auth_mysql" =3D x"yes"
 then
-    LDFLAGS=3D"$LDFLAGS -L$mysql_root/lib/mysql"
+    LDFLAGS=3D"$LDFLAGS -L$mysql_lib_dir"
     dnl Also have to do CPPFLAGS, so that AC_CHECK_HEADER works...
-    CPPFLAGS=3D"$CPPFLAGS -I$mysql_root/include/mysql"
+    CPPFLAGS=3D"$CPPFLAGS -I$mysql_include_dir"
 fi
=20
 dnl auth-ldap.
@@ -587,6 +595,7 @@
 fi
=20
 AC_SUBST(ac_aux_dir)
-AC_SUBST(mysql_root)
+AC_SUBST(mysql_include_dir)
+AC_SUBST(mysql_lib_dir)
=20
 AC_OUTPUT(Makefile init.d/Makefile config/Makefile)
</1.4.2 patch>



<CVS patch>
diff -urN tpop3d.orig/configure.in tpop3d/configure.in
--- tpop3d.orig/configure.in=09Sun Nov 10 08:45:47 2002
+++ tpop3d/configure.in=09Fri Dec 27 19:09:24 2002
@@ -62,13 +62,21 @@
     [enable_auth_mysql=3D$enableval],
     [enable_auth_mysql=3D"no"])
=20
-AC_ARG_WITH(mysql-root,
-        [    --with-mysql-root=3DDIR     Set root of MySQL distribution =
used by=20
auth_mysql.
-                              Should contain include/mysql/mysql.h and
-                              lib/mysql/libmysqlclient.so [default=3D/us=
r]
+AC_ARG_WITH(mysql-include-dir,
+        [  --with-mysql-include-dir=3DDIR     Set MySQL include director=
y
+                                   Should contain mysql.h
+                                   [default=3D/usr/include/mysql]
+],
+    [mysql_include_dir=3D$withval],
+    [mysql_include_dir=3D"/usr/include/mysql"])
+
+AC_ARG_WITH(mysql-lib-dir,
+        [  --with-mysql-lib-dir=3DDIR         Set MySQL library director=
y
+                                   Should contain libmysqlclient.so
+                                   [default=3D/usr/lib/mysql]
 ],
-    [mysql_root=3D$withval],
-    [mysql_root=3D"/usr"])
+    [mysql_lib_dir=3D$withval],
+    [mysql_lib_dir=3D"/usr/lib/mysql"])
=20
 AC_ARG_ENABLE(auth-ldap,
         [  --enable-auth-ldap      Enable authentication against an LDAP=
=20
directory.
@@ -400,9 +408,9 @@
 dnl Set up stuff for auth-mysql.
 if test x"$enable_auth_mysql" =3D x"yes"
 then
-    LDFLAGS=3D"$LDFLAGS -L$mysql_root/lib/mysql"
+    LDFLAGS=3D"$LDFLAGS -L$mysql_lib_dir"
     dnl Also have to do CPPFLAGS, so that AC_CHECK_HEADER works...
-    CPPFLAGS=3D"$CPPFLAGS -I$mysql_root/include/mysql"
+    CPPFLAGS=3D"$CPPFLAGS -I$mysql_include_dir"
 fi
=20
 dnl auth-ldap.
</CVS patch>