Fix Linux rpc problems with new glibc
[oweals/cde.git] / cde / programs / ttsnoop / Imakefile
index 9d239141a77bf3561cceeb02407510bfa25113ff..3bde4cefd14f195785d2c731e92df453464f0d6d 100644 (file)
@@ -6,11 +6,13 @@ UTILLIB = -lutil
 
 #define CplusplusSource        YES
 DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
+INCLUDES = $(TIRPCINC)
 EXTRA_LOAD_FLAGS = ExtraLoadFlags $(UNSHARED_CXXLIB)
 
 DEPLIBS = $(DEPDTTERMLIB) DepDtClientLibs $(DEPUTILLIB)
 LOCAL_LIBRARIES = $(DTTERMLIB) DtClientLibs $(UTILLIB)
 SYS_LIBRARIES = DtClientSysLibs DtClientExtraLibs
+DTCODEGENCAT = NLSPATH=$(CDESRC)/dtappbuilder/src/abmf/dtcodegen.cat
 
 
 XCOMM ##########################################################################
@@ -57,11 +59,11 @@ TARGETS.C.merged = \
        ttChooser_stubs.C       ttsnoop.C \
        ttsnoop_stubs.C
  
-SRCS.h = $(TARGETS.h.merged) $(TARGETS.h) tt_c++.h DtTt.h
+SRCS2.h = $(TARGETS.h.merged) $(TARGETS.h) tt_c++.h DtTt.h
 
-SRCS = $(TARGETS.C.merged) $(TARGETS.c) tt_c++.C DtTt.C
+SRCS2 = $(TARGETS.C.merged) $(TARGETS.c) tt_c++.C DtTt.C
 
-OBJS = \
+OBJS2 = \
        DtTt.o                  apiTracer_stubs.o \
        apiTracer_ui.o          argChooser_stubs.o \
        argChooser_ui.o         callbackChooser_stubs.o \
@@ -75,6 +77,14 @@ OBJS = \
        tt_c++.o                ttsnoop.o \
        ttsnoop_stubs.o         ttsnoop_ui.o
  
+AB_MAKEFILES = \
+       Makefile.aix \
+       Makefile.hpux \
+       Makefile.sunos \
+       Makefile.linux \
+       Makefile.freebsd \
+       Makefile.netbsd \
+       Makefile.openbsd
 
 XCOMM ###
 XCOMM ### This is basically a kludge since dtappbuilder is not being 
@@ -85,7 +95,7 @@ XCOMM ### includes::  $(TARGETS.h) $(TARGETS.c)
 XCOMM ### localincludes::  $(TARGETS.h) $(TARGETS.c)
 XCOMM ###
 
-all:: targets
+all:: targets ttdepend
 
 targets::  $(TARGETS.h) $(TARGETS.c)
 
@@ -99,7 +109,17 @@ depend::
 
 NormalCplusplusObjectRule()
 
-ComplexCplusplusProgramTarget($(PROGRAMS))
+all:: $(PROGRAMS)
+
+ComplexCplusplusProgramTarget_2($(PROGRAMS),$(LOCAL_LIBRARIES),)
+
+ttdepend:: DependFileName
+
+DependFileName::
+       -RunProgram(DEPEND,$(DEPENDFLAGS) $(ALLDEFINES) $(DEPEND_DEFINES) $(SRCS2)) > $@
+
+clean::
+       RemoveFile(ProgramTargetName(PROGRAMS))
 
 
 XCOMM #####################################################################
