8000 renamed package script to gauche-package, and added gauche-install sc… · shirok/Gauche@ac5a225 · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
renamed package script to gauche-package, and added gauche-install sc…
Browse files Browse the repository at this point in the history
…ript.

git-svn-id: https://gauche.svn.sourceforge.net/svnroot/gauche/Gauche/trunk@4464 c205566b-fb4e-0410-ab5c-8f0660156277
  • Loading branch information
shirok committed Apr 23, 2004
1 parent ad2d3c8 commit ac5a225
Show file tree
Hide file tree
Showing 11 changed files with 292 additions and 73 deletions.
7 changes: 6 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
2004-04-22 Shiro Kawai <shiro@acm.org>

* src/gauche-package.in, src/gauche-install.in : added.
* src/gauche-cesconv.in : renamed from cesconv.
* src/Makefile.in : installs gauche-* scripts to bindir.

* examples/spigot/configure.in : adapted to the package manager

* lib/gauche/package/build.scm : added
* lib/gauche/package/util.scm : added
* lib/gauche/package/fetch.scm : added
* src/package : added
* acinclude.m4 (AC_GAUCHE_MAKE_GPD): a macro to create PACKAGE.gpd
file.

Expand Down
6 changes: 4 additions & 2 deletions acinclude.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dnl Gauche-specific autoconf macros.
dnl $Id: acinclude.m4,v 1.12 2004-04-23 04:46:37 shirok Exp $
dnl $Id: acinclude.m4,v 1.13 2004-04-23 10:17:21 shirok Exp $

