From 820acb981bdeb888efa7e5dc7e432de9f8df5598 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Fri, 6 Jan 2012 10:23:38 -0800 Subject: [PATCH] Fix to incorporate C++ build changes into configure.ac and Makefile.in --- Makefile.cpp | 1030 -------------------------------------------------- Makefile.in | 57 +-- configure.ac | 57 +-- 3 files changed, 40 insertions(+), 1104 deletions(-) delete mode 100644 Makefile.cpp diff --git a/Makefile.cpp b/Makefile.cpp deleted file mode 100644 index 6e9ce74da..000000000 --- a/Makefile.cpp +++ /dev/null @@ -1,1030 +0,0 @@ - -# Copyright (C) 2005-2006 Axel Liljencrantz -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. -# -# 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. -# - -# -# Makefile. Generated from Makefile.in by configure. -# - -# -# Makefile for the fish shell. Can build fish and associated -# applications, install them, recalculate dependencies and also create -# binary distributions in tar.bz2, tar.gz and rpm formats. -# - -# -# The fish buildprocess is quite complex. Do not stare directly into -# the Makefile. Doing so may cause nausea, dizziness and -# hallucinations. -# - - -# -# Programs -# - -CC := g++ -INSTALL:=/usr/bin/install -c - - -# -# Installation directories -# - -prefix = /usr/local -exec_prefix = ${prefix} -datadir = ${prefix}/share -bindir = ${exec_prefix}/bin -mandir = ${prefix}/share/man -sysconfdir = ${prefix}/etc -docdir = ${prefix}/share/doc/${PACKAGE_TARNAME} -localedir = ${prefix}/share/locale -prefix = /usr/local -optbindirs = - -# -# Various flags -# - - -MACROS = -DLOCALEDIR=\"$(localedir)\" -DPREFIX=L\"$(prefix)\" -DDATADIR=L\"$(datadir)\" -DSYSCONFDIR=L\"$(sysconfdir)\" -debug: CFLAGS = -O0 -g -std=c99 $(MACROS) -CPPFLAGS = -g -O0 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Wno-format-security $(MACROS) -# CPPFLAGS = -std=c99 -LDFLAGS = -LDFLAGS_FISH = ${LDFLAGS} -liconv -lncurses -rdynamic -LDFLAGS_FISH_INDENT = ${LDFLAGS} -lncurses -LDFLAGS_FISH_PAGER = ${LDFLAGS} -liconv -lncurses -LDFLAGS_FISHD = ${LDFLAGS} -liconv -lncurses -LDFLAGS_MIMEDB = ${LDFLAGS} -lncurses -LDFLAGS_SET_COLOR = ${LDFLAGS} -lncurses - -# -# Set to 1 if we have gettext -# - -HAVE_GETTEXT=0 - - -# -#Additional .cpp files used by common.o. These also have a corresponding -#.h file. -# - -COMMON_FILES := util.cpp halloc.cpp halloc_util.cpp fallback.cpp - -# -# All objects that the system needs to build fish, except fish.o -# - -FISH_OBJS := function.o builtin.o complete.o env.o exec.o expand.o \ - highlight.o history.o kill.o parser.o proc.o reader.o sanity.o \ - tokenizer.o wildcard.o wgetopt.o wutil.o input.o output.o intern.o \ - env_universal.o env_universal_common.o input_common.o event.o \ - signal.o io.o parse_util.o common.o screen.o path.o \ - parser_keywords.o iothread.o builtin_scripts.o - -FISH_INDENT_OBJS := fish_indent.o print_help.o common.o \ -parser_keywords.o wutil.o tokenizer.o - -# -# Additional files used by builtin.o -# - -BUILTIN_FILES := builtin_set.cpp builtin_commandline.cpp \ - builtin_ulimit.cpp builtin_complete.cpp builtin_jobs.cpp - - -# -# All objects that the system needs to build fish_pager -# - -FISH_PAGER_OBJS := fish_pager.o output.o wutil.o \ - input_common.o env_universal.o env_universal_common.o common.o \ - print_help.o iothread.o - - -# -# All objects that the system needs to build fish_tests -# - -FISH_TESTS_OBJS := $(FISH_OBJS) fish_tests.o - - -# -# All objects that the system needs to build fishd -# - -FISHD_OBJS := fishd.o env_universal_common.o wutil.o print_help.o \ - common.o - - -# -# All objects needed to build mimedb -# - -MIME_OBJS := mimedb.o print_help.o xdgmimealias.o xdgmime.o \ - xdgmimeglob.o xdgmimeint.o xdgmimemagic.o xdgmimeparent.o wutil.o \ - common.o - - -# -# Files containing user documentation -# - -# -# These files are the source files, they contain a few @FOO@-style substitutions -# - -HDR_FILES_SRC := doc_src/index.hdr.in doc_src/commands.hdr.in doc_src/design.hdr doc_src/license.hdr doc_src/faq.hdr - - -# -# These are the generated result files -# - -HDR_FILES := $(subst .hdr.in,.hdr,$(HDR_FILES_SRC)) - -# -# Internalized scripts -# - -GENERATED_INTERN_SCRIPT_FILES := builtin_scripts.h builtin_scripts.cpp - -# Use a pattern rule so that Make knows to only issue one invocation -# per http://www.gnu.org/software/make/manual/make.html#Pattern-Intro -builtin%scripts.h builtin%scripts.cpp: internalize_scripts.py - ./internalize_scripts.py share/functions/*.fish - -# -# Files containing documentation for external commands. -# - -HELP_SRC := $(wildcard doc_src/*.txt) - - -# -# Files in the test directory -# - -TEST_IN := $(wildcard tests/test*.in) - - -# -# Files that should be added to the tar archives -# - -# -# Files in ./doc_src/ -# - -DOC_SRC_DIR_FILES := $(HDR_FILES_SRC) $(HELP_SRC) - - -# -# Files in ./ -# - -MAIN_DIR_FILES_UNSORTED := Doxyfile Doxyfile.user Doxyfile.help.in \ - Makefile.in configure configure.ac config.h.in install-sh \ - set_color.cpp key_reader.cpp $(MIME_OBJS:.o=.h) \ - $(MIME_OBJS:.o=.cpp) $(FISH_OBJS:.o=.h) $(BUILTIN_FILES) \ - $(COMMON_FILES) $(COMMON_FILES:.cpp=.h) $(FISH_OBJS:.o=.cpp) \ - fish.spec.in INSTALL README user_doc.head.html xsel-0.9.6.tar \ - ChangeLog config.sub config.guess fish_tests.cpp fish.cpp fish_pager.cpp \ - fishd.cpp seq.in make_vcs_completions.fish $(FISH_INDENT_OBJS:.o=.cpp) - -# -# The sorting is not meaningful in itself, but it has the side effect -# of removing duplicates, which means there will be fewer warnings -# during building. -# - -MAIN_DIR_FILES := $(sort $(MAIN_DIR_FILES_UNSORTED)) - - -# -# Files in ./etc/ -# - -ETC_DIR_FILES :=etc/config.fish.in - - -# -# Files in ./share/ -# - -SHARE_DIR_FILES :=share/config.fish.in - - -# -# Files in ./tests/ -# - -TESTS_DIR_FILES := $(TEST_IN) $(TEST_IN:.in=.out) $(TEST_IN:.in=.err) \ - $(TEST_IN:.in=.status) tests/test.fish tests/gen_output.fish - - -# -# Files in ./share/completions/ -# - -COMPLETIONS_DIR_FILES := $(wildcard share/completions/*.fish) - - -# -# Files in ./share/functions/ -# - -FUNCTIONS_DIR_FILES := $(wildcard share/functions/*.fish) - - -# -# Programs to install -# - -SIMPLE_PROGRAMS := fish set_color mimedb fish_pager fishd fish_indent -PROGRAMS := $(SIMPLE_PROGRAMS) seq - - -# -# Manual pages to install -# - -MANUALS := $(addsuffix .1, $(addprefix share/man/, \ - $(SIMPLE_PROGRAMS))) - - -# -# All translation message catalogs -# - -TRANSLATIONS_SRC := $(wildcard po/*.po) -TRANSLATIONS := $(TRANSLATIONS_SRC:.po=.gmo) - - -# -# Make everything needed for installing fish -# - -#all: $(PROGRAMS) user_doc share/man etc/config.fish share/config.fish $(TRANSLATIONS) -# @echo fish has now been built. -# @echo Use \'$(MAKE) install\' to install fish. - -all: fish - - -.PHONY: all - - -# -# These dependencies make sure that autoconf and configure are run -# when the source code for the build configuration has changed. -# - -configure: configure.ac - ./config.status --recheck - -Makefile: Makefile.in configure - ./config.status - - -# -# Build fish with some debug flags specified. This is GCC specific, -# and should only be used when debuging fish. -# - -#debug: -# $(MAKE) fish CFLAGS="-g -O2 -std=c99 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Wno-format-security $(MACROS) -O0 -Werror -Wno-unused -Werror -g" -#.PHONY: debug - -debug: fish - -.PHONY: debug - -# -# User documentation, describing the features of the fish shell. -# - -# Depend on the sources (*.hdr.in) and manually make the -# intermediate *.hdr and doc.h files if needed - -user_doc: $(HDR_FILES_SRC) Doxyfile.user user_doc.head.html $(HELP_SRC) - $(MAKE) doc.h $(HDR_FILES) - doxygen Doxyfile.user - touch user_doc - - -# -# Source code documentation. Also includes user documentation. -# - -doc: *.h *.cpp doc.h Doxyfile - doxygen; - - -# -# PDF version of the source code documentation. -# - -doc/refman.pdf: doc - cd doc/latex; - make; - mv refman.pdf ..; - cd ../..; - rm -r doc/latex; - - -# -# This target runs both the low level code tests and the high level script tests. -# - -test: $(PROGRAMS) fish_tests - ./fish_tests; cd tests; ../fish " >>command_list.tmp; \ - cat $$i >>command_list.tmp; \ - echo >>command_list.tmp; \ - echo >>command_list.tmp; \ - echo "Back to index". >>command_list.tmp; \ - done - mv command_list.tmp command_list.txt - cat $@.in | awk '{if ($$0 ~ /@command_list@/){ system("cat command_list.txt");} else{ print $$0;}}' >$@ - - -toc.txt: $(subst index.hdr,index.hdr.in,$(HDR_FILES)) - -rm toc.tmp $@ - for i in $(subst index.hdr,index.hdr.in,$(HDR_FILES)); do\ - NAME=`basename $$i .hdr`; \ - NAME=`basename $$NAME .hdr.in`; \ - sed <$$i >>toc.tmp -n \ - -e 's,.*\\page *\([^ ]*\) *\(.*\)$$,- \2,p' \ - -e 's,.*\\section *\([^ ]*\) *\(.*\)$$, - \2,p'; \ - done - mv toc.tmp $@ - -doc_src/index.hdr: toc.txt doc_src/index.hdr.in - cat $@.in | awk '{if ($$0 ~ /@toc@/){ system("cat toc.txt");} else{ print $$0;}}' >$@ - - -# -# doc.h is a compilation of the various snipptes of text used both for -# the user documentation and for internal help functions into a single -# file that can be parsed dy Doxygen to generate the user -# documentation. -# - -doc.h: $(HDR_FILES) - cat $(HDR_FILES) >$@ - -# -# This rule creates complete doxygen headers from each of the various -# snipptes of text used both for the user documentation and for -# internal help functions, that can be parsed to Doxygen to generate -# the internal help function text. -# - -%.doxygen:%.txt - echo "/** \page " `basename $*` >$@; - cat $*.txt >>$@; - echo "*/" >>$@ - -%: %.in - sed <$@.in >$@ \ - -e "s,@sysconfdir\@,$(sysconfdir),g" \ - -e "s,@datadir\@,$(datadir),g" \ - -e "s,@docdir\@,$(docdir),g" \ - -e "s|@configure_input\@|$@, generated from $@.in by the Makefile. DO NOT MANUALLY EDIT THIS FILE!|g" \ - -e "s,@prefix\@,$(prefix),g" \ - -e "s,@optbindirs\@,$(optbindirs),g" -#-e "s,@\@,$()," - - -# -# Compile translation files to binary format -# - -%.gmo: - if test "$(HAVE_GETTEXT)" = 1; then \ - msgfmt -o $*.gmo $*.po; \ - fi - - -# -# Update existing po file or copy messages.pot -# - -%.po:messages.pot - if test $(HAVE_GETTEXT) = 1;then \ - if test -f $*.po; then \ - msgmerge -U --backup=existing $*.po messages.pot;\ - else \ - cp messages.pot $*.po;\ - fi; \ - fi - - -# -# Create a template translation object -# - -messages.pot: *.cpp *.h etc/*.in share/*.in share/completions/*.fish share/functions/*.fish seq - if test $(HAVE_GETTEXT) = 1;then \ - xgettext -k_ -kN_ *.cpp *.h -o messages.pot; \ - if xgettext -j -k_ -kN_ -k--description -LShell etc/*.in share/*.in share/completions/*.fish share/functions/*.fish seq -o messages.pot; then true; else \ - echo "Your xgettext version is too old to build the messages.pot file"\ - rm messages.pot\ - false;\ - fi; \ - fi - -builtin.o: $(BUILTIN_FILES) - -common.o: $(COMMON_FILES) - - -# -# Generate the internal help functions by making doxygen create -# man-pages. The convertion path looks like this: -# -# .txt file -# || -# (make) -# || -# \/ -# .doxygen file -# || -# (doxygen) -# || -# \/ -# roff file -# || -# (__fish_print_help) -# || -# \/ -# formated text -# with escape -# sequences -# -# -# There ought to be something simpler. -# - -share/man: $(HELP_SRC) - -rm doc_src/*.doxygen # Remove temp files from previous run - -rm -r help_doc - -mkdir share/man - touch share/man - for i in $(HELP_SRC); do \ - FILE=doc_src/`basename $$i .txt`.doxygen; \ - echo "/** \page" `basename $$i .txt` >$$FILE; \ - cat $$i >>$$FILE; \ - echo "*/" >>$$FILE; \ - done - doxygen Doxyfile.help - for i in $(HELP_SRC); do \ - CMD_NAME=`basename $$i .txt`; \ - sed -e "s/\(.\)\\.SH/\1/" -e "s/$$CMD_NAME *\\\\- *\"\(.*\)\"/\1/" share/man/$$CMD_NAME.1; \ - done - rm doc_src/*.doxygen # Clean up intermediate files in doc_src/ - rm -r help_doc # Clean up intermediate help_doc tree - -# -# The build rules for installing/uninstalling fish -# - -# -# Check for an incompatible installed fish version, and fail with an -# error if found -# - -check-uninstall: - if test -f $(DESTDIR)$(sysconfdir)/fish.d/fish_function.fish -o -f $(DESTDIR)$(sysconfdir)/fish.d/fish_complete.fish; then \ - echo;\ - echo ERROR;\ - echo;\ - echo An older fish installation using an incompatible filesystem hierarchy was detected;\ - echo You must uninstall this fish version before proceeding;\ - echo type \'$(MAKE) uninstall-legacy\' to uninstall these files,;\ - echo or type \'$(MAKE) force-install\' to force installation.;\ - echo The latter may result in a broken installation.;\ - echo;\ - false;\ - fi; - if test -f $(DESTDIR)$(sysconfdir)/fish; then \ - echo;\ - echo ERROR;\ - echo;\ - echo An older fish installation using an incompatible filesystem hierarchy was detected;\ - echo You must remove the file $(DESTDIR)$(sysconfdir)/fish before proceeding;\ - echo type \'$(MAKE) uninstall-legacy\' to uninstall this file,;\ - echo or remove it manually using \'rm $(DESTDIR)$(sysconfdir)/fish\'.;\ - echo;\ - false;\ - fi; -.PHONY: check-uninstall - - -# -# This check makes sure that the install-sh script is executable. The -# darcs repo doesn't preserve the executable bit, so this needs to be -# run after checkout. -# - -install-sh: - if test -x $@; then true; else chmod 755 $@; fi -.PHONY: install-sh - - -# -# Try to install after checking for incompatible installed versions. -# - -install: all install-sh check-uninstall install-force -.PHONY: install - - -# -# Force installation, even in presense of incompatible previous -# version. This may fail. -# - -install-force: all install-translations - $(INSTALL) -m 755 -d $(DESTDIR)$(bindir) - for i in $(PROGRAMS); do\ - $(INSTALL) -m 755 $$i $(DESTDIR)$(bindir) ; \ - done; - $(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish - $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish - $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/completions - $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/functions - $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/man - $(INSTALL) -m 644 etc/config.fish $(DESTDIR)$(sysconfdir)/fish/ - $(INSTALL) -m 644 share/config.fish $(DESTDIR)$(datadir)/fish/ - for i in $(COMPLETIONS_DIR_FILES); do \ - $(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/completions/; \ - done; - for i in $(FUNCTIONS_DIR_FILES); do \ - $(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/functions/; \ - done; - for i in share/man/*.1; do \ - $(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/man/; \ - done; - $(INSTALL) -m 755 -d $(DESTDIR)$(docdir) - for i in user_doc/html/* ChangeLog; do \ - if test -f $$i; then \ - $(INSTALL) -m 644 $$i $(DESTDIR)$(docdir); \ - fi; \ - done; - $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1 - for i in $(MANUALS); do \ - $(INSTALL) -m 644 $$i $(DESTDIR)$(mandir)/man1/; \ - done; - @echo fish is now installed on your system. - @echo To run fish, type \'fish\' in your terminal. - @echo - @echo To use fish as your login shell: - @echo \* add the line \'$(DESTDIR)$(bindir)/fish\' to the file \'/etc/shells\'. - @echo \* use the command \'chsh -s $(DESTDIR)$(bindir)/fish\'. - @echo - @echo Have fun! -.PHONY: install-force - - -# -# Uninstall this fish version -# - -uninstall: uninstall-translations - -for i in $(PROGRAMS); do \ - rm -f $(DESTDIR)$(bindir)/$$i; \ - done; - -rm -f $(DESTDIR)$(bindir)/xsel - -rm -f $(DESTDIR)$(sysconfdir)/fish/config.fish - -rmdir $(DESTDIR)$(sysconfdir)/fish - -if test -d $(DESTDIR)$(datadir)/fish; then \ - rm -r $(DESTDIR)$(datadir)/fish; \ - fi - -if test -d $(DESTDIR)$(docdir); then \ - rm -r $(DESTDIR)$(docdir);\ - fi - -for i in $(MANUALS); do \ - rm -f $(DESTDIR)$(mandir)/man1/`basename $$i`*; \ - done; -.PHONY: uninstall - - -# -# Uninstall an older fish release. This is not the default uninstall -# since there is a slight chance that it removes a file put in place by -# the sysadmin. But if 'make install' detects a file confligt, it -# suggests using this target. -# - -uninstall-legacy: uninstall - -rm -f $(DESTDIR)$(sysconfdir)/fish.d/fish_interactive.fish - -rm -f $(DESTDIR)$(sysconfdir)/fish.d/fish_complete.fish - -rm -f $(DESTDIR)$(sysconfdir)/fish.d/fish_function.fish - -rm -f $(DESTDIR)$(sysconfdir)/fish/fish_inputrc - -if test -d $(DESTDIR)$(sysconfdir)/fish.d/completions; then \ - for i in $(COMPLETIONS_DIR_FILES); do \ - basename=`basename $$i`; \ - if test -f $(DESTDIR)$(sysconfdir)/fish.d/completions/$$basename; then \ - rm $(DESTDIR)$(sysconfdir)/fish.d/completions/$$basename; \ - fi; \ - done; \ - fi; - -rmdir $(DESTDIR)$(sysconfdir)/fish.d/completions - -rmdir $(DESTDIR)$(sysconfdir)/fish.d - -rm $(DESTDIR)$(sysconfdir)/fish - @echo The previous fish installation has been removed. -.PHONY: uninstall-legacy - -install-translations: $(TRANSLATIONS) - if test $(HAVE_GETTEXT) = 1; then \ - for i in $(TRANSLATIONS); do \ - $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/locale/`basename $$i .gmo`/LC_MESSAGES; \ - $(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/locale/`basename $$i .gmo`/LC_MESSAGES/fish.mo; \ - echo $(DESTDIR)$(datadir)/locale/`basename $$i .gmo`/LC_MESSAGES/fish.mo;\ - done; \ - fi; -.PHONY: install-translations - -uninstall-translations: - if test $(HAVE_GETTEXT) = 1; then \ - for i in $(TRANSLATIONS_SRC); do \ - rm -f $(DESTDIR)$(datadir)/locale/*/LC_MESSAGES/fish.mo; \ - done; \ - fi -.PHONY: uninstall-translations - - -# -# The build rules for all the commands -# - -# -# Build the fish program. -# - -fish: $(FISH_OBJS) fish.o - $(CC) $(FISH_OBJS) fish.o $(LDFLAGS_FISH) -o $@ - - -# -# Build the fish_pager program. -# - -fish_pager: $(FISH_PAGER_OBJS) - $(CC) $(FISH_PAGER_OBJS) $(LDFLAGS_FISH_PAGER) -o $@ - - -# -# Build the fishd program. -# - -fishd: $(FISHD_OBJS) - $(CC) $(FISHD_OBJS) $(LDFLAGS_FISHD) -o $@ - - -# -# Build the fish_tests program. -# - -fish_tests: $(FISH_TESTS_OBJS) - $(CC) $(FISH_TESTS_OBJS) $(LDFLAGS_FISH) -o $@ - - -# -# Build the mimedb program. -# -# mimedb does not need any libraries, so we don't use LDFLAGS here. -# - -mimedb: $(MIME_OBJS) - $(CC) $(MIME_OBJS) $(LDFLAGS_MIMEDB) -o $@ - - -# -# Build the set_color program -# - -set_color: set_color.o print_help.o common.o - $(CC) set_color.o print_help.o common.o wutil.o $(LDFLAGS_SET_COLOR) -o $@ - - -# -# Test program for the tokenizer library -# - -tokenizer_test: tokenizer.cpp tokenizer.h wutil.o common.o - $(CC) $(CFLAGS) tokenizer.cpp wutil.o common.o -D TOKENIZER_TEST $(LDFLAGS) -o $@ - - -# -# Build the fish_indent program. -# - -fish_indent: $(FISH_INDENT_OBJS) - $(CC) $(FISH_INDENT_OBJS) $(LDFLAGS_FISH_INDENT) -o $@ - - -# -# Neat little program to show output from terminal -# - -key_reader: key_reader.o input_common.o common.o env_universal.o env_universal_common.o wutil.o - $(CC) key_reader.o input_common.o common.o env_universal.o env_universal_common.o wutil.o $(LDFLAGS_FISH) -o $@ - - -# -# Update dependencies -# -depend: - makedepend -fMakefile.in -Y *.cpp - ./config.status -.PHONY: depend - -# -# Copy all the source files into a new directory and use tar to create -# an archive from it. Simplest way I could think of to make an archive -# witout backups, autogenerated files, etc. -# -# Uses install instead of mkdir so build won't fail if the directory -# exists -# - -fish-1.23.1.tar: $(DOC_SRC_DIR_FILES) $(MAIN_DIR_FILES) $(ETC_DIR_FILES) $(TEST_DIR_FILES) $(SHARE_DIR_FILES) $(FUNCTIONS_DIR_FILES) $(COMPLETIONS_DIR_FILES) ChangeLog user_doc share/man - rm -rf fish-1.23.1 - $(INSTALL) -d fish-1.23.1 - $(INSTALL) -d fish-1.23.1/doc_src - $(INSTALL) -d fish-1.23.1/user_doc - $(INSTALL) -d fish-1.23.1/etc - $(INSTALL) -d fish-1.23.1/share - $(INSTALL) -d fish-1.23.1/share/completions - $(INSTALL) -d fish-1.23.1/share/functions - $(INSTALL) -d fish-1.23.1/share/man - $(INSTALL) -d fish-1.23.1/tests - $(INSTALL) -d fish-1.23.1/po - cp -f $(DOC_SRC_DIR_FILES) fish-1.23.1/doc_src - cp -f $(MAIN_DIR_FILES) fish-1.23.1/ - cp -f $(ETC_DIR_FILES) fish-1.23.1/etc/ - cp -f $(SHARE_DIR_FILES) fish-1.23.1/share/ - cp -f $(COMPLETIONS_DIR_FILES) fish-1.23.1/share/completions/ - cp -f $(FUNCTIONS_DIR_FILES) fish-1.23.1/share/functions/ - cp -f $(TESTS_DIR_FILES) fish-1.23.1/tests/ - cp -f $(TRANSLATIONS_SRC) fish-1.23.1/po/ - cp -f share/man/*.1 fish-1.23.1/share/man/ - cp -rf user_doc fish-1.23.1/ - tar -c fish-1.23.1 >fish-1.23.1.tar - rm -rf fish-1.23.1 - - -# -# Just an alias for fish-1.23.1.tar -# - -tar: fish-1.23.1.tar -.PHONY: tar - - -# -# Make compressed tar archives -# - -fish-1.23.1.tar.gz: fish-1.23.1.tar - gzip -f --best -c fish-1.23.1.tar >fish-1.23.1.tar.gz - -fish-1.23.1.tar.bz2: fish-1.23.1.tar - bzip2 -f --best -k fish-1.23.1.tar - -dist: fish-1.23.1.tar.bz2 -.PHONY: dist - -# -# Build the RPM spec file. -# - -fish.spec: fish.spec.in - ./config.status - - - -# -# Create .rpm file for the current systems architecture and an -# .src.rpm file. -# - -rpm: fish-1.23.1.tar.bz2 fish.spec - @if which rpmbuild; then true; else \ - echo Could not find the rpmbuild command, needed to build an rpm; \ - echo You may be able to install it using the following command:; \ - echo \'yum install rpm-build\'; \ - false; \ - fi - cp fish.spec /usr/src/redhat/SPECS/ - cp fish-1.23.1.tar.bz2 /usr/src/redhat/SOURCES/ - rpmbuild -ba --clean /usr/src/redhat/SPECS/fish.spec - mv /usr/src/redhat/RPMS/*/fish*1.23.1*.rpm . - mv /usr/src/redhat/SRPMS/fish*1.23.1*.src.rpm . -.PHONY: rpm - - -# -# Cleanup targets -# - -# -# distclean should restore the tree to the state right after extracting a tarball. -# - -distclean: clean - rm -f fish.spec Doxyfile.help - rm -f etc/config.fish seq share/config.fish - rm -f config.status config.log config.h Makefile -.PHONY: distclean - - -# -# clean removes everything built by the makefile, but not things that -# are created by the configure script. -# - -clean: - rm -f *.o doc.h doc.tmp doc_src/*.doxygen doc_src/*.cpp doc_src/*.o doc_src/commands.hdr - rm -f $(GENERATED_INTERN_SCRIPT_FILES) - rm -f tests/tmp.err tests/tmp.out tests/tmp.status tests/foo.txt - rm -f $(PROGRAMS) fish_tests tokenizer_test key_reader - rm -f share/config.fish etc/config.fish doc_src/index.hdr doc_src/commands.hdr - rm -f fish-1.23.1.tar - rm -f fish-1.23.1.tar.gz - rm -f fish-1.23.1.tar.bz2 - rm -rf doc; - rm -rf fish-1.23.1 - rm -rf xsel-0.9.6/ - rm -f $(TRANSLATIONS) -.PHONY: clean - - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -builtin.o: config.h fallback.h util.h wutil.h builtin.h io.h function.h -builtin.o: complete.h proc.h parser.h event.h common.h reader.h env.h -builtin.o: wgetopt.h sanity.h tokenizer.h wildcard.h input_common.h input.h -builtin.o: intern.h signal.h exec.h highlight.h halloc.h halloc_util.h -builtin.o: parse_util.h parser_keywords.h expand.h path.h builtin_set.cpp -builtin.o: builtin_commandline.cpp builtin_complete.cpp builtin_ulimit.cpp -builtin.o: builtin_jobs.cpp -builtin_commandline.o: config.h signal.h fallback.h util.h wutil.h builtin.h -builtin_commandline.o: io.h common.h wgetopt.h reader.h proc.h parser.h -builtin_commandline.o: event.h tokenizer.h input_common.h input.h -builtin_commandline.o: parse_util.h -builtin_complete.o: config.h signal.h fallback.h util.h wutil.h builtin.h -builtin_complete.o: io.h common.h complete.h wgetopt.h parser.h proc.h -builtin_complete.o: event.h reader.h -builtin_jobs.o: config.h fallback.h util.h wutil.h builtin.h io.h proc.h -builtin_jobs.o: parser.h event.h common.h wgetopt.h -builtin_scripts.o: builtin_scripts.h -builtin_set.o: config.h signal.h fallback.h util.h wutil.h builtin.h io.h -builtin_set.o: env.h common.h expand.h wgetopt.h proc.h parser.h event.h -builtin_ulimit.o: config.h fallback.h util.h builtin.h io.h common.h -builtin_ulimit.o: wgetopt.h -common.o: config.h fallback.h util.h wutil.h common.h expand.h proc.h io.h -common.o: wildcard.h parser.h event.h util.cpp halloc.cpp halloc.h -common.o: halloc_util.cpp fallback.cpp -complete.o: config.h signal.h fallback.h util.h tokenizer.h wildcard.h -complete.o: common.h proc.h io.h parser.h event.h function.h complete.h -complete.o: builtin.h env.h exec.h expand.h reader.h history.h intern.h -complete.o: parse_util.h parser_keywords.h halloc.h halloc_util.h wutil.h -complete.o: path.h -env.o: config.h signal.h fallback.h util.h wutil.h proc.h io.h common.h env.h -env.o: sanity.h expand.h history.h reader.h parser.h event.h env_universal.h -env.o: env_universal_common.h input_common.h path.h halloc.h halloc_util.h -env.o: complete.h -env_universal.o: config.h signal.h fallback.h util.h common.h wutil.h -env_universal.o: env_universal_common.h env_universal.h -env_universal_common.o: config.h signal.h fallback.h util.h common.h wutil.h -env_universal_common.o: env_universal_common.h -event.o: config.h signal.h fallback.h util.h wutil.h function.h proc.h io.h -event.o: parser.h event.h common.h halloc_util.h -exec.o: config.h signal.h fallback.h util.h common.h wutil.h proc.h io.h -exec.o: exec.h parser.h event.h builtin.h function.h env.h wildcard.h -exec.o: sanity.h expand.h halloc.h halloc_util.h parse_util.h -expand.o: config.h signal.h fallback.h util.h common.h wutil.h env.h proc.h -expand.o: io.h parser.h event.h expand.h wildcard.h exec.h tokenizer.h -expand.o: complete.h parse_util.h halloc.h halloc_util.h -fallback.o: config.h fallback.h util.h -fish.o: config.h signal.h fallback.h util.h common.h reader.h io.h builtin.h -fish.o: function.h complete.h wutil.h env.h sanity.h proc.h parser.h event.h -fish.o: expand.h intern.h exec.h output.h halloc.h halloc_util.h history.h -fish.o: path.h -fish_indent.o: config.h fallback.h util.h common.h wutil.h halloc.h -fish_indent.o: halloc_util.h tokenizer.h print_help.h parser_keywords.h -fish_pager.o: config.h signal.h fallback.h util.h wutil.h common.h complete.h -fish_pager.o: output.h input_common.h env_universal.h env_universal_common.h -fish_pager.o: halloc.h halloc_util.h print_help.h -fish_tests.o: config.h signal.h fallback.h util.h common.h proc.h io.h -fish_tests.o: reader.h builtin.h function.h complete.h wutil.h env.h expand.h -fish_tests.o: parser.h event.h tokenizer.h output.h exec.h path.h halloc.h -fish_tests.o: halloc_util.h -fishd.o: config.h signal.h fallback.h util.h common.h wutil.h -fishd.o: env_universal_common.h halloc.h halloc_util.h path.h print_help.h -function.o: config.h signal.h wutil.h fallback.h util.h function.h proc.h -function.o: io.h parser.h event.h common.h intern.h reader.h parse_util.h -function.o: parser_keywords.h env.h expand.h halloc.h halloc_util.h -halloc.o: config.h fallback.h util.h common.h halloc.h -halloc_util.o: config.h fallback.h util.h common.h halloc.h -highlight.o: config.h signal.h fallback.h util.h wutil.h highlight.h env.h -highlight.o: common.h tokenizer.h proc.h io.h parser.h event.h parse_util.h -highlight.o: parser_keywords.h builtin.h function.h expand.h sanity.h -highlight.o: complete.h output.h halloc.h halloc_util.h wildcard.h path.h -history.o: config.h fallback.h util.h wutil.h history.h common.h halloc.h -history.o: halloc_util.h intern.h path.h signal.h -input.o: config.h signal.h fallback.h util.h wutil.h reader.h io.h proc.h -input.o: common.h sanity.h input_common.h input.h parser.h event.h env.h -input.o: expand.h output.h intern.h halloc.h halloc_util.h -input_common.o: config.h fallback.h util.h common.h wutil.h input_common.h -input_common.o: env_universal.h env_universal_common.h iothread.h -intern.o: config.h fallback.h util.h wutil.h common.h intern.h -io.o: config.h fallback.h util.h wutil.h exec.h proc.h io.h common.h halloc.h -iothread.o: iothread.h -key_reader.o: config.h fallback.h input_common.h -kill.o: config.h signal.h fallback.h util.h wutil.h kill.h proc.h io.h -kill.o: sanity.h common.h env.h exec.h halloc.h path.h -mimedb.o: config.h xdgmime.h fallback.h util.h print_help.h -output.o: config.h signal.h fallback.h util.h wutil.h expand.h common.h -output.o: output.h halloc_util.h highlight.h env.h -parse_util.o: config.h fallback.h util.h wutil.h common.h tokenizer.h -parse_util.o: parse_util.h expand.h intern.h exec.h proc.h io.h env.h -parse_util.o: signal.h wildcard.h halloc_util.h builtin_scripts.h -parser.o: config.h signal.h fallback.h util.h common.h wutil.h proc.h io.h -parser.o: parser.h event.h parser_keywords.h tokenizer.h exec.h wildcard.h -parser.o: function.h builtin.h env.h expand.h reader.h sanity.h -parser.o: env_universal.h env_universal_common.h intern.h parse_util.h -parser.o: halloc.h halloc_util.h path.h -parser_keywords.o: config.h fallback.h common.h util.h parser_keywords.h -path.o: config.h fallback.h util.h common.h env.h wutil.h halloc.h -path.o: halloc_util.h path.h expand.h -print_help.o: print_help.h -proc.o: config.h signal.h fallback.h util.h wutil.h proc.h io.h common.h -proc.o: reader.h sanity.h env.h parser.h event.h halloc.h halloc_util.h -proc.o: output.h -reader.o: config.h signal.h fallback.h util.h wutil.h highlight.h env.h -reader.o: common.h reader.h io.h proc.h parser.h event.h complete.h history.h -reader.o: sanity.h exec.h expand.h tokenizer.h kill.h input_common.h input.h -reader.o: function.h output.h screen.h halloc.h halloc_util.h iothread.h -reader.o: parse_util.h -sanity.o: config.h signal.h fallback.h util.h common.h sanity.h proc.h io.h -sanity.o: history.h reader.h kill.h wutil.h -screen.o: config.h fallback.h common.h util.h wutil.h output.h highlight.h -screen.o: env.h screen.h -set_color.o: config.h fallback.h print_help.h -signal.o: config.h signal.h common.h util.h fallback.h wutil.h event.h -signal.o: reader.h io.h proc.h -tokenizer.o: config.h fallback.h util.h wutil.h tokenizer.h common.h -util.o: config.h fallback.h util.h common.h wutil.h -wgetopt.o: config.h wgetopt.h wutil.h fallback.h -wildcard.o: config.h fallback.h util.h wutil.h complete.h common.h wildcard.h -wildcard.o: reader.h io.h expand.h exec.h proc.h halloc_util.h -wutil.o: config.h fallback.h util.h common.h wutil.h halloc.h halloc_util.h -xdgmime.o: xdgmime.h xdgmimeint.h xdgmimeglob.h xdgmimemagic.h xdgmimealias.h -xdgmime.o: xdgmimeparent.h -xdgmimealias.o: xdgmimealias.h xdgmime.h xdgmimeint.h -xdgmimeglob.o: xdgmimeglob.h xdgmime.h xdgmimeint.h -xdgmimeint.o: xdgmimeint.h xdgmime.h -xdgmimemagic.o: xdgmimemagic.h xdgmime.h xdgmimeint.h -xdgmimeparent.o: xdgmimeparent.h xdgmime.h xdgmimeint.h diff --git a/Makefile.in b/Makefile.in index 8ab91a706..87cc87ae8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -38,7 +38,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ # Programs # -CC := @CC@ +CC := @CPP@ INSTALL:=@INSTALL@ @@ -63,8 +63,7 @@ optbindirs = @optbindirs@ # MACROS = -DLOCALEDIR=\"$(localedir)\" -DPREFIX=L\"$(prefix)\" -DDATADIR=L\"$(datadir)\" -DSYSCONFDIR=L\"$(sysconfdir)\" -CFLAGS = @CFLAGS@ $(MACROS) $(EXTRA_CFLAGS) -CPPFLAGS = @CPPFLAGS@ +CXXFLAGS = @CXXFLAGS@ $(MACROS) $(EXTRA_CXXFLAGS) LDFLAGS = @LIBS@ @LDFLAGS@ LDFLAGS_FISH = ${LDFLAGS} @LIBS_FISH@ @LDFLAGS_FISH@ LDFLAGS_FISH_INDENT = ${LDFLAGS} @LIBS_FISH_INDENT@ @@ -81,11 +80,11 @@ HAVE_GETTEXT=@HAVE_GETTEXT@ # -#Additional .c files used by common.o. These also have a corresponding +#Additional .cpp files used by common.o. These also have a corresponding #.h file. # -COMMON_FILES := util.c halloc.c halloc_util.c fallback.c +COMMON_FILES := util.cpp halloc.cpp halloc_util.cpp fallback.cpp # @@ -97,7 +96,7 @@ FISH_OBJS := function.o builtin.o complete.o env.o exec.o expand.o \ tokenizer.o wildcard.o wgetopt.o wutil.o input.o output.o intern.o \ env_universal.o env_universal_common.o input_common.o event.o \ signal.o io.o parse_util.o common.o screen.o path.o \ - parser_keywords.o + parser_keywords.o iothread.o builtin_scripts.o FISH_INDENT_OBJS := fish_indent.o print_help.o common.o \ parser_keywords.o wutil.o tokenizer.o @@ -106,8 +105,8 @@ parser_keywords.o wutil.o tokenizer.o # Additional files used by builtin.o # -BUILTIN_FILES := builtin_set.c builtin_commandline.c \ - builtin_ulimit.c builtin_complete.c builtin_jobs.c +BUILTIN_FILES := builtin_set.cpp builtin_commandline.cpp \ + builtin_ulimit.cpp builtin_complete.cpp builtin_jobs.cpp # @@ -116,7 +115,7 @@ BUILTIN_FILES := builtin_set.c builtin_commandline.c \ FISH_PAGER_OBJS := fish_pager.o output.o wutil.o \ input_common.o env_universal.o env_universal_common.o common.o \ - print_help.o + print_help.o iothread.o # @@ -160,6 +159,18 @@ HDR_FILES_SRC := doc_src/index.hdr.in doc_src/commands.hdr.in doc_src/design.hdr HDR_FILES := $(subst .hdr.in,.hdr,$(HDR_FILES_SRC)) +# +# Internalized scripts +# + +GENERATED_INTERN_SCRIPT_FILES := builtin_scripts.h builtin_scripts.cpp + +# Use a pattern rule so that Make knows to only issue one invocation +# per http://www.gnu.org/software/make/manual/make.html#Pattern-Intro +builtin%scripts.h builtin%scripts.cpp: internalize_scripts.py + ./internalize_scripts.py share/functions/*.fish + + # # Files containing documentation for external commands. # @@ -191,12 +202,12 @@ DOC_SRC_DIR_FILES := $(HDR_FILES_SRC) $(HELP_SRC) MAIN_DIR_FILES_UNSORTED := Doxyfile Doxyfile.user Doxyfile.help.in \ Makefile.in configure configure.ac config.h.in install-sh \ - set_color.c key_reader.c $(MIME_OBJS:.o=.h) \ - $(MIME_OBJS:.o=.c) $(FISH_OBJS:.o=.h) $(BUILTIN_FILES) \ - $(COMMON_FILES) $(COMMON_FILES:.c=.h) $(FISH_OBJS:.o=.c) \ + set_color.cpp key_reader.cpp $(MIME_OBJS:.o=.h) \ + $(MIME_OBJS:.o=.cpp) $(FISH_OBJS:.o=.h) $(BUILTIN_FILES) \ + $(COMMON_FILES) $(COMMON_FILES:.cpp=.h) $(FISH_OBJS:.o=.cpp) \ fish.spec.in INSTALL README user_doc.head.html xsel-0.9.6.tar \ - ChangeLog config.sub config.guess fish_tests.c fish.c fish_pager.c \ - fishd.c seq.in make_vcs_completions.fish $(FISH_INDENT_OBJS:.o=.c) + ChangeLog config.sub config.guess fish_tests.cpp fish.cpp fish_pager.cpp \ + fishd.cpp seq.in make_vcs_completions.fish $(FISH_INDENT_OBJS:.o=.cpp) # # The sorting is not meaningful in itself, but it has the side effect @@ -302,11 +313,11 @@ Makefile: Makefile.in configure # debug: - $(MAKE) all EXTRA_CFLAGS="-O0 -Wno-unused -Werror -g" + $(MAKE) all EXTRA_CXXFLAGS="-O0 -Wno-unused -Werror -g" .PHONY: debug prof: - $(MAKE) all EXTRA_CFLAGS="-pg" LDFLAGS="-pg" + $(MAKE) all EXTRA_CXXFLAGS="-pg" LDFLAGS="-pg" .PHONY: prof # @@ -326,7 +337,7 @@ user_doc: $(HDR_FILES_SRC) Doxyfile.user user_doc.head.html $(HELP_SRC) # Source code documentation. Also includes user documentation. # -doc: *.h *.c doc.h Doxyfile +doc: *.h *.cpp doc.h Doxyfile doxygen; @@ -453,9 +464,9 @@ doc.h: $(HDR_FILES) # Create a template translation object # -messages.pot: *.c *.h etc/*.in share/*.in share/completions/*.fish share/functions/*.fish seq +messages.pot: *.cpp *.h etc/*.in share/*.in share/completions/*.fish share/functions/*.fish seq if test $(HAVE_GETTEXT) = 1;then \ - xgettext -k_ -kN_ *.c *.h -o messages.pot; \ + xgettext -k_ -kN_ *.cpp *.h -o messages.pot; \ if xgettext -j -k_ -kN_ -k--description -LShell etc/*.in share/*.in share/completions/*.fish share/functions/*.fish seq -o messages.pot; then true; else \ echo "Your xgettext version is too old to build the messages.pot file"\ rm messages.pot\ @@ -742,8 +753,8 @@ set_color: set_color.o print_help.o common.o # Test program for the tokenizer library # -tokenizer_test: tokenizer.c tokenizer.h wutil.o common.o - $(CC) $(CFLAGS) tokenizer.c wutil.o common.o -D TOKENIZER_TEST $(LDFLAGS) -o $@ +tokenizer_test: tokenizer.cpp tokenizer.h wutil.o common.o + $(CC) $(CXXFLAGS) tokenizer.cpp wutil.o common.o -D TOKENIZER_TEST $(LDFLAGS) -o $@ # @@ -766,7 +777,7 @@ key_reader: key_reader.o input_common.o common.o env_universal.o env_universal_c # Update dependencies # depend: - makedepend -fMakefile.in -Y *.c + makedepend -fMakefile.in -Y *.cpp ./config.status .PHONY: depend @@ -877,7 +888,7 @@ distclean: clean # clean: - rm -f *.o doc.h doc.tmp doc_src/*.doxygen doc_src/*.c doc_src/*.o doc_src/commands.hdr + rm -f *.o doc.h doc.tmp doc_src/*.doxygen doc_src/*.cpp doc_src/*.o doc_src/commands.hdr rm -f tests/tmp.err tests/tmp.out tests/tmp.status tests/foo.txt rm -f $(PROGRAMS) fish_tests tokenizer_test key_reader rm -f share/config.fish etc/config.fish doc_src/index.hdr doc_src/commands.hdr diff --git a/configure.ac b/configure.ac index 377ab5ebe..1863304cc 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,7 @@ for i in /usr/pkg /sw /opt /opt/local; do AC_MSG_CHECKING([for $i/include include directory]) if test -d $i/include; then AC_MSG_RESULT(yes) - CPPFLAGS="$CPPFLAGS -I$i/include/" + CXXFLAGS="$CXXFLAGS -I$i/include/" CFLAGS="$CFLAGS -I$i/include/" else AC_MSG_RESULT(no) @@ -159,10 +159,7 @@ AH_BOTTOM([#if __GNUC__ >= 3 # Set up various programs needed for install # -# Here we look for c99 before cc as Sun Studio compiler supports c99 -# through the c99 binary. - -AC_PROG_CC([gcc c99 cc]) +AC_PROG_CC([g++ cpp]) AC_PROG_CPP AC_PROG_INSTALL @@ -239,55 +236,13 @@ if test x$local_gettext != xno; then fi -# -# Test if the compiler accepts the -std=c99 flag. If so, using it -# increases the odds of correct compilation, since we want to use the -# *wprintf functions, which where defined in C99. -# -# NOTE: Never versions of autoconf has AC_CHECK_PROG_CC_C99 -# - -if test "$CC" != "c99"; then - XCFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -std=c99" - XCPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -std=c99" - AC_MSG_CHECKING(if -std=c99 works) - - AC_CACHE_VAL( - local_cv_has__std_c99, - [ - AC_TRY_RUN( - [ - #include - #include - - int main() - { - return 0; - } - ], - local_cv_has__std_c99=yes, - local_cv_has__std_c99=no, - ) - ] - ) - - AC_MSG_RESULT($local_cv_has__std_c99) - case x$local_cv_has__std_c99 in - xno) - CFLAGS="$XCFLAGS" - CPPFLAGS="$XCPPFLAGS" ;; - esac -fi - # # Try to enable large file support. This will make sure that on systems # where off_t can be either 32 or 64 bit, the latter size is used. On # other systems, this should do nothing. (Hopefully) # -CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64" +CXXFLAGS="$CXXFLAGS -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64" # # If we are using gcc, set some flags that increase the odds of the @@ -306,14 +261,14 @@ if test "$GCC" = yes; then # bug has been verified to not exist on Linux using GCC 3.3.3. # - CFLAGS="$CFLAGS -fno-optimize-sibling-calls" + CXXFLAGS="$CXXFLAGS -fno-optimize-sibling-calls" # # -Wall is there to keep me on my toes # - CFLAGS="$CFLAGS -Wall" + CXXFLAGS="$CXXFLAGS -Wall" # # This is needed in order to get the really cool backtraces @@ -645,7 +600,7 @@ AC_CHECK_HEADER( # conditional definition of __EXTENSIONS__, to avoid redundant tests. # -XCFLAGS="$CFLAGS" +XCFLAGS="$CXXFLAGS" echo Checking how to use -D_XOPEN_SOURCE=600 and -D_POSIX_C_SOURCE=200112L... local_found_posix_switch=no