@@ -147,39 +167,45 @@ $(m.GEN_UI_C) Plus() $(m.GEN_UI_H) Plus() $(m.GEN_STUBS_C++): ttsnoop.bip $(m.SR
 # define CodeGenTarget(m) CodeGenAppendableTarget(m)
 #endif
 
+#define SED_MoreButton $(SED) \                                                @@\
+       -e 's/\(MoreButton;\)/\1Boolean _DtCanHelp( const char * );/' \ @@\
+       -e 's/\(XtManageChild(Quick_help\)/XtSetSensitive(MoreButton,_DtCanHelp(help_data->help_text));\1/' \   @@\
+       -e 's/\(buffer, vol, loc;\)/\1Boolean _DtHelped( Widget );/' \  @@\
+       -e 's/\(if( (cp=strrchr\)/if (_DtHelped( help_dialog)) return;\1/' \ @@\
+       dtb_utils.c > dtb_utils.c.patched
+
+#define SED_DtbTt $(SED) \                                             @@\
+       -e 's/^DtbTt/extern String snooperArgv[];DtbTt/' \              @@\
+       -e 's/XmNheight, 257,//' \                                      @@\
+       -e 's/XmNwidth, 580,//' \                                       @@\
+       -e 's/XmNcolumns, 80,//' \                                      @@\
+       -e 's/XmNrows, 24/DtNsubprocessArgv, snooperArgv/' \            @@\
+       ttsnoop_ui.c > ttsnoop_ui.c.patched
+
+#define SED_DtbApi $(SED) \                                            @@\
+       -e 's/^DtbApi/extern String apiTracerArgv[];DtbApi/' \          @@\
+       -e 's/XmNrows, 24/XmNrows, 24, DtNsubprocessArgv, apiTracerArgv/' \ @@\
+       apiTracer_ui.c > apiTracer_ui.c.patched
 
 ttsnoop.C ttsnoop.h dtb_utils.c dtb_utils.h: ttsnoop.bip ttsnoop.C.src
        $(CP) ttsnoop.C.src ttsnoop.c
-       -if [ ! -w ttsnoop.c ]; then \
-               chmod +w ttsnoop.c; fi
+       -if [ ! -w ttsnoop.c ]; then chmod +w ttsnoop.c; fi
        $(DTCODEGEN) -changed -merge -p ttsnoop.bip -main
        $(RM) ttsnoop.C
        $(MV) ttsnoop.c ttsnoop.C
        chmod -w ttsnoop.C
        cat externC.h dtb_utils.h closeBrace.h > dtb_utils.h.patched
        $(MV) dtb_utils.h.patched dtb_utils.h
-       sed \
-       -e 's/\(MoreButton;\)/\1Boolean _DtCanHelp( const char * );/' \
-       -e 's/\(XtManageChild(Quick_help\)/XtSetSensitive(MoreButton,_DtCanHelp(help_data->help_text));\1/' \
-       -e 's/\(buffer, vol, loc;\)/\1Boolean _DtHelped( Widget );/' \
-       -e 's/\(if( (cp=strrchr\)/if (_DtHelped( help_dialog)) return;\1/' \
-       dtb_utils.c > dtb_utils.c.patched
+       SED_MoreButton
        $(MV) dtb_utils.c.patched dtb_utils.c
 ttsnoop.o: ttsnoop.C ttsnoop.bip $(TARGETS.h) $(TARGETS.h.merged)
 
 CodeGenAppendableTarget(ttsnoop)
-       sed -e 's/^DtbTt/extern String snooperArgv[];DtbTt/' \
-       -e 's/XmNheight, 257,//' \
-       -e 's/XmNwidth, 580,//' \
-       -e 's/XmNcolumns, 80,//' \
-       -e 's/XmNrows, 24/DtNsubprocessArgv, snooperArgv/' \
-       ttsnoop_ui.c > ttsnoop_ui.c.patched
+       SED_DtbTt
        $(MV) ttsnoop_ui.c.patched ttsnoop_ui.c
 
 CodeGenAppendableTarget(apiTracer)
-       sed -e 's/^DtbApi/extern String apiTracerArgv[];DtbApi/' \
-       -e 's/XmNrows, 24/XmNrows, 24, DtNsubprocessArgv, apiTracerArgv/' \
-       apiTracer_ui.c > apiTracer_ui.c.patched
+       SED_DtbApi
        $(MV) apiTracer_ui.c.patched apiTracer_ui.c
 
 CodeGenTarget(ttChooser)
@@ -192,11 +218,11 @@ CodeGenTarget(argChooser)
 CodeGenTarget(callbackChooser)
 
 CLEAN_FILES =  core .dtcodegen.log *.BAK *.delta *.patched \
-                $(PROGRAMS) $(OBJS) $(TARGETS.c) $(TARGETS.h) \
+                $(PROGRAMS) $(OBJS2) $(TARGETS.c) $(TARGETS.h) \
                $(TARGETS.c.temp) $(TARGETS.C.merged) Ttsnoop
 
 clean::
-       $(RM) $(CLEAN_FILES)
+       $(RM) $(CLEAN_FILES) $(AB_MAKEFILES)
 
 scour:
        $(RM) $(CLEAN_FILES) $(TARGETS.h.merged) Makefile Makefile.aix Makefile.hpux Makefile.sunos