Prepping Unix build of ODBC plugin.
authorScott Cantor <cantor.2@osu.edu>
Mon, 25 Jun 2007 21:04:00 +0000 (21:04 +0000)
committerScott Cantor <cantor.2@osu.edu>
Mon, 25 Jun 2007 21:04:00 +0000 (21:04 +0000)
configure.ac
odbc-store/Makefile.am [new file with mode: 0644]
odbc-store/odbc-store.rc [new file with mode: 0644]
odbc-store/odbc-store.vcproj
odbc-store/resource.h [new file with mode: 0644]

index 838b80e..4f1005f 100644 (file)
@@ -557,107 +557,106 @@ fi
 
 
 #
-# Implement the checks of the ODBC Credential Cache
+# Implement the checks of the ODBC Storage Service
 #
 # 1) Assume the user wants ODBC; if it's not found then just continue without
 # 2) If the user specifically requested odbc, look for it and ERROR if not found
-# 3) If the user specifically requested no-odbc, don't build it.
+# 3) If the user specifically requested no odbc, don't build it.
 #
 
-#AC_CONFIG_FILES([odbc_ccache/Makefile])
+AC_CONFIG_FILES([odbc-store/Makefile])
 
 # determine whether we should enable the odbc ccache
-#AC_ARG_ENABLE([odbc],
-#      AC_HELP_STRING([--disable-odbc], [disable the ODBC Credential Cache]),
-#      [odbc_enabled=$enableval], [odbc_enabled=default])
+AC_ARG_ENABLE([odbc],
+       AC_HELP_STRING([--disable-odbc], [disable the ODBC Storage Service]),
+       [odbc_enabled=$enableval], [odbc_enabled=default])
 
-#if test "x$odbc_enabled" = "x" ; then
-#   odbc_enabled=yes
-#fi
+if test "x$odbc_enabled" = "x" ; then
+   odbc_enabled=yes
+fi
 
 # Are we trying to build ODBC?
-#AC_MSG_CHECKING(whether to build the ODBC ccache)
-#if test "$odbc_enabled" = "yes" ; then
-#   build_odbc=yes
-#   AC_MSG_RESULT(yes)
-#elif test "$odbc_enabled" = "default" ; then
-#   build_odbc=yes
-#   AC_MSG_RESULT([yes, if it can be found])
-#else
-#   build_odbc=no
-#   AC_MSG_RESULT(no)
-#fi
+AC_MSG_CHECKING(whether to build the ODBC storage service)
+if test "$odbc_enabled" = "yes" ; then
+   build_odbc=yes
+   AC_MSG_RESULT(yes)
+elif test "$odbc_enabled" = "default" ; then
+   build_odbc=yes
+   AC_MSG_RESULT([yes, if it can be found])
+else
+   build_odbc=no
+   AC_MSG_RESULT(no)
+fi
 
 # If we're trying to build ODBC, try to find the odbc_config program.
-#if test "$build_odbc" = "yes" ; then
-#   odbc_dir=""
-#   AC_ARG_WITH(odbc,
-#      AC_HELP_STRING([--with-odbc=PATH], [directory where odbc is installed]),
-#          [if test "$with_odbc" = no ; then
-#               AC_MSG_ERROR([Try running --disable-odbc instead.])
-#             elif test "$with_odbc" != yes ; then
-#               odbc_dir="$with_odbc/bin"
-#             fi ])
-
-   # Try to find the mysql_config program
-#   AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
-
-#   if test "$ODBC_CONFIG" = no ; then
-#      if test "$odbc_enabled" = "yes" ; then
-#        AC_MSG_ERROR(Cannot find odbc_config)
-#      else
-#        AC_MSG_WARN(ODBC not found, skipping.)
-#      fi
-#   fi
-#fi
-
-#if test "$build_odbc" = yes ; then
-#   ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
-#   ODBC_CFLAGS=`eval echo $ODBC_CFLAGS`
-#   ODBC_LIBS=`$ODBC_CONFIG --libs`
-#   ODBC_LIBS=`eval echo $ODBC_LIBS`
-
-#   save_CPPFLAGS="$CPPFLAGS"
-#   CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
-
-#   AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
-#   if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
-#     AC_MSG_ERROR(unable to find ODBC header files)
-#   fi
-
-#   if test "$have_sql_h" = yes ; then
-#      save_LIBS="$LIBS"
-#      LIBS="$LIBS $ODBC_LIBS"
-#      AC_MSG_CHECKING(if we can link againt ODBC)
-#      AC_TRY_LINK(
-#        [#include <sql.h>
-#         #include <sqlext.h>
-#         #include <stdio.h>],
-#        [SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)],
-#        [have_odbc_libs=yes],
-#        [have_odbc_libs=no])
-#      LIBS="$save_LIBS"
-
-#      if test "$have_odbc_libs" = no ; then
-#         if test "$odbc_enabled" = "yes" ; then
-#            AC_MSG_ERROR([unable to link with ODBC Library])
-#         else
-#            AC_MSG_RESULT(no, skipping ODBC)
-#         fi
-#      fi
-#   fi
-
-#   CPPFLAGS="$save_CPPFLAGS"
-#fi
+if test "$build_odbc" = "yes" ; then
+   odbc_dir=""
+   AC_ARG_WITH(odbc,
+       AC_HELP_STRING([--with-odbc=PATH], [directory where odbc is installed]),
+           [if test "$with_odbc" = no ; then
+               AC_MSG_ERROR([Try running --disable-odbc instead.])
+             elif test "$with_odbc" != yes ; then
+               odbc_dir="$with_odbc/bin"
+             fi ])
+
+   AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
+
+   if test "$ODBC_CONFIG" = no ; then
+      if test "$odbc_enabled" = "yes" ; then
+        AC_MSG_ERROR(Cannot find odbc_config)
+      else
+        AC_MSG_WARN(ODBC not found, skipping.)
+      fi
+   fi
+fi
+
+if test "$build_odbc" = yes ; then
+   ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
+   ODBC_CFLAGS=`eval echo $ODBC_CFLAGS`
+   ODBC_LIBS=`$ODBC_CONFIG --libs`
+   ODBC_LIBS=`eval echo $ODBC_LIBS`
+
+   save_CPPFLAGS="$CPPFLAGS"
+   CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
+
+   AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
+   if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
+     AC_MSG_ERROR(unable to find ODBC header files)
+   fi
+
+   if test "$have_sql_h" = yes ; then
+      save_LIBS="$LIBS"
+      LIBS="$LIBS $ODBC_LIBS"
+      AC_MSG_CHECKING(if we can link againt ODBC)
+      AC_TRY_LINK(
+        [#include <sql.h>
+         #include <sqlext.h>
+         #include <stdio.h>],
+        [SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)],
+        [have_odbc_libs=yes],
+        [have_odbc_libs=no])
+      LIBS="$save_LIBS"
+
+      if test "$have_odbc_libs" = no ; then
+         if test "$odbc_enabled" = "yes" ; then
+            AC_MSG_ERROR([unable to link with ODBC Library])
+         else
+            AC_MSG_RESULT(no, skipping ODBC)
+         fi
+      fi
+   fi
+
+   CPPFLAGS="$save_CPPFLAGS"
+fi
 
 # if have_odbc_libs=yes then go ahead with building ODBC
