Commits

Barry Schwartz committed 3f82419

More configuration.

Comments (0)

Files changed (5)

fortran/font/Makefile.am

 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+#--------------------------------------------------------------------------
+
 ACLOCAL_AMFLAGS = -I m4
 
+force_rebuild = if test -f $@; then :; else \
+        $(RM) $<; \
+            $(MAKE) $(AM_MAKEFLAGS) $<; \
+     fi
+
 lib_LTLIBRARIES = libib-not-yet-named.la
 libib_not_yet_named_la_SOURCES = opentype_bytes.F90					\
 	  opentype_data_types.F90 opentype_fixed.F90 opentype_longs.F90	\
 	  opentype_shorts.F90 opentype_tags.F90 opentype_uint24.F90
+
+pkgconfigdir = "${libdir}/pkgconfig"
+nodist_pkgconfig_DATA = package-not-yet-named.pc
+
+#--------------------------------------------------------------------------
+
+if HAVE_MODFILES
+
+MODFILES = opentype_bytes opentype_data_types opentype_fixed		\
+	  opentype_longs opentype_shorts opentype_tags opentype_uint24
+
+pkginclude_HEADERS = $(foreach f, $(MODFILES), $(call modfile,${f}))
+
+$(call modfile,opentype_bytes): opentype_bytes.lo
+	@$(force_rebuild)
+$(call modfile,opentype_data_types): opentype_data_types.lo
+	@$(force_rebuild)
+$(call modfile,opentype_fixed): opentype_fixed.lo
+	@$(force_rebuild)
+$(call modfile,opentype_longs): opentype_longs.lo
+	@$(force_rebuild)
+$(call modfile,opentype_shorts): opentype_shorts.lo
+	@$(force_rebuild)
+$(call modfile,opentype_tags): opentype_tags.lo
+	@$(force_rebuild)
+$(call modfile,opentype_uint24): opentype_uint24.lo
+	@$(force_rebuild)
+
+opentype_data_types.lo $(call modfile,opentype_data_types): $(call		\
+	  modfile,opentype_bytes) $(call modfile,opentype_fixed) $(call		\
+	  modfile,opentype_longs) $(call modfile,opentype_shorts) $(call	\
+	  modfile,opentype_tags) $(call modfile,opentype_uint24)
+
+else
+
+MODFILES =
+
+endif
+
+#--------------------------------------------------------------------------
+
+MOSTLYCLEANFILES = $(foreach f, $(MODFILES), $(call modfile,${f}))
+
+#--------------------------------------------------------------------------

fortran/font/configure.ac

 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 AC_PREREQ([2.68])
-AC_INIT([PACKAGE-NOT-YET-NAMED], [0.1], [https://bitbucket.org/chemoelectric/odds_and_ends])
+AC_INIT([PACKAGE-NOT-YET-NAMED],[0.1],[https://bitbucket.org/chemoelectric/odds_and_ends])
 AM_INIT_AUTOMAKE([foreign])
 AC_CONFIG_MACRO_DIR([m4])
 LT_INIT
 
+
 # Checks for programs.
 AC_PROG_FC
 
+
 # Checks for libraries.
 
+
 # Checks for header files.
 
+
 # Checks for typedefs, structures, and compiler characteristics.
+
 AC_FC_FREEFORM
 AC_FC_LINE_LENGTH
 if test "x$ac_cv_fc_compiler_gnu" = xyes; then
-   AC_LANG(Fortran)
+   AC_LANG_PUSH(Fortran)
+   AX_CHECK_COMPILER_FLAGS([-cpp],[FCFLAGS="${FCFLAGS} -cpp"])
    AX_CHECK_COMPILER_FLAGS([-Wextra],[FCFLAGS=" -Wextra ${FCFLAGS}"])
    AX_CHECK_COMPILER_FLAGS([-Wall],[FCFLAGS=" -Wall ${FCFLAGS}"])
    AX_CHECK_COMPILER_FLAGS([-std=f2008],[FCFLAGS=" -std=f2008 ${FCFLAGS}"])
+   AC_LANG_POP(Fortran)
 fi
 
+AC_ARG_VAR([FC_MODEXT],[filename extension of Fortran 90 module files (or no-module-files)])
+AC_ARG_VAR([FC_MODCASE],[case of Fortran 90 module files (lower/upper)])
+
+if test x"$FC_MODEXT" = x; then
+   AX_F90_MODULE_EXTENSION
+   AC_SUBST([FC_MODEXT],[$ax_cv_f90_modext])
+else
+   AC_MSG_NOTICE([assuming Fortran modules extension... $FC_MODEXT])
+fi
+
+if test x"$FC_MODEXT" = xno-module-files; then
+   FC_MODEXT=""
+fi
+
+if test x"$FC_MODEXT" != x; then
+   if test x"$FC_MODCASE" = x; then
+      EBENO_F90_MODULE_CASE
+      AC_SUBST([FC_MODCASE],[$ebeno_cv_f90_modcase])
+   else
+      case x"$FC_MODCASE" in
+        xlower|xupper)
+          AC_MSG_NOTICE([assuming Fortran modules case... $FC_MODCASE])
+          ;;
+        *)
+          AC_MSG_ERROR([illegal FC_MODCASE, must be lower or upper... $FC_MODCASE])
+          ;;
+      esac
+   fi
+fi
+
+case x"$FC_MODCASE" in
+   xlower) AC_SUBST([modcase],['${1}']) ;;
+   xupper) AC_SUBST([modcase],['$(shell echo ${1} | sed -e "s/\.$(FC_MODEXT)//" | tr a-z A-Z)']) ;;
+   *)     AC_SUBST([modcase],['']) ;;
+esac
+
+case x"$FC_MODEXT" in
+   x) AC_SUBST([modfile],['']) ;;
+   *) AC_SUBST([modfile],['$(call modcase, ${1}).$(FC_MODEXT)']) ;;
+esac
+
+AM_CONDITIONAL([HAVE_MODFILES],[test x"$FC_MODEXT" != x])
+
+
 # Checks for library functions.
 
