Modified the rlm_sql driver Makefiles to use the new autoconf values. Removed rlm_sql...
authormmachado <mmachado>
Sat, 10 Mar 2001 01:49:04 +0000 (01:49 +0000)
committermmachado <mmachado>
Sat, 10 Mar 2001 01:49:04 +0000 (01:49 +0000)
Make.inc.in
src/modules/rlm_sql/drivers/checkconfig [deleted file]
src/modules/rlm_sql/drivers/rlm_sql_iodbc/Makefile
src/modules/rlm_sql/drivers/rlm_sql_mysql/Makefile
src/modules/rlm_sql/drivers/rlm_sql_oracle/Makefile
src/modules/rlm_sql/drivers/rlm_sql_postgresql/Makefile
src/modules/rlm_sql/drivers/rules.mak

index ff4e55d..4a4352e 100644 (file)
@@ -51,7 +51,7 @@ USE_STATIC_LIBS = @USE_STATIC_LIBS@
 STATIC_MODULES = @STATIC_MODULES@
 
 #
-#  PostgreSQL defines
+#  SQL driver defines
 #
 PGROOT         = @PGROOT@
 PQ_LIBS                = @PQ_LIBS@
@@ -59,3 +59,9 @@ PG_INCLUDE_DIR        = @PG_INCLUDE_DIR@
 
 SQL_MYSQL_LIBS = @MYSQL_LIBS@
 SQL_MYSQL_INCLUDE = @MYSQL_INCLUDE@
