From 4915b3e9c414e904126ae181f141d4c925262f58 Mon Sep 17 00:00:00 2001 From: Nicholas Malaya Date: Tue, 7 Feb 2012 03:21:22 +0000 Subject: [PATCH] [cantera]: few edits to get everything working --- Cantera/Makefile.am | 2 +- Cantera/ext/f2c_libs/Makefile.am | 3 +- Cantera/ext/f2c_libs/signal1.h | 35 ++++++++++++++ Cantera/ext/f2c_libs/sysdep1.h | 78 ++++++++++++++++++++++++++++++++ Cantera/src/Makefile.am | 2 +- Cantera/src/base/Makefile.am | 1 + 6 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 Cantera/ext/f2c_libs/signal1.h create mode 100644 Cantera/ext/f2c_libs/sysdep1.h diff --git a/Cantera/Makefile.am b/Cantera/Makefile.am index 25ffef14a..e7f5b3e5b 100644 --- a/Cantera/Makefile.am +++ b/Cantera/Makefile.am @@ -1,4 +1,4 @@ # $Id: $ # will need to add python and matlab -SUBDIRS = src user cxx ext +SUBDIRS = ext src user cxx diff --git a/Cantera/ext/f2c_libs/Makefile.am b/Cantera/ext/f2c_libs/Makefile.am index ed9f91ba1..234868e93 100644 --- a/Cantera/ext/f2c_libs/Makefile.am +++ b/Cantera/ext/f2c_libs/Makefile.am @@ -36,7 +36,7 @@ cc_sources = abort_.c c_log.c d_atn2.c dfe.c d_prod.c \ # arithchk.c getarg_.c iargc_.c -h_sources = f2c.h fio.h fmt.h fp.h lio.h rawio.h sysdep1.h +h_sources = f2c.h sysdep1.h fio.h fmt.h fp.h lio.h rawio.h AM_CPPFLAGS = -I. AM_CXXFLAGS = $(AM_CPPFLAGS) @@ -57,7 +57,6 @@ all: cp -u signal1.h0 signal1.h cp $(h_sources) $(top_builddir)/build/include/ - __top_builddir__build_lib_libctf2c_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) __top_builddir__build_lib_libctf2c_la_SOURCES = $(cc_sources) $(h_sources) diff --git a/Cantera/ext/f2c_libs/signal1.h b/Cantera/ext/f2c_libs/signal1.h new file mode 100644 index 000000000..a383774b8 --- /dev/null +++ b/Cantera/ext/f2c_libs/signal1.h @@ -0,0 +1,35 @@ +/* You may need to adjust the definition of signal1 to supply a */ +/* cast to the correct argument type. This detail is system- and */ +/* compiler-dependent. The #define below assumes signal.h declares */ +/* type SIG_PF for the signal function's second argument. */ + +/* For some C++ compilers, "#define Sigarg_t ..." may be appropriate. */ + +#include + +#ifndef Sigret_t +#define Sigret_t void +#endif +#ifndef Sigarg_t +#ifdef KR_headers +#define Sigarg_t +#else +#define Sigarg_t int +#endif +#endif /*Sigarg_t*/ + +#ifdef USE_SIG_PF /* compile with -DUSE_SIG_PF under IRIX */ +#define sig_pf SIG_PF +#else +typedef Sigret_t (*sig_pf)(Sigarg_t); +#endif + +#define signal1(a,b) signal(a,(sig_pf)b) + +#ifdef __cplusplus +#define Sigarg ... +#define Use_Sigarg +#else +#define Sigarg Int n +#define Use_Sigarg n = n /* shut up compiler warning */ +#endif diff --git a/Cantera/ext/f2c_libs/sysdep1.h b/Cantera/ext/f2c_libs/sysdep1.h new file mode 100644 index 000000000..259b2b020 --- /dev/null +++ b/Cantera/ext/f2c_libs/sysdep1.h @@ -0,0 +1,78 @@ +#ifndef SYSDEP_H_INCLUDED +#define SYSDEP_H_INCLUDED +#undef USE_LARGEFILE +#ifndef NO_LONG_LONG + +#ifdef __sun__ +#define USE_LARGEFILE +#define OFF_T off64_t +// On some older solaris systems, it seems that OFF_T needed to +// be set to an int sometimes. It didn't cause crashes if you +// didn't. However, ld warnings would occur if the sys -lg2c +// libs were loaded at the same time. +// see man pages for fseek and fseeko. +// Can be debugged by finding out what off_t is set to in the +// the standard compiler headings. +//#define OFF_T int +#endif + +#ifdef __linux__ +#define USE_LARGEFILE +#define OFF_T __off64_t +#endif + +#ifdef _AIX43 +#define _LARGE_FILES +#define _LARGE_FILE_API +#define USE_LARGEFILE +#endif /*_AIX43*/ + +#ifdef __hpux +#define _FILE64 +#define _LARGEFILE64_SOURCE +#define USE_LARGEFILE +#endif /*__hpux*/ + +#ifdef __sgi +#define USE_LARGEFILE +#endif /*__sgi*/ + +#ifdef __FreeBSD__ +#define OFF_T off_t +#define FSEEK fseeko +#define FTELL ftello +#endif + +#ifdef USE_LARGEFILE +#ifndef OFF_T +#define OFF_T off64_t +#endif +#ifndef _LARGEFILE_SOURCE +#define _LARGEFILE_SOURCE +#endif +#ifndef _LARGEFILE64_SOURCE +#define _LARGEFILE64_SOURCE +#endif +#include +#include +#define FOPEN fopen64 +#define FREOPEN freopen64 +#define FSEEK fseeko64 +#define FSTAT fstat64 +#define FTELL ftello64 +#define FTRUNCATE ftruncate64 +#define STAT stat64 +#define STAT_ST stat64 +#endif /*USE_LARGEFILE*/ +#endif /*NO_LONG_LONG*/ + +#ifndef NON_UNIX_STDIO +#ifndef USE_LARGEFILE +#define _INCLUDE_POSIX_SOURCE /* for HP-UX */ +#define _INCLUDE_XOPEN_SOURCE /* for HP-UX */ +#include "sys/types.h" +#include "sys/stat.h" +#endif +#endif + +#endif /*SYSDEP_H_INCLUDED*/ diff --git a/Cantera/src/Makefile.am b/Cantera/src/Makefile.am index 836d04dc6..9e77467e2 100644 --- a/Cantera/src/Makefile.am +++ b/Cantera/src/Makefile.am @@ -1,6 +1,6 @@ # $Id: $ # will need to add python and matlab -SUBDIRS = numerics base converters thermo transport oneD zeroD kinetics spectra equil +SUBDIRS = base numerics converters thermo transport oneD zeroD kinetics spectra equil diff --git a/Cantera/src/base/Makefile.am b/Cantera/src/base/Makefile.am index 688dc57bd..2a9401316 100644 --- a/Cantera/src/base/Makefile.am +++ b/Cantera/src/base/Makefile.am @@ -30,6 +30,7 @@ __top_builddir__build_lib_libctbase_la_SOURCES = $(cc_sources) $(h_sources) # header file accumulation -- only copy if file updated! all: @echo copying headers $< + mkdir $(top_builddir)/build/include/ cp -u *.h $(top_builddir)/build/include/ CLEANFILES = *.o