[cig-commits] [commit] pluggable: Created proper Automake makefile and configure script. (08b5b73)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Apr 9 08:55:34 PDT 2014


Repository : ssh://geoshell/specfem3d_globe

On branch  : pluggable
Link       : https://github.com/geodynamics/specfem3d_globe/compare/64e1b38f0c5ebb4056cce0b15d41c0b9f94ab6e5...099a4d330d5b173b21e51ad441f9f429e5d37842

>---------------------------------------------------------------

commit 08b5b738729db7690913e09685b39ef5831af5eb
Author: Leif Strand <leif at geodynamics.org>
Date:   Wed May 6 18:21:21 2009 +0000

    Created proper Automake makefile and configure script.


>---------------------------------------------------------------

08b5b738729db7690913e09685b39ef5831af5eb
 LICENSE => UTILS/seis_process/COPYING |  0
 UTILS/seis_process/Makefile           | 25 -------------------------
 UTILS/seis_process/Makefile.am        | 11 +++++++++++
 UTILS/seis_process/configure.ac       | 25 ++++++++++++++++++++-----
 4 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/LICENSE b/UTILS/seis_process/COPYING
similarity index 100%
copy from LICENSE
copy to UTILS/seis_process/COPYING
diff --git a/UTILS/seis_process/Makefile b/UTILS/seis_process/Makefile
deleted file mode 100644
index ab75f83..0000000
--- a/UTILS/seis_process/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# %License%
-
-
-
-## The environment variable SACAUX is required for running SAC.
-## We will assume SACAUX is already defined.
-
-## The SAC library on GPS machine is for SUN, not for linux
-## using my version for now
-SACAUX = /home/tan2/opt/sac-101.2/aux
-
-CC = gcc
-CFLAGS = -O2
-CPPFLAGS = -I$(SACAUX)/../include
-LDFLAGS = -L$(SACAUX)/../lib -lsacio
-
-all: asc2sac convolve_stf
-
-asc2sac: asc2sac.c
-	$(CC) asc2sac.c -o asc2sac $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
-
-convolve_stf: convolve_stf.c
-	$(CC) convolve_stf.c -o convolve_stf $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -lm
-
-
diff --git a/UTILS/seis_process/Makefile.am b/UTILS/seis_process/Makefile.am
new file mode 100644
index 0000000..223b0a7
--- /dev/null
+++ b/UTILS/seis_process/Makefile.am
@@ -0,0 +1,11 @@
+## Process this file with automake to produce Makefile.in
+
+bin_PROGRAMS = asc2sac convolve_stf get_sac_header
+bin_SCRIPTS = process_data.pl process_syn.pl rotate.pl
+
+AM_CPPFLAGS = -I$(SACAUX)/../include
+AM_LDFLAGS = -L$(SACAUX)/../lib
+
+asc2sac_SOURCES = asc2sac.c
+convolve_stf_SOURCES = convolve_stf.c
+get_sac_header_SOURCES = get_sac_header.c
diff --git a/UTILS/seis_process/configure.ac b/UTILS/seis_process/configure.ac
index a16cdf6..36a87dc 100644
--- a/UTILS/seis_process/configure.ac
+++ b/UTILS/seis_process/configure.ac
@@ -2,22 +2,34 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.61)
-AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
+AC_INIT([seis_process], [1.0.0], [cig-seismo at geodynamics.org])
 AC_CONFIG_SRCDIR([convolve_stf.c])
 AC_CONFIG_HEADER([config.h])
+AM_INIT_AUTOMAKE([foreign])
+
+AC_ARG_VAR(SACAUX, [SAC 'aux' directory])
+if test "x$SACAUX" = x; then
+    AC_MSG_ERROR([environment variable SACAUX is not set])
+fi
 
 # Checks for programs.
 AC_PROG_CC
 
+save_LDFLAGS=$LDFLAGS
+save_CPPFLAGS=$CPPFLAGS
+LDFLAGS="-L$SACAUX/../lib $LDFLAGS"
+CPPFLAGS="-I$SACAUX/../include $CPPFLAGS"
+
 # Checks for libraries.
-# FIXME: Replace `main' with a function in `-lm':
-AC_CHECK_LIB([m], [main])
-# FIXME: Replace `main' with a function in `-lsacio':
-AC_CHECK_LIB([sacio], [main])
+AC_SEARCH_LIBS([sqrt], [m])
+AC_CHECK_LIB([sacio], [rsac1], [], [AC_MSG_ERROR([sacio library not found])])
+AC_CHECK_LIB([sac], [fft], [], [AC_MSG_ERROR([sac library not found])])
 
 # Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS([limits.h stdlib.h string.h])
+AC_CHECK_HEADER([sacio.h], [], [AC_MSG_ERROR([sacio.h not found])])
+AC_CHECK_HEADER([sac.h], [], [AC_MSG_ERROR([sac.h not found])])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -27,5 +39,8 @@ AC_FUNC_MALLOC
 AC_FUNC_STRTOD
 AC_CHECK_FUNCS([sqrt strtol])
 
+LDFLAGS=$save_LDFLAGS
+CPPFLAGS=$save_CPPFLAGS
+
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT



More information about the CIG-COMMITS mailing list