cdargs-1.35/0000777000076400001440000000000010401700277006450 5cdargs-1.35/m4/0000777000076400001440000000000010401700300006753 5cdargs-1.35/m4/Makefile.am0000644000076400001440000000003710165104704010740 EXTRA_DIST = mp_with_curses.m4 cdargs-1.35/m4/Makefile.in0000644000076400001440000001011610401700300010733 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ EXTRA_DIST = mp_with_curses.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps m4/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status tags: TAGS TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = m4 distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: tags distdir info-am info dvi-am dvi check check-am \ installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cdargs-1.35/m4/mp_with_curses.m40000644000076400001440000000212710165104712012202 dnl Source: http://www.gnu.org/software/ac-archive/htmldoc/mp_with_curses.html dnl AC_DEFUN([MP_WITH_CURSES], [AC_ARG_WITH(ncurses, [ --with-ncurses Force the use of ncurses over curses],,) mp_save_LIBS="$LIBS" CURSES_LIB="" if test "$with_ncurses" != yes then AC_CACHE_CHECK([for working curses], mp_cv_curses, [LIBS="$LIBS -lcurses" AC_TRY_LINK( [#include ], [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ], mp_cv_curses=yes, mp_cv_curses=no)]) if test "$mp_cv_curses" = yes then AC_DEFINE(HAVE_CURSES_H) CURSES_LIB="-lcurses" fi fi if test ! "$CURSES_LIB" then AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses, [LIBS="$mp_save_LIBS -lncurses" AC_TRY_LINK( [#include ], [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ], mp_cv_ncurses=yes, mp_cv_ncurses=no)]) if test "$mp_cv_ncurses" = yes then AC_DEFINE(HAVE_NCURSES_H) CURSES_LIB="-lncurses" fi fi LIBS="$mp_save_LIBS" ])dnl cdargs-1.35/doc/0000777000076400001440000000000010401700277007215 5cdargs-1.35/doc/Makefile.am0000644000076400001440000000005407450372176011201 man_MANS = cdargs.1 EXTRA_DIST = $(man_MANS)cdargs-1.35/doc/Makefile.in0000644000076400001440000001262410401700277011203 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ man_MANS = cdargs.1 EXTRA_DIST = $(man_MANS) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = man1dir = $(mandir)/man1 MANS = $(man_MANS) NROFF = nroff DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status install-man1: $(mkinstalldirs) $(DESTDIR)$(man1dir) @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done uninstall-man1: @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \ done install-man: $(MANS) @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-man1 uninstall-man: @$(NORMAL_UNINSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 tags: TAGS TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = doc distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-man install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-man uninstall: uninstall-am all-am: Makefile $(MANS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: install-man1 uninstall-man1 install-man uninstall-man tags \ distdir info-am info dvi-am dvi check check-am installcheck-am \ installcheck install-exec-am install-exec install-data-am install-data \ install-am install uninstall-am uninstall all-redirect all-am all \ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cdargs-1.35/doc/cdargs.10000644000076400001440000002446510032570770010474 .TH CDARGS "1" "March 2002" .SH NAME cdargs \- bookmarks and browser for cd shell built-in .SH SYNOPSIS .B cdargs [\fIOPTIONS\fR] .br .br .B "function cv () { " .br .B " cdargs ""$1"" && cd ""`cat ""$HOME/.cdargsresult""`"" ;" .br .B "}" .br .B cv [\fINeedle\fR] .br .SH DESCRIPTION With .I cdargs you can jump to various places throughout the file-system that are defined using a plain text, line oriented bookmarks file. .PP You can create bookmarks by editing your bookmarks file "$HOME/.cdargs" using your favorite editor, by using the "--add" option to .I cdargs or by using the built-in mechanism that will be described later. .PP While you are in .I cdargs you can use various commands to navigate through your list of bookmarks and through the file-system. These are described below in the section "COMMANDS". The most commonly used and most obvious commands are the up/down keys for navigation, "ENTER" for selection of a path and "q" for quit. .PP To be able to actually use this program together with the shell built-in "cd" command you must use a little trick by defining a shell function. Of course the syntax for this is different between the \fIcsh\fR-like shells (like \fItcsh\fR) and the \fIsh\fR-like shells (like \fIbash\fR). .PP For \fIsh\fR-like shells: .br function cv () { .br cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`" ; .br } .PP For \fIcsh\fR-like shells: .br alias cv 'cdargs \\!* && cd `cat $HOME/.cdargsresult`' .PP Now you only have to put the .I cdargs binary somewhere into your path. Of course you can create functions and/or aliases for different purposes. You might want to add a \fIpwd\fR call to echo your current directories or put --nowrap in your functions to enable a different scrolling behavior. See section SHELL FUNCTIONS below. Since version 1.19 cdargs brings a collection of bash functions (and since 1.20 tcsh aliases, too) with it. You only have to source this in your ~/.profile or ~/.bashrc (or ~/.tcsh) and you get nice kinds of magic prepared (completion...). Please read the cdargs-bash.sh or cdargs-tcsh.csh respectively for the documentation of these functions. .SH COMMAND-LINE OPTIONS You can call .I cdargs with a few options, but otherwise you probably won't call it directly but via the function you defined. .IP "\fB-h\fR or \fB--help\fR" display usage information and exit. .IP "\fB-v\fR or \fB\-\-version\fR" output version information and exit. .IP "\fB-a\fR or \fB\-\-add=\fR[:\fIdesc\fR:]\fIpath\fR" add \fIpath\fR to the bookmarks list using the optional \fIdesc\fR as description string. .IP "\fB-f\fR or \fB\-\-file=\fIFILE\fR" uses the given FILE as bookmarks file .IP "\fB-u\fR or \fB\-\-user=\fIUSER\fR" read the default bookmarks file of USER. Won't modify that file. .IP "\fB-o\fR or \fB\-\-output=\fIFILE\fR" use FILE as the result-file (who knows what The World might make of this feature that I can't imagine...) .IP "\fB-b\fR or \fB\-\-browse\fR" start .I cdargs in BROWSE mode in the current directory. .IP "\fB-r\fR or \fB\-\-noresolve\fR" Don't exit with a result when the \fINeedle\fR matches a description exactly (which is some every-day-magic) but show a list (even if it contains just one entry). .IP "\fB-c\fR or \fB\-\-cwd\fR" Make the current working directory the current entry on startup if it appears on the list. .IP "\fB\-\-nowrap\fR" Don't wrap the cursor around when hitting the end of the list. .IP \fINeedle\fR The Needle performs some magic which I hope improves the usage of cdargs. The Needle is examined in the following order and the first thing that fits is taken. If \fINeedle\fR is a one-digit integer the appropriate entry is preselected. Otherwise if \fINeedle\fR is a string each entry of the list is checked whether it contains \fINeedle\fR. Then \fINeedle\fR has two functions: .br If it just matches a substring of either path or description that option is placed in the list. If it \fBexactly\fR matches a description string this is the result (that means cdargs closes the curses window, exits and the changing of directories takes place). If it doesn't match a line, that line won't be displayed. And to make things even more complicated you can affect this behavior by using the "--noresolve" option. This option is used when you think you give a \fINeedle\fR which matches descriptions exactly but you don't want it to be resolved if it does. This option is internally turned on when you delete an entry (otherwise the deletion of entries until only one entry is left would lead to resolving) or when the bookmarks file contains only one entry. Finally, if the filtered list (but not the bookmarks file) contains only one entry it is selected and the program exits successfully, unless you chose --noresolve. I can only hope that you understand this nested if babble... Please note, that the existence of a \fINeedle\fR disables the saving of the list at the end of the program. .SH "COMMANDS" When you are in .I cdargs you have two modes and several commands at your hands. .PP The two modes are LIST (when your bookmark list is displayed) and BROWSE (when you navigate through the file-system). .PP The navigation keys are mostly available in Emacs and vi style for all maniacs out there. .PP \fBCommon Keys\fR .IP "\fB/\fR or \fBk/j\fR or \fBC-n/C-p\fR" move selection up/down and scroll. .IP "\fB\fR" select current entry. .IP "\fB\fR" toggle modes: LIST or BROWSE. .IP "\fB/\fR or \fBC-a/C-e\fR" goto first/last entry in list. .IP "\fBc\fR" add current directory to list. .IP "\fBC\fR" add current directory to list but ask the user for a description .IP "\fB/\fR or \fBC-v\fR" Scroll the list in 10-line-steps. This will never wraparound and does not honor the nowrap-option .IP "\fBe, v\fR" edit the list in $EDITOR. .IP "\fBH, ?\fR" show the help-screen. .IP "\fB~, /\fR" browse home/root directory. .IP "\fBq\fR" quit - saving the list. .IP "\fBC-c, C-g, C-[ \fR" abort - don't save the list. .PP .PP \fBKeys in BROWSE mode\fR .IP "\fB, h, C-b\fR" descent into current directory. .IP "\fB, l, C-f\fR" up one directory. .IP "\fB[num]\fR" make [num] the current highlighted entry .IP "\fBa\fR" add current entry to list. .IP "\fBA\fR" add current entry to list but ask the user for a description, just like with 'c' and 'C'. .IP "\fB.\fR" toggle display of hidden files. .PP .PP \fBKeys in LIST mode\fR .IP "\fB[num]\fR" select and resolve entry [num] if displayed. .IP "\fB, h, C-b\fR" descent into the current entry. .IP "\fB, l, C-f\fR" up one directory from current dir. .IP "\fBd\fR or \fBC-d\fR" delete current entry from list. .IP "\fBs\fR or \fBt\fR" swap (transpose) two entries of the list. .IP "\fBM\fR or \fBm\fR" move an entry up or down in the list and set the current position afterwards so that repeated keystrokes keep moving the same entry up and down. .SH SHELL FUNCTIONS In addition to the shell function mentioned above you might wish to add other commands to your function. One example is to echo the directory you changed to: function cv () { .br cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`" && pwd; .br } Or you can remove the file in which .I cdargs reports it's result: function cv () { .br cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`" && rm -f "$HOME/.cdargsresult"; .br } Since version 1.19 cdargs comes with a file of preset functions for bash: see cdargs-bash.sh in the distribution. From now on you only have to source that file if you are using a \fIsh\fR-like shell. Then you can use the shell completion to switch directories even faster by typing cv [TAB] Since version 1.20 cdargs comes with a file of rudimentary aliases (and completion) for the \fItcsh\fR. .br Any volunteers for porting all the bash functionality to \fItcsh\fR are welcome. .SH "DISPLAY" The .I cdargs window has one line at the bottom for the display of messages like when you added to your list or when you hit an unknown key. The second line from the bottom is a status line which shows the current directory and a one letter code for the current operation mode: .IP "\fBB\fR" for BROWSE .IP "\fBL\fR" for LIST .PP The largest part of the display is used to show you either the list of your bookmarks or the contents of the current directory. On the left side you'll probably find a number which you can use for a slightly quicker jumping compared to using the cursor movement. These numbers can be moved as described above. Next comes the short description of an entry in brackets. This is convient when you have quite long paths in your bookmarks and most of them start with the same base (e.g. /home/user). Finally there is the actual absolute path you'll be warping to when finishing. Obviously the current entry is highlighted. If the path is preced by a "!" it points to an invalid directory. A bookmark pointing to the current working directory is displayed in bold font (if the terminal emulation understands that attribute). .SH "FILES" .I "$HOME/.cdargs" personal bookmarks file. .TP .I "$HOME/.cdargsresult" temporary file for passing results to shell. .TP .I "contrib/cdargs-bash.sh" example collection of bash functions. .TP .I "contrib/cdargs-tcsh.csh" example collection of tcsh functions. .TP .I "contrib/cdargs.el" (X)Emacs front-end to personal bookmarks file .SH "REPORTING BUGS" Report bugs to . .SH "AUTHOR" .I cdargs was written by Stefan Kamphausen with add-ons by Claus Brunzema. Many user-interface improvements came from Dan Allen. .SH "SEE ALSO" The current version of .I cdargs is located at .IP http://www.skamphausen.de/software/cdargs .PP You might want to visit that site. Other than that pressing the 'H' key in .I cdargs fires up a help screen. .SH "COPYRIGHT" Copyright \(co 2001-2003 Stefan Kamphausen .PP .I cdargs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. cdargs-1.35/src/0000777000076400001440000000000010401700277007237 5cdargs-1.35/src/Makefile.am0000644000076400001440000000034410165106543011213 bin_PROGRAMS = cdargs #AM_CXXFLAGS = -g -ansi -pedantic -Wall -W #AM_CXXFLAGS = -g -ansi -Wall -W AM_CXXFLAGS = -g -Wall -W # CXXFLAGS = -O2 # EXTRA_DIST = OOREDESIGN LDADD = @CURSES_LIB@ cdargs_SOURCES = cdargs.cc cdargs.h cdargs-1.35/src/Makefile.in0000644000076400001440000001666110401700277011232 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ bin_PROGRAMS = cdargs #AM_CXXFLAGS = -g -ansi -pedantic -Wall -W #AM_CXXFLAGS = -g -ansi -Wall -W AM_CXXFLAGS = -g -Wall -W # CXXFLAGS = -O2 # EXTRA_DIST = OOREDESIGN LDADD = @CURSES_LIB@ cdargs_SOURCES = cdargs.cc cdargs.h mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = PROGRAMS = $(bin_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ cdargs_OBJECTS = cdargs.o cdargs_LDADD = $(LDADD) cdargs_DEPENDENCIES = cdargs_LDFLAGS = CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best SOURCES = $(cdargs_SOURCES) OBJECTS = $(cdargs_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .cc .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) distclean-binPROGRAMS: maintainer-clean-binPROGRAMS: install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) list='$(bin_PROGRAMS)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: cdargs: $(cdargs_OBJECTS) $(cdargs_DEPENDENCIES) @rm -f cdargs $(CXXLINK) $(cdargs_LDFLAGS) $(cdargs_OBJECTS) $(cdargs_LDADD) $(LIBS) .cc.o: $(CXXCOMPILE) -c $< tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = src distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done cdargs.o: cdargs.cc cdargs.h info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-binPROGRAMS install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-binPROGRAMS uninstall: uninstall-am all-am: Makefile $(PROGRAMS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \ mostlyclean-am clean: clean-am distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \ distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-binPROGRAMS \ maintainer-clean-compile maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile tags mostlyclean-tags distclean-tags \ clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ check-am installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cdargs-1.35/src/cdargs.h0000644000076400001440000000626610032567255010610 /* File: cdargs.h * * This file is part of cdargs * * Copyright (C) 2001-2003 by Stefan Kamphausen * Author: Stefan Kamphausen * * Time-stamp: <31-Mar-2004 18:15:41 ska> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ # ifndef CDARGS_H_INCLUDED # define CDARGS_H_INCLUDED # define DEBUG 0 // thanks to cscope source for this: #define CTRL(x) (x & 037) #if (BSD || V9) && !__NetBSD__ #define TERMINFO 0 /* no terminfo curses */ #else #define TERMINFO 1 #endif /* The main list constructs */ /****************************/ // current list, probably directory listing vector > cur_list; // the default list which is written from and saved to file vector > default_list; // an iterator for these typedef vector >::iterator listit; // Display/Browse Modes; enum { LIST, BROWSE }; // File or Directory? typedef enum { PATH_IS_FILE, PATH_IS_DIR } pathtype; // needed for map struct ltstr { bool operator()(const char* s1,const char* s2) const { return strcmp(s1, s2) < 0; } }; bool list_from_file(void); void list_from_dir(const char* name = "."); void list_to_file(void); bool do_not_show(const char* name); void cur_pos_adjust(int n=0,bool wraparound=true); bool entry_nr_exists(unsigned int nr); string current_entry(void); void add_to_default_list(string path, string description="", bool ask_for_desc=false); void add_to_list_file(string path); void delete_from_default_list(int pos); void edit_list_file(void); //string default_list_file(void); string get_resultfile(void); char* get_cwd_as_charp(void); string get_cwd_as_string(void); string get_listfile(void); string capitalized_last_dirname(string path); string last_dirname(string path); string canonify_filename(string filename); bool valid(string path, pathtype mode); void version(void); void usage(void); /* Curses and Display Stuff */ void init_curses(void); bool user_interaction(int c); void swap_two_entries(int advance_afterwards); string get_description_from_user(void); void message(const char* msg); void display_list(void); //void scrolling(int lines); void update_modeline(void); void set_areas(void); void resizeevent(int sig); bool visible(int pos); int max_yoffset(void); void helpscreen(void); /* Get outta here */ void fatal_exit(char* msg); void terminate(int sig); void finish(string result, bool retval); void abort_cdargs(void); # endif cdargs-1.35/src/cdargs.cc0000644000076400001440000011246010400360047010725 /* File: cdargs.cc * * This file is part of cdargs * * Copyright (C) 2001-2003 by Stefan Kamphausen * Author: Stefan Kamphausen * * Time-stamp: <26-Feb-2006 18:06:47 ska> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /********************************************************************/ /* MAN, IF YOU DIDN'T TRY TO FIX THIS CODE YOU DON'T KNWO HOW MUCH */ /* IT NEEDS A COMPLETE REWRITE */ /* (the author) */ /********************************************************************/ // damn, if you remove this, you get lots of trouble that _I_ don't // wanna get involved in. I've been reading include files for more // than one hour now, and that's my decision. The code is a mess // anyway. #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif /* C++ Includes */ # include # include # include # include # include # include using namespace std; /* C Includes */ # include # include # include # include # include # include # include # include # include //# if defined(USE_NCURSES) && !defined(RENAMED_NCURSES) # if defined(HAVE_NCURSES_H) # include # else # include # endif # include "cdargs.h" /* GLOBALS */ // FIXME: this file has too many globals. Especially the // offset/position handling is UGLY! // // Change this if you want different length (actually width) for the // description: # define DESCRIPTION_MAXLENGTH 18 # define DESCRIPTION_BROWSELENGTH 8 const char* DefaultListfile = ".cdargs"; const char* DefaultResultfile = "~/.cdargsresult"; const char* Needle = NULL; bool NeedleGiven = false; int CurrPosition = 0; map LastPositions; // terminal coordinates and other curses stuff int terminal_width, terminal_height; int xmax; int display_area_ymax; int display_area_ymin; int modeliney; int msg_area_y; int yoffset = 0; bool curses_running = false; int shorties_offset = 0; // cdargs modi int mode = LIST; bool show_hidden_files = false; bool opt_no_wrap = false; bool opt_no_resolve = false; bool listfile_empty = false; bool opt_cwd = false; string opt_resultfile=""; string opt_listfile=""; string opt_user=""; int main(int argc, char** argv) { int c; /* parse command line args */ while (1) { int option_index = 0; static struct option long_options[] = { {"add" , 1, 0, 0}, {"file" , 1, 0, 0}, {"user" , 1, 0, 0}, {"browse" , 0, 0, 0}, {"nowrap" , 0, 0, 0}, {"noresolve" , 0, 0, 0}, {"cwd" , 0, 0, 0}, {"output" , 1, 0, 0}, {"version" , 0, 0, 0}, {"help" , 0, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "a:f:u:brco:vh", long_options, &option_index); if (c == -1) { break; } string optname; string argument; switch (c) { case 0: optname = string(long_options[option_index].name); if (optname == "help") { version(); usage(); exit(0); } if (optname == "version") { version(); exit(0); } if (optname == "add") { argument = string(optarg); add_to_list_file(argument); exit(0); } if (optname == "file") { opt_listfile = string(optarg); } if (optname == "user") { opt_user = string(optarg); } if(optname == "browse") { mode = BROWSE; } if (optname == "nowrap") { opt_no_wrap = true; } if (optname == "noresolve") { opt_no_resolve = true; } if (optname == "cwd") { opt_cwd = true; } if (optname == "output") { opt_resultfile = string(optarg); } break; case 'a': argument = string(optarg); add_to_list_file(argument); exit(0); break; case 'f': opt_listfile = string(optarg); break; case 'u': opt_user = string(optarg); break; case 'b': mode = BROWSE; break; case 'r': opt_no_resolve = true; break; case 'c': opt_cwd = true; break; case 'o': opt_resultfile = string(optarg); break; case 'h': version(); usage(); exit(0); break; case 'v': version(); exit(0); default: usage(); exit(1); } } if (optind < argc) { Needle = argv[optind]; if(strlen(Needle) > 0) { NeedleGiven = true; } if(strlen(Needle) == 1 && isdigit(Needle[0])) { CurrPosition = atoi(Needle); Needle = NULL; } } // leave terminal tidy // FIXME: what other signals do I need to catch? signal(SIGINT, terminate); signal(SIGTERM, terminate); signal(SIGSEGV, terminate); init_curses(); // answer to terminal reizing signal(SIGWINCH, resizeevent); /* get list from file or start in browse mode */ if (!list_from_file()) { /* doesn't exist. browse current dir */ mode = BROWSE; } // if we're browsing read the CWD if(mode == BROWSE) { list_from_dir(); } /* main event loop */ /* determines the entry to use */ while (1) { display_list(); c = getch(); if (!user_interaction(c)) { break; } } finish(current_entry(), true); exit(1); } void toggle_mode(void) { if (mode == LIST) { mode = BROWSE; list_from_dir("."); } else { if(listfile_empty) { // list was empty at start if(!default_list.empty()) { // but isn't now list_to_file(); list_from_file(); mode = LIST; } else { // ok, we have nothing to show here message("No List entry. Staying in BROWSE mode"); mode = BROWSE; list_from_dir("."); } } else { // the "normal" case; // disable Needle and reload the list! NeedleGiven = false; Needle = NULL; list_from_file(); yoffset = 0; shorties_offset = 0; CurrPosition = 0; mode = LIST; } } } void toggle_hidden(void) { show_hidden_files = !show_hidden_files; if (mode == BROWSE) { list_from_dir(); } } bool user_interaction(int c) { int num; string curen; switch(c) { // ==== Exits case CTRL('['): // vi case CTRL('g'): // emacs abort_cdargs(); break; case 'q': finish(".", false); break; case 13: // ENTER // choose dir at cur pos return false; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': num = c-'0'+shorties_offset; if(mode == LIST) { if (entry_nr_exists(num)) { CurrPosition = num+yoffset; return opt_no_resolve?true:false; } } else { CurrPosition = num+yoffset; return true; } break; // ==== Modes case '.': // show hidden files toggle_hidden(); break; case '\t': // TAB toggle_mode(); break; // ==== Navigate The List case 'j': // vi case CTRL('n'): // emacs #if TERMINFO case KEY_DOWN: #endif // navigate list++ cur_pos_adjust(+1); break; case 'k': // vi case CTRL('p'): // emacs #if TERMINFO case KEY_UP: #endif // navigate list-- cur_pos_adjust(-1); break; case '^': // vi? case CTRL('a'): // emacs #if TERMINFO case KEY_HOME: #endif // go to top CurrPosition = 0; yoffset = 0; break; case '$': // vi case CTRL('e'): // emacs # if TERMINFO case KEY_END: #endif // go to end if (mode == BROWSE) { CurrPosition = cur_list.size()-1; } else { CurrPosition = default_list.size()-1; } yoffset = max_yoffset(); break; //==== move the shortcut digits ('shorties') // FIXME case ??: //vi // FIXME maybe change the scrolling behaviour to not take the window but the whole // list? That means recentering when shorties leave the screen (adjust yoffset and // CurrPosition) case CTRL('v'): // emacs #if TERMINFO case KEY_NPAGE: #endif for(int i=0;i<10;i++) { cur_pos_adjust(+1,false); } break; // fixme: vi? //case CTRL(''): // FIXME: META(x)?? #if TERMINFO case KEY_PPAGE: #endif for(int i=0;i<10;i++) { cur_pos_adjust(-1,false); } break; case 'h': // vi case CTRL('b'): // emacs #if TERMINFO case KEY_LEFT: #endif // up dir if (mode == BROWSE) { // LastPositions[get_current_dir_name()] = CurrPosition; LastPositions[get_cwd_as_charp()] = CurrPosition; } else { mode = BROWSE; } list_from_dir(".."); break; case 'l': // vi case CTRL('f'): // emacs #if TERMINFO case KEY_RIGHT: #endif // descend dir at cur pos curen = current_entry(); if (mode == BROWSE) { LastPositions[get_cwd_as_charp()] = CurrPosition; } else { mode = BROWSE; } list_from_dir(curen.c_str()); break; case 'H': case '?': helpscreen(); break; case 'd': case CTRL('d'): // emacs #if TERMINFO case KEY_BACKSPACE: #endif // delete dir acp if (mode == LIST && !NeedleGiven) { delete_from_default_list(CurrPosition); } else { beep(); } break; #if TERMINFO case KEY_IC: #endif case 'a': // add dir acp (if in browse mode) if(!NeedleGiven) { if (mode == BROWSE) { add_to_default_list(current_entry()); } else { add_to_default_list(get_cwd_as_string()); } } else { beep(); } break; case 'A': if(!NeedleGiven) { // add dir acp (if in browse mode) (ask for desc) if (mode == BROWSE) { add_to_default_list(current_entry(),"",true); } else { add_to_default_list(get_cwd_as_string(),"",true); } } else { beep(); } break; case 'c': if(!NeedleGiven) { // add the current dir in every mode add_to_default_list(get_cwd_as_string()); } else { beep(); } break; case 'C': if(!NeedleGiven) { // add the current dir in every mode (ask for desc) add_to_default_list(get_cwd_as_string(),"",true); } else { beep(); } break; // ==== EDIT the list case 'v': case 'e': { if(!NeedleGiven) { edit_list_file(); } else { beep(); } break; } case 'm': swap_two_entries(1); break; case 'M': swap_two_entries(-1); break; case 't': case 's': swap_two_entries(0); break; // ==== Filesystem Hotspots case '~': mode = BROWSE; list_from_dir(getenv("HOME")); break; case '/': mode = BROWSE; list_from_dir("/"); break; default: beep(); message("unknown command"); } return true; } void swap_two_entries(int advance_afterwards) { int switch_index; if(advance_afterwards >= 0) { switch_index = CurrPosition + 1; } else { switch_index = CurrPosition -1; } // ranges check: if(switch_index >= int(default_list.size()) || switch_index < 0) { beep(); return; } if (mode == LIST && !NeedleGiven) { pair tmp = default_list[CurrPosition]; default_list[CurrPosition] = default_list[switch_index]; default_list[switch_index] = tmp; cur_pos_adjust(advance_afterwards); display_list(); } else { beep(); } } string get_description_from_user(void) { char desc[DESCRIPTION_MAXLENGTH+1]; move(msg_area_y, 0); clrtoeol(); printw("Enter description ( to quit): "); refresh(); echo(); getnstr(desc, DESCRIPTION_MAXLENGTH); noecho(); move(msg_area_y, 0); clrtoeol(); return string(desc); } bool list_from_file(void) { string desc; string path; int linecount=0; default_list.clear(); string mylistfile = get_listfile(); ifstream listfile(mylistfile.c_str()); if (!listfile) { return false; } string cwd = get_cwd_as_string(); while (! listfile.eof()) { string line; getline(listfile, line); if(line == "") continue; // comments ... are not saved later so we simply don't allow // them // if (line[0] == '#') { // continue; // } // detect path and description at the leading slash of the // absolute path: desc = line.substr(0,line.find('/')-1); path = line.substr(line.find('/')); if(opt_cwd && cwd == path) { CurrPosition = linecount; } // counting the lines: if only one, no resolving should take place linecount++; // if we got an exact match and not opt_no_resolve the first entry is // the result! if(NeedleGiven && Needle && Needle == desc && !opt_no_resolve) { finish(path,true); } // filtered? if (do_not_show(desc.c_str()) && do_not_show(path.c_str())) { continue; } default_list.push_back(make_pair(desc, path)); } listfile.close(); // some magic: switch(linecount) { case 0: listfile_empty = true; break; case 1: opt_no_resolve=true; break; } shorties_offset = 0; if(default_list.empty()) { return false; } return true; } // default: name="." void list_from_dir(const char* name) { string previous_dir = ""; if(name == "..") { previous_dir = get_cwd_as_string(); } // Checking, Changing and Reading if (chdir(name) < 0) { string msg = "couldn't change to dir: "; msg += name; message(msg.c_str()); } DIR* THISDIR; string cwd = get_cwd_as_string(); THISDIR = opendir(cwd.c_str()); if (THISDIR == NULL) { string msg = "couldn't read dir: "; msg += cwd; message(msg.c_str()); sleep(1); abort_cdargs(); } yoffset = 0; shorties_offset = 1; struct dirent* en; struct stat buf; // cleanup cur_list.clear(); CurrPosition = 1; // put the current directory on top ef every listing string desc = "."; cur_list.push_back(make_pair(desc,cwd)); // read home dir while ((en = readdir(THISDIR)) != NULL) { /* filter dirs */ if (do_not_show(en->d_name)) continue; string fullname; fullname = cwd + string("/") + string(en->d_name); fullname=canonify_filename(fullname); stat(fullname.c_str(), &buf); if (!S_ISDIR(buf.st_mode)) continue; string lastdir = last_dirname(fullname); cur_list.push_back(make_pair(lastdir, fullname)); } // empty directory listing: .. and . desc=".."; string path=get_cwd_as_string(); if(cur_list.size() == 1) { path = path.substr(0,path.find(last_dirname(path))); cur_list.push_back(make_pair(desc,path)); } sort(cur_list.begin(),cur_list.end()); // have we remembered a current position for this dir? if (LastPositions.count(cwd.c_str())) { CurrPosition = LastPositions[cwd.c_str()]; } else { //CurrPosition = 1; if(previous_dir.length() > 0) { int count = 0; for(listit it=cur_list.begin(); it!=cur_list.end();++it, count++) { if(it->second == previous_dir) { CurrPosition = count; break; } } } } if(!visible(CurrPosition)) { yoffset = CurrPosition - 1; } closedir(THISDIR); } void list_to_file(void) { // don't write empty files FIXME: unlink file? string mylistfile = get_listfile(); if(default_list.empty()) { unlink(mylistfile.c_str()); return; } // never touch the listfile of another user if(opt_user.size() > 0) { return; } string backup_file = mylistfile + "~"; if(rename(mylistfile.c_str(),backup_file.c_str()) == -1) { fprintf(stderr,"warning: could not create backupfile\n"); } ofstream listfile(mylistfile.c_str()); if (!listfile) { fatal_exit("couldn't write listfile"); } for (listit li = default_list.begin();li != default_list.end(); ++li) { listfile << li->first << " " << li->second << endl; } listfile.close(); } bool do_not_show(const char* name) { /* don't show current, up, hidden if not flag */ if (mode == BROWSE) { if (strcmp(name, "..") == 0) return true; if (!show_hidden_files && name[0] == '.') return true; } else { if (!NeedleGiven) { return false; } if(!Needle) return false; /* FIXME case-insensitive comparison */ //if (strcasecmp(name, Needle)) { if (strstr(name, Needle)) { return false; } else { return true; } } return false; } // default: n=0, // wraparound=true void cur_pos_adjust(int n, bool wraparound) { int newpos = CurrPosition + n; int max, min; if (mode == LIST) { max = default_list.size() - 1; } else { max = cur_list.size() - 1; } min = 0; if (newpos < min) { if (opt_no_wrap || !wraparound) return; newpos = max; yoffset = max_yoffset(); } if (newpos > max) { if (opt_no_wrap || !wraparound) return; newpos = min; yoffset = 0; } CurrPosition = newpos; // scrolling... if (CurrPosition-yoffset >= display_area_ymax) { yoffset++; } if (yoffset > 0 && CurrPosition == yoffset) { yoffset--; } } bool entry_nr_exists(unsigned int nr) { if (mode == LIST) { return nr(DESCRIPTION_MAXLENGTH+1)) { fprintf(stderr,"description too long! max %d chars\n", DESCRIPTION_MAXLENGTH); exit(-4); } else { desc = path.substr(1,colon2_at-1); } path = path.substr(colon2_at+1); } // FIXME: check for existance here? if(path.at(0) != '/') { fprintf(stderr,"this is not an absolute path:\n%s\n",path.c_str()); exit(-2); } list_from_file(); add_to_default_list(path,desc,false); list_to_file(); } void delete_from_default_list(int pos) { int count = 0; for (listit li = default_list.begin();li != default_list.end(); ++li) { if (count == pos) { default_list.erase(li); cur_pos_adjust(0,false); // we want no one-entry-in-list-magic anymore opt_no_resolve=true; return; } else { count++; } } } void edit_list_file(void) { char* editor = getenv("EDITOR"); if (!editor) { // FIXME: how to detect debian and the /usr/bin/editor rule? struct stat buf; if(stat("/usr/bin/editor",&buf) == 0) editor = "/usr/bin/editor"; else editor = "vi"; } endwin(); list_to_file(); system((string(editor) + " \"" + get_listfile() + "\"").c_str()); list_from_file(); refresh(); init_curses(); display_list(); } string get_resultfile(void) { if(opt_resultfile.size() >0) { return opt_resultfile; } return string(DefaultResultfile); } char* get_cwd_as_charp(void) { char buf[PATH_MAX]; char* result = getcwd(buf, sizeof(buf)); if(result == NULL) { message("cannot determine current working directory.exit."); sleep(1); abort_cdargs(); } /* this can be a memleak if not freed again */ /* but then ... how long does cdargs usually run? */ return strdup(buf); } string get_cwd_as_string(void) { char* cwd = get_cwd_as_charp(); if(cwd == NULL) { return ""; } else { string result = string(cwd); free(cwd); return result; } } string get_listfile(void) { string user="~"; string file=DefaultListfile; string effective_listfile = ""; if(opt_user.size() > 0) { user = opt_user; } if(opt_listfile.size() > 0) { return canonify_filename(opt_listfile); } if(user[0] == '~') { effective_listfile = user + "/" + file; } else { effective_listfile = "/home/" + user + "/" + file; } return canonify_filename(effective_listfile); } // return the last dir in path with a capital initial letter string capitalized_last_dirname(string path) { string dirname = path.substr(path.find_last_of('/') + 1); dirname[0] = toupper(dirname[0]); return dirname; } // same but not capitalized string last_dirname(string path) { // trailing slash if(path.at(path.size()-1) == '/') { path = path.substr(0,path.size()-1); } string dirname = path.substr(path.find_last_of('/') + 1); return dirname; } string canonify_filename(string filename) { size_t pos=0; // remove double slashes if((pos = filename.find("//",0)) < filename.size()) { filename.replace(pos,2,"/"); } if (filename[0] != '~') { return filename; } // resolve home directory return string(getenv("HOME")) + filename.substr(1); } void version(void) { printf("cdargs - version %s\n", VERSION); } void usage(void) { printf("expanding the shell built-in cd with bookmarks and browser\n\n"); printf(" Usually you don't call this programm directly.\n"); printf(" Copy it somewhere into your path and create\n"); printf(" a shell alias (which takes arguments) as described\n"); printf(" in the file INSTALL which came with this program.\n"); printf("\n For general usage press 'H' while running.\n\n\n"); printf("Usage:\n"); printf(" cdargs select from bookmarks\n"); printf(" cdargs [--noresolve] \n"); printf(" Needle is a filter for the list: each\n"); printf(" entry is compared to the Needle and if it\n"); printf(" doesn't match it won't show up.\n"); printf(" The Needle performs some magic here. See\n"); printf(" manpage for details.\n"); printf(" If --noresolve is given the list will be shown\n"); printf(" even if Needle matches a description exactly.\n"); printf(" cdargs Needle is a digit: make digit the current entry\n\n"); printf(" cdargs [-a|--add]=[:desc:]path \n"); printf(" add PATH to the list file using the\n"); printf(" optional description between the colons\n"); printf(" and exit\n"); printf("\n"); printf("Other Options\n"); printf(" -f, --file=PATH take PATH as bookmark file\n"); printf(" -u, --user=USER read (default) bookmark file of USER\n"); printf(" -o,- -output=FILE use FILE as result file\n"); printf(" -r, --nowrap change the scrolling behaviour for long lists\n"); printf(" -c, --cwd make current directory the current entry if on the list\n"); printf(" -b, --browse start in BROWSE mode with the current dir\n"); printf(" -h, --help print this help message and exit\n"); printf(" -v, --version print version info and exit\n"); printf("\n"); } /***********************************************************/ /* CURSES STUFF */ /***********************************************************/ /* stuff to initialise the ncurses lib */ void init_curses(void) { initscr(); // init curses screen //savetty(); // ?? nonl(); // no newline cbreak(); // not in cooked mode: char immediately available noecho(); // chars are not echoed keypad(stdscr, true); // Arrow keys etc leaveok(stdscr, TRUE); // Don't show the... curs_set(0); // ...cursor set_areas(); curses_running = true; } void message(const char* msg) { if (curses_running) { move(msg_area_y, 0); clrtoeol(); printw("%s [any key to continue]", msg); refresh(); getch(); move(msg_area_y, 0); clrtoeol(); } else { printf("%s\n", msg); } } void display_list(void) { char description_format[40]; vector > list; if (mode == LIST) { // perform some magic here: if the list contains just one // entry (probably due to filtering by giving a Needle) // we are done. if(default_list.size() == 1 && !opt_no_resolve) { finish(current_entry(), true); } else { list = default_list; } } else { list = cur_list; } clear(); update_modeline(); int pos = display_area_ymin; if(CurrPosition > static_cast(list.size()) - 1) { CurrPosition = list.size()-1; } // Calculate actual maxlength of descriptions so we can eliminate // trailing blanks. We have to iterate thru the list to get the // longest description unsigned int actual_maxlength = 0; if(mode == LIST) { for (listit li = list.begin() + yoffset;li != list.end(); ++li) { if ( strlen(li->first.c_str() ) > actual_maxlength ) { actual_maxlength = strlen(li->first.c_str() ); } } // Don't let actual_maxlength > DESCRIPTION_MAXLENGTH if ( actual_maxlength > DESCRIPTION_MAXLENGTH) { actual_maxlength = DESCRIPTION_MAXLENGTH; } } else { actual_maxlength = DESCRIPTION_BROWSELENGTH; } string cwd = get_cwd_as_string(); for (listit li = list.begin() + yoffset;li != list.end(); ++li) { //string desc = li->first.substr(0, (DESCRIPTION_MAXLENGTH+1)); string desc = li->first.substr(0, actual_maxlength); string path = li->second.substr(0, xmax - 16); string fullpath = li->second; char validmarker = ' '; if(!valid(fullpath,PATH_IS_DIR)) { validmarker = '!'; } if (pos > display_area_ymax) { break; } move(pos, 0); if (pos == CurrPosition - yoffset) { attron(A_STANDOUT); } if (fullpath == cwd) { attron(A_BOLD); } if (pos >= shorties_offset && pos < 10+shorties_offset) { printw("%2d", pos-shorties_offset); } else { printw(" "); } // Compose format string for printw. Notice %% to represent literal % sprintf(description_format, " [%%-%ds] %%c%%s", actual_maxlength ); printw(description_format, desc.c_str(), validmarker,path.c_str()); if (pos == CurrPosition - yoffset) { attroff(A_STANDOUT); } if (fullpath == cwd) { attroff(A_BOLD); } pos++; } } void update_modeline(void) { move(modeliney, 0); clrtoeol(); move(modeliney, 0); attron(A_REVERSE); string curmode; char modechar; if (mode == LIST) { curmode = "List"; modechar = 'L'; } else { curmode = "Browse"; modechar = 'B'; } string cwd = get_cwd_as_string(); attron(A_BOLD); printw("%c: %s ", modechar, cwd.c_str()); // printw(" yoff: %d shoff: %d currpos: %d ", yoffset,shorties_offset,CurrPosition); attroff(A_BOLD); hline(' ', xmax); attroff(A_REVERSE); } void set_areas(void) { getmaxyx(stdscr, terminal_height, terminal_width); // get win-dims xmax = terminal_width - 1; display_area_ymin = 0; display_area_ymax = terminal_height - 3; modeliney = terminal_height - 2; msg_area_y = terminal_height - 1; } void resizeevent(int sig) { // shut up, compiler (void)sig; // re-connect signal(SIGWINCH, resizeevent); // FIXME: is this the correct way?? endwin(); refresh(); init_curses(); display_list(); } bool visible(int pos) { if(pos < 0) { return false; } if(pos-yoffset<0) { return false; } if(pos+yoffset > display_area_ymax) { return false; } return true; } int max_yoffset(void) { int len, ret; if (mode == BROWSE) { len = cur_list.size() - 1; } else { len = default_list.size() - 1; } ret = len - display_area_ymax; return ret<0 ? 0:ret; } void helpscreen(void) { char *pager = getenv("PAGER"); if (!pager) { // FIXME: how to detect debian and the /usr/bin/pager rule? struct stat buf; if(stat("/usr/bin/pager",&buf) == 0) { pager = "/usr/bin/pager"; } else { if(stat("/usr/bin/less",&buf) == 0) { pager = "/usr/bin/less"; } else { pager = "more"; } } } endwin(); FILE* help = popen(pager,"w"); // FIXME: error checking this doesn't work, er? if(help == NULL) { init_curses(); message("could not open pager"); return; } int l = 0; char* help_lines[] = { "cdargs (c) 2001-2003 S. Kamphausen ", "/ move selection up/down and scroll", " please see manpage for alternative bindings!", " select current entry", " toggle modes: LIST or BROWSE", "/ goto first/last entry in list if available in terminal", "c add current directory to list", "C same as 'c' but ask for a description", " scroll the list 10 lines up or down", "e,v edit the list in $EDITOR", "H,? show this help", "~,/ browse home/root directory", "q quit - saving the list", "C-c,C-g,C-[ abort - don't save the list", " ", "Commands in BROWSE-mode:", " descent into current directory", " up one directory", "[num] make [num] the highlighted entry", "a add current entry to list", "A same as 'a' but ask for a description", ". toggle display of hidden files", " ", "Commands in LIST-mode:", "[num] select and resolve entry [num] if displayed", " descent into the current entry", " up one directory from current dir", "d delete current entry from list", "a add current directory to list", "s,t swap(transpose) two lines in the list", "M/m move an entry up down in the list" }; int help_lines_size = 31; while (l < help_lines_size) { fprintf(help,"%s\n",help_lines[l]); l++; } fprintf(help,"\n"); pclose(help); // convenience for more which exits at the end: if(strstr(pager,"more")) { sleep(1); } refresh(); init_curses(); } /************************************************/ /* EXITs */ /************************************************/ void fatal_exit(char* msg) { endwin(); fprintf(stderr, msg); exit(1); } void terminate(int sig) { endwin(); if(sig == 11) { fprintf(stderr,"programm received signal %d\n",sig); fprintf(stderr,"This should never happen.\n"); fprintf(stderr,"Maybe you want to send an email to the author and report a bug?\n"); fprintf(stderr,"Author: Stefan Kamphausen \n"); } fprintf(stderr,"abort.\n"); exit(1); } void finish(string result, bool retval) { curs_set(1); // re-show cursor (FIXME: necessary?) clear(); // clear screen for stupid terminals like aterm refresh(); // ..and make sure we really see the clean screen //resetty(); // ?? endwin(); // finish the curses at all // only save if list was not filtered! if (!NeedleGiven){ list_to_file(); } // is the result really a dir? if(!valid(result,PATH_IS_DIR)) { fprintf(stderr,"This is not a valid directory:\n%s\n",result.c_str()); exit(-3); } // string resfile = canonify_filename(Resultfile); string resfile = canonify_filename(get_resultfile()); ofstream out(resfile.c_str()); if (out) { out << result << endl; out.close(); } if (!retval) { exit(1); } exit(0); } void abort_cdargs(void) { curs_set(1); // re-show cursor (FIXME: necessary?) clear(); // clear screen for stupid terminals like aterm refresh(); // ..and make sure we really see the clean screen //resetty(); // ?? endwin(); // finish the curses at all exit(-1); } bool valid(string path, pathtype mode) { struct stat buf; string canon_path = canonify_filename(path); if(mode == PATH_IS_FILE) { stat(canon_path.c_str(), &buf); if (S_ISREG(buf.st_mode)) return true; } else if (mode == PATH_IS_DIR) { stat(canon_path.c_str(), &buf); if (S_ISDIR(buf.st_mode)) return true; } return false; } cdargs-1.35/NEWS0000644000076400001440000000003007620035114007054 please see ChangeLog... cdargs-1.35/TODO0000644000076400001440000000362307624235401007065 TODO List for cdargs Time-stamp: <17-Feb-2003 20:41:53 ska> Bugs ==== 1. TAB Completion with (for awk) special characters I'd even extent this to the general shell plugin and completion: - option -u[--user] works with the binary but not with the shell plugin - AWK compreply generation I'd like to see common cd completion when a bookmark could be resolved (of course the binary had to act in an appropriate way) These are the things on my personal ToDo List for this leetle project: [ ] Spacers in the list? [ ] TOTAL REWRITE FROM SCRATCH for cleaner design and code! I'd really to see this done, but alas! who's got the time for it? [ ] new keys to scroll long directory listings (SPACE and BACKSPACE or should SPACE be finish-using-the-currently-shown-directory ? [ ] search modus: in BROWSE mode it would be quite cool to just type '/ et' and automatically end up in the etc directory. [ ] automatic installation of shell script files and add a line to source them at the end of ~/.bashrc? Well, maybe [ ] Fix everything for different terminals than xterm; Example: in (some version of) konsole KEY_HOME and KEY_END don't work properly [ ] And when that is done I WANT COLORS ($LS_COLORS...)! [?] The Legal Stuff [?] Some good ideas for the User Interface anybody? [ ] remove the GNU_SOURCES to be compilable on other platforms? Here come the things I probably (or definetly) won't do myself. Feel free to get into the game [ ] Internationalization [ ] the usual security flaws (buffer, printf, whatever) [ ] compile, run, test on various platforms (I have only linux boxes) [x] make a debian package - thanks to Petra Malik [ ] fix m4 macro setup (make barfs if you change configure.in. you have to run autogen.sh in this case). Explanation: =========== [ ] open subject [x] done (and will be removed later) [?] is this OK yet? (maybe needs some debugging) [-] action cancelledcdargs-1.35/contrib/0000777000076400001440000000000010401700277010110 5cdargs-1.35/contrib/cdargs-bash.sh0000644000076400001440000002235210401677621012550 #!/bin/sh # (C) 2002-2003 Dan Allen and Stefan Kamphausen # Written by Dan Allen # - small additions by Stefan Kamphausen # - better completion code by Robi Malik robi.malik@nexgo.de # - trailing path support by Damon Harper Feb 2006 # Globals CDARGS_SORT=0 # set to 1 if you want mark to sort the list CDARGS_NODUPS=1 # set to 1 if you want mark to delete dups # --------------------------------------------- # # Run the cdargs program to get the target # # directory to be used in the various context # # This is the fundamental core of the # # bookmarking idea. An alias or substring is # # expected and upon receiving one it either # # resolves the alias if it exists or opens a # # curses window with the narrowed down options # # waiting for the user to select one. # # # # @param string alias # # # # @access private # # @return 0 on success, >0 on failure # # --------------------------------------------- # function _cdargs_get_dir () { local bookmark extrapath # if there is one exact match (possibly with extra path info after it), # then just use that match without calling cdargs if [ -e "$HOME/.cdargs" ]; then dir=`grep "^$1 " "$HOME/.cdargs"` if [ -z "$dir" ]; then bookmark="${1/\/*/}" if [ "$bookmark" != "$1" ]; then dir=`grep "^$bookmark " "$HOME/.cdargs"` extrapath=`echo "$1" | sed 's#^[^/]*/#/#'` fi fi [ -n "$dir" ] && dir=`echo "$dir" | sed 's/^[^ ]* //'` fi if [ -z "$dir" -o "$dir" != "${dir/ /}" ]; then # okay, we need cdargs to resolve this one. # note: intentionally retain any extra path to add back to selection. dir= if cdargs --noresolve "${1/\/*/}"; then dir=`cat "$HOME/.cdargsresult"` rm -f "$HOME/.cdargsresult"; fi fi if [ -z "$dir" ]; then echo "Aborted: no directory selected" >&2 return 1 fi [ -n "$extrapath" ] && dir="$dir$extrapath" if [ ! -d "$dir" ]; then echo "Failed: no such directory '$dir'" >&2 return 2 fi } # --------------------------------------------- # # Perform the command (cp or mv) using the # # cdargs bookmark alias as the target directory # # # # @param string command argument list # # # # @access private # # @return void # # --------------------------------------------- # function _cdargs_exec () { local arg dir i last call_with_browse # Get the last option which will be the bookmark alias eval last=\${$#}; # Resolve the bookmark alias. If it cannot resolve, the # curses window will come up at which point a directory # will need to be choosen. After selecting a directory, # the function will continue and $_cdargs_dir will be set. if [ -e $last ]; then last= fi if _cdargs_get_dir "$last"; then # For each argument save the last, move the file given in # the argument to the resolved cdargs directory i=1; for arg; do if [ $i -lt $# ]; then $command "$arg" "$dir"; fi let i=$i+1; done fi } # --------------------------------------------- # # Prepare to move file list into the cdargs # # target directory # # # # @param string command argument list # # # # @access public # # @return void # # --------------------------------------------- # function mvb () { local command command='mv -i'; _cdargs_exec $*; } # --------------------------------------------- # # Prepare to copy file list into the cdargs # # target directory # # # # @param string command argument list # # # # @access public # # @return void # # --------------------------------------------- # function cpb () { local command command='cp -i'; _cdargs_exec $*; } # --------------------------------------------- # # Change directory to the cdargs target # # directory # # # # @param string alias # # # # @access public # # @return void # # --------------------------------------------- # function cdb () { local dir _cdargs_get_dir "$1" && cd "$dir" && echo `pwd`; } alias cb='cdb' alias cv='cdb' # --------------------------------------------- # # Mark the current directory with alias # # provided and store as a cdargs bookmark # # directory # # # # @param string alias # # # # @access public # # @return void # # --------------------------------------------- # function mark () { local tmpfile # first clear any bookmarks with this same alias, if file exists if [[ "$CDARGS_NODUPS" && -e "$HOME/.cdargs" ]]; then tmpfile=`echo ${TEMP:-${TMPDIR:-/tmp}} | sed -e "s/\\/$//"` tmpfile=$tmpfile/cdargs.$USER.$$.$RANDOM grep -v "^$1 " "$HOME/.cdargs" > $tmpfile && 'mv' -f $tmpfile "$HOME/.cdargs"; fi # add the alias to the list of bookmarks cdargs --add=":$1:`pwd`"; # sort the resulting list if [ "$CDARGS_SORT" ]; then sort -o "$HOME/.cdargs" "$HOME/.cdargs"; fi } # Oh, no! Not overwrite 'm' for stefan! This was # the very first alias I ever wrote in my un*x # carreer and will always be aliased to less... # alias m='mark' # --------------------------------------------- # # Mark the current directory with alias # # provided and store as a cdargs bookmark # # directory but do not overwrite previous # # bookmarks with same name # # # # @param string alias # # # # @access public # # @return void # # author: SKa # # --------------------------------------------- # function ca () { # add the alias to the list of bookmarks cdargs --add=":$1:`pwd`"; } # --------------------------------------------- # # Bash programming completion for cdargs # # Sets the $COMPREPLY list for complete # # # # @param string substring of alias # # # # @access private # # @return void # # --------------------------------------------- # function _cdargs_aliases () { local cur bookmark dir strip oldIFS COMPREPLY=() if [ -e "$HOME/.cdargs" ]; then cur=${COMP_WORDS[COMP_CWORD]} if [ "$cur" != "${cur/\//}" ]; then # if at least one / bookmark="${cur/\/*/}" dir=`grep "^$bookmark " "$HOME/.cdargs" | sed 's#^[^ ]* ##'` if [ -n "$dir" -a "$dir" = "${dir/ /}" -a -d "$dir" ]; then strip="${dir//?/.}" oldIFS="$IFS" IFS=' ' COMPREPLY=( $( compgen -d "$dir`echo "$cur" | sed 's#^[^/]*##'`" \ | sed -e "s/^$strip/$bookmark/" -e "s/\([^\/a-zA-Z0-9#%_+\\\\,.-]\)/\\\\\\1/g" ) ) IFS="$oldIFS" fi else COMPREPLY=( $( (echo $cur ; cat "$HOME/.cdargs") | \ awk 'BEGIN {first=1} {if (first) {cur=$0; l=length(cur); first=0} else if (substr($1,1,l) == cur) {print $1}}' ) ) fi fi return 0 } # --------------------------------------------- # # Bash programming completion for cdargs # # Set up completion (put in a function just so # # `nospace' can be a local variable) # # # # @param none # # # # @access private # # @return void # # --------------------------------------------- # _cdargs_complete() { local nospace= [ "${BASH_VERSINFO[0]}" -ge 3 -o \( "${BASH_VERSINFO[0]}" = 2 -a \( "${BASH_VERSINFO[1]}" = 05a -o "${BASH_VERSINFO[1]}" = 05b \) \) ] && nospace='-o nospace' complete $nospace -S / -X '*/' -F _cdargs_aliases cv cb cdb } _cdargs_complete cdargs-1.35/contrib/Makefile.am0000644000076400001440000000006607622003277012071 EXTRA_DIST = cdargs-bash.sh cdargs-tcsh.csh cdargs.el cdargs-1.35/contrib/Makefile.in0000644000076400001440000001015710401700277012075 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ EXTRA_DIST = cdargs-bash.sh cdargs-tcsh.csh cdargs.el mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps contrib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status tags: TAGS TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = contrib distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: tags distdir info-am info dvi-am dvi check check-am \ installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cdargs-1.35/contrib/cdargs.el0000644000076400001440000001015707626243327011632 ;;; cdargs.el --- Directory Bookmarks ;; $Id: $ ;; Copyright (C) 2003 by Stefan Kamphausen ;; Author: Stefan Kamphausen ;; Keywords: tools, unix ;; This file is not part of XEmacs. ;; This program is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; This program 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 ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program; see the file COPYING. If not, write to the Free ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ;; 02111-1307, USA. ;;; Commentary: ;; This is an Emacs front-end to cdargs. It provides a function (cv or ;; cdargs) which uses the same bookmarks list as the terminal program ;; cdargs and lets the user quickly make a directory listed there the ;; current working directory. ;; CDargs is available from ;; http://www.skamphausen.de/software/cdargs/ ;; ;;; Installation: ;; Since version 1.24 there is a cdargs.el which you just put ;; somewhere where Emacs can find it (see variable load-path) and the ;; require it in your personal init file (may be one of ~/.emacs, ;; ~/.xemacs/init.el ~/.xemacs/my/config/personal.el or something ;; else): ;; (require 'cdargs) ;; This defines the function cdargs and an alias cv ;;; Code: (defgroup cdargs nil "Jump to directories quickly." :tag "CDargs" :link '(url-link :tag "Home Page" "http://www.skamphausen.de/software/cdargs/") :link '(emacs-commentary-link :tag "Commentary in cdargs.el" "cdargs.el") :prefix "cdargs-" :group 'editing-basics) (defcustom cdargs-list-file "~/.cdargs" "The filename of the cdargs bookmarks." :type 'string :group 'cdargs) (defcustom cdargs-warped-hook nil "List of function to run after changing to a directory with cdargs. For example it can be useful to add the `desktop-read' function here. This way you can restore a whole session saved earlier with desktop-save without having to start Emacs from a terminal. It's probably a good idea to use some kind of wrapper to check whether a desktop exists because otherwise it would delete all open buffers: \(add-hook 'cdargs-warped-hook '(lambda () (when (file-exists-p (expand-file-name desktop-basefilename \"./\")) (desktop-read))))" :type 'hook :group 'cdargs) (defun cdargs () "Change the current working directory using a bookmarks file. This function behaves similar to the command line program cdargs together with which it is distributed. You can use TAB completion and the usual history repeat keys for quick access." (interactive) (let* ((alist (cdargs-make-list)) (hist (mapcar 'car alist)) (dir (cdr (assoc (completing-read "warp to: " alist nil t nil 'hist nil) alist)))) (cd dir) (run-hooks 'cdargs-warped-hook))) (defalias 'cv 'cdargs) (defun cdargs-make-list () "Return an ALIST with descriptions and paths." (let ((file (expand-file-name cdargs-list-file)) (the-list) (desc) (path) (start)) (when (file-readable-p file) (with-temp-buffer (insert-file-contents file) (goto-char (point-min)) (while (not (eobp)) (setq desc (buffer-substring (point) (- (search-forward " /") 2))) (setq path (buffer-substring (- (point) 1) (progn (end-of-line) (point)))) (setq the-list (cons (cons desc path) the-list)) (forward-line)))) the-list)) (defun cdargs-edit () "Simply open the bookmarks file" (interactive) (find-file cdargs-list-file)) (provide 'cdargs) ;;; cdargs.el ends herecdargs-1.35/contrib/cdargs-tcsh.csh0000644000076400001440000000147210333360705012733 #!/bin/csh # (C) 2002-2005 Stefan Kamphausen # (T)CShell extensions written by # Stefan Kamphausen # Ruediger Goetz # Note: this is currently BY FAR not as advanced as the bash stuff # written by Dan! # Just the basic cdargs functionality for tcshell alias cv 'cdargs \!* && cd `cat $HOME/.cdargsresult`' # add current directory with description: alias ca 'cdargs --add=:\!*":"$cwd' # don't blame me if this is wrong! It took me quite a while to find in # st**id tcsh docs *grrr* (insert "sorry-to-the-developers" here). Too # few examples and too much fuss with the colons (is there any reason # that just escaping the colon with a backslash doesn't work?!? That # would be very intuitive and common practice). # Simple completion (thanks RG) complete cv 'n@*@`cat -s ~/.cdargs | sed -e "s/ .*//"`@' cdargs-1.35/aclocal.m40000644000076400001440000001107210401700233010215 dnl aclocal.m4 generated automatically by aclocal 1.4-p5 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 1 dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN([AM_INIT_AUTOMAKE], [AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] AC_SUBST(VERSION) dnl test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) AC_REQUIRE([AM_SANITY_CHECK]) AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET])]) # # Check to make sure that the build environment is sane. # AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "[$]*" != "X $srcdir/configure conftestfile" \ && test "[$]*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "[$]2" = conftestfile ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi rm -f conftest* AC_MSG_RESULT(yes)]) dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) dnl The program must properly implement --version. AC_DEFUN([AM_MISSING_PROG], [AC_MSG_CHECKING(for working $2) # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if ($2 --version) < /dev/null > /dev/null 2>&1; then $1=$2 AC_MSG_RESULT(found) else $1="$3/missing $2" AC_MSG_RESULT(missing) fi AC_SUBST($1)]) dnl Source: http://www.gnu.org/software/ac-archive/htmldoc/mp_with_curses.html dnl AC_DEFUN([MP_WITH_CURSES], [AC_ARG_WITH(ncurses, [ --with-ncurses Force the use of ncurses over curses],,) mp_save_LIBS="$LIBS" CURSES_LIB="" if test "$with_ncurses" != yes then AC_CACHE_CHECK([for working curses], mp_cv_curses, [LIBS="$LIBS -lcurses" AC_TRY_LINK( [#include ], [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ], mp_cv_curses=yes, mp_cv_curses=no)]) if test "$mp_cv_curses" = yes then AC_DEFINE(HAVE_CURSES_H) CURSES_LIB="-lcurses" fi fi if test ! "$CURSES_LIB" then AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses, [LIBS="$mp_save_LIBS -lncurses" AC_TRY_LINK( [#include ], [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ], mp_cv_ncurses=yes, mp_cv_ncurses=no)]) if test "$mp_cv_ncurses" = yes then AC_DEFINE(HAVE_NCURSES_H) CURSES_LIB="-lncurses" fi fi LIBS="$mp_save_LIBS" ])dnl cdargs-1.35/README0000644000076400001440000000125310322173107007243 Cdargs - Copyright (c) 2001-2003 Stefan Kamphausen You may use, alter and distribute it under the terms of the GNU General Public License (see file COPYING). * Description: Keep you hotspots of the filesystem in a bookmark list and warp there easily or browse the filesystem with a few fast keystrokes. inspired by the CDBM script written by Michael Schili for the german iX-Magazin and the derived scripts in the discussion thread to that script. This is a complete rewrite of the whole thing in C++ with a bunch of features added to it. For an explanation see file INSTALL, start cdargs: ./cdargs and press 'H' to get to the help screen. cdargs-1.35/THANKS0000644000076400001440000000544310400357160007303 Michael Schilli http://www.perlmeister.com - initial idea (written in perl) see: http://www.heise.de/ix/artikel/2001/01/179/ (german article) The guys in the iX forum who enhanced the script thus provding good ideas for the user interface. Forum (german) is at: http://www.heise.de/ix/foren/go.shtml?list=1&g=200101179 Dan Allen For more feedback and suggestions from the world (on version 1.14 and the following). He wanted: - mutt/vim style keybindings for movement - resolving the list if only one entry - from other requests the Needle magic was born - don't use A_BOLD for highlighting of current entry (I took A_STANDOUT instead) - ask user for a description and remove capitalize in default - adding of entries from the command line. - AND MUCH MORE... Plus he found most of the bugs and he provided the bash shell functions (check out the completion with cv [TAB]!!)! This was most valuable input, Dan. Damjan Lango first feedback from the world wishing two features: - history - add function to add to the list current directory, not only the selected. Tomi Ollila For more feedback and suggestions from the world - return code != null for quitting - suggested introducing configurable keymaps Stephen Gildea and Juhapekka Tolvanen for corrections with quoting and portability of the shell functions. Oron Pered for correcting my asumptions about the backticks and terminal/curses things. I'm pretty sure that I'll use that in an upcoming project :). Plus the .spec file and instructions how to use it to build the RPM package. R"udiger Goetz for tcsh completion Petra Malik for the Debian packaging and bugfixes. Robi Malik for improvements to the bash completion code. Richard Lammers for highlight current directory in list feature idea and much more feedback Randy Chamberlin for whitespaces in paths (and descriptions) bug report Maximiliano Pin for suggestions to the user interface and bug reporting. Oscar Fernandez Sierra for the patch that enables a variable width/length for the description (in contrast to the hardcoded 8 before that) Miki Tebeka and Claus for the Cygwin things. Geert Jan Bex for changes to cdargs-bash.sh Damon Harper for subdirectory completion in bash. Peace and Pleasure to you all! + www.skamphausen.de __ __ _ __ __ -+ | <` \____// |__| |_ |_| | |_ | | \ ~~~ / | |__ | | |__ |__ | +- `-ll-' May The Open Source Be With You! -+ cdargs-1.35/configure0000755000076400001440000030467110401700234010277 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} ac_unique_file="autogen.sh" # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. build=$build_alias host=$host_alias target=$target_alias # FIXME: should be removed in autoconf 3.0. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat < if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. EOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue cd $ac_subdir # A "../" for each directory in /$ac_subdir. ac_dots=`echo $ac_subdir | sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` case $srcdir in .) # No --srcdir option. We are building in place. ac_sub_srcdir=$srcdir ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_sub_srcdir=$srcdir/$ac_subdir ;; *) # Relative path. ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; esac # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_sub_srcdir/configure.gnu; then echo $SHELL $ac_sub_srcdir/configure.gnu --help=recursive elif test -f $ac_sub_srcdir/configure; then echo $SHELL $ac_sub_srcdir/configure --help=recursive elif test -f $ac_sub_srcdir/configure.ac || test -f $ac_sub_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\EOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. EOF exit 0 fi exec 5>config.log cat >&5 </dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` PATH = $PATH _ASUNAME } >&5 cat >&5 <\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ac_sep=" " ;; *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" ac_sep=" " ;; esac # Get rid of the leading space. done # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. trap 'exit_status=$? # Save into config.log some information that might help in debugging. echo >&5 echo "## ----------------- ##" >&5 echo "## Cache variables. ##" >&5 echo "## ----------------- ##" >&5 echo >&5 # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } >&5 sed "/^$/d" confdefs.h >conftest.log if test -s conftest.log; then echo >&5 echo "## ------------ ##" >&5 echo "## confdefs.h. ##" >&5 echo "## ------------ ##" >&5 echo >&5 cat conftest.log >&5 fi (echo; echo) >&5 test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" >&5 echo "$as_me: exit $exit_status" >&5 rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:839: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} cat "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:850: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:858: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:874: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:878: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:884: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:886: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:888: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. It doesn't matter if # we pass some twice (in addition to the command line arguments). if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:907: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:909: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if { (echo "$as_me:929: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? echo "$as_me:932: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_path_separator=';' else ac_path_separator=: fi PATH_SEPARATOR="$ac_path_separator" rm -f conftest.sh ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:958: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:978: checking for a BSD compatible install" >&5 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_IFS=$IFS; IFS=$ac_path_separator for ac_dir in $PATH; do IFS=$ac_save_IFS # Account for people who put trailing slashes in PATH elements. case $ac_dir/ in / | ./ | .// | /cC/* \ | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ | /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if $as_executable_p "$ac_dir/$ac_prog"; then if test $ac_prog = install && grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:1027: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:1038: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "$*" != "X $srcdir/configure conftestfile" \ && test "$*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:1061: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftestfile ) then # Ok. : else { { echo "$as_me:1074: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest* echo "$as_me:1081: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed echo "$as_me:1096: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:1116: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:1120: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi PACKAGE=cdargs VERSION=1.35 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:1130: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <>confdefs.h <&5 echo $ECHO_N "checking for working aclocal... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (aclocal --version) < /dev/null > /dev/null 2>&1; then ACLOCAL=aclocal echo "$as_me:1151: result: found" >&5 echo "${ECHO_T}found" >&6 else ACLOCAL="$missing_dir/missing aclocal" echo "$as_me:1155: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:1159: checking for working autoconf" >&5 echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoconf --version) < /dev/null > /dev/null 2>&1; then AUTOCONF=autoconf echo "$as_me:1166: result: found" >&5 echo "${ECHO_T}found" >&6 else AUTOCONF="$missing_dir/missing autoconf" echo "$as_me:1170: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:1174: checking for working automake" >&5 echo $ECHO_N "checking for working automake... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (automake --version) < /dev/null > /dev/null 2>&1; then AUTOMAKE=automake echo "$as_me:1181: result: found" >&5 echo "${ECHO_T}found" >&6 else AUTOMAKE="$missing_dir/missing automake" echo "$as_me:1185: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:1189: checking for working autoheader" >&5 echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoheader --version) < /dev/null > /dev/null 2>&1; then AUTOHEADER=autoheader echo "$as_me:1196: result: found" >&5 echo "${ECHO_T}found" >&6 else AUTOHEADER="$missing_dir/missing autoheader" echo "$as_me:1200: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:1204: checking for working makeinfo" >&5 echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (makeinfo --version) < /dev/null > /dev/null 2>&1; then MAKEINFO=makeinfo echo "$as_me:1211: result: found" >&5 echo "${ECHO_T}found" >&6 else MAKEINFO="$missing_dir/missing makeinfo" echo "$as_me:1215: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:1229: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:1244: found $ac_dir/$ac_word" >&5 break done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:1252: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:1255: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:1268: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:1283: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:1291: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:1294: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:1306:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:1309: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:1312: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1314: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:1317: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1319: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:1322: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line 1326 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:1342: checking for C++ compiler default output" >&5 echo $ECHO_N "checking for C++ compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:1345: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:1348: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. for ac_file in `ls a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:1371: error: C++ compiler cannot create executables" >&5 echo "$as_me: error: C++ compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:1377: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:1382: checking whether the C++ compiler works" >&5 echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:1388: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1391: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:1398: error: cannot run C++ compiled programs. If you meant to cross compile, use \`--host'." >&5 echo "$as_me: error: cannot run C++ compiled programs. If you meant to cross compile, use \`--host'." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:1406: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:1413: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:1415: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:1418: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 if { (eval echo "$as_me:1420: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:1423: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:1439: error: cannot compute EXEEXT: cannot compile and link" >&5 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:1445: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:1451: checking for object suffix" >&5 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1457 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:1469: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1472: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:1484: error: cannot compute OBJEXT: cannot compile" >&5 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:1491: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:1495: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1501 "configure" #include "confdefs.h" int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1516: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1519: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1522: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1525: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:1537: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:1543: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1549 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1561: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1564: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1567: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1570: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:1580: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line 1607 "configure" #include "confdefs.h" #include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1620: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1623: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1626: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1629: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line 1639 "configure" #include "confdefs.h" $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1651: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1654: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1657: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1660: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:1690: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:1705: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1713: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1716: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:1725: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:1740: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1748: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1751: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:1764: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:1779: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1787: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1790: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:1799: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="cc" echo "$as_me:1814: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1822: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1825: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:1838: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:1858: found $ac_dir/$ac_word" >&5 break done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" ${1+"$@"} shift ac_cv_prog_CC="$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1880: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1883: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:1894: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:1909: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1917: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1920: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:1933: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:1948: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1956: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1959: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:1971: error: no acceptable cc found in \$PATH" >&5 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:1976:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:1979: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:1982: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1984: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:1987: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1989: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:1992: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:1995: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2001 "configure" #include "confdefs.h" int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2016: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2019: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2022: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2025: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:2037: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:2043: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2049 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2061: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2064: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2067: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2070: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:2080: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2107: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2110: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2113: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2116: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line 2128 "configure" #include "confdefs.h" #include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2141: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2144: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2147: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2150: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line 2160 "configure" #include "confdefs.h" $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2172: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2175: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2178: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2181: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:2213: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line 2234 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:2239: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2245: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line 2268 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:2272: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2278: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:2315: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line 2325 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:2330: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2336: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line 2359 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:2363: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2369: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:2397: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:2408: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2414 "configure" #include "confdefs.h" #include #include #include #include _ACEOF if { (eval echo "$as_me:2422: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2428: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line 2450 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line 2468 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line 2489 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:2515: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2518: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:2520: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2523: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:2536: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi # Check whether --with-ncurses or --without-ncurses was given. if test "${with_ncurses+set}" = set; then withval="$with_ncurses" fi; mp_save_LIBS="$LIBS" CURSES_LIB="" if test "$with_ncurses" != yes then echo "$as_me:2555: checking for working curses" >&5 echo $ECHO_N "checking for working curses... $ECHO_C" >&6 if test "${mp_cv_curses+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else LIBS="$LIBS -lcurses" cat >conftest.$ac_ext <<_ACEOF #line 2562 "configure" #include "confdefs.h" #include int main () { chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2574: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2577: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2580: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2583: \$? = $ac_status" >&5 (exit $ac_status); }; }; then mp_cv_curses=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 mp_cv_curses=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:2593: result: $mp_cv_curses" >&5 echo "${ECHO_T}$mp_cv_curses" >&6 if test "$mp_cv_curses" = yes then cat >>confdefs.h <<\EOF #define HAVE_CURSES_H 1 EOF CURSES_LIB="-lcurses" fi fi if test ! "$CURSES_LIB" then echo "$as_me:2606: checking for working ncurses" >&5 echo $ECHO_N "checking for working ncurses... $ECHO_C" >&6 if test "${mp_cv_ncurses+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else LIBS="$mp_save_LIBS -lncurses" cat >conftest.$ac_ext <<_ACEOF #line 2613 "configure" #include "confdefs.h" #include int main () { chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2625: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2628: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2631: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2634: \$? = $ac_status" >&5 (exit $ac_status); }; }; then mp_cv_ncurses=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 mp_cv_ncurses=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:2644: result: $mp_cv_ncurses" >&5 echo "${ECHO_T}$mp_cv_ncurses" >&6 if test "$mp_cv_ncurses" = yes then cat >>confdefs.h <<\EOF #define HAVE_NCURSES_H 1 EOF CURSES_LIB="-lncurses" fi fi LIBS="$mp_save_LIBS" if test "x$CURSES_LIB" = "x" ; then { { echo "$as_me:2658: error: Fatal error: couldn't find ncurses/curses." >&5 echo "$as_me: error: Fatal error: couldn't find ncurses/curses." >&2;} { (exit 1); exit 1; }; } fi ac_config_files="$ac_config_files Makefile contrib/Makefile doc/Makefile src/Makefile m4/Makefile cdargs.spec" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overriden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\EOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p EOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:2773: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated automatically by configure. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false SHELL=\${CONFIG_SHELL-$SHELL} ac_cs_invocation="\$0 \$@" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } exec 6>&1 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\EOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` shift set dummy "$ac_option" "$ac_optarg" ${1+"$@"} shift ;; -*);; *) # This is not an option, so the user has probably given explicit # arguments. ac_need_defaults=false;; esac case $1 in # Handling of the options. EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:2941: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) shift CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) shift CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; # This is an error. -*) { { echo "$as_me:2960: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done exec 5>>config.log cat >&5 << _ACEOF ## ----------------------- ## ## Running config.status. ## ## ----------------------- ## This file was extended by $as_me 2.52, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS > $ac_cs_invocation on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF EOF cat >>$CONFIG_STATUS <<\EOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "contrib/Makefile" ) CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;; "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "m4/Makefile" ) CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; "cdargs.spec" ) CONFIG_FILES="$CONFIG_FILES cdargs.spec" ;; *) { { echo "$as_me:3001: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } EOF cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@DEFS@,$DEFS,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@CPP@,$CPP,;t t s,@CURSES_LIB@,$CURSES_LIB,;t t CEOF EOF cat >>$CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" EOF cat >>$CONFIG_STATUS <<\EOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" ;; esac done; } ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` else ac_dir_suffix= ac_dots= fi case $srcdir in .) ac_srcdir=. if test -z "$ac_dots"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_dots$srcdir$ac_dir_suffix ac_top_srcdir=$ac_dots$srcdir ;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_dots$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:3218: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated automatically by config.status. */ configure_input="Generated automatically from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:3236: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:3249: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done EOF cat >>$CONFIG_STATUS <<\EOF { (exit 0); exit 0; } EOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: exec 5>/dev/null $SHELL $CONFIG_STATUS || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi cdargs-1.35/configure.in0000644000076400001440000000066710401677577010726 AC_INIT(autogen.sh) AM_INIT_AUTOMAKE(cdargs, 1.35) AC_PROG_CXX AC_STDC_HEADERS dnl AC_CHECK_CURSES dnl if test "$has_curses" = "false" ; then dnl AC_MSG_ERROR([Fatal error: couldn't find ncurses/curses.]) dnl fi MP_WITH_CURSES if test "x$CURSES_LIB" = "x" ; then AC_MSG_ERROR([Fatal error: couldn't find ncurses/curses.]) fi AC_SUBST(CURSES_LIB) AC_OUTPUT(Makefile contrib/Makefile doc/Makefile src/Makefile m4/Makefile cdargs.spec) cdargs-1.35/install-sh0000754000076400001440000001273607354345614010415 #!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 cdargs-1.35/autogen.sh0000754000076400001440000000030710165104551010364 #! /bin/sh SRCDIR=`dirname $0` rm -f $SRCDIR/config.cache echo "aclocal" aclocal -I m4 echo "autoconf" autoconf echo "automake" automake --add-missing --copy echo "configure" $SRCDIR/configure exit cdargs-1.35/missing0000754000076400001440000001421307354345614010000 #! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Franc,ois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 cdargs-1.35/cdargs.spec.in0000644000076400001440000000207410333361353011115 %define profiledir %{_sysconfdir}/profile.d Name: @PACKAGE@ Version: @VERSION@ Release: 1 Vendor: Stefan Kamphausen License: GPL Group: Applications/File Packager: Oron Peled Summary: The Shell cd with bookmarks and browser Source: http://www.skamphausen.de/software/cdargs/%name-%version.tar.gz URL: http://www.skamphausen.de/software/cdargs/ Buildroot: %{_tmppath}/%{name}-%{version}-root %description Navigate cd Arguments/expand the shell built-in cd with bookmarks and browser %prep %setup %build %configure make %install rm -rf $RPM_BUILD_ROOT mkdir $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install mkdir -p $RPM_BUILD_ROOT%{profiledir} install -m 755 contrib/cdargs-bash.sh $RPM_BUILD_ROOT%{profiledir}/cdargs.sh install -m 755 contrib/cdargs-tcsh.csh $RPM_BUILD_ROOT%{profiledir}/cdargs.csh %files %defattr(-, root, root) %{_bindir}/cdargs %{profiledir}/cdargs.* %doc %{_mandir}/man1/cdargs.1* %doc AUTHORS ChangeLog COPYING INSTALL NEWS README THANKS TODO %doc contrib/cdargs.el %clean rm -rf $RPM_BUILD_ROOT cdargs-1.35/mkinstalldirs0000754000076400001440000000132207354345614011204 #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here cdargs-1.35/Makefile.am0000644000076400001440000000013207456627331010433 EXTRA_DIST = autogen.sh configure cdargs.spec cdargs.spec.in SUBDIRS = contrib doc src m4 cdargs-1.35/Makefile.in0000644000076400001440000002333110401700277010433 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ EXTRA_DIST = autogen.sh configure cdargs.spec cdargs.spec.in SUBDIRS = contrib doc src m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = cdargs.spec DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ Makefile.in NEWS THANKS TODO aclocal.m4 cdargs.spec.in configure \ configure.in install-sh missing mkinstalldirs DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): configure.in cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) cdargs.spec: $(top_builddir)/config.status cdargs.spec.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. @SET_MAKE@ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ test "$$subdir" != "." || dot_seen=yes; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist -rm -rf $(distdir) GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) dist -rm -rf $(distdir) @banner="$(distdir).tar.gz is ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done for subdir in $(SUBDIRS); do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ chmod 777 $(distdir)/$$subdir; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ fi; \ done info-am: info: info-recursive dvi-am: dvi: dvi-recursive check-am: all-am check: check-recursive installcheck-am: installcheck: installcheck-recursive install-exec-am: install-exec: install-exec-recursive install-data-am: install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive uninstall-am: uninstall: uninstall-recursive all-am: Makefile all-redirect: all-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-recursive clean-am: clean-tags clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-tags distclean-generic clean-am distclean: distclean-recursive -rm -f config.status maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-recursive -rm -f config.status .PHONY: install-data-recursive uninstall-data-recursive \ install-exec-recursive uninstall-exec-recursive installdirs-recursive \ uninstalldirs-recursive all-recursive check-recursive \ installcheck-recursive info-recursive dvi-recursive \ mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs-am \ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cdargs-1.35/cdargs.spec0000644000076400001440000000206410401700244010477 %define profiledir %{_sysconfdir}/profile.d Name: cdargs Version: 1.35 Release: 1 Vendor: Stefan Kamphausen License: GPL Group: Applications/File Packager: Oron Peled Summary: The Shell cd with bookmarks and browser Source: http://www.skamphausen.de/software/cdargs/%name-%version.tar.gz URL: http://www.skamphausen.de/software/cdargs/ Buildroot: %{_tmppath}/%{name}-%{version}-root %description Navigate cd Arguments/expand the shell built-in cd with bookmarks and browser %prep %setup %build %configure make %install rm -rf $RPM_BUILD_ROOT mkdir $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install mkdir -p $RPM_BUILD_ROOT%{profiledir} install -m 755 contrib/cdargs-bash.sh $RPM_BUILD_ROOT%{profiledir}/cdargs.sh install -m 755 contrib/cdargs-tcsh.csh $RPM_BUILD_ROOT%{profiledir}/cdargs.csh %files %defattr(-, root, root) %{_bindir}/cdargs %{profiledir}/cdargs.* %doc %{_mandir}/man1/cdargs.1* %doc AUTHORS ChangeLog COPYING INSTALL NEWS README THANKS TODO %doc contrib/cdargs.el %clean rm -rf $RPM_BUILD_ROOT cdargs-1.35/AUTHORS0000644000076400001440000000047210322173206007435 Stefan Kamphausen I started this project and whenever there is an I-narrator it's me :). Claus Brunzema Cleaned the code, gave hints, is user no.2 introduced autoconf/automake and m4 to this project and more... Other Contributors: see the THANKS file :-)cdargs-1.35/INSTALL0000644000076400001440000000674110401435235007424 COMPILATION =========== Installation is easy, do: $ configure $ make then become root and do: # make install-strip If you're not content with the displayed width of the description you might want to change cdargs.cc. Look for the lines # define DESCRIPTION_MAXLENGTH 18 # define DESCRIPTION_BROWSELENGTH 8 and change the numbers according to your taste. CREATE SHELL FUNCTION(S) ======================== For Versions 1.19 And Newer (bash) ---------------------------------- Simply copy the file contrib/cdargs-bash.sh somewhere into your $PATH and put a line like source cdargs-bash.sh in your ~/.bashrc. This loads some very useful functions into your shell. (Please note that these functions could be improved but I don't have enough bash knowledge for that.) For Versions 1.20 And Newer (tcsh) ---------------------------------- Copy the file contrib/cdargs-tcsh.csh to a place that you like and source it from your ~/.cshrc (or ~/.tcsh ?). Please note that I don't know much about tcsh (im bashi-ish) and thus this might be quite quirky... Any help appreciated in making the tcsh expansion as powerfull as Dan's bash functions. For Older Versions ------------------ Put a line like the following into your shell startup-script (.profile, .bashrc, .zshrc, whatever) to create a shell function: function cv () { cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`" } If you want to you can remove the file in your homedirectory after successfully using cdargs: function cv () { cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`" && rm -f "$HOME/.cdargsresult" } or you can echo the directory you changed to: function cv () { cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`" && pwd ; } Another thing you might find useful is an alias for adding paths: function ca () { cdargs --add="$1" ; } function capwd () { cdargs --add=":$1:"`pwd` ; } (Note that the '&&' is just possible since version 1.11 which introduced a reasonable return code to cdargs. Both version should work.) WRAPPING ======== If you do not like the cursor wrapping around on the top and the bottom of the list, start cdargs with the additional option --nowrap: Example: function cb () { cdargs --nowrap "$1" && cd `cat $HOME/.cdargsresult` ; } MORE HELP ========= For more information try: $ configure --help $ cdargs --help or press 'H' or '?' while running cdargs. Additionally since version 1.16 cdargs comes with a manpage. GNU/X Emacs =========== Since version 1.24 there is a cdargs.el which you just put somewhere where Emacs can find it (see variable load-path) and the require it in your personal init file (may be one of ~/.emacs, ~/.xemacs/init.el ~/.xemacs/my/config/personal.el or something else): (require 'cdargs) Appendix: ========= Creating an RPM (thanks Oron!) ------------------------------ First way (assuming all directories relative to /usr/src/redhat): - Put the .spec file in the SPECS directories - Put the tar.gz file in the SOURCES directory - From the SPECS directory run: rpm -bb cdargs.spec # to build only binary RPM rpm -bs cdargs.spec # to build only source RPM rpm -ba cdargs.spec # to build both Second way (assuming the tar.gz file contains .spec file): - Simply run: rpm -ta cdargs-.tar.gz The resulting binary RPM will be below the RPMS directory (e.g: RPMS/i386). Signing The Tarball ------------------- The whole thing, including the tarball: gpg -a --sign cdargs-.tar.gz Just the signature: gpg -ab --default-key 0BA0A295 --sign cdargs-.tar.gz cdargs-1.35/ChangeLog0000644000076400001440000004605010401700271010135 2006-03-03 Stefan Kamphausen * configure.in: Version 1.35 * contrib/cdargs-bash.sh: Minor bugfix from Damon when completing the second subdirectory. 2006-03-02 Stefan Kamphausen * configure.in: Version 1.34 * contrib/cdargs-bash.sh: Many changes to make completion work with subdirectories from Damon. 2006-02-26 Stefan Kamphausen * src/cdargs.cc: applied patch from Claus for empty lines in bookmark file. * THANKS: Added Damon. Changed email adresses to contain _at_ instead of the real at. 2005-11-12 Stefan Kamphausen * src/cdargs.cc(edit_list_file): Quoted filename. 2005-11-06 Stefan Kamphausen * cdargs.spec.in: Fixes by Oron: - s/Copyright/License/ - Install the contrib/*.{csh,sh} into /etc/profile.d/ instead of the documentation directory -- so they are usable to all. - Used the %configure macro (standard in RedHat and Mandriva -- what about Suse?). - Used DESTDIR for installation (standard in automake generated Makefiles). * contrib/cdargs-tcsh.csh: Changed path of csh. Actually one should remove the path because the file must be sourced anyway. Anyway... 2005-10-09 Stefan Kamphausen * configure.in: Version 1.32 * README: email to website.... * cdargs.spec.in (Vendor): email to website.... * AUTHORS: email to website.... * src/cdargs.cc: Removed references to my email address. Use domain instead. 2005-10-01 Stefan Kamphausen * THANKS: added Geert * contrib/cdargs-bash.sh: Patch by Geert: more quotes and the sed-statement will use the first space as separater, not the last. 2005-01-04 Stefan Kamphausen * INSTALL: signing with detached signature added. 2004-12-30 Stefan Kamphausen * configure.in: New curses M4, version 1.31 * src/cdargs.cc(list_to_file): Creating backup now. (toggle_mode): Fixed a long standing bug in which you could loose almost all your bookmarks when toggling the mode with a needle defined. * autogen.sh (SRCDIR): New curses M4, no "." in PATH * m4/Makefile.am (EXTRA_DIST): New curses M4 * src/Makefile.am (LDADD): New curses M4 * THANKS: Added Miki and Claus for Cygwinification * src/cdargs.cc(user_interaction): opt_no_resolve works in LIST-mode, too. 2004-03-31 Stefan Kamphausen * configure.in: Version 1.29 * INSTALL (Appendix): typo, add signing instruction - mainly for myself. * doc/cdargs.1: New PgKey-behaviour. * src/cdargs.cc(user_interaction): opt_noresolv now works in LIST mode. PageKeys now scroll the list and not the shortcut numbers, which was kinda stupid anyway. Note, however, the we don't scroll in screenfulls but in 10's because this is better in terminals that are vertically large, because a screenfull of scrolling wouldn't do anything there. In addition this scrolling won't wrap around. The adjust_shorties_offset function was removed from the sources. (helpscreen): New PgKey-behaviour 2003-12-22 Stefan Kamphausen * THANKS: changed email adress of Petra 2003-12-18 Stefan Kamphausen * src/cdargs.cc: removed get_current_dir_name() and wrote two new functions (get_cwd_as_charp) and (get_cwd_as_string). All this to overcome a bug when trying to do anything in a directory that had been removed in the meantime. Now we just exit in such a case. This also involves another checkpoint in (list_from_dir) where an exit was picked instead of going one directory up. It took me hours to even track that bug down! You nasty, you! 2003-06-05 Stefan Kamphausen * configure.in: Version 1.27 * src/cdargs.cc: renamed (abort) to (abort_cdargs) according to debian bug and bugfix by Petra Malik. * src/cdargs.h: renamed (abort) to (abort_cdargs) ... 2003-02-23 Stefan Kamphausen * configure.in: Version 1.26 * contrib/cdargs.el (cdargs-warped-hook): added hint with desktop check in docstring * cdargs.spec.in: (re)added cdargs.el, which I had put into cdargs.spec. * contrib/cdargs.el: added installation * THANKS: added Oscar * INSTALL: Describe the variable width settings. * src/cdargs.cc: Applied patch by Oscar to get a description of variable length. Changed that code again to have the length fixed for browse mode. 2003-02-16 Stefan Kamphausen * contrib/cdargs.el: added cdargs-warped-hook, changed the file parser from a quite perlish to a more elispish way. 2003-02-13 Stefan Kamphausen * src/cdargs.cc(list_from_dir): when coming to a directory which hadn't been visited before, using ".." make the previous directory the current directory. 2003-02-11 Stefan Kamphausen * configure.in: Version 1.24 * src/cdargs.cc: several code cleanups, fixed the handling of a digit-Needle again. * src/cdargs.cc(terminate): print a bug report request on SIGSEGV. * doc/cdargs.1: updated keys in list mode in the COMMANDS section. * src/cdargs.cc(user_interaction): swapping/transposing entries now has its own function which can also proceed the current position afterwards: swap_two_entries. New commands m and M move an entry up or down and move the position, too. (helpscreen): new commands: m and M. (swap_two_entries): new. * doc/cdargs.1: opt_cwd ... * src/cdargs.cc(display_list): bugfix with longer pathnames than displayed. (main, list_from_file, global): added opt_cwd which activates the current working directory as the current entry on startup. 2003-02-10 Stefan Kamphausen * INSTALL (Example): added cdargs.el * doc/cdargs.1 (mode): added cdargs.el * contrib/Makefile.am (EXTRA_DIST): added cdargs.el * cdargs.spec (Buildroot): added cdargs.el * cdargs.el: NEW 2003-02-08 Stefan Kamphausen * src/cdargs.cc(helpscreen): using PAGER instead of self-rolled help-window. 2003-02-06 Stefan Kamphausen * configure.in: Version 1.23 * doc/cdargs.1: added DISPLAY section. * src/cdargs.cc(display_list): added marking of list entries that point to no valid directories [using a '!' in front of the path] and have a list item which is equal to the current working directory stand out in bold font. (list_from_file): changed the reading routine to correctly detect descriptions and paths with whitespaces. 2003-02-04 Stefan Kamphausen * configure.in: Version 1.22 * src/cdargs.cc(edit_list_file): honored Debians /usr/bin/editor preference by stat()ing it. * contrib/cdargs-bash.sh: Changed completion code improver from Jochen to Robi: Jochen _detected_ and Robi (partly) solved the bug. 2003-02-02 Stefan Kamphausen * src/cdargs.cc(terminate): different way to shut up the compiler that may be cleaner? (resizeevent) dto. 2003-01-30 Stefan Kamphausen * src/cdargs.h: copyright -2003 * src/cdargs.cc: copyright -2003 * doc/cdargs.1 (bash): more small fixes by Petra and spell checking. * contrib/cdargs-bash.sh (_cdargs_aliases): more bugfixes by Jochen Voss. 2003-01-27 Stefan Kamphausen * src/cdargs.cc (toggle_mode): added yoffset = 0 to avoid segfaults. This really feels ugly and makes me feel like rewriting the whole thing even more... * contrib/cdargs-bash.sh (_cdargs_aliases): fixed the slash bug found and solved by Jochen Voss with the general problem of special characters still lurking there at the unprepared user. * doc/cdargs.1: small fixes by Petra Malik, extended copyright notice to 2003. 2002-04-27 Stefan Kamphausen * src/cdargs.cc: (list_to_file) no writing when a user was given as option. (main) new options: --file, --user and --output [f,u,o] to change bookmarks and output files. (list_from_file) uses new get_listfile() (edit_list_file) uses new get_listfile() (get_resultfile) new function (get_listfile) new function (usage) described new options * doc/cdargs.1: Description of --file and --user and --output added * contrib/cdargs-bash.sh: re-introduced the logical AND when changing directories with cdargs (function cdb) 2002-04-15 Stefan Kamphausen * cdargs.spec.in: Added RPM spec-file written by Oron Peled. * INSTALL: described new tcsh file. * doc/cdargs.1: described new tcsh file and added an extra not about the shell completion. * contrib/cdargs-tcsh.sh: added file 2002-04-12 Stefan Kamphausen * src/cdargs.cc: (list_from_dir) added sorting of list. 2002-04-10 Stefan Kamphausen * src/cdargs.cc: (list_from_dir) fixed long listing revisited lost highlighter problem - hopefully. 2002-04-09 Stefan Kamphausen * configure.in: Version 1.19. * (user_interaction) added vi-keybindings for HOME and END. Moved offset handling when current position leaves the screen to cur_pos_add(). (cur_pos_add) see above. (visible) new function. Tests whether the given position is visible on the screen. 2002-04-05 Stefan Kamphausen * contrib/cdargs-bash.sh (_cdargs_exec): set last to empty string if the last argument is an existing file, which means that no alias/description was given. Start in browse mode then. * src/cdargs.cc: Made the appearance of "." and ".." more consistent with common un*x practice and more intuitive. Added --browse/-b option to start in browse mode. Since the optional argument handling in getopt_long() seems to be a GNU extension and someday I want to compile on other unices I don't enable it here - it always starts with the current directory. 2002-04-04 Stefan Kamphausen * THANKS: Added Oron Pered. * README: Noted the TTY-code I got from Oron Pered. * doc/cdargs.1: Edited key labels like in (helpscreen) and added the Emacs-style bindings. * src/cdargs.cc: (init_curses) added code line for better handling of cursor - effectively of not showing any cursor at all. (helpscreen) removed alternative keybindings (now in manpage) and corrected the key labels from 'left' to ''. (user_interaction) added many many emacs-style keybindings and TERMINFO compile tests - inspired from cscope source :-). Thank you! (toggle_mode) disable Needle and reread list from file when entering LIST mode, which should only happen when someone presses TAB twice. (finish) clearing screen because terminals like aterm let the list be displayed after finishing. I think this is wasted screen-room so remove it. 2002-04-03 Stefan Kamphausen * doc/cdargs.1: Described PageUp and PageDown. * src/cdargs.cc: The existance of a Needle is not checked by pointer but by size of Needle-string; this fixes a bug when called like cdargs "" which would never save the list. Somehow connected to this is the disabling of deleting/adding/editing of the list when no saving will take place. Find the tests for 'NeedleGiven'. Added PAGE_UP and PAGE_DN keys to move the Shortcut Digits This probably shows up everywhere where you can find a 'shorties_offset' variable. Added this to (helpscreen) Corrected the positioning of active entry when deleting inside the list and not the last entry. Changed (cur_pos_add) to (cur_pos_adjust). 2002-04-01 Stefan Kamphausen * doc/cdargs.1: Behaviour of numbers, not saving the list when Needle is given. Changed the size of the description field from 15 to 9 (and hold your thumbs that we don't have to recalc some things from that). * src/cdargs.cc: Pressing numbers in BROWSE mode just makes that the current position, not resolving anymore in (user_interaction). Fixes for reading and writing of bookmarks file when the list and/or the file is empty in (list_to_file) and (list_from_file). A small fix for the Current Position when it is somewhere outside the displayable list in (display_list). Show the current mode in (update_modeline). Reflect changes in (helpscreen). * contrib/cdargs-bash.sh: Check for existance of ~/.cdargs in function _cdargs_get_dir. Enabled _both_ cv and cb as an alias to the formal cdb. 2002-03-31 Stefan Kamphausen * doc/cdargs.1: Reflect one-entry-bookmark-file behaviour. Tell about the new bash functions. * contrib/cdargs-bash.sh: New in the distribution. A few changes to the version of Dan: cv instead of cb and added function ca which does not mess with the bookmarks file. Improved creation of a tempfile using PID and a RANDOM number from the kernel for filename. * src/cdargs.cc: (cur_pos_add) Added a wraparound option (default true) in addition to the --nowrap option from the commandline. (delete_from_default_list) fixed a bug with CurrentPosition when deleting the last entry. (list_from_file) Counting lines and if only one entry we show the list in any case. 2002-03-30 Stefan Kamphausen * doc/cdargs.1: Describe the Needle magic and the new option --noresolve. Description of the --add=[:desc:]path syntax. * src/cdargs.cc: Some more Needle magic: if it matches a description exactly that is taken unless the (new) command line option --noresolve was given. Reflect this in helpscreen. 2002-03-29 Stefan Kamphausen * src/cdargs.cc(last_dirname): Fixed behaviour when there is a trailing slash. (add_to_list_file): Only allowing absolute paths. Adding new colon-description-syntax to allow passing of descriptions from command line. An empty string from user-interaction quits the adding of a path to the list. (list_from_dir): Removed capitalization of dirnames. Added empty directory listing: ".." and ".". 2002-03-28 Stefan Kamphausen * src/cdargs.cc: Updated docs: mainly shell functions stuff; in helpscreen() and in usage(). * doc/cdargs.1: Updated docs: mainly shell functions stuff. * INSTALL: Updated docs: mainly shell functions stuff. * THANKS: Added Juhapekka Tolvanen. 2002-03-27 Stefan Kamphausen * doc/Makefile.am: brandnew and exciting: cdargs now comes with a manpage :-) * doc/cdargs.1: Wrote manpage. Probably this need reworking. * src/cdargs.cc: Added '?' as a key to call for help, added the keys 'A' and 'C' that work just like their lowercase equivalents (i.e. adding directories to the list) but ask the user to enter a description string. Reflect this in helpscreen() and fix a bug in helpscreen to really display all the help. 2002-03-26 Stefan Kamphausen * src/cdargs.cc: Suggestions by Dan Allen: vim/mutt-style keybindings, i.e. h/l for left right and k/j for up/down. The currently selected list entry is not displayed with attribute A_BOLD but A_STANDOUT (which is the best highlighting mode of the current terminal and I hope this works well). Plus if the list to display (in LIST mode) contains only one entry (usually due to filtering it) cdargs exits with that entry as the result. Reflect this in helpscreen, too. 2002-03-20 Stefan Kamphausen * src/cdargs.cc: Version 1.14. Added capitalized_last_dirname function which e.g. is used to insert a default description when adding paths to the default list. 2002-02-02 Stefan Kamphausen * src/cdargs.cc: Version 1.13. New hotkeys: '/' and '~' which switch to browse mode and show the root or home directory. Fixed a bug with filenames in the root directory. Changed email adress from corporate to private. 2002-01-14 Stefan Kamphausen * src/cdargs.cc: when Needle (search pattern) is integer the current position is set accordingly. 2001-10-02 Stefan Kamphausen * src/cdargs.cc: cleaned up code formatting * src/cdargs.h: cleaned up code formatting 2001-09-28 Stefan Kamphausen * configure.in: version 1.11 * THANKS: Added Thanks to Tomi Ollila * INSTALL: changed function to use return code * src/cdargs.cc: cdargs now has a reasonable return code. So you can use a better shell function. Wrote that to docs, too 2001-09-27 Stefan Kamphausen * configure.in: version 1.1 * THANKS: Added Thanks to Damjan Lango * src/cdargs.cc: Fixed a bug when adding a directory to a file from the command line: it always added CWD because cur_list is empty. Now this test only takes place when the (n)curses enginge is running. 2001-09-26 Stefan Kamphausen * src/cdargs.cc: - added 'c' key to insert current directory - fixed a coredump in curses when adding a directory from the command line - rearranged the help screen for small terminal - fixed a missing 'break' in user_interaction which caused your listfile to shring when viewing the helpscreen - added history (using a C++ map) so that the current position is set when you re-enter an already visited directory. cdargs-1.35/COPYING0000644000076400001440000004311007354345614007433 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.