From 219afde828024d1e4b4c35f0ef3dcda39ad6d40d Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 20 Jun 2000 14:21:35 +0000 Subject: [PATCH] Tidied GSDoc stuff git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6737 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 9 ++- GSDoc/GNUmakefile | 51 ----------------- GSDoc/GNUmakefile.local | 97 -------------------------------- GSDoc/Makefile.postamble | 58 ------------------- GSDoc/Makefile.preamble | 66 ---------------------- GSDoc/README | 27 --------- Tools/GNUmakefile | 7 ++- Tools/Makefile.postamble | 5 +- Tools/Makefile.preamble | 7 ++- {GSDoc => Tools}/gnustep.gsdoc | 0 {GSDoc => Tools}/gsdoc-0_6_5.dtd | 0 {GSDoc => Tools}/gsdoc.gsdoc | 0 {GSDoc => Tools}/gsdoc.m | 37 ++++++++++++ 13 files changed, 59 insertions(+), 305 deletions(-) delete mode 100644 GSDoc/GNUmakefile delete mode 100644 GSDoc/GNUmakefile.local delete mode 100644 GSDoc/Makefile.postamble delete mode 100644 GSDoc/Makefile.preamble delete mode 100644 GSDoc/README rename {GSDoc => Tools}/gnustep.gsdoc (100%) rename {GSDoc => Tools}/gsdoc-0_6_5.dtd (100%) rename {GSDoc => Tools}/gsdoc.gsdoc (100%) rename {GSDoc => Tools}/gsdoc.m (98%) diff --git a/ChangeLog b/ChangeLog index 0ca658f75..27817ae47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,9 +2,12 @@ * configure.in: Added check for recent libxml * config.mak.in: Added defeine for HAVE_LIBXML - * GSDoc/gsdoc.m: modified for standard libxml 2.0 installation - * GSDoc/README: updated - * GSDoc/Makefile.preamble: conditional on presence of libxml + * Tools/gsdoc.m: Added from GSDoc and modified for standard + libxml 2.0 installation + * Tools/gsdoc-0_6_5.dtd: Added from GSDoc + * Tools/gsdoc.gsdoc: Added from GSDoc + * Tools/gnustep.gsdoc: Added from GSDoc + * GSDoc: all removed 2000-06-19 Richard Frith-Macdonald diff --git a/GSDoc/GNUmakefile b/GSDoc/GNUmakefile deleted file mode 100644 index 08d72a604..000000000 --- a/GSDoc/GNUmakefile +++ /dev/null @@ -1,51 +0,0 @@ -# -# Documentation tools makefile for GNUstep Base Library -# Copyright (C) 2000 Free Software Foundation, Inc. -# -# Written by: Richard Frith-Macdonald -# -# This file is part of the GNUstep Base Library. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public -# License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. - -# Install into the system root by default -GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) - -GNUSTEP_MAKEFILES = $(GNUSTEP_SYSTEM_ROOT)/Makefiles - -include $(GNUSTEP_MAKEFILES)/common.make - -include ../Version -include ../config.mak - -dtddir = $(GNUSTEP_RESOURCES)/DTDs -DTD_FILES = gsdoc-0_6_5.dtd - -# The application to be compiled -TOOL_NAME = gsdoc - -# The source files to be compiled -gsdoc_OBJC_FILES = gsdoc.m - -DIST_FILES = GNUmakefile Makefile.preamble Makefile.postamble - --include Makefile.preamble - --include GNUmakefile.local - -include $(GNUSTEP_MAKEFILES)/objc.make -include $(GNUSTEP_MAKEFILES)/tool.make - --include Makefile.postamble diff --git a/GSDoc/GNUmakefile.local b/GSDoc/GNUmakefile.local deleted file mode 100644 index 6bb88ad32..000000000 --- a/GSDoc/GNUmakefile.local +++ /dev/null @@ -1,97 +0,0 @@ -# -# GNUmakefile.local for the GNUstep package -# - -# -# Flags dealing with compiling and linking -# - -TOPLEV = /var/data0/core -ifeq ($(BACK_PROJ),) -BACK_PROJ = xgps -endif -ifneq ($(EXTENSIONS_VERSION),) -_PKG = extensions -endif -ifneq ($(GNUSTEP_BASE_VERSION),) -_PKG = base -endif -ifneq ($(GNUSTEP_GUI_VERSION),) -_PKG = p_gui -endif -ifneq ($(GNUSTEP_XRAW_VERSION),) -_PKG = xraw -endif -ifneq ($(GNUSTEP_XDPS_VERSION),) -_PKG = xdps -endif -ifneq ($(GNUSTEP_XGPS_VERSION),) -_PKG = xgps -endif -ifneq ($(GDL_VERSION),) -_PKG = db -endif -ifeq ($(_PKG),) -_PKG = guile -endif - -# Additional flags to pass to the C compiler -#ADDITIONAL_CFLAGS += - -# Additional LDFLAGS to pass to the linker -#ADDITIONAL_LDFLAGS += - -# Additional include directories the compiler should search -# Additional library directories the linker should search - -ifeq ($(findstring $(_PKG), extensions p_gui $(BACK_PROJ) db guile),$(_PKG)) - ifeq ($(FOUNDATION_LIB), gnu) - ADDITIONAL_INCLUDE_DIRS += -I$(TOPLEV)/base/Headers/gnustep \ - -I$(TOPLEV)/base/Headers \ - -I$(TOPLEV)/base/Source/$(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS) - ADDITIONAL_LIB_DIRS += -L$(TOPLEV)/base/Source/$(GNUSTEP_OBJ_DIR) - endif - ifeq ($(FOUNDATION_LIB), fd) - ADDITIONAL_INCLUDE_DIRS += -I$(TOPLEV)/libFoundation - ADDITIONAL_LIB_DIRS += \ - -L$(TOPLEV)/libFoundation/Foundation/$(GNUSTEP_OBJ_DIR) - endif -endif - -ifeq ($(findstring $(_PKG), p_gui $(BACK_PROJ) db guile),$(_PKG)) - ADDITIONAL_INCLUDE_DIRS += -I$(TOPLEV)/extensions - ADDITIONAL_LIB_DIRS += -L$(TOPLEV)/extensions/extensions/$(GNUSTEP_OBJ_DIR) -endif - -ifeq ($(findstring $(_PKG), $(BACK_PROJ) db guile),$(_PKG)) - ADDITIONAL_INCLUDE_DIRS += -I$(TOPLEV)/gui/Headers - ADDITIONAL_LIB_DIRS += -L$(TOPLEV)/gui/Model/$(GNUSTEP_OBJ_DIR) \ - -L$(TOPLEV)/gui/Source/$(GNUSTEP_OBJ_DIR) -endif - -ifeq ($(findstring $(_PKG), p_gui guile),$(_PKG)) - ADDITIONAL_INCLUDE_DIRS += -I$(TOPLEV)/$(BACKPROJ)/Headers - ADDITIONAL_LIB_DIRS += -L$(TOPLEV)/$(BACK_PROJ)/Source/$(GNUSTEP_OBJ_DIR) -endif - -GNUSTEP_HEADERS_FND_FLAG = -GNUSTEP_HEADERS_GUI_FLAG = -GNUSTEP_HEADERS_TARGET_FLAG = -GNUSTEP_USER_HEADERS_FLAG = -GNUSTEP_LOCAL_HEADERS_FLAG = -# not used when building the core: -GNUSTEP_SYSTEM_HEADERS = /nowhere/Headers - -GNUSTEP_USER_LIBRARIES_FLAG = -GNUSTEP_USER_TARGET_LIBRARIES_FLAG = -GNUSTEP_LOCAL_LIBRARIES_FLAG = -GNUSTEP_LOCAL_TARGET_LIBRARIES_FLAG = -# not used when building the core: -GNUSTEP_SYSTEM_LIBRARIES = /nowhere -GNUSTEP_SYSTEM_TARGET_LIBRARIES = /nowhere - -ifeq ($(POSTGRES95_DATABASE),yes) -POSTGRES95_CFLAGS = -I/usr/include/postgresql -POSTGRES95_LDFLAGS = -lpq -ADDITIONAL_INCLUDE_DIRS += $(POSTGRES95_CFLAGS) -endif diff --git a/GSDoc/Makefile.postamble b/GSDoc/Makefile.postamble deleted file mode 100644 index 3385e17c8..000000000 --- a/GSDoc/Makefile.postamble +++ /dev/null @@ -1,58 +0,0 @@ -# -# Makefile.postamble -# -# Project specific makefile rules -# -# Uncomment the targets you want. -# The double colons (::) are important, do not make them single colons -# otherwise the normal makefile rules will not be performed. -# - -# Things to do before compiling -# before-all:: - -# Things to do after compiling -# after-all:: - -# Things to do before installing -before-install:: - $(MKDIRS) $(dtddir) - -# Things to do after installing -after-install:: - for file in $(DTD_FILES); do \ - $(INSTALL_DATA) $$file $(dtddir)/$$file ; \ - done - -# Things to do before uninstalling -# before-uninstall:: - -# Things to do after uninstalling -# after-uninstall:: - -# Things to do before cleaning -# before-clean:: - -# Things to do after cleaning -# after-clean:: - -# Things to do before distcleaning -# before-distclean:: - -# Things to do after distcleaning -# after-distclean:: - -# Things to do before checking -# before-check:: - -# Things to do after checking -# after-check:: - -regenerate: - -copy-dist: $(DIST_FILES) - mkdir ../snap/Tools - for f in $(DIST_FILES); do \ - cp $$f ../snap/Tools ; \ - done - diff --git a/GSDoc/Makefile.preamble b/GSDoc/Makefile.preamble deleted file mode 100644 index d45a1cb2f..000000000 --- a/GSDoc/Makefile.preamble +++ /dev/null @@ -1,66 +0,0 @@ -# -# Copyright (C) 2000 Free Software Foundation, Inc. -# -# Written by: Richard Frith-Macdonald -# -# This file is part of the GNUstep Base Library. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public -# License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. -# - -# -# Makefile.preamble -# -# Project specific makefile variables, and additional -# -# Do not put any Makefile rules in this file, instead they should -# be put into Makefile.postamble. -# - -# -# Flags dealing with compiling and linking -# - -# Additional flags to pass to the preprocessor -ADDITIONAL_CPPFLAGS += -DHAVE_LIBXML=$(HAVE_LIBXML) - -# Additional flags to pass to the Objective-C compiler -#ADDITIONAL_OBJCFLAGS += - -# Additional flags to pass to the C compiler -#ADDITIONAL_CFLAGS += - -# Additional include directories the compiler should search -ADDITIONAL_INCLUDE_DIRS += \ - -I../Headers/gnustep -I../Headers \ - -I../Source/$(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS) - -# Additional LDFLAGS to pass to the linker -#ADDITIONAL_LDFLAGS += - -# Additional library directories the linker should search -ADDITIONAL_LIB_DIRS += -L../Source/$(GNUSTEP_OBJ_DIR) - -# Additional libraries for XML parsing -ifeq ($(HAVE_LIBXML),1) -ADDITIONAL_TOOL_LIBS += -lxml -lz -endif - -# -# Flags dealing with installing and uninstalling -# - -# Additional directories to be created during installation -#ADDITIONAL_INSTALL_DIRS += diff --git a/GSDoc/README b/GSDoc/README deleted file mode 100644 index d215d10c0..000000000 --- a/GSDoc/README +++ /dev/null @@ -1,27 +0,0 @@ - -20-Jun-2000 - -GSDoc should probably be part of the 'Tools' directory of gstep-base, -but it depends on a version of the gnome XML parsing library that is -probably not available on most machines. - -Before doing anything else - you need to install the Gnome xml parser library! - -I build gsdoc using the 2.0.0 release of the parser. - -You can find out how to get this from http://www.xmlsoft.org - -Once you have installed the xml parser library, you can build gsdoc -and install it. - -Run gsdoc giving it the name of a gsdoc file as an argument, and it will -produce an html output file. - -This is an alpha release of the software - please send fixes and improvements -to rfm@gnu.org - -Volunteers to write gsdoc->info or gsdoc->TeX or any other translators are -very welcome. - - - diff --git a/Tools/GNUmakefile b/Tools/GNUmakefile index 270462637..a04a03f60 100644 --- a/Tools/GNUmakefile +++ b/Tools/GNUmakefile @@ -30,14 +30,19 @@ include $(GNUSTEP_MAKEFILES)/common.make include ../Version include ../config.mak +# DTDs to install +dtddir = $(GNUSTEP_RESOURCES)/DTDs +DTD_FILES = gsdoc-0_6_5.dtd + # The application to be compiled -TOOL_NAME = gdnc defaults plmerge \ +TOOL_NAME = gdnc gsdoc defaults plmerge \ plparse sfparse pldes plser OBJC_PROGRAM_NAME = gdomap # The source files to be compiled gdomap_C_FILES = gdomap.c gdnc_OBJC_FILES = gdnc.m +gsdoc_OBJC_FILES = gsdoc.m defaults_OBJC_FILES = defaults.m dread_OBJC_FILES = dread.m dremove_OBJC_FILES = dremove.m diff --git a/Tools/Makefile.postamble b/Tools/Makefile.postamble index 84b7de2e6..098c45024 100644 --- a/Tools/Makefile.postamble +++ b/Tools/Makefile.postamble @@ -19,7 +19,10 @@ # Things to do after installing after-install:: - @if [ "`whoami`" != "root" ]; then \ + @for file in $(DTD_FILES); do \ + $(INSTALL_DATA) $$file $(dtddir)/$$file ; \ + done; \ + if [ "`whoami`" != "root" ]; then \ echo ""; \ echo "************************************************************"; \ echo "WARNING: gdomap MUST be installed owned by root and with"; \ diff --git a/Tools/Makefile.preamble b/Tools/Makefile.preamble index 03bab77d4..4c3dd348e 100644 --- a/Tools/Makefile.preamble +++ b/Tools/Makefile.preamble @@ -36,7 +36,7 @@ # # Additional flags to pass to the preprocessor -#ADDITIONAL_CPPFLAGS += +ADDITIONAL_CPPFLAGS += -DHAVE_LIBXML=$(HAVE_LIBXML) # Additional flags to pass to the Objective-C compiler #ADDITIONAL_OBJCFLAGS += @@ -55,6 +55,11 @@ ADDITIONAL_INCLUDE_DIRS += -I../Headers/gnustep -I../Headers \ # Additional library directories the linker should search ADDITIONAL_LIB_DIRS += -L../Source/$(GNUSTEP_OBJ_DIR) +# Additional libraries for XML parsing +ifeq ($(HAVE_LIBXML),1) +ADDITIONAL_TOOL_LIBS += -lxml -lz +endif + # # Flags dealing with installing and uninstalling # diff --git a/GSDoc/gnustep.gsdoc b/Tools/gnustep.gsdoc similarity index 100% rename from GSDoc/gnustep.gsdoc rename to Tools/gnustep.gsdoc diff --git a/GSDoc/gsdoc-0_6_5.dtd b/Tools/gsdoc-0_6_5.dtd similarity index 100% rename from GSDoc/gsdoc-0_6_5.dtd rename to Tools/gsdoc-0_6_5.dtd diff --git a/GSDoc/gsdoc.gsdoc b/Tools/gsdoc.gsdoc similarity index 100% rename from GSDoc/gsdoc.gsdoc rename to Tools/gsdoc.gsdoc diff --git a/GSDoc/gsdoc.m b/Tools/gsdoc.m similarity index 98% rename from GSDoc/gsdoc.m rename to Tools/gsdoc.m index 05e1eec4e..9c04ac455 100644 --- a/GSDoc/gsdoc.m +++ b/Tools/gsdoc.m @@ -22,6 +22,26 @@ */ +/* + Before doing anything else - you need to install the Gnome xml parser library! + + I build gsdoc using the 2.0.0 release of the parser. + + You can find out how to get this from http://www.xmlsoft.org + + Once you have installed the xml parser library, you can build gsdoc + and install it. + + Run gsdoc giving it the name of a gsdoc file as an argument, and it will + produce an html output file. + + This is an alpha release of the software - please send fixes and improvements + to rfm@gnu.org + + Volunteers to write gsdoc->info or gsdoc->TeX or any other translators are + very welcome. + */ + #include #if HAVE_LIBXML @@ -153,6 +173,7 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt) extern int xmlDoValidityCheckingDefaultValue; xmlExternalEntityLoader ldr; NSString *s; + NSFileManager *m; xmlDoValidityCheckingDefaultValue = 1; ldr = xmlGetExternalEntityLoader(); @@ -161,6 +182,22 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt) xmlSetExternalEntityLoader((xmlExternalEntityLoader)loader); } + /* + * Ensure we have a valid file name. + */ + s = [name pathExtension]; + m = [NSFileManager defaultManager]; + if ([m fileExistsAtPath: name] == NO && [s length] == 0) + { + s = [name stringByAppendingPathExtension: @"gsdoc"]; + if ([m fileExistsAtPath: s] == NO) + { + NSLog(@"No such document - %@", name); + [self dealloc]; + return nil; + } + name = s; + } fileName = [name copy]; /* * Build an XML tree from the file.