From c49a1d03942279129540d23c6521306951e004b6 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 12 Jun 2002 20:21:14 +0000 Subject: [PATCH] ICU-1868 'manually' archive libraries (for AS/400 or other platforms where gmake is unable to handle the dependencies) X-SVN-Rev: 8863 --- icu4c/source/tools/pkgdata/sttcmode.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/icu4c/source/tools/pkgdata/sttcmode.c b/icu4c/source/tools/pkgdata/sttcmode.c index 927866bfbcc..73dd7e21c9b 100644 --- a/icu4c/source/tools/pkgdata/sttcmode.c +++ b/icu4c/source/tools/pkgdata/sttcmode.c @@ -31,6 +31,11 @@ #include "filestrm.h" +/** set if AR is NOT to be called implicitly by gnumake + ** (i.e. if the form libblah.a($(OBJECTS) doesnt work) + **/ +#define NO_IMPLICIT_AR 0 + void pkg_sttc_writeReadme(struct UPKGOptions_ *o, const char *libName, UErrorCode *status) { char tmp[1024]; @@ -125,14 +130,13 @@ writeObjRules(UPKGOptions *o, FileStream *makefile, CharList **objects) uprv_strcpy(tmp+(p-1-baseName), "_"); /* to append */ uprv_strcat(tmp, p); - uprv_strcat(tmp, "."); - uprv_strcat(tmp, STATIC_O); + uprv_strcat(tmp, ".$(STATIC_O)"); *objects = pkg_appendToList(*objects, &oTail, uprv_strdup(tmp)); /* write source list */ strcpy(cfile,tmp); - strcpy(cfile+strlen(cfile)-strlen("." STATIC_O), ".c" ); + strcpy(cfile+strlen(cfile)-strlen(".$(STATIC_O)"), ".c" ); /* Make up parents.. */ @@ -207,7 +211,6 @@ void pkg_mode_static(UPKGOptions *o, FileStream *makefile, UErrorCode *status) T_FileStream_writeLine(makefile, tmp); T_FileStream_writeLine(makefile, "LIB_TARGET=$(TARGET)\n"); - uprv_strcpy(tmp, "all: $(TARG_PATH)$(LIB_TARGET)"); uprv_strcat(tmp, "\n\n"); T_FileStream_writeLine(makefile, tmp); @@ -256,8 +259,14 @@ void pkg_mode_static(UPKGOptions *o, FileStream *makefile, UErrorCode *status) T_FileStream_writeLine(makefile,"$(TEMP_PATH)%.$(STATIC_O): $(TEMP_PATH)%.c\n\t $(COMPILE.c) -o $@ $<\n\n"); +#if NO_IMPLICIT_AR + T_FileStream_writeLine(makefile, "$(TARG_PATH)$(LIB_TARGET):$(TARG_PATH)$(LIB_TARGET) $(OBJECTS) $(LISTFILES)\n" + "\t$(AR) $(ARFLAGS) $(TARG_PATH)$(LIB_TARGET) $(OBJECTS)\n" + "\t$(RANLIB) $@\n\n"); +#else T_FileStream_writeLine(makefile, "$(TARG_PATH)$(LIB_TARGET):$(TARG_PATH)$(LIB_TARGET)($(OBJECTS)) $(LISTFILES)\n" "\t$(RANLIB) $@\n\n"); +#endif T_FileStream_writeLine(makefile, "CLEANFILES= $(CMNLIST) $(OBJECTS) $(TARG_PATH)$(LIB_TARGET) $(TARG_PATH)$(MIDDLE_STATIC_LIB_TARGET) $(TARG_PATH)$(TARGET)\n\nclean:\n\t-$(RMV) $(CLEANFILES) $(MAKEFILE)");