Makefile.in: build comerr dll
authorRichard Basch <probe@mit.edu>
Sat, 15 Feb 1997 21:37:11 +0000 (21:37 +0000)
committerRichard Basch <probe@mit.edu>
Sat, 15 Feb 1997 21:37:11 +0000 (21:37 +0000)
comerr16.def comerr32.def: New definition files for Windows comerr library
krb5_16.def krb5_32.def: Removed comerr exports
win_glue.c: win32 dll entry/exit code added
gssapi32.def krb5_32.def: Removed obsolete WEP & LibMain exports

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9875 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/ChangeLog
src/lib/Makefile.in
src/lib/comerr16.def [new file with mode: 0644]
src/lib/comerr32.def [new file with mode: 0644]
src/lib/gssapi32.def
src/lib/krb5_16.def
src/lib/krb5_32.def
src/lib/win_glue.c

index c8c3e2b073a7924f77d526a80c4d0800db5b927d..fa2a3c54d47a2b5bad1a520b1e69ccb19d90b424 100644 (file)
@@ -1,3 +1,11 @@
+Fri Feb 14 16:40:03 1997  Richard Basch  <basch@lehman.com>
+
+       * Makefile.in: Build separate ComErr DLL
+       * comerr16.def comerr32.def: ComErr exported API
+       * krb5_16.def krb5_32.def: Removed ComErr/Win16 entries
+       * no_glue.c: Dummy stub for ComErr (win16/win32)
+       * win_glue.c: Win32 DLL startup/exit code added
+
 Sat Feb  8 12:21:53 1997  Richard Basch  <basch@lehman.com>
 
        * krb5_16.def krb5_32.def:
index c94909b8063deac00a362b71093268feb942be9f..201a9942c3b688d637f9a7d299d03967644b4caa 100644 (file)
@@ -24,12 +24,14 @@ clean-windows::
 
 # Windows stuff to make krb5 and gssapi DLLs.
 
-GLIBS = gssapi\gssapi.lib
+CLIBS = $(BUILDTOP)\util\et\comerr.lib
 KLIBS = krb5\krb5.lib crypto\crypto.lib \
        $(BUILDTOP)\util\profile\profile.lib \
-       $(BUILDTOP)\util\et\comerr.lib \
        kadm\kadm.lib des425\des425.lib
+GLIBS = gssapi\gssapi.lib
 
+##WIN16##CDEF = comerr16.def
+##WIN32##CDEF = comerr32.def
 ##WIN16##KDEF = krb5_16.def
 ##WIN32##KDEF = krb5_32.def
 ##WIN16##GDEF = gssapi16.def
@@ -39,35 +41,54 @@ KLIBS = krb5\krb5.lib crypto\crypto.lib \
 ##WIN32##WINLIBS = msvcrt.lib kernel32.lib wsock32.lib \
 ##WIN32##      user32.lib shell32.lib oldnames.lib
 ##WIN32##WINDLLFLAGS = /nodefaultlib /incremental:no /pdb:none /release \
-##WIN32##              /nologo /align:0x1000 /base:0x1c000000 /dll /debug
+##WIN32##              /nologo /align:0x1000 /base:0x1c000000 /dll \
+##WIN32##              /entry:DllMain
 
 
 
-$(KLIB): $(KLIBS) $(WLIB) $(KDEF) win_glue.obj
+$(CLIB): $(CLIBS) $(WLIB) $(CDEF) no_glue.obj
+##WIN16##      link /co /seg:400 /noe /nod /nol \
+##WIN16##         no_glue, $*.dll, $*.map, $(CLIBS) $(WINLIBS), $(CDEF)
+##WIN16##      rc /nologo /p /k $*.dll
+##WIN16##      implib /nologo $@ $*.dll
+##WIN32##      link $(WINDLLFLAGS) /def:$(CDEF) /out:$*.dll \
+##WIN32##         no_glue.obj $(CLIBS) $(WINLIBS)
+
+$(KLIB): $(KLIBS) $(CLIB) $(WLIB) $(KDEF) krb_glue.obj
 ##WIN16##      link /co /seg:400 /noe /nod /nol \
-##WIN16##         win_glue, $*.dll, $*.map, \
-##WIN16##         $(KLIBS) $(WINLIBS), $(KDEF)
+##WIN16##         krb_glue, $*.dll, $*.map, \
+##WIN16##         $(KLIBS) $(CLIB) $(WINLIBS), $(KDEF)
 ##WIN16##      rc /nologo /p /k $*.dll
 ##WIN16##      implib /nologo $@ $*.dll
 ##WIN32##      link $(WINDLLFLAGS) /def:$(KDEF) /out:$*.dll \
