From: mmachado Date: Sat, 10 Mar 2001 01:49:04 +0000 (+0000) Subject: Modified the rlm_sql driver Makefiles to use the new autoconf values. Removed rlm_sql... X-Git-Tag: release_0_1_0~150 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=freeradius.git;a=commitdiff_plain;h=81bf6d94fe8f4d9a4df2b75f05295cf57cbbb79a Modified the rlm_sql driver Makefiles to use the new autoconf values. Removed rlm_sql specific checkconfig. --- diff --git a/Make.inc.in b/Make.inc.in index ff4e55d..4a4352e 100644 --- a/Make.inc.in +++ b/Make.inc.in @@ -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 index 1506bcb..0000000 --- a/src/modules/rlm_sql/drivers/checkconfig +++ /dev/null @@ -1,360 +0,0 @@ -#!/bin/sh -# -# $Id$ -# -CC=`grep CC ../../../../../Make.inc | sed 's/.*=//;s/ //g'` - -usage() { - cat < 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 <tmp$$.c < - -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 < - -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 <> config.mak - echo "#define $DEF \"$FILE\"" >> config.h -else - echo "" - 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 < - -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 diff --git a/src/modules/rlm_sql/drivers/rlm_sql_iodbc/Makefile b/src/modules/rlm_sql/drivers/rlm_sql_iodbc/Makefile index db7c762..92f1909 100644 --- a/src/modules/rlm_sql/drivers/rlm_sql_iodbc/Makefile +++ b/src/modules/rlm_sql/drivers/rlm_sql_iodbc/Makefile @@ -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 - diff --git a/src/modules/rlm_sql/drivers/rlm_sql_mysql/Makefile b/src/modules/rlm_sql/drivers/rlm_sql_mysql/Makefile index 4f9b1d6..b28d501 100644 --- a/src/modules/rlm_sql/drivers/rlm_sql_mysql/Makefile +++ b/src/modules/rlm_sql/drivers/rlm_sql_mysql/Makefile @@ -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 + + diff --git a/src/modules/rlm_sql/drivers/rlm_sql_oracle/Makefile b/src/modules/rlm_sql/drivers/rlm_sql_oracle/Makefile index 21f4954..9659331 100644 --- a/src/modules/rlm_sql/drivers/rlm_sql_oracle/Makefile +++ b/src/modules/rlm_sql/drivers/rlm_sql_oracle/Makefile @@ -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 - diff --git a/src/modules/rlm_sql/drivers/rlm_sql_postgresql/Makefile b/src/modules/rlm_sql/drivers/rlm_sql_postgresql/Makefile index 48818ab..6f0a6d6 100644 --- a/src/modules/rlm_sql/drivers/rlm_sql_postgresql/Makefile +++ b/src/modules/rlm_sql/drivers/rlm_sql_postgresql/Makefile @@ -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 - diff --git a/src/modules/rlm_sql/drivers/rules.mak b/src/modules/rlm_sql/drivers/rules.mak index 19176f9..0275dee 100644 --- a/src/modules/rlm_sql/drivers/rules.mak +++ b/src/modules/rlm_sql/drivers/rules.mak @@ -20,8 +20,6 @@ # ####################################################################### -include ../../../../../Make.inc - all: dynamic #######################################################################