--- netcdf-3.5.1/src/Makefile.orig 2004-01-27 15:08:14.000000000 +0100 +++ netcdf-3.5.1/src/Makefile 2004-02-11 23:29:29.498007248 +0100 @@ -27,11 +27,12 @@ # I moved fortran to the bottom of the list, sometimes AIX make get's confused # if the C library and the fortran library are built in the same second. - Ed -all: libsrc/all \ +# but fortran objects are linked into C library, so must it be built first --q +all: fortran/all \ + libsrc/all \ ncdump/all \ ncgen/all \ cxx/all \ - fortran/all \ f90/all test: fortran/all \ diff -Nur netcdf-3.5.0.orig/src/cxx/Makefile netcdf-3.5.0/src/cxx/Makefile --- netcdf-3.5.0.orig/src/cxx/Makefile Wed May 12 21:38:30 1999 +++ netcdf-3.5.0/src/cxx/Makefile Wed Apr 4 23:16:55 2001 @@ -11,19 +11,19 @@ nctst.cpp ncvalues.cpp ncvalues.h netcdf.cpp netcdfcpp.h \ expected cxxdoc.tex cxxdoc.ps texinfo.tex netcdf.hh -LIBRARY = libnetcdf_c++.a -lib_netcdf = ../libsrc/libnetcdf.a -ld_netcdf = -L../libsrc -lnetcdf +LIBRARYL = libnetcdf_c++.la +lib_netcdf = ../libsrc/libnetcdf.la +ld_netcdf = -L../libsrc/.libs -lnetcdf HEADER1 = netcdfcpp.h HEADER2 = ncvalues.h HEADER3 = netcdf.hh -libs = $(LIBRARY) $(ld_netcdf) $(LIBS) +libs = -L.libs -lnetcdf_c++ $(ld_netcdf) $(LIBS) purify = purify -LIB_OBJS = netcdf.o ncvalues.o +LIB_OBJS = netcdf.lo ncvalues.lo # a test program that uses some of the draft C++ interface prog = nctst @@ -33,16 +33,19 @@ *.cps *.dvi *.fns \ *.log *~ *.gs *.aux *.cp *.fn *.ky *.pg *.toc *.tp *.vr -all: $(LIBRARY) $(prog) +all: $(LIBRARYL) $(prog) + +libnetcdf_c++.la: $(LIB_OBJS) + libtool --mode=link --tag=CXX $(CXX) -o libnetcdf_c++.la $(LIB_OBJS) $(LDFLAGS) -rpath $(LIBDIR) $(lib_netcdf) test: $(prog) FORCE ./$(prog) > test.out @cmp expected test.out && \ echo "*** C++ test successful ***" ; -install: $(LIBDIR)/$(LIBRARY) $(INCDIR)/$(HEADER1) $(INCDIR)/$(HEADER2)\ +install: $(LIBRARYL) $(INCDIR)/$(HEADER1) $(INCDIR)/$(HEADER2)\ $(INCDIR)/$(HEADER3) - + libtool --mode=install install $(LIBRARYL) $(LIBDIR) uninstall: -rm -f $(LIBDIR)/$(LIBRARY) @@ -50,7 +53,7 @@ -rm -f $(INCDIR)/$(HEADER2) -rm -f $(INCDIR)/$(HEADER3) -$(prog) : $(prog_objs) $(LIBRARY) $(lib_netcdf) +$(prog) : $(prog_objs) $(LIBRARYL) $(lib_netcdf) $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $(prog_objs) $(libs) nctst_src: nctst.cpp netcdf.cpp ncvalues.cpp diff -Nur netcdf-3.5.0.orig/src/fortran/Makefile netcdf-3.5.0/src/fortran/Makefile --- netcdf-3.5.0.orig/src/fortran/Makefile Wed Feb 21 22:20:26 2001 +++ netcdf-3.5.0/src/fortran/Makefile Wed Apr 4 23:18:04 2001 @@ -13,20 +13,20 @@ ld_netcdf = $(LIBRARY) HEADER = netcdf.inc LIB_OBJS = \ - fort-attio.o \ - fort-control.o \ - fort-dim.o \ - fort-genatt.o \ - fort-geninq.o \ - fort-genvar.o \ - fort-lib.o \ - fort-misc.o \ - fort-v2compat.o \ - fort-vario.o \ - fort-var1io.o \ - fort-varaio.o \ - fort-varmio.o \ - fort-varsio.o + fort-attio.lo \ + fort-control.lo \ + fort-dim.lo \ + fort-genatt.lo \ + fort-geninq.lo \ + fort-genvar.lo \ + fort-lib.lo \ + fort-misc.lo \ + fort-v2compat.lo \ + fort-vario.lo \ + fort-var1io.lo \ + fort-varaio.lo \ + fort-varmio.lo \ + fort-varsio.lo # MANUAL = netcdf.3f @@ -69,7 +69,7 @@ # -all: $(LIBRARY) $(MANUAL) +all: $(LIB_OBJS) $(MANUAL) test: ftest FORCE ./ftest diff -Nur netcdf-3.5.0.orig/src/libsrc/Makefile netcdf-3.5.0/src/libsrc/Makefile --- netcdf-3.5.0.orig/src/libsrc/Makefile Fri Feb 25 16:14:14 2000 +++ netcdf-3.5.0/src/libsrc/Makefile Wed Apr 4 23:21:35 2001 @@ -7,7 +7,7 @@ INCLUDES = -I. -LIBRARY = libnetcdf.a +LIBRARYL = libnetcdf.la ld_netcdf = -L. -lnetcdf HEADER = netcdf.h @@ -54,7 +54,23 @@ t_ncxx.c \ t_ncx.c -LIB_OBJS = $(LIB_CSRCS:.c=.o) +LIB_OBJS = $(LIB_CSRCS:.c=.lo) + +LIB_FOBJS = \ + ../fortran/fort-attio.lo \ + ../fortran/fort-control.lo \ + ../fortran/fort-dim.lo \ + ../fortran/fort-genatt.lo \ + ../fortran/fort-geninq.lo \ + ../fortran/fort-genvar.lo \ + ../fortran/fort-lib.lo \ + ../fortran/fort-misc.lo \ + ../fortran/fort-v2compat.lo \ + ../fortran/fort-vario.lo \ + ../fortran/fort-var1io.lo \ + ../fortran/fort-varaio.lo \ + ../fortran/fort-varmio.lo \ + ../fortran/fort-varsio.lo GARBAGE = t_ncio.o t_ncio t_ncx.o t_ncx t_ncxx.o t_ncxx \ t_nc.o t_nc test.nc *.so @@ -62,15 +78,19 @@ DIST_GARBAGE = ncconfig.h -all: $(LIBRARY) $(MANUAL) +all: $(LIBRARYL) $(MANUAL) check: full_test full_test: test_ncx test nctest -install: $(LIBDIR)/$(LIBRARY) \ +install: $(LIBRARYL) \ $(INCDIR)/$(HEADER) \ $(MANDIR)/man3/$(MANUAL) + libtool install $(LIBRARYL) $(LIBDIR) + +libnetcdf.la: $(LIB_OBJS) + libtool --mode=link --tag=CC $(CC) -o libnetcdf.la $(LIB_OBJS) $(LIB_FOBJS) $(LDFLAGS) -rpath $(LIBDIR) uninstall: -rm -f $(LIBDIR)/$(LIBRARY) @@ -95,10 +115,10 @@ cmp test.nc test_nc.sav @echo '*** Success ***' -nctest: $(LIBRARY) +nctest: $(LIBRARYL) (cd ../nctest ; make test) -nc_test: $(LIBRARY) +nc_test: $(LIBRARYL) (cd ../nc_test ; make test) diff -Nur netcdf-3.5.0.orig/src/ncdump/Makefile netcdf-3.5.0/src/ncdump/Makefile --- netcdf-3.5.0.orig/src/ncdump/Makefile Tue Mar 13 18:42:52 2001 +++ netcdf-3.5.0/src/ncdump/Makefile Wed Apr 4 23:22:41 2001 @@ -16,11 +16,11 @@ test0.cdl ncdump.1 Makefile MANUAL = ncdump.1 -lib_netcdf = ../libsrc/libnetcdf.a +lib_netcdf = ../libsrc/libnetcdf.la # Don't use "-L../libsrc -lnetcdf" in the following because that doesn't # work on a CRAY T90 (sigh). -ld_netcdf = $(lib_netcdf) +ld_netcdf = -L../libsrc/.libs -lnetcdf OBJS = ncdump.o vardata.o dumplib.o GARBAGE = $(PROGRAM) test0.nc test1.nc test1.cdl test2.cdl diff -Nur netcdf-3.5.0.orig/src/ncgen/Makefile netcdf-3.5.0/src/ncgen/Makefile --- netcdf-3.5.0.orig/src/ncgen/Makefile Tue Mar 13 18:42:53 2001 +++ netcdf-3.5.0/src/ncgen/Makefile Wed Apr 4 23:23:09 2001 @@ -15,10 +15,10 @@ ctest.c ctest ctest0.nc ctest1.cdl \ ftest.f ftest ftest0.nc ftest1.cdl -lib_netcdf = ../libsrc/libnetcdf.a +lib_netcdf = ../libsrc/libnetcdf.la # Don't use "-L../libsrc -lnetcdf" in the following because that doesn't # work on a CRAY T90 (sigh). -ld_netcdf = $(lib_netcdf) +ld_netcdf = -L../libsrc/.libs -lnetcdf PACKING_LIST = Makefile depend escapes.c generic.h \ ncgenyy.c ncgentab.c ncgentab.h \ diff -Nur netcdf-3.5.0.orig/src/rules.make netcdf-3.5.0/src/rules.make --- netcdf-3.5.0.orig/src/rules.make Mon Mar 12 23:31:55 2001 +++ netcdf-3.5.0/src/rules.make Wed Apr 4 23:24:06 2001 @@ -4,7 +4,7 @@ # It should be processed by every execution of the that utility. .SUFFIXES: -.SUFFIXES: .a .o .i .f .c .cpp .F .y .l .m4 +.SUFFIXES: .a .o .lo .i .f .c .cpp .F .y .l .m4 ################################################################################ @@ -13,11 +13,17 @@ .c.o: $(COMPILE.c) $< +.c.lo: + libtool --mode=compile --tag=CC $(COMPILE.c) $< + .c.i: $(CPP) $(CPPFLAGS) $< >$@ .cpp.o: $(COMPILE.cxx) $< + +.cpp.lo: + libtool --mode=compile --tag=CXX $(COMPILE.cxx) $< # Not all FORTRAN compilers support C-preprocessing of *.F files; ergo, a # relatively complicated rule ensues.