-##WIN32##         win_glue.obj $(KLIBS) $(WINLIBS)
+##WIN32##         krb_glue.obj $(KLIBS) $(CLIB) $(WINLIBS)
 
-$(GLIB): $(GLIBS) $(KLIB) $(GDEF) win_glue.obj
+$(GLIB): $(GLIBS) $(KLIB) $(CLIB) $(GDEF) gss_glue.obj
 ##WIN16##      link /co /seg:400 /noe /nod /nol \
-##WIN16##         win_glue, $*.dll, $*.map, \
-##WIN16##         $(GLIBS) $(KLIB) $(WINLIBS), $(GDEF)
+##WIN16##         gss_glue, $*.dll, $*.map, \
+##WIN16##         $(GLIBS) $(KLIB) $(CLIB) $(WINLIBS), $(GDEF)
 ##WIN16##      rc /nologo /p /k $*.dll
 ##WIN16##      implib /nologo $@ $*.dll
 ##WIN32##      link $(WINDLLFLAGS) /def:$(GDEF) /out:$*.dll \
-##WIN32##         win_glue.obj $(GLIBS) $(KLIB) $(WINLIBS)
+##WIN32##         gss_glue.obj $(GLIBS) $(KLIB) $(CLIB) $(WINLIBS)
 
-win_glue.obj: win_glue.c
-       $(CC) $(CFLAGS) /c win_glue.c
+krb_glue.obj: win_glue.c
+       $(CC) $(CFLAGS) /c /DKRB5=1 /Fo$@ $**
+gss_glue.obj: win_glue.c
+       $(CC) $(CFLAGS) /c /DGSSAPI=1 /Fo$@ $**
+no_glue.obj: win_glue.c
+       $(CC) $(CFLAGS) /c /Fo$@ $**
 
 ##WIN16##$(WLIB):  winsock.def
 ##WIN16##      implib /nologo $@ winsock.def
 
 
+# Build Convenience
+comerr.lib: $(CLIB)
+krb5.lib:   $(KLIB)
+gssapi.lib: $(GLIB)
+
+
 sap_glue.obj: win_glue.c
        $(CC) $(CFLAGS) -DSAP_TIMEBOMB -I$(VERS_DIR) /c /Fo$@ win_glue.c
 
diff --git a/src/lib/comerr16.def b/src/lib/comerr16.def
new file mode 100644 (file)
index 0000000..c85c4bc
--- /dev/null
@@ -0,0 +1,16 @@
+LIBRARY                COMERR16
+DESCRIPTION    'DLL for ComErr'
+EXETYPE                WINDOWS
+CODE           PRELOAD MOVEABLE DISCARDABLE
+DATA           PRELOAD MOVEABLE SINGLE
+HEAPSIZE       8192
+
+EXPORTS
+       WEP                                     @1001 RESIDENTNAME
+       LibMain                                 @1002
+;
+       _com_err
+       com_err_va
+       error_message
+       add_error_table
+       remove_error_table
diff --git a/src/lib/comerr32.def b/src/lib/comerr32.def
new file mode 100644 (file)
index 0000000..91f6d19
--- /dev/null
@@ -0,0 +1,12 @@
+;LIBRARY               COMERR32
+DESCRIPTION    'DLL for ComErr'
+CODE           PRELOAD MOVEABLE DISCARDABLE
+DATA           PRELOAD MOVEABLE SINGLE
+HEAPSIZE       8192
+
+EXPORTS
+       com_err
+       com_err_va
+       error_message
+       add_error_table
+       remove_error_table
index 38484149f98008f00a015b10c8aa4cea7e72d10c..d80e85bbc256a72d144b834ecc4d37440c85209f 100644 (file)
@@ -9,9 +9,6 @@ DATA            PRELOAD MOVEABLE SINGLE
 HEAPSIZE       8192
 
 EXPORTS
-       WEP                                     @1001
-       LibMain                                 @1002
-;
        gss_acquire_cred
        gss_release_cred
        gss_init_sec_context
index afe3d2af608c4991b08ec3f2da51009278b36990..db9b26f9d1f54adc7bc484b4fb1cce70196a994b 100644 (file)
@@ -159,17 +159,6 @@ EXPORTS
        krb5_free_adm_data
        krb5_read_adm_reply
        krb5_send_adm_cmd
