view main/database/src/Makefile.in @ 12718:1af86934c14e octave-forge

Make compatible with Octaves new exception-based error handling. Retain compatibility with Octaves old error handling based on error_state. * src/error_helpers.[h,cc]: Added. * src/Makefile.in: Integrate error-helpers.[h,cc]. * src/config.h.in: Added. * configure.ac, src/config.h.in: Test presence of 'error_state' and presence of 'verror (octave_execution_exception&, const char *, va_list)'. * src/__pq_connect__.cc, src/command.cc, src/command.h, src/converters.cc, src/converters_arr_comp.cc, src/pq_connection.cc, src/pq_conninfo.cc, src/pq_exec.cc, src/pq_lo.cc, src/pq_update_types.cc: If necessary, include error-helpers.h, replace error() with c_verror(), set and check a different error indicator than error_state, use CHECK_ERROR or SET_ERR, explicitely check for errors instead of relying on Octave checking error_state when returning to the prompt.
author i7tiol
date Sat, 27 Feb 2016 11:11:04 +0000
parents 67adec29dee0
children 65172e6662d6
line wrap: on
line source

# We rely on g++ features, configure assures CXX=g++.
CXX := @CXX@

EXTRALIBS = 
ifeq ($(OS),Windows_NT)
  EXTRALIBS = -lws2_32
endif

ifndef CXXFLAGS
CXXFLAGS_NSA := "-g -O2 -fno-strict-aliasing"
CXXFLAGS := "-g -O2"
else
CXXFLAGS_NSA := "$(CXXFLAGS) -fno-strict-aliasing"
endif

OBJECTS := __pq_connect__.o pq_close.o pq_exec.o converters.o \
           converters_arr_comp.o pq_connection.o command.o \
           pq_update_types.o pq_lo.o pq_conninfo.o __pq_internal_exit__.o \
           error-helpers.o

pq_interface.oct: $(OBJECTS)
	@MKOCTFILE@ -o pq_interface.oct -L`@PG_CONFIG@ --libdir` -lpq $(OBJECTS) $(EXTRALIBS)

converters.o: converters.cc converters.h wrap_endian.h config.h error-helpers.h
	CXX=$(CXX) CXXFLAGS=$(CXXFLAGS_NSA) @MKOCTFILE@ -I`@PG_CONFIG@ --includedir` -c converters.cc

converters_arr_comp.o: converters_arr_comp.cc converters.h wrap_endian.h \
                       pq_connection.h command.h config.h error-helpers.h
	CXX=$(CXX) CXXFLAGS=$(CXXFLAGS_NSA) @MKOCTFILE@ -I`@PG_CONFIG@ --includedir` -c converters_arr_comp.cc

# be on the safe side with respect to include files
%.o: %.cc converters.h pq_connection.h command.h config.h error-helpers.h
	CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) @MKOCTFILE@ -I`@PG_CONFIG@ --includedir` -c $<

.PHONY: clean
clean: ; rm -f *.o *.oct