summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorConstantin Jucovschi <cj@ubuntu.localdomain>2009-04-24 07:20:22 -0400
committerConstantin Jucovschi <cj@ubuntu.localdomain>2009-04-24 07:20:22 -0400
commit8f27e65bddd7d4b8515ce620fb485fdd78fcdf89 (patch)
treebd328a4dd4f92d32202241b5e3a7f36177792c5f /m4
downloadrasdaman-upstream-8f27e65bddd7d4b8515ce620fb485fdd78fcdf89.tar.gz
rasdaman-upstream-8f27e65bddd7d4b8515ce620fb485fdd78fcdf89.tar.xz
rasdaman-upstream-8f27e65bddd7d4b8515ce620fb485fdd78fcdf89.zip
Initial commitv8.0
Diffstat (limited to 'm4')
-rw-r--r--m4/ac_prog_ecpg.m430
-rw-r--r--m4/ac_prog_java_cc.m468
-rw-r--r--m4/ac_prog_rpcgen.m430
-rw-r--r--m4/ac_prog_sed.m430
-rw-r--r--m4/ax_lib_postgresql.m4155
-rw-r--r--m4/ax_lib_rasdaman.m4151
-rw-r--r--m4/ct_check_postgres_db.m474
7 files changed, 538 insertions, 0 deletions
diff --git a/m4/ac_prog_ecpg.m4 b/m4/ac_prog_ecpg.m4
new file mode 100644
index 0000000..b1025a9
--- /dev/null
+++ b/m4/ac_prog_ecpg.m4
@@ -0,0 +1,30 @@
+dnl @synopsis AC_PROG_ECPG
+dnl
+dnl Finds e precompiler for PostgreSQL embedded code.
+dnl
+dnl @category PostgreSQL
+dnl @author Sorin Stancu-Mara <smsorin@gmail.com>
+dnl @version 2009-02-22
+dnl @license GPLWithACException
+
+AC_DEFUN([AC_PROG_ECPG],
+[
+ AC_ARG_WITH([ecpg],
+ [AS_HELP_STRING([--with-ecpg=PATH],
+ [path to ecpg])],
+ [
+ ECPG="$withval"
+ ],
+ [with_ecpg=check])
+ if test "x$with_ecpg" = xcheck; then
+ AC_PATH_PROG([ECPG], [ecpg], [])
+ fi
+
+ if test ! -x "$ECPG"; then
+ AC_MSG_ERROR([Unable to find ecpg or it's an executable file.])
+ fi
+
+ AC_SUBST([ECPG])
+
+])
+
diff --git a/m4/ac_prog_java_cc.m4 b/m4/ac_prog_java_cc.m4
new file mode 100644
index 0000000..66c44b1
--- /dev/null
+++ b/m4/ac_prog_java_cc.m4
@@ -0,0 +1,68 @@
+dnl @synopsis AC_PROG_JAVA_CC
+dnl
+dnl Finds the appropriate java compiler on your path. By preference the
+dnl java compiler is gcj, then jikes then javac.
+dnl
+dnl The macro can take one argument specifying a space separated list
+dnl of java compiler names.
+dnl
+dnl For example:
+dnl
+dnl AC_PROG_JAVA_CC(javac, gcj)
+dnl
+dnl The macro also sets the compiler options variable: JAVA_CC_OPTS to
+dnl something sensible:
+dnl
+dnl - for GCJ it sets it to: @GCJ_OPTS@
+dnl (if GCJ_OPTS is not yet defined then it is set to "-C")
+dnl
+dnl - no other compiler has applicable options yet
+dnl
+dnl Here's an example configure.in:
+dnl
+dnl AC_INIT(Makefile.in)
+dnl AC_PROG_JAVA_CC()
+dnl AC_OUTPUT(Makefile)
+dnl dnl End.
+dnl
+dnl And here's the start of the Makefile.in:
+dnl
+dnl PROJECT_ROOT := @srcdir@
+dnl # Tool definitions.
+dnl JAVAC := @JAVA_CC@
+dnl JAVAC_OPTS := @JAVA_CC_OPTS@
+dnl JAR_TOOL := @jar_tool@
+dnl
+dnl @category Java
+dnl @author Nic Ferrier <nferrier@tapsellferrier.co.uk>
+dnl @version 2002-03-04
+dnl @license GPLWithACException
+
+# AC_PROG_JAVA_CC([COMPILER ...])
+# --------------------------
+# COMPILER ... is a space separated list of java compilers to search for.
+# This just gives the user an opportunity to specify an alternative
+# search list for the java compiler.
+AC_DEFUN([AC_PROG_JAVA_CC],
+[AC_ARG_VAR([JAVA_CC], [java compiler command])dnl
+AC_ARG_VAR([JAVA_CC_FLAGS], [java compiler flags])dnl
+m4_ifval([$1],
+ [AC_CHECK_TOOLS(JAVA_CC, [$1])],
+[AC_CHECK_TOOL(JAVA_CC, gcj)
+if test -z "$JAVA_CC"; then
+ AC_CHECK_TOOL(JAVA_CC, javac)
+fi
+if test -z "$JAVA_CC"; then
+ AC_CHECK_TOOL(JAVA_CC, jikes)
+fi
+])
+GCJ="$JAVA_CC"
+if test "$JAVA_CC" = "gcj"; then
+ if test "$GCJ_OPTS" = ""; then
+ AC_SUBST(GCJ_OPTS,-C)
+ fi
+ AC_SUBST(JAVA_CC_OPTS, @GCJ_OPTS@,
+ [Define the compilation options for GCJ])
+fi
+test -z "$JAVA_CC" && AC_MSG_ERROR([no acceptable java compiler found in \$PATH])
+])# AC_PROG_JAVA_CC
diff --git a/m4/ac_prog_rpcgen.m4 b/m4/ac_prog_rpcgen.m4
new file mode 100644
index 0000000..852044f
--- /dev/null
+++ b/m4/ac_prog_rpcgen.m4
@@ -0,0 +1,30 @@
+dnl @synopsis AC_PROG_RPCGEN
+dnl
+dnl Finds a RPC compiler
+dnl
+dnl @category RPC Networking
+dnl @author Sorin Stancu-Mara <smsorin@gmail.com>
+dnl @version 2009-02-22
+dnl @license GPLWithACException
+
+AC_DEFUN([AC_PROG_RPCGEN],
+[
+ AC_ARG_WITH([rpcgen],
+ [AS_HELP_STRING([--with-rpcgen=PATH],
+ [path to rpcgen])],
+ [
+ RPCGEN="$withval"
+ ],
+ [with_rpcgen=check])
+ if test "x$with_rpcgen" = xcheck; then
+ AC_PATH_PROG([RPCGEN], [rpcgen], [])
+ fi
+
+ if test ! -x "$RPCGEN"; then
+ AC_MSG_ERROR([Unable to find rpcgen or it's an executable file.])
+ fi
+
+ AC_SUBST([RPCGEN])
+
+])
+
diff --git a/m4/ac_prog_sed.m4 b/m4/ac_prog_sed.m4
new file mode 100644
index 0000000..69253cc
--- /dev/null
+++ b/m4/ac_prog_sed.m4
@@ -0,0 +1,30 @@
+dnl @synopsis AC_PROG_SED
+dnl
+dnl Finds a sed editor
+dnl
+dnl @category editors
+dnl @author Sorin Stancu-Mara <smsorin@gmail.com>
+dnl @version 2009-02-22
+dnl @license GPLWithACException
+
+AC_DEFUN([AC_PROG_SED],
+[
+ AC_ARG_WITH([sed],
+ [AS_HELP_STRING([--with-sed=PATH],
+ [path to sed])],
+ [
+ SED="$withval"
+ ],
+ [with_sed=check])
+ if test "x$with_sed" = xcheck; then
+ AC_PATH_PROG([SED], [sed], [])
+ fi
+
+ if test ! -x "$SED"; then
+ AC_MSG_ERROR([Unable to find sed or it's an executable file.])
+ fi
+
+ AC_SUBST([SED])
+
+])
+
diff --git a/m4/ax_lib_postgresql.m4 b/m4/ax_lib_postgresql.m4
new file mode 100644
index 0000000..b51134e
--- /dev/null
+++ b/m4/ax_lib_postgresql.m4
@@ -0,0 +1,155 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_lib_postgresql.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIB_POSTGRESQL([MINIMUM-VERSION])
+#
+# DESCRIPTION
+#
+# This macro provides tests of availability of PostgreSQL 'libpq' library
+# of particular version or newer.
+#
+# AX_LIB_POSTGRESQL macro takes only one argument which is optional. If
+# there is no required version passed, then macro does not run version
+# test.
+#
+# The --with-postgresql option takes one of three possible values:
+#
+# no - do not check for PostgreSQL client library
+#
+# yes - do check for PostgreSQL library in standard locations (pg_config
+# should be in the PATH)
+#
+# path - complete path to pg_config utility, use this option if pg_config
+# can't be found in the PATH
+#
+# This macro calls:
+#
+# AC_SUBST(POSTGRESQL_CFLAGS)
+# AC_SUBST(POSTGRESQL_LDFLAGS)
+# AC_SUBST(POSTGRESQL_VERSION)
+#
+# And sets:
+#
+# HAVE_POSTGRESQL
+#
+# LAST MODIFICATION
+#
+# 2008-04-12
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Mateusz Loskot <mateusz@loskot.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_LIB_POSTGRESQL],
+[
+ AC_ARG_WITH([postgresql],
+ AC_HELP_STRING([--with-postgresql=@<:@ARG@:>@],
+ [use PostgreSQL library @<:@default=yes@:>@, optionally specify path to pg_config]
+ ),
+ [
+ if test "$withval" = "no"; then
+ want_postgresql="no"
+ elif test "$withval" = "yes"; then
+ want_postgresql="yes"
+ else
+ want_postgresql="yes"
+ PG_CONFIG="$withval"
+ fi
+ ],
+ [want_postgresql="yes"]
+ )
+
+ POSTGRESQL_CFLAGS=""
+ POSTGRESQL_LDFLAGS=""
+ POSTGRESQL_VERSION=""
+
+ dnl
+ dnl Check PostgreSQL libraries (libpq)
+ dnl
+
+ if test "$want_postgresql" = "yes"; then
+
+ if test -z "$PG_CONFIG" -o test; then
+ AC_PATH_PROG([PG_CONFIG], [pg_config], [])
+ fi
+
+ if test ! -x "$PG_CONFIG"; then
+ AC_MSG_ERROR([$PG_CONFIG does not exist or it is not an exectuable file])
+ PG_CONFIG="no"
+ found_postgresql="no"
+ fi
+
+ if test "$PG_CONFIG" != "no"; then
+ AC_MSG_CHECKING([for PostgreSQL libraries])
+ POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
+ POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq"
+
+ POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'`
+
+ AC_DEFINE([HAVE_POSTGRESQL], [1],
+ [Define to 1 if PostgreSQL libraries are available])
+
+ found_postgresql="yes"
+ AC_MSG_RESULT([yes])
+ else
+ found_postgresql="no"
+ AC_MSG_RESULT([no])
+ fi
+ fi
+
+ dnl
+ dnl Check if required version of PostgreSQL is available
+ dnl
+
+
+ postgresql_version_req=ifelse([$1], [], [], [$1])
+
+ if test "$found_postgresql" = "yes" -a -n "$postgresql_version_req"; then
+
+ AC_MSG_CHECKING([if PostgreSQL version is >= $postgresql_version_req])
+
+ dnl Decompose required version string of PostgreSQL
+ dnl and calculate its number representation
+ postgresql_version_req_major=`expr $postgresql_version_req : '\([[0-9]]*\)'`
+ postgresql_version_req_minor=`expr $postgresql_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
+ postgresql_version_req_micro=`expr $postgresql_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+ if test "x$postgresql_version_req_micro" = "x"; then
+ postgresql_version_req_micro="0"
+ fi
+
+ postgresql_version_req_number=`expr $postgresql_version_req_major \* 1000000 \
+ \+ $postgresql_version_req_minor \* 1000 \
+ \+ $postgresql_version_req_micro`
+
+ dnl Decompose version string of installed PostgreSQL
+ dnl and calculate its number representation
+ postgresql_version_major=`expr $POSTGRESQL_VERSION : '\([[0-9]]*\)'`
+ postgresql_version_minor=`expr $POSTGRESQL_VERSION : '[[0-9]]*\.\([[0-9]]*\)'`
+ postgresql_version_micro=`expr $POSTGRESQL_VERSION : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+ if test "x$postgresql_version_micro" = "x"; then
+ postgresql_version_micro="0"
+ fi
+
+ postgresql_version_number=`expr $postgresql_version_major \* 1000000 \
+ \+ $postgresql_version_minor \* 1000 \
+ \+ $postgresql_version_micro`
+
+ postgresql_version_check=`expr $postgresql_version_number \>\= $postgresql_version_req_number`
+ if test "$postgresql_version_check" = "1"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ fi
+
+ AC_SUBST([POSTGRESQL_VERSION])
+ AC_SUBST([POSTGRESQL_CFLAGS])
+ AC_SUBST([POSTGRESQL_LDFLAGS])
+])
diff --git a/m4/ax_lib_rasdaman.m4 b/m4/ax_lib_rasdaman.m4
new file mode 100644
index 0000000..f16be78
--- /dev/null
+++ b/m4/ax_lib_rasdaman.m4
@@ -0,0 +1,151 @@
+dnl @synopsis AX_LIB_RASDAMAN([Action-if-found, [Action-if-not-fonund]])
+dnl
+dnl Checks if the necessary libraries and headers are available in order
+dnl to compile a program that uses raslib.
+dnl
+dnl @author Sorin Stancu-Mara <smsorin@gmail.com>
+dnl @version 2009-03-16
+dnl @licence GPLWithACException
+
+AC_DEFUN([AX_LIB_RASDAMAN],
+[
+ dnl prerequisites
+ dnl ****************
+ raslib_requirements_ok="yes"
+ raslib_missing=""
+ AC_CHECK_LIB([crypto], [EVP_DigestInit],
+ [
+ LIBS="-lcrypto $LIBS"
+ AC_DEFINE([HAVE_LIBCRYPTO])
+ ],
+ [
+ raslib_requirements_ok="no"
+ raslib_missing="$raslib_missing libcrypto"
+ ])
+ AC_CHECK_LIB([tiff], [TIFFClientOpen],
+ [
+ LIBS="-ltiff $LIBS"
+ AC_DEFINE([HAVE_LIBTIFF])
+ ],
+ [
+ raslib_requirements_ok="no"
+ raslib_missing="$raslib_missing libtiff"
+ ])
+ AC_CHECK_LIB([mfhdf], [SDstart],
+ [
+ LIBS="-lmfhdf $LIBS"
+ AC_DEFINE([HAVE_LIBHDF])
+ ],
+ [
+ raslib_requirements_ok="no"
+ raslib_missing="$raslib_missing libmfhdf"
+ ])
+ AC_CHECK_LIB([png], [png_set_read_fn],
+ [
+ LIBS="-lpng $LIBS"
+ AC_DEFINE([HAVE_LIBHDF])
+ ],
+ [
+ raslib_requirements_ok="no"
+ raslib_missing="$raslib_missing libpng"
+ ])
+ if test "$raslib_requirements_ok" = "no"; then
+ AC_MSG_NOTICE([rasdaman prerequisites not met. You need to install$raslib_missing.])
+ { echo -n; $2 }
+ else
+ AC_LANG_PUSH([C++])
+ AC_ARG_WITH([rasdaman],
+ [AS_HELP_STRING([--with-rasdaman=PATH],
+ [path to rasdaman directory hint])],
+ [HINT_RASLIB="$withval"])
+
+ raslib_found="no"
+ raslib_headers_found="no"
+ dnl find the headers
+ dnl ************
+ raslib_save_CPPFLAGS="$CPPFLAGS"
+ if test "x$HINT_RASLIB" != "x"; then
+ CPPFLAGS="$CPPFLAGS -I$HINT_RASLIB/include -I$HINT_RASLIB"
+ fi
+ AC_CHECK_HEADERS([rasdaman.hh],
+ [raslib_headers_found="yes"])
+ dnl find raslib
+ dnl *************
+ if test "$raslib_headers_found" = "yes"; then
+ CPPFLAGS="$CPPFLAGS -DDEBUG -DDEBUG_MAIN -DEARLY_TEMPLATE -D__EXECUTABLE__"
+ raslib_save_LIBS="$LIBS"
+ raslib_save_LDFLAGS="$LDFLAGS"
+ LIBS="-lclientcomm -lrasodmg -lcompression -lconversion -lclientcomm -lrasodmg -lraslib -lnetwork $LIBS"
+ AC_MSG_CHECKING([raslib])
+ AC_TRY_LINK([
+ #include "rasdaman.hh"
+ #include "raslib/template_inst.hh"
+ #include "debug/debug.hh"
+ ],
+ [
+ r_Database database;
+ database.open("");
+ ],
+ [raslib_found="yes"])
+ if test "$raslib_found" = "yes"; then
+ AC_MSG_RESULT([yes])
+ fi
+ if test "$raslib_found" = "no"; then
+ dnl Not in the default path.
+ dnl Take the hint and assume it's an install directory
+ dnl This means the libs are under lib
+ LDFLAGS="$LDFLAGS -L$HINT_RASLIB/lib"
+ AC_TRY_LINK([
+ #include "rasdaman.hh"
+ #include "raslib/template_inst.hh"
+ #include "debug/debug.hh"
+ ],
+ [
+ r_Database database;
+ database.open("");
+ ],
+ [raslib_found="yes"])
+ if test "$raslib_found" = "yes"; then
+ AC_MSG_RESULT([$HINT_RASLIB/lib])
+ fi
+ fi
+ if test "$raslib_found" = "no"; then
+ dnl Maybe the directory is a dev directory
+ LDFLAGS="$raslib_save_LDFLAGS -L$HINT_RASLIB/clientcomm"
+ LDFLAGS="$LDFLAGS -L$HINT_RASLIB/rasodmg -L$HINT_RASLIB/compression"
+ LDFLAGS="$LDFLAGS -L$HINT_RASLIB/conversion -L$HINT_RASLIB/clientcomm"
+ LDFLAGS="$LDFLAGS -L$HINT_RASLIB/raslib -L$HINT_RASLIB/network"
+ AC_TRY_LINK([
+ #include "rasdaman.hh"
+ #include "raslib/template_inst.hh"
+ #include "debug/debug.hh"
+ ],
+ [
+ r_Database database;
+ database.open("");
+ ],
+ [raslib_found="yes"])
+ if test "$raslib_found" = "yes"; then
+ AC_MSG_RESULT([$HINT_RASLIB])
+ fi
+ fi
+ if test "$raslib_found" = "no"; then
+ AC_MSG_RESULT([no])
+ fi
+ fi
+
+ if test "$raslib_found" = "no"; then
+ dnl We can't find raslib... restore everything
+ LDFLAGS="$raslib_save_LDFLAGS"
+ LIBS="$raslib_save_LIBS"
+ CXXCPPFLAGS="$raslib_save_CXXCPPFLAGS"
+ dnl Run user give commands
+ { echo -n ; $2 }
+ else
+ dnl Run user given commands
+ { echo -n ; $1 }
+ fi
+
+ AC_LANG_POP
+ fi dnl raslib_requirements_ok = no
+])
diff --git a/m4/ct_check_postgres_db.m4 b/m4/ct_check_postgres_db.m4
new file mode 100644
index 0000000..6e2b7d6
--- /dev/null
+++ b/m4/ct_check_postgres_db.m4
@@ -0,0 +1,74 @@
+dnl @synopsis CT_CHECK_POSTGRES_DB
+dnl
+dnl This macro tries to find the headers and librarys for the
+dnl PostgreSQL database to build client applications.
+dnl
+dnl If includes are found, the variable PQINCPATH will be set. If
+dnl librarys are found, the variable PQLIBPATH will be set. if no check
+dnl was successful, the script exits with a error message.
+dnl
+dnl @category InstalledPackages
+dnl @author Christian Toepp <c.toepp@gmail.com>
+dnl @version 2005-12-30
+dnl @license AllPermissive
+
+AC_DEFUN([CT_CHECK_POSTGRES_DB], [
+
+AC_ARG_WITH(pgsql,
+ [ --with-pgsql=PREFIX Prefix of your PostgreSQL installation],
+ [pg_prefix=$withval], [pg_prefix=])
+AC_ARG_WITH(pgsql-inc,
+ [ --with-pgsql-inc=PATH Path to the include directory of PostgreSQL],
+ [pg_inc=$withval], [pg_inc=])
+AC_ARG_WITH(pgsql-lib,
+ [ --with-pgsql-lib=PATH Path to the librarys of PostgreSQL],
+ [pg_lib=$withval], [pg_lib=])
+
+
+AC_SUBST(PQINCPATH)
+AC_SUBST(PQLIBPATH)
+
+if test "$pg_prefix" != ""; then
+ AC_MSG_CHECKING([for PostgreSQL includes in $pg_prefix/include])
+ if test -f "$pg_prefix/include/libpq-fe.h" ; then
+ PQINCPATH="-I$pg_prefix/include"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_ERROR(libpq-fe.h not found)
+ fi
+ AC_MSG_CHECKING([for PostgreSQL librarys in $pg_prefix/lib])
+ if test -f "$pg_prefix/lib/libpq.so" ; then
+ PQLIBPATH="-L$pg_prefix/lib"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_ERROR(libpq.so not found)
+ fi
+else
+ if test "$pg_inc" != ""; then
+ AC_MSG_CHECKING([for PostgreSQL includes in $pg_inc])
+ if test -f "$pg_inc/libpq-fe.h" ; then
+ PQINCPATH="-I$pg_inc"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_ERROR(libpq-fe.h not found)
+ fi
+ fi
+ if test "$pg_lib" != ""; then
+ AC_MSG_CHECKING([for PostgreSQL librarys in $pg_lib])
+ if test -f "$pg_lib/libpq.so" ; then
+ PQLIBPATH="-L$pg_lib"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_ERROR(libpq.so not found)
+ fi
+ fi
+fi
+
+if test "$PQINCPATH" = "" ; then
+ AC_CHECK_HEADER([postgresql/libpq-fe.h], [], AC_MSG_ERROR(libpq-fe.h not found))
+fi
+if test "$PQLIBPATH" = "" ; then
+ AC_CHECK_LIB(pq, PQconnectdb, [], AC_MSG_ERROR(libpq.so not found))
+fi
+
+])