+
+#SQL_ODBC_LIBS = @ODBC_LIBS@
+#SQL_ODBC_INCLUDE = @ODBC_INCLUDE@
+
+#SQL_ORACLE_LIBS = @ORACLE_LIBS@
+#SQL_ORACLE_INCLUDE = @ORACLE_INCLUDE@
diff --git a/src/modules/rlm_sql/drivers/checkconfig b/src/modules/rlm_sql/drivers/checkconfig
deleted file mode 100755 (executable)
index 1506bcb..0000000
+++ /dev/null
@@ -1,360 +0,0 @@
-#!/bin/sh
-#
-#  $Id$
-#
-CC=`grep CC ../../../../../Make.inc | sed 's/.*=//;s/ //g'`
-
-usage() {
-    cat <<EOF
-Usage: checkconfig [opts] DEFINE thingy bar
- Echoes DEFINE to config.mak and config.h IF the conditions match.
-
-  -c LIBFOO function
-     Check if 'function' can be used without linking a library
-
-  -l LIBFOO function -lfoo ["additional compilation flags"]
-     Check if 'function' is defined in library 'foo'
-
-  -I HAVE_INCLUDE foo.h
-     Check if include file <foo.h> exists.
-
-  -f HAVE_FILE /path/to/file
-     Check if the specified file exists
-
-  -d HAVE_DIR /path/to/dir/
-     Check if the specified directory exists
-
-  -e PROGRAM program
-     Find out where the specified executable lives.
-
-EOF
-    exit 0
-}
-
-#######################################################################
-#
-# print out help
-#
-#######################################################################
-if [ "$#" -le "2" ];then
-  usage
-fi
-
-DEF=$2
-
-#######################################################################
-#
-# Check to see if a variable by the name of DEF is already defined.
-# If so, don't bother doing the check.
-#
-#######################################################################
-if [ -r config.mak ];then
-  ALREADY=`grep "^$DEF=" config.mak`
-  if [ "$ALREADY" != "" ];then
-    exit 0
-  fi
-fi
-
-#######################################################################
-#
-#  Define a function used to compile things
-#
-#######################################################################
-compile() {
-$CC $CFLAGS tmp$$.c $LIBS -o tmp$$ 2>/dev/null 1>/dev/null
-if [ "$?" = "0" ];then
-  echo yes
-  echo $DEF=$LIBS >>config.mak
-  if [ "$CFLAGS" != "" ];then
-    echo ${DEF}_CFLAGS=$CFLAGS >> config.mak
-  fi
-  echo "#define $DEF" 1 >> config.h
-else
-# We still want to output what we *would* have done to the
-# config files. But we output them commented out, so they don't take
-# affect.
-  echo no
-  echo "# $DEF=$LIBS" >>config.mak
-  if [ "$CFLAGS" != "" ];then
-    echo "# ${DEF}_CFLAGS=$CFLAGS" >> config.mak
-  fi
-  echo "/* #define $DEF 1 */" >> config.h
-fi
-rm -f tmp$$.c tmp$$ 
-}
-
-#######################################################################
-#
-#  Do whatever check we've been asked to perform
-#
-#######################################################################
-case "$1" in
-
-#######################################################################
-#
-# -l: See if a library exists by trying to reference a function in it.
-#
-#######################################################################
-  -l)
-
-if [ "$#" -lt "4" ];then
-    usage
-fi
-
-if [ "$#" = "5" ];then
-  CFLAGS=$5
-fi
-
-FUNCTION=$3
-LIBS=$4
-
-echo -n "checking for $FUNCTION in $LIBS ... "
-
-cat >tmp$$.c <<EOF
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $FUNCTION();
-
-int main(int argc, char **argv)
-{
-  $FUNCTION();
-  return 0;
-}
-EOF
-compile
-;;
-
-#######################################################################
-#
-# -I: See if an include file exists, by trying to #include it.
-#
-#######################################################################
-  -I)
-
-if [ "$#" -lt "3" ];then
-    usage
-fi
-
-INCLUDE=$3
-if [ "$#" = "4" ];then
-  CFLAGS=$4
-fi
-
-echo -n "checking for $INCLUDE ... "
-
-cat >tmp$$.c <<EOF
-#include <$INCLUDE>
-
-int main(int argc, char **argv)
-{
-  return 0;
-}
-EOF
-compile
-;;
-
-#######################################################################
-#
-# -p: See if an include file defines a particular prototype
-#
-# (sigh) this doesn't work.  I'm not sure how to get it to work, either.
-#
-#######################################################################
-  -p)
-if [ "$#" -lt "4" ];then
-    usage
-fi
-
-if [ "$#" = "5" ];then
-  CFLAGS=$5
-fi
-
-FUNCTION=$3
-INCLUDE=$4
-
-echo -n "checking if $INCLUDE has a prototype for $FUNCTION ... "
-
-cat >tmp$$.c <<EOF
-#include <$INCLUDE>
-
-int main(int argc, char **argv)
-{
-  void *foo=$FUNCTION;
-  return 0;
-}
-EOF
-compile
-;;
-
-#######################################################################
-#
-# -c: See if a function exists WITHOUT including a library
-#
-#######################################################################
-  -c)
-
-if [ "$#" != "3" ];then
-    usage
-fi
-
-FUNCTION=$3
-
-echo -n "checking if $FUNCTION exists ... "
-
-cat >tmp$$.c <<EOF
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $FUNCTION();
-
-int main(int argc, char **argv)
-{
-  $FUNCTION();
-  return 0;
-}
-EOF
-compile
-;;
-
-#######################################################################
-#
-# -f: see if a file exists
-#
-#######################################################################
-  -f)
-if [ "$#" != "3" ];then
-    usage
-fi
-
-FILE=$3
-
-echo -n "checking what to use for $DEF ... "
-
-# see if it's a file
-if [ -f $FILE ];then
-  echo $FILE
-  echo $DEF=$FILE >> config.mak
-  echo "#define $DEF \"$FILE\"" >> config.h
-else
-  echo "<nothing>"
-  echo "# $DEF=" >> config.mak
-  echo "/* #define $DEF \"$FILE\" */" >> config.h
-fi
-;;
-
-#######################################################################
-#
-# -d: see if a directory exists
-#
-#######################################################################
-  -d)
-if [ "$#" != "3" ];then
-    usage
-fi
-
-DIR=$3
-
-echo -n "checking what to use for $DEF ... "
-
-if [ -d $DIR ];then
-  echo $DIR
-  echo $DEF=$DIR >> config.mak
-  echo "#define $DEF \"$DIR\"" >> config.h
-else
-  echo
-fi
-;;
-
-#######################################################################
-#
-# -e: find out where an executable exists
-#
-#######################################################################
-  -e)
-if [ "$#" != "3" ];then
-    usage
-fi
-
-FILE=$3
-
-echo -n "checking for $FILE ... "
-
-dummy=`echo $PATH:/usr/ucb | sed 's/:/ /g;s/\/ //g;'`
-for dir in $dummy; do 
-  if [ -f $dir/$FILE ]; then
-    LOCATION=$dir/$FILE
-    break
-  fi
-done
-
-# see if it's a file
-if [ -f $LOCATION ];then
-  echo $LOCATION
-  echo $DEF=$LOCATION >> config.mak
-  echo "#define $DEF \"$LOCATION\"" >> config.h
-else
-  echo
-fi
-;;
-
-#######################################################################
-#
-# -s: See if an include file defines a particular structure
-#
-#  This doesn't work quite right now, as we have to have it automatically
-# include the appropriate library but...
-#
-#######################################################################
-  -s)
-if [ "$#" -lt "4" ];then
-    usage
-fi
-
-if [ "$#" = "5" ];then
-  CFLAGS=$5
-fi
-
-STRUCTURE=$3
-INCLUDE=$4
-
-echo -n "checking for $INCLUDE that defines $STRUCTURE ... "
-
-cat >tmp$$.c <<EOF
-#include <$INCLUDE>
-
-int main(int argc, char **argv)
-{
-  $STRUCTURE *foo;
-  return 0;
-}
-EOF
-
-$CC $CFLAGS tmp$$.c -o tmp$$ 2>/dev/null 1>/dev/null
-if [ "$?" = "0" ];then
-  echo yes
-  echo $DEF=$INCLUDE >>config.mak
-  if [ "$CFLAGS" != "" ];then
-    echo ${DEF}_CFLAGS=$CFLAGS >> config.mak
-  fi
-  echo "#ifdef USE_${DEF}" >> config.h
-  echo "#include <$INCLUDE>" >> config.h
-  echo "#endif USE_${DEF}" >> config.h
-else
-  echo no
-fi
-rm -f tmp$$.c tmp$$ 
-
-;;
-
-#######################################################################
-#
-# Anything else
-#
-#######################################################################
-  *)
-  usage
-;;
-
-esac
-exit 0
index db7c762..92f1909 100644 (file)
@@ -1,23 +1,18 @@
-# must be first
-include config.mak
+include ../../../../../Make.inc
 
 TARGET         = rlm_sql_iodbc
 SRCS           = sql_iodbc.c
 HEADERS                = sql_iodbc.h