dnl AC_GAUCHE_INIT_EXT
dnl Sets some parameters about installed Gauche package.
Expand All @@ -16,6 +16,8 @@ AC_DEFUN([AC_GAUCHE_INIT_EXT],
[
AC_PATH_PROG([GOSH], gosh)
AC_PATH_PROG([GAUCHE_CONFIG], gauche-config)
AC_PATH_PROG([GAUCHE_PACKAGE], gauche-package)
AC_PATH_PROG([GAUCHE_INSTALL], gauche-install)
GAUCHE_TOP=
GAUCHE_INC="`gauche-config -I`"
GAUCHE_LIB="`gauche-config -L`"
Expand Down Expand Up @@ -145,7 +147,7 @@ AC_DEFUN([AC_GAUCHE_MAKE_GPD],
[
GAUCHE_PACKAGE_CONFIGURE_ARGS="`echo ""$ac_configure_args"" | sed 's/[\\""\`\$]/\\\&/g'`"
AC_MSG_NOTICE([creating ${PACKAGE_NAME}.gpd])
$GOSH package make-gpd "$PACKAGE_NAME" \
$GAUCHE_PACKAGE make-gpd "$PACKAGE_NAME" \
-version "$PACKAGE_VERSION" \
-configure "./configure $GAUCHE_PACKAGE_CONFIGURE_ARGS"
])
6 changes: 4 additions & 2 deletions aclocal.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dnl Gauche-specific autoconf macros.
dnl $Id: aclocal.m4,v 1.28 2004-04-23 04:46:37 shirok Exp $
dnl $Id: aclocal.m4,v 1.29 2004-04-23 10:17:21 shirok Exp $

dnl AC_GAUCHE_INIT_EXT
dnl Sets some parameters about installed Gauche package.
Expand All @@ -16,6 +16,8 @@ AC_DEFUN([AC_GAUCHE_INIT_EXT],
[
AC_PATH_PROG([GOSH], gosh)
AC_PATH_PROG([GAUCHE_CONFIG], gauche-config)
AC_PATH_PROG([GAUCHE_PACKAGE], gauche-package)
AC_PATH_PROG([GAUCHE_INSTALL], gauche-install)
GAUCHE_TOP=
GAUCHE_INC="`gauche-config -I`"
GAUCHE_LIB="`gauche-config -L`"
Expand Down Expand Up @@ -145,7 +147,7 @@ AC_DEFUN([AC_GAUCHE_MAKE_GPD],
[
GAUCHE_PACKAGE_CONFIGURE_ARGS="`echo ""$ac_configure_args"" | sed 's/[\\""\`\$]/\\\&/g'`"
AC_MSG_NOTICE([creating ${PACKAGE_NAME}.gpd])
$GOSH package make-gpd "$PACKAGE_NAME" \
$GAUCHE_PACKAGE make-gpd "$PACKAGE_NAME" \
:version "$PACKAGE_VERSION" \
:configure "./configure $GAUCHE_PACKAGE_CONFIGURE_ARGS"
])
Expand Down
23 changes: 8 additions & 15 deletions examples/spigot/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# $Id: Makefile.in,v 1.6 2003-11-21 21:27:17 shirok Exp $
# $Id: Makefile.in,v 1.7 2004-04-23 10:17:47 shirok Exp $
#

SHELL = @SHELL@
Expand All @@ -16,7 +16,6 @@ CC = @CC@
LIBS = @LIBS@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
INSTALL = @INSTALL@
INSTALL_TYPE = @INSTALL_TYPE@

# Set by configure
Expand All @@ -25,6 +24,8 @@ GAUCHE_CONFIG = @GAUCHE_CONFIG@
OBJEXT = @OBJEXT@
DSOEXT = @SOEXT@

INSTALL = @GAUCHE_INSTALL@

MODULE = spigot

ARCHFILES = $(MODULE).$(DSOEXT)
Expand All @@ -38,7 +39,7 @@ OBJS = $(MODULE)_head.$(OBJEXT) \
$(MODULE)_tail.$(OBJEXT)
GENERATED = spigotlib.c $(MODULE)_head.c $(MODULE)_tail.c
CONFIG_GENERATED = Makefile config.cache config.log config.status \
configure.lineno autom4te*.cache
configure.lineno autom4te*.cache spigot.gpd

HEADER_INSTALL_DIR = $(DESTDIR)/`$(GAUCHE_CONFIG) --$(INSTALL_TYPE)incdir`
SCM_INSTALL_DIR = $(DESTDIR)/`$(GAUCHE_CONFIG) --$(INSTALL_TYPE)libdir`
Expand Down Expand Up @@ -67,18 +68,10 @@ check : all
$(GOSH) -I. test.scm > test.log

install : all
if test ! -z "$(HEADERS)"; then \
$(INSTALL) -d $(HEADER_INSTALL_DIR); \
$(INSTALL) -m 444 $(HEADERS) $(HEADER_INSTALL_DIR); \
fi
if test ! -z "$(SCMFILES)"; then \
$(INSTALL) -d $(SCM_INSTALL_DIR); \
$(INSTALL) -m 444 $(SCMFILES) $(SCM_INSTALL_DIR); \
fi
if test ! -z "$(ARCHFILES)"; then \
$(INSTALL) -d $(ARCH_INSTALL_DIR); \
$(INSTALL) -m 555 $(ARCHFILES) $(ARCH_INSTALL_DIR); \
fi
$(INSTALL) -m 444 -T $(HEADER_INSTALL_DIR) $(HEADERS)
$(INSTALL) -m 444 -T $(SCM_INSTALL_DIR) $(SCMFILES)
$(INSTALL) -m 555 -T $(ARCH_INSTALL_DIR) $(ARCHFILES)
$(INSTALL) -m 444 -T $(SCM_INSTALL_DIR)/.packages spigot.gpd

clean :
rm -rf core $(TARGET) $(OBJS) $(GENERATED) *~ test.log so_locations
Expand Down
3 changes: 2 additions & 1 deletion examples/spigot/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dnl
dnl Configuring spigot
dnl process this file with "autoconf -I `gauche-config --ac`" to
dnl generate 'configure'.
dnl $Id: configure.in,v 1.1 2003-06-10 20:59:45 shirok Exp $
dnl $Id: configure.in,v 1.2 2004-04-23 10:17:47 shirok Exp $
dnl

AC_PREREQ(2.54)
Expand Down Expand Up @@ -36,5 +36,6 @@ dnl This should come after all tests, or the tests that does link will fail.
AC_GAUCHE_FIX_LIBS

dnl Output
AC_GAUCHE_MAKE_GPD
AC_OUTPUT(Makefile)

25 changes: 22 additions & 3 deletions src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ INSTALL_SUBHEADERS = gauche/config.h gauche/vm.h gauche/vminsn.h \
gauche/class.h gauche/exception.h \
gauche/pthread.h gauche/uthread.h gauche/arch.h
INSTALL_LIBS = libgauche.$(SOEXT)
INSTALL_BINS = gosh gauche-config
INSTALL_SCMS = gauche-init.scm genstub cesconv package
INSTALL_BINS = gosh gauche-config gauche-install gauche-package \
gauche-cesconv
INSTALL_SCMS = gauche-init.scm genstub cesconv

GENERATED_SCRIPTS = gauche-install gauche-package gauche-cesconv

PRIVATE_HEADERS = gauche/arith.h gauche/builtin-syms.h

Expand Down Expand Up @@ -124,7 +127,7 @@ HEADERS = gauche.h $(INSTALL_SUBHEADERS) $(PRIVATE_HEADERS)

OBJECTS = $(libgauche_OBJECTS) $(gosh_OBJECTS)

all : gosh$(EXEEXT) libgauche.$(SOEXT)
all : gosh$(EXEEXT) libgauche.$(SOEXT) $(GENERATED_SCRIPTS)

gosh$(EXEEXT) : libgauche.$(SOEXT) $(gosh_OBJECTS)
@rm -f gosh$(EXEEXT)
Expand Down Expand Up @@ -165,6 +168,21 @@ gauche/arch.h :
@echo '#define GAUCHE_SITE_LIB_DIR "$(SITE_SCM_DIR)"' >> gauche/arch.h
@echo '#define GAUCHE_SITE_ARCH_DIR "$(SITE_ARCH_DIR)"' >> gauche/arch.h

gauche-install : gauche-install.in
@rm -f gauche-install
@echo "#!$(BIN_INSTALL_DIR)/gosh" > gauche-install
@cat gauche-install.in >> gauche-install

gauche-package : gauche-package.in
@rm -f gauche-package
@echo "#!$(BIN_INSTALL_DIR)/gosh" > gauche-package
@cat gauche-package.in >> gauche-package

gauche-cesconv : gauche-cesconv.in
@rm -f gauche-cesconv
@echo "#!$(BIN_INSTALL_DIR)/gosh" > gauche-cesconv
@cat gauche-cesconv.in >> gauche-cesconv

# tests -----------------------------------------------
TESTFILES = `cat ../test/TESTS`

Expand Down Expand Up @@ -203,6 +221,7 @@ CONFIG_GENERATED = Makefile gauche-config gauche/config.h
clean :
rm -rf core core.[0-9]* gosh$(EXEEXT) \
test-vmstack$(EXEEXT) test-arith$(EXEEXT) \
$(GENERATED_SCRIPTS) \
libgauche.$(SOEXT)* *.$(OBJEXT) *~ *.a *.t *.def *.exp \
test.log test.dir so_locations gauche/*~ gauche/arch.h

Expand Down
50 changes: 7 additions & 43 deletions src/cesconv
Original file line number Diff line number Diff line change
@@ -1,46 +1,10 @@
;;;
;;; cesconv - a simple Gauche script to convert CESes
;;;
;;; $Id: cesconv,v 1.1 2004-01-27 04:37:57 shirok Exp $
;;;
;;-*-Scheme-*-
;; $Id: cesconv,v 1.2 2004-04-23 10:17:47 shirok Exp $
;;

;; iconv-like script. useful to have during make process.

(use gauche.charconv)
(use gauche.parseopt)
(use file.filter)

(define (usage)
(print "Usage: gosh cesconv [options] inputfile")
(print " --from-code, -f encoding : input ces. can be '*jp' to guess.")
(print " --to-code, -t encoding : output ces.")
(print " --output, -o file : output file (instead of stdout)")
(print "When inputfile is omitted, input is taken from stdin.")
(print "when input/output ces is omitted, Gauche's native CES is used.")
(exit 0))

(define (process iport oport ices oces)
(copy-port (wrap-with-input-conversion iport ices)
(wrap-with-output-conversion oport oces)
:unit 'char))
;; Kept for backward compatibility. Will be gone soon.

(define (main args)
(let-args (cdr args) ((ices "f|from-code=s" (gauche-character-encoding))
(oces "t|to-code=s" (gauche-character-encoding))
(outfile "o|output=s" #f)
. files)
(file-filter (lambda (in out)
(let ((inp (wrap-with-input-conversion in ices))
(outp (wrap-with-output-conversion out oces)))
(copy-port inp outp :unit 'char)
(close-input-port inp)
(close-output-port outp)))
:input (or (and (pair? files) (car files))
(current-input-port))
:output (or outfile (current-output-port))
)
0))

;; Local variables:
;; mode: scheme
;; end:
(warn "'cesconv' is obsoleted. Use gauche-cesconv script instead.")
(sys-system (string-join (cons "gauche-cesconv" (cdr args)) " "))
0)
47 changes: 47 additions & 0 deletions src/gauche-cesconv.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
;;;
;;; gauche-cesconv - a simple Gauche script to convert CESes
;;;
;;; $Id: gauche-cesconv.in,v 1.1 2004-04-23 10:17:47 shirok Exp $
;;;

;; iconv-like script. useful to have during make process.

(use gauche.charconv)
(use gauche.parseopt)
(use file.filter)

(define (usage)
(print "Usage: gosh cesconv [options] inputfile")
(print " -f, --from-code=encoding : input ces. can be '*jp' to guess.")
(print " -t, --to-code=encoding : output ces.")
(print " -o, --output=file : output file (instead of stdout)")
(print "When inputfile is omitted, input is taken from stdin.")
(print "when input/output ces is omitted, Gauche's native CES is used.")
(exit 0))

(define (process iport oport ices oces)
(copy-port (wrap-with-input-conversion iport ices)
(wrap-with-output-conversion oport oces)
:unit 'char))

(define (main args)
(let-args (cdr args) ((ices "f|from-code=s" (gauche-character-encoding))
(oces "t|to-code=s" (gauche-character-encoding))
(outfile "o|output=s" #f)
(#f "h|help" (usage))
. files)
(file-filter (lambda (in out)
(let ((inp (wrap-with-input-conversion in ices))
(outp (wrap-with-output-conversion out oces)))
(copy-port inp outp :unit 'char)
(close-input-port inp)
(close-output-port outp)))
:input (or (and (pair? files) (car files))
(current-input-port))
:output (or outfile (current-output-port))
)
0))

;; Local variables:
;; mode: scheme
;; end:
Loading

0 comments on commit ac5a225

Please sign in to comment.
0