-;Com_err routines
-       _com_err
-       error_message
-       et_init
-       et_shutdown
-       et_add_error_table
-       et_error_message
-       _et_com_err
-       _et_com_err_va
-       et_set_hook
-       __et_list
 ;
 ;Temporary exports (DO NOT USE)
        _sscanf
index 0c2bd3e1b22b8ad6b2fad1cafaf98bfb8ccc0a0f..c8f43ac6399d1dafb1dfa86c621e57961696fe09 100644 (file)
@@ -9,8 +9,6 @@ DATA            PRELOAD MOVEABLE SINGLE
 HEAPSIZE       8192
 
 EXPORTS
-       WEP                                     @1001
-       LibMain                                 @1002
 ; Kerberos 5
        krb5_build_principal
        krb5_build_principal_ext
@@ -158,17 +156,6 @@ EXPORTS
        krb5_free_adm_data
        krb5_read_adm_reply
        krb5_send_adm_cmd
-;Com_err routines
-       com_err
-       error_message
-       et_init
-       et_shutdown
-       et_add_error_table
-       et_error_message
-       et_com_err
-       et_com_err_va
-       et_set_hook
-       _et_list
 ;
 ;Temporary exports (DO NOT USE)
        decode_krb5_ticket
index 519bbcf94e8536dc032ccaed2ccbaa3bf6021471..b05024a654fa52cebbe4e684b8566ad51efb540a 100644 (file)
 #include <vs.h>
 #include <v.h>
 
+
+#if defined(GSSAPI) && !defined(KRB5)
+#define KRB5 1
+#endif
+#if defined(KRB5) && !defined(NEED_WINSOCK)
+#define NEED_WINSOCK 1
+#endif
+
+
 /*
  * Use the version server to give us some control on distribution and usage
  * We're going to test track as well
@@ -149,10 +158,8 @@ static krb5_error_code do_timebomb()
  */
 krb5_error_code krb5_vercheck()
 {
-       krb5_error_code retval;
-       
 #ifdef TIMEBOMB
-       retval = do_timebomb();
+       krb5_error_code retval = do_timebomb();
        if (retval)
                return retval;
 #endif
@@ -163,6 +170,7 @@ krb5_error_code krb5_vercheck()
        return 0;
 }
 
+#ifdef NEED_WINSOCK
 int
 win_socket_initialize()
 {
@@ -184,6 +192,54 @@ win_socket_initialize()
 
     return 0;
 }
+#endif
+
+#ifdef _WIN32
+
+BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
+{
+   switch (fdwReason)
+   {
+       case DLL_PROCESS_ATTACH:
+#ifdef NEED_WINSOCK
+          win_socket_initialize ();
+#endif
+#ifdef KRB5
+          krb5_init_ets((krb5_context)0);
+#endif
+#ifdef GSSAPI
+          initialize_k5g_error_table();
+          initialize_ggss_error_table();
+#endif    
+          break;
+
+       case DLL_THREAD_ATTACH:
+          break;
+
+       case DLL_THREAD_DETACH:
+          break;
+
+       case DLL_PROCESS_DETACH:
+#ifdef GSSAPI
+          cleanup_k5g_error_table();
+          cleanup_ggss_error_table();
+#endif
+#ifdef KRB5
+          krb5_finish_ets((krb5_context)0);
+#endif
+#ifdef NEED_WINSOCK
+          WSACleanup ();
+#endif
+          break;
+
+       default:
+          return FALSE;
+   }
+   return TRUE;   // successful DLL_PROCESS_ATTACH
+}
+
+#else
 
 BOOL CALLBACK
 LibMain (hInst, wDataSeg, cbHeap, CmdLine)
@@ -192,7 +248,16 @@ WORD wDataSeg;
 WORD cbHeap;
 LPSTR CmdLine;
 {
+#ifdef NEED_WINSOCK
     win_socket_initialize ();
+#endif
+#ifdef KRB5
+    krb5_init_ets((krb5_context)0);
+#endif
+#ifdef GSSAPI
+    initialize_k5g_error_table();
+    initialize_ggss_error_table();
+#endif
     return 1;
 }
 
@@ -200,6 +265,17 @@ int CALLBACK __export
 WEP(nParam)
        int nParam;
 {
+#ifdef GSSAPI
+    cleanup_k5g_error_table();
+    cleanup_ggss_error_table();
+#endif
+#ifdef KRB5
+    krb5_finish_ets((krb5_context)0);
+#endif
+#ifdef NEED_WINSOCK
     WSACleanup();
+#endif
     return 1;
 }
+
+#endif