-RLM_SQL_CFLAGS =
-RLM_SQL_LIBS   =
+RLM_SQL_CFLAGS = $(SQL_ODBC_INCLUDE)
+RLM_SQL_LIBS   = $(SQL_ODBC_LIBS)
 
 $(DYNAMIC_OBJS): $(HEADERS) 
 
 ###
 # over-ride the previous assignment if we're not building anything
-ifeq ($(LIBIODBC),)
+ifeq ($(SQL_ODBC_LIBS),)
 TARGET        =
 endif
 
 include ../rules.mak
 
-# must be last
-config.mak:
-       @../checkconfig -l IODBC odbc_init -liodbc -L/usr/local/iodbc/lib
-
index 4f9b1d6..b28d501 100644 (file)
@@ -1,3 +1,4 @@
+include ../../../../../Make.inc
 
 TARGET         = rlm_sql_mysql
 SRCS           = sql_mysql.c
@@ -9,9 +10,11 @@ $(DYNAMIC_OBJS): $(HEADERS)
 
 ###
 # over-ride the previous assignment if we're not building anything
-#ifeq ($(SQL_MYSQL_LIBS),)
-#TARGET                =
-#endif
+ifeq ($(SQL_MYSQL_LIBS),)
+TARGET         =
+endif
 
 include ../rules.mak
 
+
+
index 21f4954..9659331 100644 (file)
@@ -1,23 +1,18 @@
-# must be first
-include config.mak
+include ../../../../../Make.inc
 
 TARGET         = rlm_sql_oracle
 SRCS           = sql_oracle.c
 HEADERS                = sql_oracle.h
-RLM_SQL_CFLAGS =
-RLM_SQL_LIBS   =
+RLM_SQL_CFLAGS = $(SQL_ORACLE_INCLUDE)
+RLM_SQL_LIBS   = $(SQL_ORACLE_LIBS)
 
 $(DYNAMIC_OBJS): $(HEADERS) 
 
 ###
 # over-ride the previous assignment if we're not building anything
-ifeq ($(LIBORACLE),)
+ifeq ($(SQL_ORACLE_LIBS),)
 TARGET        =
 endif
 
 include ../rules.mak
 
-# must be last
-config.mak:
-       @../checkconfig -l LIBORACLE oracle_init -loracle -L/usr/local/oracle/lib
-
index 48818ab..6f0a6d6 100644 (file)
@@ -1,23 +1,17 @@
-# must be first
-include config.mak
+include ../../../../../Make.inc
 
 TARGET         = rlm_sql_postgresql
 SRCS           = sql_postgresql.c
 HEADERS                = sql_postgresql.h
-RLM_SQL_CFLAGS =
-RLM_SQL_LIBS   =
+RLM_SQL_CFLAGS = $(PG_INCLUDE_DIR)
+RLM_SQL_LIBS   = $(PQ_LIBS)
 
 $(DYNAMIC_OBJS): $(HEADERS) 
 
 ###
 # over-ride the previous assignment if we're not building anything
-ifeq ($(LIBPG),)
+ifeq ($(PQ_LIBS),)
 TARGET        =
 endif
 
 include ../rules.mak
-
-# must be last
-config.mak:
-       @../checkconfig -l LIBPG pg_init -lpg -L/usr/local/pg/lib
-
index 19176f9..0275dee 100644 (file)
@@ -20,8 +20,6 @@
 #
 #######################################################################
 
-include ../../../../../Make.inc
-
 all: dynamic
 
 #######################################################################