Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions src/Makefile.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=======================================================================
# Mac OS X Monterey Makefile.config
# Generic Makefile.config
#-----------------------------------------------------------------------
# This file is used as a template for Makefile.config if there is not
# a predefined file in ${CWPROOT}/src/configs.
Expand Down Expand Up @@ -48,8 +48,7 @@ include $(CWPROOT)/src/Rules/opengl.rules
LINEHDRFLAG =
XDRFLAG = -DSUXDR
ENDIANFLAG = -DCWP_LITTLE_ENDIAN
#LARGE_FILE_FLAG = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DGNU_SOURCE
LARGE_FILE_FLAG =
LARGE_FILE_FLAG = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE

CWP_FLAGS = $(LARGE_FILE_FLAG) $(ENDIANFLAG) $(XDRFLAG) $(LINEHDRFLAG)

Expand All @@ -76,28 +75,27 @@ POSTLFLAGS =

IX11 = /usr/X11/include
LX11 = /usr/X11/lib
#IMOTIF = /usr/X11R6/include
#LMOTIF = /usr/X11R6/lib
IMOTIF = /opt/local/include
LMOTIF = /opt/local/lib
IMOTIF = /usr/X11R6/include
LMOTIF = /usr/X11R6/lib

LD_LIBRARY_PATH += $(CWPROOT)/lib:${LX11}:${LMOTIF}

#-----------------------------------------------------------------------
# Gnu compilers by default just because they are the most common
#-----------------------------------------------------------------------

CPP = /usr/bin/cpp
CPP = cpp

CC = /usr/bin/gcc
#OPTC = -g -c90 -m64 -Wall -ansi -Wno-long-long
#OPTC = -g -std=c90 -m64 -Wall -ansi -Wno-long-long
OPTC = -g -std=c99 -m64 -Wall -ansi -Wno-long-long
CC = gcc
OPTC = -g -std=c99 -Wall -pedantic -Wno-long-long -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L
CFLAGS = -I$I $(OPTC) $(CWP_FLAGS)
CFLAGS += -I/usr/include/tirpc

# if gfortran is made using Homebrew
FC = gfortran
FOPTS = -g
FFLAGS = $(FOPTS) -ffixed-line-length-none -fallow-argument-mismatch
FFLAGS = $(FOPTS) -ffixed-line-length-none

C++FLAGS = -I$I $(OPTC) $(CWP_FLAGS)

LDFLAGS = -ltirpc
POSTLFLAGS = -ltirpc
99 changes: 99 additions & 0 deletions src/Makefile.config_old
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#=======================================================================
# Generic Makefile.config
#-----------------------------------------------------------------------
# This file is used as a template for Makefile.config if there is not
# a predefined file in ${CWPROOT}/src/configs.
#
# Likely source of issues will be the setting of preprocessor symbols
# to properly pick up common, non-ANSI & non-POSIX extensions in
# /usr/include/stdio.h for popen(3c), pclose(3c), fdopen(3c), etc.
#
# If you are using this file rather than a preconfigured version
# please post it to the seisunix mailing list along w/ the output
# from the sys_arch command.
#
#=======================================================================


#-----------------------------------------------------------------------
# pick up the Make rules (Gnu make required)
#-----------------------------------------------------------------------

include $(CWPROOT)/src/Rules/gnumake.rules
include $(CWPROOT)/src/Rules/abbrev.rules
include $(CWPROOT)/src/Rules/cflags.rules
include $(CWPROOT)/src/Rules/suffix.rules
include $(CWPROOT)/src/Rules/misc.rules
include $(CWPROOT)/src/Rules/opengl.rules

#-----------------------------------------------------------------------
# CWP feature options
#-----------------------------------------------------------------------
#
# LINEHDRFLAG=SU_LINEHEADER - adds 3200 byte text & 400 byte SEG-Y
# style line headers to output. CWP/SU
# always reads either format unless SUXDR
# has been selected.
#
# XDRFLAG=-DSUXDR - forces all SU data to be big endian
# independent of processor architecture
#
# LARGE_FILE_FLAG - controls access to files > 2 GB on
# some systems.
#
# -DSLTSU_SEGY_H - if defined selects SLT/SU trace header
# layout so both packages are compatible
#-----------------------------------------------------------------------

LINEHDRFLAG =
XDRFLAG = -DSUXDR
ENDIANFLAG = -DCWP_LITTLE_ENDIAN
LARGE_FILE_FLAG = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE

CWP_FLAGS = $(LARGE_FILE_FLAG) $(ENDIANFLAG) $(XDRFLAG) $(LINEHDRFLAG)

