updated everything to use alanconf.
authoraland <aland>
Tue, 17 Aug 1999 15:42:14 +0000 (15:42 +0000)
committeraland <aland>
Tue, 17 Aug 1999 15:42:14 +0000 (15:42 +0000)
The 'rules.mak' file now checks for an empty target,
and does nothing if so.

The various make files now rely on 'config.mak', and
re-set the TARGET to '' if their required libraries, etc.
do not exist.

src/modules/checkconfig
src/modules/rlm_example/Makefile
src/modules/rlm_pam/Makefile
src/modules/rlm_sql/Makefile
src/modules/rules.mak

index 566809d..3a3cf35 100755 (executable)
@@ -66,7 +66,12 @@ if [ "$?" = "0" ];then
   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
+  echo "/* #define $DEF 1 */" >> config.h
 fi
 rm -f tmp$$.c tmp$$ 
 }
index e0c0350..610e0b1 100644 (file)
@@ -3,4 +3,3 @@ TARGET  = rlm_example
 SRCS   = rlm_example.c
 
 include ../rules.mak
-
index a37acc8..5d65d79 100644 (file)
@@ -1,8 +1,17 @@
+# must be first
+include config.mak
+
 TARGET = rlm_pam
 SRCS   = rlm_pam.c
 LIBS   = -lpam -ldl
 
+# over-ride the previous assignment if we're not building anything
+ifeq ($(LIBPAM),)
+TARGET =
+endif
+
 include ../rules.mak
 
+# must be last
 config.mak:
        @../checkconfig -l LIBPAM pam_start -lpam -ldl
index 51e9e55..6cd2666 100644 (file)
@@ -1,4 +1,17 @@
+# must be first
+include config.mak
+
 TARGET = rlm_mysql
 SRCS   = rlm_mysql.c mysql.c
+LIBS   = -lmysql
+
+# over-ride the previous assignment if we're not building anything
+ifeq ($(LIBMYSQL),)
+TARGET =
+endif
 
 include ../rules.mak
+
+# must be last
+config.mak:
+       @../checkconfig -l LIBMYSQL mysql_init -lmysql
index b7c52b8..cbd462c 100644 (file)
@@ -50,6 +50,7 @@ DYNAMIC_OBJS  = $(SRCS:.c=.lo)
 
 CFLAGS         += -I../../include
 
+ifneq ($(TARGET),)
 #######################################################################
 #
 # Define a number of new targets
@@ -71,10 +72,23 @@ $(TARGET).so: $(DYNAMIC_OBJS)
 #
 #######################################################################
 static: $(TARGET).a
-       @cp $< ..
+       @cp $< ../lib
 
 dynamic: $(TARGET).so
-       @cp $< ..
+       @cp $< ../lib
+
+#######################################################################
+#
+#  It's a dummy target: don't build it
+#
+#######################################################################
+else
+static:
+
+dynamic:
+
+# if $(TARGET) == ""
+endif
 
 #######################################################################
 #