# HG changeset patch # User jwe # Date 819960029 0 # Node ID 6e8ac624ed9b25d1bfaee191ef438896a9997317 # Parent f1b5a5086e4622c825dd45d5cfc7471e163bdbe2 [project @ 1995-12-26 06:35:24 by jwe] diff --git a/Makeconf.in b/Makeconf.in --- a/Makeconf.in +++ b/Makeconf.in @@ -211,18 +211,16 @@ # rule for making object from Fortran source files, so there should be # no pattern or command for that. -%.c : %.f -@DOT_C_FROM_DOT_F_CMD@ +@fortran_rules_frag@ -@DOT_O_FROM_DOT_F_PAT@ -@DOT_O_FROM_DOT_F_CMD@ - -# How to make .o files from .c files: +# How to make .o files: .c.o: + test -z "$(CPICFLAG)" -a -f pic || $(CC) -c $(CPPFLAGS) $(CPICFLAG) $(ALL_CFLAGS) $< -o pic/$@ \ $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< .cc.o: + test -z "$(CXXPICFLAG)" -a -f pic || $(CXX) -c $(CPPFLAGS) $(CXXPICFLAG) $(ALL_CXXFLAGS) $< -o pic/$@ \ $(CXX) -c $(CPPFLAGS) $(ALL_CXXFLAGS) $< # Here is a rule for generating dependencies for .cc files: diff --git a/configure.in b/configure.in --- a/configure.in +++ b/configure.in @@ -20,7 +20,7 @@ ### along with Octave; see the file COPYING. If not, write to the Free ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -AC_REVISION($Revision: 1.144 $) +AC_REVISION($Revision: 1.145 $) AC_PREREQ(2.0) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -352,6 +352,9 @@ AC_MSG_RESULT([defining FPICFLAG to be $FPICFLAG]) AC_MSG_RESULT([defining CPICFLAG to be $CPICFLAG]) AC_MSG_RESULT([defining CXXPICFLAG to be $CXXPICFLAG]) +AC_SUBST(FPICFLAG) +AC_SUBST(CPICFLAG) +AC_SUBST(CXXPICFLAG) ### Allow compilation of smaller kernel. This only works if some form ### of dynamic linking is also supported and used. @@ -494,10 +497,19 @@ fi fi +fortran_rules_frag=Makerules.f77 if $have_fortran_compiler; then - DOT_C_FROM_DOT_F_CMD= - DOT_O_FROM_DOT_F_PAT='.f.o:' - DOT_O_FROM_DOT_F_CMD=' $(FC) -c $(ALL_FFLAGS) $<' + cat << \EOF > $fortran_rules_frag + +.c.f: + +.f.o: + if [ -z "$(FPICFLAG)" ] && [ -f pic ]; then \ + $(FC) -c $(FPICFLAG) $(ALL_FFLAGS) $< -o pic/$@; \ + else true; fi + $(FC) -c $(ALL_FFLAGS) $<' + +EOF elif $have_f2c; then AC_DEFINE(F77_APPEND_UNDERSCORE, 1) AC_MSG_RESULT([defining F77_APPEND_UNDERSCORE to be 1]) @@ -511,11 +523,14 @@ if test -z "$FLIBS"; then AC_MSG_WARN([I found f2c but not libf2c.a, or libF77.a and libI77.a]) fi - DOT_C_FROM_DOT_F_CMD=' cat $< | $(F2C) $(F2CFLAGS) > $(@F)' - AC_MSG_RESULT([defining DOT_C_FROM_DOT_F_CMD to be $DOT_C_FROM_DOT_F_CMD]) - DOT_O_FROM_DOT_F_PAT='%.o : %.f' - DOT_O_FROM_DOT_F_CMD= - AC_MSG_RESULT([defining DOT_O_FROM_DOT_F_PAT to be $DOT_O_FROM_DOT_F_PAT]) + cat << \EOF > $fortran_rules_frag + +.c.f: + cat $< | $(F2C) $(F2CFLAGS) > $(@F) + +%.o : %.f + +EOF else AC_MSG_WARN([in order to build octave, you must have a compatible]) AC_MSG_WARN([Fortran compiler or f2c installed and in your path.]) @@ -530,9 +545,7 @@ AC_SUBST(FLIBS) AC_SUBST(F2C) AC_SUBST(F2CFLAGS) -AC_SUBST(DOT_C_FROM_DOT_F_CMD) -AC_SUBST(DOT_O_FROM_DOT_F_PAT) -AC_SUBST(DOT_O_FROM_DOT_F_CMD) +AC_SUBST_FILE(fortran_rules_frag) ### Extract libraries and directories from FLIBS and CXXLIBS. ### @@ -903,12 +916,21 @@ export CXX export F77 -AC_CONFIG_SUBDIRS(kpathsea libcruft scripts $INFO_DIR $PLPLOT_DIR $READLINE_DIR) +AC_CONFIG_SUBDIRS(kpathsea scripts $INFO_DIR $PLPLOT_DIR $READLINE_DIR) ### Do the substitutions in all the Makefiles. AC_OUTPUT(Makefile octMakefile Makeconf liboctave/Makefile - src/Makefile dld/Makefile doc/Makefile test/Makefile) + src/Makefile dld/Makefile doc/Makefile test/Makefile + libcruft/Makefile libcruft/Makerules libcruft/blas/Makefile + libcruft/balgen/Makefile libcruft/dassl/Makefile + libcruft/eispack/Makefile libcruft/fftpack/Makefile + libcruft/fsqp/Makefile libcruft/lapack/Makefile + libcruft/linpack/Makefile libcruft/minpack/Makefile + libcruft/misc/Makefile libcruft/npsol/Makefile + libcruft/odepack/Makefile libcruft/qpsol/Makefile + libcruft/quadpack/Makefile libcruft/ranlib/Makefile + libcruft/slatec-fn/Makefile libcruft/villad/Makefile) ### Print a summary so that important information isn't missed. @@ -935,6 +957,7 @@ Default pager: $DEFAULT_PAGER gnuplot: $GNUPLOT_BINARY + Build shared libraries: $shared_libs Minimal kernel option: $lite_kernel Dynamic Linking (dld): $use_dld Dynamic Linking (dlopen/dlsym): $use_dl diff --git a/libcruft/Makefile.in b/libcruft/Makefile.in --- a/libcruft/Makefile.in +++ b/libcruft/Makefile.in @@ -21,7 +21,8 @@ # List of the directories that contain Fortran source. Simply copying # a new .f file into one of these directories is sufficient to have it # added to libcruft.a. If you add a new directory here, you also need -# generate a new configure script (edit configure.in and run autoconf). +# generate a new configure script in the top-level directory (edit +# configure.in and run autoconf). CRUFT_DIRS = balgen blas dassl eispack fftpack fsqp lapack linpack \ minpack misc npsol odepack qpsol quadpack ranlib slatec-fn \ @@ -29,8 +30,7 @@ SUBDIRS = $(CRUFT_DIRS) -DISTFILES = Makefile.in Makerules.in $(SOURCES) STOP.patch \ - configure.in configure mkinstalldirs +DISTFILES = Makefile.in Makerules.in $(SOURCES) STOP.patch all: $(SUBDIRS) libcruft.a .PHONY: all @@ -81,7 +81,7 @@ rm -f *.a *.o distclean:: clean - rm -f Makefile Makerules config.log config.status + rm -f Makefile Makerules maintainer-clean:: distclean rm -f tags TAGS diff --git a/libcruft/Makerules.in b/libcruft/Makerules.in --- a/libcruft/Makerules.in +++ b/libcruft/Makerules.in @@ -19,9 +19,15 @@ CWD = $(shell pwd) THISDIR = $(notdir $(CWD)) -all: $(CRUFT_OBJ) $(SPECIAL_DEPEND) +all: stamp-picdir $(CRUFT_OBJ) $(SPECIAL_DEPEND) .PHONY: all +stamp-picdir: + if [ -n "$(FPICFLAG)" ] || [ -n "$(CPICFLAG)" ] || [ -n "$(CXXPICFLAG)" ]; then \ + if [ -d pic ]; then true; else mkdir pic ; fi ; \ + else true; fi + touch stamp-picdir + install: all .PHONY: install diff --git a/liboctave/Makefile.in b/liboctave/Makefile.in --- a/liboctave/Makefile.in +++ b/liboctave/Makefile.in @@ -64,9 +64,15 @@ LIBOCTAVE_DEPEND := $(patsubst %, liboctave.a(%), $(OBJECTS)) -all: liboctave.a +all: stamp-picdir liboctave.a .PHONY: all +stamp-picdir: + if [ -n "$(FPICFLAG)" ] || [ -n "$(CPICFLAG)" ] || [ -n "$(CXXPICFLAG)" ]; then \ + if [ -d pic ]; then true; else mkdir pic ; fi ; \ + else true; fi + touch stamp-picdir + liboctave.a: $(OBJECTS) $(AR) $(ARFLAGS) liboctave.a $(OBJECTS) $(RANLIB) liboctave.a @@ -97,7 +103,7 @@ etags $(SOURCES) clean: - rm -f *.a *.o *.d + rm -f *.a *.o *.d pic/*.o .PHONY: clean mostlyclean: clean