-#if test "$have_odbc_libs" = yes ; then
-#   # this AC_MSG_RESULT is from above!
-#   AC_MSG_RESULT(yes)
-#   WANT_SUBDIRS="$WANT_SUBDIRS odbc_ccache"
-#   AC_SUBST(ODBC_CFLAGS)
-#   AC_SUBST(ODBC_LIBS)
-#fi
+if test "$have_odbc_libs" = yes ; then
+   # this AC_MSG_RESULT is from above!
+   AC_MSG_RESULT(yes)
+   WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
+   AC_SUBST(ODBC_CFLAGS)
+   AC_SUBST(ODBC_LIBS)
+fi
 
 
 AC_SUBST(WANT_SUBDIRS)
diff --git a/odbc-store/Makefile.am b/odbc-store/Makefile.am
new file mode 100644 (file)
index 0000000..f6c9ebc
--- /dev/null
@@ -0,0 +1,20 @@
+AUTOMAKE_OPTIONS = foreign
+
+plugindir = $(libexecdir)
+plugin_LTLIBRARIES = odbc-store.la
+
+AM_CFLAGS = $(ODBC_CFLAGS)
+AM_CXXFLAGS = $(ODBC_CFLAGS)
+
+odbc_store_la_LIBADD = \
+       $(ODBC_LIBS)
+
+odbc_store_la_SOURCES = \
+       odbc-store.cpp
+
+odbc_store_la_LDFLAGS = -module -avoid-version $(XMLSEC_LIBS)
+
+install-exec-hook:
+       for la in $(plugin_LTLIBRARIES) ; do rm -f $(DESTDIR)$(plugindir)/$$la ; done
+
+EXTRA_DIST = odbc-store.vcproj odbc-store.rc resource.h
diff --git a/odbc-store/odbc-store.rc b/odbc-store/odbc-store.rc
new file mode 100644 (file)
index 0000000..1a64b78
--- /dev/null
@@ -0,0 +1,101 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 2,0,0,0
+ PRODUCTVERSION 2,0,0,0
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904b0"
+        BEGIN
+            VALUE "CompanyName", "Internet2"
+            VALUE "FileDescription", "Shibboleth ODBC Storage Service Plugin"
+            VALUE "FileVersion", "2, 0, 0, 0"
+            VALUE "InternalName", "odbc-store"
+            VALUE "LegalCopyright", "Copyright (C) 2007 Internet2"
+            VALUE "OriginalFilename", "odbc-store.so"
+            VALUE "ProductName", "Shibboleth 2.0"
+            VALUE "ProductVersion", "2, 0, 0, 0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+
+#endif    // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
\ No newline at end of file
index 4b2f7d7..cefc0fe 100644 (file)
                        RelativePath=".\odbc-store.cpp"\r
                        >\r
                </File>\r
+               <File\r
+                       RelativePath=".\odbc-store.rc"\r
+                       >\r
+               </File>\r
+               <File\r
+                       RelativePath=".\resource.h"\r
+                       >\r
+               </File>\r
        </Files>\r
        <Globals>\r
        </Globals>\r
diff --git a/odbc-store/resource.h b/odbc-store/resource.h
new file mode 100644 (file)
index 0000000..7a79a45
--- /dev/null
@@ -0,0 +1,14 @@
+//{{NO_DEPENDENCIES}}\r
+// Microsoft Visual C++ generated include file.\r
+// Used by odbc-store.rc\r
+\r
+// Next default values for new objects\r
+// \r
+#ifdef APSTUDIO_INVOKED\r
+#ifndef APSTUDIO_READONLY_SYMBOLS\r
+#define _APS_NEXT_RESOURCE_VALUE        101\r
+#define _APS_NEXT_COMMAND_VALUE         40001\r
+#define _APS_NEXT_CONTROL_VALUE         1001\r
+#define _APS_NEXT_SYMED_VALUE           101\r
+#endif\r
+#endif\r