IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3410


Ignore:
Timestamp:
Mar 11, 2005, 1:19:01 PM (21 years ago)
Author:
asc
Message:

added various MySQL tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/configure.ac

    r3241 r3410  
    3939dnl Setup the info for psLib for pkg-config
    4040PSLIB_CFLAGS="-I${includedir}"
     41
     42dnl ----------------- MYSQL options --------------------
     43dnl MYSQL_LDFLAGS="-L${libdir}/mysql"
     44dnl MYSQL_CFLAGS="-I${includedir}/mysql"
     45AC_ARG_ENABLE(mysql,
     46 [AC_HELP_STRING([--enable-mysql],[Build MySQL portions of psLib])],
     47 [AC_MSG_RESULT([enable building MySQL portions])
     48  MYSQL_REQ="yes"],
     49 [AC_MSG_RESULT([disable building MySQL portions])])
     50
     51if test "$MYSQL_REQ" == "yes"
     52then
     53  AC_ARG_WITH(mysql,
     54  [AC_HELP_STRING([--with-mysql=DIR],[Specify location of MYSQL.])],
     55  [MYSQL_CFLAGS="-I$withval/include"
     56   MYSQL_LDFLAGS="-L$withval/lib"])
     57  AC_ARG_WITH(mysql-include,
     58  [AC_HELP_STRING([--with-mysql-include=DIR],[Specify MYSQL include directory.])],
     59  [MYSQL_CFLAGS="-I$withval"])
     60  AC_ARG_WITH(mysql-lib,
     61  [AC_HELP_STRING([--with-mysql-lib=DIR],[Specify MYSQL library directory.])],
     62  [MYSQL_LDFLAGS="-L$withval"])
     63  CFLAGS="${CFLAGS=} $MYSQL_CFLAGS"
     64  PSLIB_LIBS="${PSLIB_LIBS=} $MYSQL_LDFLAGS -lmysql"
     65  AC_CHECK_HEADERS([mysql/mysql.h],[],
     66     [AC_MSG_ERROR([MySQL 4.1.2 or newer is required.  Obtain it at  http://www.mysql.com or use --with-mysql to specify location.])])
     67
     68  AC_RUN_IFELSE([AC_LANG_PROGRAM(
     69[[#include <stdlib.h>
     70#include <stdio.h>
     71#include <mysql/mysql_version.h>
     72]],[[int v=MYSQL_VERSION_ID;
     73    if (v < 40102) {
     74        exit(1);
     75    } else {
     76        exit(0);
     77    }
     78]])], [], [AC_MSG_ERROR([MySQL 4.1.2 or newer is required.  Obtain it at  http://www.mysql.com or use --with-mysql to specify location.])])
     79
     80  CFLAGS="${CFLAGS=} -DBUILD_PSDB"
     81fi
    4182
    4283dnl ----------------- CFITSIO options --------------------
Note: See TracChangeset for help on using the changeset viewer.