#-----------------------------------------------------------------------
# system stuff
#-----------------------------------------------------------------------

SHELL = /bin/sh
ROOT = $(CWPROOT)

LN = ln # this needs to be changed to cp for FAT32 filesystems
AR = ar
ARFLAGS = rv
RANLIB = ranlib
RANFLAGS =
ICHMODLINE = chmod 644 $@
MCHMODLINE = chmod 755 $@

POSTLFLAGS =

#-----------------------------------------------------------------------
# use both X11 path conventions
#-----------------------------------------------------------------------

IX11 = /usr/X11/include
LX11 = /usr/X11/lib
IMOTIF = /usr/X11R6/include
LMOTIF = /usr/X11R6/lib

LD_LIBRARY_PATH += $(CWPROOT)/lib:${LX11}:${LMOTIF}

#-----------------------------------------------------------------------
# Gnu compilers by default just because they are the most common
#-----------------------------------------------------------------------

CPP = cpp

CC = gcc
OPTC = -g -std=c99 -Wall -pedantic -Wno-long-long
CFLAGS = -I$I $(OPTC) $(CWP_FLAGS)

FC = gfortran
FOPTS = -g
FFLAGS = $(FOPTS) -ffixed-line-length-none

C++FLAGS = -I$I $(OPTC) $(CWP_FLAGS)


8 changes: 7 additions & 1 deletion src/cwp/lib/tempname.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
/* Copyright (c) Colorado School of Mines, 2011.*/
/* Copyright (c) Colorado School of Mines, 2012.*/
/* All rights reserved. */

/*********************** self documentation **********************/

#define _POSIX_C_SOURCE 200809L // added - ben

#include "cwp.h"
/* next 3 lines edited - ben */
#include <stdio.h> // for fdopen, FILE
#include <unistd.h> // for mkstemp
#include <stdlib.h> // for NULL and general utilities


/*****************************************************************************
TEMPORARY_FILENAME - Creates a file name in a user-specified directory.
Expand Down
2 changes: 1 addition & 1 deletion src/cwp_su_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CWP/SU Release 44R24 25 March 2022
CWP/SU Release 45R00 30 April 2023
1 change: 1 addition & 0 deletions src/par/lib/docpkge.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Author: Jack K. Cohen, Center for Wave Phenomena
****************************************************************************/
/**************** end self doc ********************************/

#define _POSIX_C_SOURCE 200809L // added - ben

#include "par.h"

Expand Down
2 changes: 2 additions & 0 deletions src/par/lib/subcalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ CWP: Shuki Ronen, Jack Cohen
***************************************************************************/
/**************** end self doc ********************************/

#define _POSIX_C_SOURCE 200809L

#include "par.h"

#define ERROR NULL
Expand Down
2 changes: 1 addition & 1 deletion src/par/main/ray_theory/rayt2dtopo.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void zcoorTopog(float fxs,float dxs,int nxs,Surface *srf,float *sz,
float *nangl);


main(int argc, char **argv)
int main(int argc, char **argv)
{
int na,nat,nt,nxs,nxo,nzo,nx,nz,nxt,nx0,mx,npv,nsrf,*nxzsrf;
float dt,xs,fxs,dxs,exs,fxo,fzo,dxo,dzo,exo,ezo,fa,ea,amin,eat,
Expand Down
2 changes: 2 additions & 0 deletions src/psplot/main/psepsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

/* PSEPSI: $Revision: 1.10 $ ; $Date: 2011/11/17 00:10:53 $ */

#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include "psplot.h"
#include "par.h"

Expand Down
Binary file modified src/su/include/mkhdr
Binary file not shown.
Binary file modified src/su/include/mkheader
Binary file not shown.
Binary file modified src/su/include/mkxdrbhdrsub
Binary file not shown.
Binary file modified src/su/include/mkxdrhdrsub
Binary file not shown.
6 changes: 6 additions & 0 deletions src/su/lib/fgettr.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ Authors: SEP: Einar Kjartansson, Stew Levin CWP: Shuki Ronen, Jack Cohen
*/
/**************** end self doc ********************************/

#define _POSIX_C_SOURCE 200809L

#ifndef TEST

#ifdef SU_LINE_HEADER
Expand All @@ -71,6 +73,10 @@ int out_line_hdr=0;

#endif

#include <strings.h> // for swab()
#include <unistd.h> // for swab() and fileno()
#include <stdio.h> // for fileno()

#include "su.h"
#include "segy.h"

Expand Down