install_tclxpa
authorOle Streicher <olebole@debian.org>
Thu, 25 Sep 2014 10:21:34 +0000 (11:21 +0100)
committerOle Streicher <olebole@debian.org>
Thu, 25 Sep 2014 10:21:34 +0000 (11:21 +0100)
Gbp-Pq: Name install_tclxpa.patch

Makefile.in
tcl.c

index 0155f6906d675bfb7cab99621642da21fda0d173..e45872ca6a66cddd31fabaa1fcfb9f3a1d104418 100644 (file)
@@ -38,6 +38,7 @@ INSTALL_ROOT = $(DESTDIR)
 
 # Directory in which to install the .a or .so binary for the XPA library:
 LIB_INSTALL_DIR =      $(INSTALL_ROOT)$(exec_prefix)/lib
+TCL_LIB_INSTALL_DIR =  $(LIB_INSTALL_DIR)/tcltk/xpa
 
 # Directory in which to install the program wish:
 BIN_INSTALL_DIR =      $(INSTALL_ROOT)$(exec_prefix)/bin
@@ -142,7 +143,7 @@ GTK_OBJS =  gtkloop.o
 INCL   =       xpa.h xpap.h
 
 # these are all the modules going into the "normal" xpa library
-LIBOBJS =      ${BASE_OBJS} ${TCL_OBJS} ${XT_OBJS} ${GTK_OBJS}
+LIBOBJS =      ${BASE_OBJS} ${XT_OBJS} ${GTK_OBJS}
 LIB =  libxpa.a
 
 # used in link line
@@ -167,6 +168,8 @@ install::   install-man
 
 install::      install-share
 
+install::      tclxpa_install
+
 lib:           $(LIB) $(DOSHARED)
 
 $(LIB):                $(LIBOBJS)
@@ -190,14 +193,17 @@ mingw-dll:        $(LIBOBJS)
                -Wl,--output-def,libxpa.def,--out-implib,libxpa_dll.a,-no-undefined,--enable-runtime-pseudo-reloc -o libxpa.dll \
                -lwsock32
 
-tclxpa:                $(LIB)
-               @(rm -rf libtclxpa.tmp; mkdir libtclxpa.tmp; \
-               (cd libtclxpa.tmp && ar x ../lib$(PACKAGE).a); \
-               rm -f libtclxpa.tmp/xt*.o; \
-               CC='$(CC)' CXX=$(CXX) \
-               ./mklib -o tclxpa libtclxpa.tmp/*.o $(TCL_LIBS); \
-               test -r libtclxpa.dylib && cp -p libtclxpa.dylib libtclxpa.so && echo "copying libtclxpa.dylib to libtclxpa.so"; \
-               rm -rf libtclxpa.tmp)
+
+tclxpa:                $(TCL_OBJS) 
+               ar cruv libtclxpa.a $(TCL_OBJS)
+               $(RANLIB) libtclxpa.a
+
+shtclxpa:      tclxpa
+               @(rm -rf $(PACKAGE)tmp; mkdir $(PACKAGE)tmp; \
+               (cd $(PACKAGE)tmp && ar x ../libtclxpa.a); \
+               CC='$(CC)' CXX='$(CXX)' \
+               ./mklib -o tclxpa -L. -lxpa $(PACKAGE)tmp/*.o $(TCL_LIBS); \
+               rm -rf $(PACKAGE)tmp; )
 
 diff:
                -(for f in `ls *.c`;                                    \
@@ -256,7 +262,7 @@ smoke:  ctest stest
 _install:
 
 shlib_install:
-       @-(for i in `ls *.so* *.dylib *.sl 2>/dev/null` ; \
+       @-(for i in `ls libxpa.so* *.dylib *.sl 2>/dev/null` ; \
           do \
           if [ -h $$i ] ; then \
                echo "Installing link $$i" ; \
@@ -268,6 +274,11 @@ shlib_install:
           fi; \
           done;)
 
+tclxpa_install: shtclxpa
+       mkdir -p $(TCL_LIB_INSTALL_DIR)
+       $(INSTALL_DATA) libtclxpa.so $(TCL_LIB_INSTALL_DIR)
+       $(INSTALL_DATA) pkgIndex.tcl $(TCL_LIB_INSTALL_DIR)
+
 install-binaries: $(LIB) $(PROGS)
        @for i in $(LIB_INSTALL_DIR) $(INCLUDE_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
            do \
diff --git a/tcl.c b/tcl.c
index 8d104bf1a15a8a20e9661eddbb90ce3946c9f6eb..9e4721f7b4fb2009f8cc855c0466f47570b99306 100644 (file)
--- a/tcl.c
+++ b/tcl.c
@@ -971,7 +971,7 @@ static int XPARec_Tcl(clientData, interp, objc, objv)
     /* create new tcl variable for this socket */
     else{
       /* create a tcl channel corresponding to the xpa socket */
-      if( !(chan = Tcl_MakeTcpClientChannel((ClientData)xpa_cmdfd(xpa))) ){
+      if( !(chan = Tcl_MakeTcpClientChannel((ClientData)(intptr_t)xpa_cmdfd(xpa))) ){
        Tcl_SetResult(interp, "XPA$ERROR: could not map XPA cmdfd to tcl",
                      TCL_STATIC);
        result = TCL_ERROR;
@@ -1013,7 +1013,7 @@ static int XPARec_Tcl(clientData, interp, objc, objv)
     }
     /* create new tcl variable for this socket */
     else{
-      if( !(chan = Tcl_MakeTcpClientChannel((ClientData)xpa_datafd(xpa))) ){
+      if( !(chan = Tcl_MakeTcpClientChannel((ClientData)(intptr_t)xpa_datafd(xpa))) ){
        Tcl_SetResult(interp, "XPA$ERROR: could not map XPA datafd to tcl",
                      TCL_STATIC);
        result = TCL_ERROR;