]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix rlm_mschap builds on OSX
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 25 Feb 2013 22:13:51 +0000 (17:13 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 25 Feb 2013 22:13:51 +0000 (17:13 -0500)
src/modules/rlm_mschap/.gitignore
src/modules/rlm_mschap/config.h.in [new file with mode: 0644]
src/modules/rlm_mschap/configure.in [new file with mode: 0644]
src/modules/rlm_mschap/rlm_mschap.c
src/modules/rlm_mschap/rlm_mschap.mk [deleted file]
src/modules/rlm_mschap/rlm_mschap.mk.in [new file with mode: 0644]

index 3cfae44a7cba2a5018df656b7a00616390254138..c9ba1a435dc98d855cf15a014d23042f5e64a126 100644 (file)
@@ -1 +1,4 @@
+configure
+config.h
+rlm_mschap.mk
 smbencrypt
diff --git a/src/modules/rlm_mschap/config.h.in b/src/modules/rlm_mschap/config.h.in
new file mode 100644 (file)
index 0000000..9aaf853
--- /dev/null
@@ -0,0 +1,22 @@
+/* config.h.in.  Generated from configure.in by autoheader.  */
+
+/* Build with Apple Open Directory support */
+#undef HAVE_OPEN_DIRECTORY
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
diff --git a/src/modules/rlm_mschap/configure.in b/src/modules/rlm_mschap/configure.in
new file mode 100644 (file)
index 0000000..ad7a438
--- /dev/null
@@ -0,0 +1,39 @@
+AC_INIT(rlm_mschap.c)
+AC_REVISION($Revision$)
+AC_DEFUN(modname,[rlm_mschap])
+
+if test x$with_[]modname != xno; then
+
+       AC_PROG_CC
+       AC_PROG_CPP
+
+       FR_SMART_CHECK_INCLUDE(membership.h)
+       if test "x$ac_cv_header_membership_h" = "xyes"; then
+               AC_DEFINE([HAVE_MEMBERSHIP_H],[1],[Build with Apple Open Directory support])
+               mschap_sources+="opendir.c"
+               mschap_ldflags+=" -framework DirectoryService" 
+       fi
+       targetname=modname
+else
+       targetname=
+       echo \*\*\* module modname is disabled.
+fi
+
+if test x"$fail" != x""; then
+       if test x"${enable_strict_dependencies}" = x"yes"; then
+               AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
+       else
+               AC_MSG_WARN([silently not building ]modname[.])
+               AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); 
+               targetname=""
+       fi
+fi
+
+AC_SUBST(mschap_sources)
+AC_SUBST(mschap_ldflags)
+AC_SUBST(mschap_cflags)
+AC_SUBST(targetname)
+
+AC_CONFIG_HEADER(config.h)
+AC_OUTPUT(rlm_mschap.mk)
+
index 155ac57b6dab5e06e645bb6389c1526bd9f7be10..31842cd7abff63d63b46d156366d0462849b416f 100644 (file)
@@ -37,10 +37,10 @@ RCSID("$Id$")
 #include       "smbdes.h"
 
 #ifdef HAVE_OPENSSL_CRYPTO_H
-#include       <openssl/rc4.h>
+#  include     <openssl/rc4.h>
 #endif
 
-#ifdef __APPLE__
+#ifdef WITH_OPEN_DIRECTORY
 extern int od_mschap_auth(REQUEST *request, VALUE_PAIR *challenge, VALUE_PAIR * usernamepair);
 #endif
 
@@ -152,7 +152,7 @@ typedef struct rlm_mschap_t {
        const char *auth_type;
        int allow_retry;
        char *retry_msg;
-#ifdef __APPLE__
+#ifdef WITH_OPEN_DIRECTORY
        int  open_directory;
 #endif  
 } rlm_mschap_t;
@@ -556,7 +556,7 @@ static const CONF_PARSER module_config[] = {
          offsetof(rlm_mschap_t, allow_retry), NULL,  "yes" },
        { "retry_msg",   PW_TYPE_STRING_PTR,
          offsetof(rlm_mschap_t, retry_msg), NULL,  NULL },
-#ifdef __APPLE__
+#ifdef WITH_OPEN_DIRECTORY
        { "use_open_directory",    PW_TYPE_BOOLEAN,
          offsetof(rlm_mschap_t,open_directory), NULL, "yes" },
 #endif
@@ -1705,7 +1705,7 @@ static rlm_rcode_t mschap_authenticate(void * instance, REQUEST *request)
                        return RLM_MODULE_REJECT;
                }
 
-#ifdef __APPLE__
+#ifdef WITH_OPEN_DIRECTORY
                /*
                 *  No "known good" NT-Password attribute.  Try to do
                 *  OpenDirectory authentication.
diff --git a/src/modules/rlm_mschap/rlm_mschap.mk b/src/modules/rlm_mschap/rlm_mschap.mk
deleted file mode 100644 (file)
index 880ecd0..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-TARGET         := rlm_mschap.a
-SOURCES                := rlm_mschap.c smbdes.c opendir.c mschap.c
diff --git a/src/modules/rlm_mschap/rlm_mschap.mk.in b/src/modules/rlm_mschap/rlm_mschap.mk.in
new file mode 100644 (file)
index 0000000..2c08419
--- /dev/null
@@ -0,0 +1,10 @@
+TARGETNAME     := @targetname@
+
+ifneq "$(TARGETNAME)" ""
+TARGET         := $(TARGETNAME).a
+endif
+
+SOURCES                := $(TARGETNAME).c smbdes.c mschap.c @mschap_sources@
+
+SRC_CFLAGS     := @mschap_cflags@
+TGT_LDLIBS     := @mschap_ldflags@