diff --git a/configure.ac b/configure.ac index c94e457402c..39f0be92ef0 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,9 @@ AC_CONFIG_MACRO_DIR([m4]) # Find and learn about the C compiler. AC_PROG_CC +# Find and learn about the Fortran compiler. +AC_PROG_FC + # Libtool initialisation. AC_PROG_LIBTOOL @@ -111,6 +114,7 @@ AC_CONFIG_HEADERS([config.h]) AC_OUTPUT(Makefile src/Makefile src/clib/Makefile + src/flib/Makefile tests/Makefile tests/cunit/Makefile examples/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 82d1b94a386..6007c92c2f8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,4 +2,9 @@ # Ed Hartnett -SUBDIRS = clib +# Does the user want to build fortran? +if BUILD_FORTRAN +FLIB = flib +endif + +SUBDIRS = clib $(FLIB) diff --git a/src/flib/Makefile.am b/src/flib/Makefile.am new file mode 100644 index 00000000000..3e9b5fe50c0 --- /dev/null +++ b/src/flib/Makefile.am @@ -0,0 +1,26 @@ +## This is the automake file to build the PIO Fortran library. +# Ed Hartnett 3/19/19 + +# The library we are building. +#lib_LTLIBRARIES = libpiof.la + +# These linker flags specify libtool version info. +# See http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning +# for information regarding incrementing `-version-info`. +#libpiof_la_LDFLAGS = -version-info 1:0:0 + +# The library soure files. +#libpiof_la_SOURCES = pio.F90 + +# Build this uninstalled convenience library. +noinst_LTLIBRARIES = libpio_kinds.la + +# The convenience library depends on its source. +libpio_kinds_la_SOURCES = pio_kinds.F90 + +# Mod file depends on its o file, is built and then installed. +pio_kinds.mod: pio_kinds.$(OBJEXT) +BUILT_SOURCES = pio_kinds.mod +include_HEADERS = pio_kinds.mod + +CLEANFILES = *.mod