-AC_CONFIG_FILES([Makefile])
+
+AC_CONFIG_FILES([Makefile package-not-yet-named.pc])
 AC_OUTPUT
-

fortran/font/m4/ax_f90_module_extension.m4

+# ===========================================================================
+#  http://www.gnu.org/software/autoconf-archive/ax_f90_module_extension.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_F90_MODULE_EXTENSION
+#
+# DESCRIPTION
+#
+#   Find Fortran 90 modules file extension. The module extension is stored
+#   in the cached variable ax_f90_modext, or "unknown" if the extension
+#   cannot be found.
+#
+# LICENSE
+#
+#   Copyright (c) 2009 Luc Maisonobe <luc@spaceroots.org>
+#   Copyright (c) 2009 Alexander Pletzer <pletzer@txcorp.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 11
+
+AC_DEFUN([AX_F90_MODULE_EXTENSION],[
+AC_CACHE_CHECK([fortran 90 modules extension],
+ax_cv_f90_modext,
+[AC_LANG_PUSH(Fortran)
+i=0
+while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
+  i=`expr $i + 1`
+done
+mkdir tmpdir_$i
+cd tmpdir_$i
+AC_COMPILE_IFELSE([
+!234567
+      module conftest_module
+      contains
+      subroutine conftest_routine
+      write(*,'(a)') 'gotcha!'
+      end subroutine conftest_routine
+      end module conftest_module
+  ],
+  [ax_cv_f90_modext=`ls | sed -n 's,conftest_module\.,,p'`
+   if test x$ax_cv_f90_modext = x ; then
+dnl Some F90 compilers put module filename in uppercase letters
+     ax_cv_f90_modext=`ls | sed -n 's,CONFTEST_MODULE\.,,p'`
+     if test x$ax_cv_f90_modext = x ; then
+       ax_cv_f90_modext=""
+     fi
+   fi
+  ],
+  [ax_cv_f90_modext=""])
+cd ..
+rm -fr tmpdir_$i
+AC_LANG_POP(Fortran)
+])])

fortran/font/m4/ebeno_f90_module_case.m4

+# ===========================================================================
+#  http://www.gnu.org/software/autoconf-archive/ax_f90_module_extension.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_F90_MODULE_EXTENSION
+#
+# DESCRIPTION
+#
+#   Find Fortran 90 modules file extension. The module extension is stored
+#   in the cached variable ax_f90_modext, or "unknown" if the extension
+#   cannot be found.
+#
+# LICENSE
+#
+#   Copyright (c) 2009 Luc Maisonobe <luc@spaceroots.org>
+#   Copyright (c) 2009 Alexander Pletzer <pletzer@txcorp.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+AC_DEFUN([EBENO_F90_MODULE_CASE],[
+AC_CACHE_CHECK([fortran 90 modules case],
+ebeno_cv_f90_modcase,
+[AC_LANG_PUSH(Fortran)
+i=0
+while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
+  i=`expr $i + 1`
+done
+mkdir tmpdir_$i
+cd tmpdir_$i
+AC_COMPILE_IFELSE([
+!234567
+      module conftest_module
+      contains
+      subroutine conftest_routine
+      write(*,'(a)') 'gotcha!'
+      end subroutine conftest_routine
+      end module conftest_module
+  ],
+  [if ls | grep -F -q conftest_module.; then
+      ebeno_cv_f90_modcase="lower"
+   elif ls | grep -F -q CONFTEST_MODULE.; then
+      ebeno_cv_f90_modcase="upper"
+   else
+      ebeno_cv_f90_modcase=""
+   fi
+  ],
+  [ebeno_cv_f90_modcase=""])
+cd ..
+rm -fr tmpdir_$i
+AC_LANG_POP(Fortran)
+])])

fortran/font/package-not-yet-named.pc.in

+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+libdir=@libdir@
+datarootdir=@datarootdir@
+mandir=@mandir@
+includedir=@includedir@
+localedir=@localedir@
+
+Name: @PACKAGE_NAME@
+Description: Font-manipulation software not yet named
+Version: @PACKAGE_VERSION@
+Requires: 
+Libs: -L${libdir} -lib-not-yet-named
+Cflags: -I${includedir}/package-not-yet-named
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.