diff --git a/builds/posix/Makefile.in b/builds/posix/Makefile.in index ea1639cd17..3c682f2837 100644 --- a/builds/posix/Makefile.in +++ b/builds/posix/Makefile.in @@ -36,7 +36,11 @@ ROOT=$(shell cd ..; pwd) include make.defaults +ifeq ($(CROSS_OUT), Y) +include make.crossPlatform +else include make.platform +endif include make.rules include make.shared.variables @@ -48,18 +52,24 @@ else DefaultTarget := Release endif -.PHONY: master_process firebird Debug Release extern +ifeq ($(IsCross), Y) + Process := cross_process +else + Process := master_process +endif + +.PHONY: master_process cross_process firebird Debug Release extern all: firebird firebird: - $(MAKE) TARGET=$(DefaultTarget) master_process + $(MAKE) TARGET=$(DefaultTarget) $(Process) Release: - $(MAKE) TARGET=Release master_process + $(MAKE) TARGET=Release $(Process) Debug: - $(MAKE) TARGET=Debug master_process + $(MAKE) TARGET=Debug $(Process) #---------------------------------------------------------------------------- @@ -102,14 +112,28 @@ endif export_lists: $(ALLVERS) +#___________________________________________________________________________ +# LibTomMath - used by cross-builds +# + +.PHONY: tommath +TOMLIB=$(LIB)/libtommath.a +TOM_Objs=$(addprefix ../extern/libtommath/,$(call doObjects,$(call dirFiles,../extern/libtommath))) + +tommath: $(TOMLIB) + +$(TOMLIB): $(TOM_Objs) + -$(RM) $@ + $(STATICLIB_LINK) $@ $^ #___________________________________________________________________________ # main build target for both debug abd release builds # -.PHONY: boot yvalve engine fbintl gpre utilities plugins rest codes examples +.PHONY: cross1 cross2 boot yvalve engine fbintl gpre utilities plugins rest codes examples master_process: + ln -sf $(SRC_ROOT)/include/gen/autoconfig.auto $(SRC_ROOT)/include/gen/autoconfig.h $(MAKE) updateBuildNum $(MAKE) export_lists $(MAKE) extern @@ -133,6 +157,35 @@ endif $(MAKE) examples $(MAKE) rest + +cross_process: + $(MAKE) TARGET=Native cross1 + $(MAKE) CROSS_OUT=Y cross2 + +cross1: + ln -sf $(SRC_ROOT)/include/gen/autoconfig.auto $(SRC_ROOT)/include/gen/autoconfig.h + $(MAKE) updateBuildNum + $(MAKE) export_lists + $(MAKE) extern + $(MAKE) boot + $(MAKE) yvalve + $(MAKE) engine + $(MAKE) fbintl + $(MAKE) gbak isql gfix +# Now having ready such useful tools as gbak and isql, we may restore / create +# required databases and switch to full-featured gpre + $(MAKE) gpre +# Pay attention - after build force gpre_current to point to gpre +# even if gpre itself was not rebuilt + -$(RM) $(GPRE_CURRENT) + (cd $(BIN); $(LN) $(notdir $(RUN_GPRE)) $(notdir $(GPRE_CURRENT))) + +cross2: + ln -sf $(SRC_ROOT)/include/cross/$(CROSS_CONFIG) $(SRC_ROOT)/include/gen/autoconfig.h + $(MAKE) tommath + $(MAKE) yvalve + + #___________________________________________________________________________ # static library - various common code, used in different FB projects # @@ -219,10 +272,10 @@ yachts.lnk: metadata.fdb -$(RM) $@ $(LN) $^ $@ -metadata.fdb: $(ISQL) $(SRC_ROOT)/dbs/metadata.sql +metadata.fdb: $(RUN_ISQL) $(SRC_ROOT)/dbs/metadata.sql -$(RM) $@ - $(ISQL) -q -i $(SRC_ROOT)/dbs/metadata.sql - $(GFIX) -mode read_only $@ + $(RUN_ISQL) -q -i $(SRC_ROOT)/dbs/metadata.sql + $(RUN_GFIX) -mode read_only $@ $(CHMOD) 0444 $@ $(HELP_FDB): help.fdb @@ -231,7 +284,7 @@ $(HELP_FDB): help.fdb $(CHMOD) 0444 $@ help.fdb: $(BLD_ROOT)/misc/help.gbak - $(GBAK) -MODE read_only -R $< $@ + $(RUN_GBAK) -MODE read_only -R $< $@ $(CHMOD) 0444 $@ $(SECURITY_FDB): security.fdb @@ -241,18 +294,18 @@ $(SECURITY_FDB): security.fdb security.fdb: $(SRC_ROOT)/dbs/security.sql -$(RM) $@ -$(RM) $(SECURITY_TMP) - echo create database \'$(SECURITY_TMP)\'\; | $(ISQL) - $(GFIX) -write async $(SECURITY_TMP) - $(ISQL) -i $^ $(SECURITY_TMP) + echo create database \'$(SECURITY_TMP)\'\; | $(RUN_ISQL) + $(RUN_GFIX) -write async $(SECURITY_TMP) + $(RUN_ISQL) -i $^ $(SECURITY_TMP) $(CHMOD) a=rw $(SECURITY_TMP) $(CP) $(SECURITY_TMP) $@ - $(GFIX) -write sync $@ + $(RUN_GFIX) -write sync $@ msg.timestamp: $(MSG_FILES) -$(RM) msg.fdb - echo create database \'msg.fdb\'\; | $(ISQL) - $(GFIX) -write async msg.fdb - for sql in $(MSG_FILES); do (echo $$sql; $(ISQL) -i $$sql msg.fdb) || exit; done + echo create database \'msg.fdb\'\; | $(RUN_ISQL) + $(RUN_GFIX) -write async msg.fdb + for sql in $(MSG_FILES); do (echo $$sql; $(RUN_ISQL) -i $$sql msg.fdb) || exit; done $(TOUCH) $@ @@ -264,7 +317,7 @@ udfsupport: udfs: ibudf fbudf -UDF = $(FIREBIRD)/UDF +UDF = $(FB_BUILD)/UDF IBUDF_SO = $(UDF)/ib_udf.$(SHRLIB_EXT) FBUDF_SO = $(UDF)/fbudf.$(SHRLIB_EXT) @@ -439,8 +492,8 @@ examples: include_generic message_file: $(FIREBIRD_MSG) -$(FIREBIRD_MSG): $(BUILD_FILE) msg.timestamp - $(BUILD_FILE) -d msg.fdb -f $@ +$(FIREBIRD_MSG): $(RUN_BUILD_FILE) msg.timestamp + $(RUN_BUILD_FILE) -d msg.fdb -f $@ $(CHMOD_6) $@ $(BUILD_FILE): $(BUILD_Objects) $(COMMON_LIB) @@ -454,7 +507,7 @@ $(BUILD_FILE): $(BUILD_Objects) $(COMMON_LIB) # software - mainly they are just flattened out to make the view simpler # from an external point of view. -INCLUDE_DEST= $(FIREBIRD)/include +INCLUDE_DEST= $(FB_BUILD)/include include_generic: $(INCLUDE_DEST)/ib_util.h \ $(INCLUDE_DEST)/ibase.h @@ -521,7 +574,7 @@ install install-embedded silent_install package packages dist: clean: clean_objects clean_dependancies clean_extern_objects clean_build \ - clean_yacc_gen clean_gpre_gen clean_dbs clean_examples + clean_yacc_gen clean_gpre_gen clean_dbs clean_examples clean_tommath ifeq ($(EDITLINE_FLG),Y) ifeq ($(STD_EDITLINE),false) @@ -558,6 +611,9 @@ clean_editline: #clean_icu: # -$(MAKE) -C $(ROOT)/extern/icu/source clean +clean_tommath: + -$(MAKE) -C $(ROOT)/extern/libtommath clean + clean_objects: $(RM) `find $(TMP_ROOT)/ -type f -name '*.o' -print` $(RM) `find $(TMP_ROOT)/ -type f -name '*.a' -print` diff --git a/builds/posix/Makefile.in.examples b/builds/posix/Makefile.in.examples index b1c8a0a01e..669d10366f 100644 --- a/builds/posix/Makefile.in.examples +++ b/builds/posix/Makefile.in.examples @@ -33,7 +33,7 @@ ROOT=../.. # Add the install include directory to the search path since the # examples need to build using those headers values. -CFLAGS := $(CFLAGS) -I$(FIREBIRD)/include +CFLAGS := $(CFLAGS) -I$(FB_BUILD)/include include $(ROOT)/gen/make.defaults diff --git a/builds/posix/Makefile.in.plugins_examples b/builds/posix/Makefile.in.plugins_examples index 1f9fd96153..a5331c8773 100644 --- a/builds/posix/Makefile.in.plugins_examples +++ b/builds/posix/Makefile.in.plugins_examples @@ -36,7 +36,7 @@ else DefaultTarget := Release endif -CPPFLAGS+= -I$(FIREBIRD)/include +CPPFLAGS+= -I$(FB_BUILD)/include include $(ROOT)/gen/make.defaults include $(ROOT)/gen/make.platform diff --git a/builds/posix/make.android.arme b/builds/posix/make.android.arme new file mode 100644 index 0000000000..eec8142fe1 --- /dev/null +++ b/builds/posix/make.android.arme @@ -0,0 +1,44 @@ + +ifeq ($(NDK),) +$(error Must export NDK location before building for Android) +endif +NDK_ROOT:=$(NDK) +#NDK_LOG:=1 + +include $(NDK)/build/core/init.mk + +CROSS_PLATFORM:=$(NDK)/platforms/android-9/arch-arm +CROSS_PREFIX:=$(NDK)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- + +CXX:=$(CROSS_PREFIX)g++ +CC:=$(CROSS_PREFIX)gcc +AR:=$(CROSS_PREFIX)ar +AS:=$(CROSS_PREFIX)as +LD:=$(CROSS_PREFIX)ld +NM:=$(CROSS_PREFIX)nm +OBJCOPY:=$(CROSS_PREFIX)objcopy +OBJDUMP:=$(CROSS_PREFIX)objdump +RANLIB:=$(CROSS_PREFIX)ranlib +STRIP:=$(CROSS_PREFIX)strip + +COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -DANDROID -DARM -pipe -MMD -fPIC -fmessage-length=0 \ + -I$(ROOT)/extern/libtommath --sysroot=$(CROSS_PLATFORM) \ + -I$(ROOT)/extern/icu/source/common -I$(ROOT)/extern/icu/source/i18n +OPTIMIZE_FLAGS=-O3 -fno-omit-frame-pointer +WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable + +PROD_FLAGS=$(COMMON_FLAGS) $(OPTIMIZE_FLAGS) +#DEV_FLAGS=-DUSE_VALGRIND $(COMMON_FLAGS) $(WARN_FLAGS) +DEV_FLAGS=$(COMMON_FLAGS) $(WARN_FLAGS) + +CROSS_CONFIG=android.arme + +LDFLAGS += --sysroot=$(CROSS_PLATFORM) -L$(NDK)/sources/cxx-stl/gnu-libstdc++/libs/armeabi +DroidLibs := -lm -ldl -lsupc++ + +LINK_LIBS = $(DroidLibs) +STATICLINK_LIBS = $(DroidLibs) +SO_LINK_LIBS = $(DroidLibs) + +EXE_LINK_OPTIONS= $(LDFLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) $(LINK_EMPTY_SYMBOLS) +LIB_LINK_OPTIONS= $(LDFLAGS) -shared diff --git a/builds/posix/make.defaults b/builds/posix/make.defaults index 26f95f086b..1a091f67f8 100755 --- a/builds/posix/make.defaults +++ b/builds/posix/make.defaults @@ -47,7 +47,14 @@ BLD_ROOT=$(ROOT)/builds LNG_ROOT=$(ROOT)/lang_helpers EXA_ROOT=$(ROOT)/examples -FIREBIRD=$(GEN_ROOT)/$(TARGET)/firebird +IsCross=@IS_CROSS@ + +FB_BUILD=$(GEN_ROOT)/$(TARGET)/firebird +ifeq ($(IsCross), Y) + FIREBIRD=$(GEN_ROOT)/Native/firebird +else + FIREBIRD=$(FB_BUILD) +endif FIREBIRD_LOCK=$(FIREBIRD) export FIREBIRD @@ -57,9 +64,10 @@ export FIREBIRD_LOCK FIREBIRD_BOOT_BUILD=1 export FIREBIRD_BOOT_BUILD -LIB=$(FIREBIRD)/lib -BIN=$(FIREBIRD)/bin -PLUGINS=$(FIREBIRD)/plugins +LIB=$(FB_BUILD)/lib +BIN=$(FB_BUILD)/bin +PLUGINS=$(FB_BUILD)/plugins +RBIN=$(FIREBIRD)/bin # This picks up the current directory and maps it to the equivalent module # in the src and gen area. @@ -143,7 +151,7 @@ ECHO= echo QUIET_ECHO= @echo CD= cd CAT= cat -AR= ar @AR_OPTIONS@ crsu +AR= ar @AR_OPTIONS@ LN= @LN_S@ RANLIB= @RANLIB@ BTYACC=$(ROOT)/extern/btyacc/btyacc @@ -155,7 +163,7 @@ LD = @CXX@ # LINKER COMMANDS LIB_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) -STATICLIB_LINK = ar cruvs +STATICLIB_LINK = $(AR) crus EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) STATICEXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) @@ -226,7 +234,7 @@ ENGINE_SONAME = $(PLUGINS)/$(EngineSoName) # confuses the dynamic load process. So we only have the .$(SHRLIB_EXT) file # MOD 28-July-2002 -LIBFBINTL_SO = $(FIREBIRD)/intl/$(LIB_PREFIX)fbintl.$(SHRLIB_EXT) +LIBFBINTL_SO = $(FB_BUILD)/intl/$(LIB_PREFIX)fbintl.$(SHRLIB_EXT) ifeq ($(EDITLINE_FLG),Y) ifeq ($(STD_EDITLINE), true) @@ -323,7 +331,7 @@ LINK_PLUG_LIBS = -L$(LIB) $(SO_LINK_LIBS) COMMON_LIB = $(OBJ)/common.a # From utilities -CREATE_DB = $(BIN)/create_db$(EXEC_EXT) +CREATE_DB = $(RBIN)/create_db$(EXEC_EXT) GDS_DROP = $(BIN)/gds_drop$(EXEC_EXT) FBSVCMGR = $(BIN)/fbsvcmgr$(EXEC_EXT) FBTRACEMGR = $(BIN)/fbtracemgr$(EXEC_EXT) @@ -332,8 +340,8 @@ NBACKUP = $(BIN)/nbackup$(EXEC_EXT) LOCKPRINT = $(BIN)/fb_lock_print$(EXEC_EXT) GSEC = $(BIN)/gsec$(EXEC_EXT) GFIX = $(BIN)/gfix$(EXEC_EXT) +RUN_GFIX = $(RBIN)/gfix$(EXEC_EXT) GDS_REBUILD = $(BIN)/gds_rebuild$(EXEC_EXT) -GDS_RELAY = $(BIN)/gds_relay$(EXEC_EXT) GDS_INSTALL = $(BIN)/gds_install$(EXEC_EXT) GDS_INSTALL = $(BIN)/gds_install_service$(EXEC_EXT) FBGUARD = $(BIN)/fbguard$(EXEC_EXT) @@ -349,25 +357,25 @@ QLI = $(BIN)/qli$(EXEC_EXT) # From isql ISQL = $(BIN)/isql$(EXEC_EXT) -ISQL_STATIC = $(BIN)/isql_static$(EXEC_EXT) -MUISQL = $(BIN)/muisql$(EXEC_EXT) +RUN_ISQL = $(RBIN)/isql$(EXEC_EXT) # From burp -GBAK_STATIC = $(BIN)/gbak_static$(EXEC_EXT) GBAK = $(BIN)/gbak$(EXEC_EXT) +RUN_GBAK = $(RBIN)/gbak$(EXEC_EXT) GSPLIT = $(BIN)/gsplit$(EXEC_EXT) # From gpre # (gpre current is a link to one of the others) -GPRE_BOOT = $(BIN)/gpre_boot$(EXEC_EXT) -GPRE_STATIC = $(BIN)/gpre_static$(EXEC_EXT) +GPRE_BOOT = $(RBIN)/gpre_boot$(EXEC_EXT) GPRE = $(BIN)/gpre$(EXEC_EXT) -GPRE_CURRENT = $(BIN)/gpre_current$(EXEC_EXT) +RUN_GPRE = $(RBIN)/gpre$(EXEC_EXT) +GPRE_CURRENT = $(RBIN)/gpre_current$(EXEC_EXT) # From msgs CHECK_MESSAGES = $(BIN)/check_messages$(EXEC_EXT) BUILD_FILE = $(BIN)/build_file$(EXEC_EXT) +RUN_BUILD_FILE = $(RBIN)/build_file$(EXEC_EXT) FIREBIRD_MSG = $(FIREBIRD)/firebird.msg ENTER_MESSAGES = $(BIN)/enter_messages$(EXEC_EXT) diff --git a/builds/posix/make.rules b/builds/posix/make.rules index 2ddef5c197..4cd7ea5d96 100644 --- a/builds/posix/make.rules +++ b/builds/posix/make.rules @@ -86,6 +86,9 @@ $(OBJ)/%.cpp: $(SRC_ROOT)/%.epp .SUFFIXES: .lo .o .cpp .c +%.o: %.c + $(CC) $(WCFLAGS) -c $(firstword $<) -o $@ + $(OBJ)/%.o: $(SRC_ROOT)/%.c $(CC) $(WCFLAGS) -c $(firstword $<) -o $@ @sed $(INLINE_EDIT_SED) -e "1,2s/:/: \$$(wildcard/" -e "\$$s/\(.*\)/\\1)/" $(patsubst %.o,%.d,$@) diff --git a/builds/posix/make.shared.variables b/builds/posix/make.shared.variables index 007defe260..e0cc7bf391 100644 --- a/builds/posix/make.shared.variables +++ b/builds/posix/make.shared.variables @@ -1,5 +1,6 @@ # Helper functions -makeObjects= $(addprefix $(OBJ)/$(1)/,$(patsubst %.y,%.o,$(patsubst %.epp,%.o,$(patsubst %.c,%.o,$(2:.cpp=.o))))) +doObjects= $(patsubst %.y,%.o,$(patsubst %.epp,%.o,$(patsubst %.c,%.o,$(1:.cpp=.o)))) +makeObjects= $(addprefix $(OBJ)/$(1)/,$(call doObjects,$2)) dirFiles= $(notdir $(wildcard ../src/$(1)/*.cpp)) $(notdir $(wildcard ../src/$(1)/*.c)) \ $(notdir $(wildcard ../src/$(1)/*.epp)) $(notdir $(wildcard ../src/$(1)/*.y)) dirInPath= $(call makeObjects,$(1),$(call dirFiles,$(1))) diff --git a/configure.in b/configure.in index b6610313d1..aa87964232 100644 --- a/configure.in +++ b/configure.in @@ -12,7 +12,7 @@ m4_ifdef([AC_CONFIG_MACRO_DIR], [m4_define([AC_CONFIG_MACRO_DIR], [])]) AC_CONFIG_MACRO_DIR(m4) -AC_CONFIG_HEADER(src/include/gen/autoconfig.h:builds/make.new/config/config.h.in) +AC_CONFIG_HEADER(src/include/gen/autoconfig.auto:builds/make.new/config/config.h.in) dnl XE_APPEND(value, varname) define([XE_APPEND],[[$2]="$[$2] [$1]"]) @@ -448,6 +448,14 @@ AC_ARG_ENABLE(developer, esac]) AC_SUBST(DEVEL_FLG) +CROSS= +IS_CROSS=N +AC_ARG_WITH(cross-build, + [ --with-cross-build build for platform different from current one], + [CROSS=${withval} + IS_CROSS=Y]) +AC_SUBST(IS_CROSS) + dnl Avoid dumb '-g -O2' autoconf's default dnl Debugging information and optimization flags should be set in prefix.$platform file dnl Should be replaced with AC_PROG_GCC_DEFAULT_FLAGS() when available @@ -663,6 +671,7 @@ AC_CHECK_HEADERS(atomic_ops.h) AC_CHECK_HEADERS(poll.h) AC_CHECK_HEADERS(langinfo.h) AC_CHECK_HEADERS(iconv.h) +AC_CHECK_HEADERS(libio.h) dnl check for ICU presence AC_CHECK_HEADER(unicode/ucnv.h,,AC_MSG_ERROR(ICU support not found - please install development ICU package)) @@ -813,6 +822,9 @@ dnl Checks for pthread functions AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) AC_CHECK_FUNCS(pthread_mutexattr_setrobust_np) AC_CHECK_FUNCS(pthread_mutex_consistent_np) +AC_CHECK_FUNCS(pthread_rwlockattr_setkind_np) +AC_CHECK_FUNCS(pthread_cancel) +AC_CHECK_FUNCS(sigset) dnl Semaphores if test "$ac_cv_header_semaphore_h" = "yes"; then @@ -1036,8 +1048,16 @@ AC_SUBST(EXPORT_SYMBOLS_STYLE) AC_DEFINE_UNQUOTED(FB_PREFIX, $(if test "x$prefix" = "xNONE" ; then echo \"$ac_default_prefix\"; else echo \"$prefix\"; fi), [Installation path prefix]) +FB_TARGETS="Debug Release" +test "x$CROSS" = "x" || FB_TARGETS="$FB_TARGETS Native" + AC_CONFIG_COMMANDS(,,[ -for fb_tgt in Debug Release; do + +FB_TARGETS="$FB_TARGETS" +for fb_tgt in \$FB_TARGETS; do + + echo "Creating \$fb_tgt directories" + dnl ### GEN ### directories for databases and misc mkdir -p gen/\$fb_tgt/examples mkdir -p gen/\$fb_tgt/refDatabases @@ -1062,8 +1082,7 @@ dnl # output mkdir -p gen/\$fb_tgt/firebird/help mkdir -p gen/\$fb_tgt/firebird/plugins/udr -dnl #### TEMP ######### directories for generated .cpp, .o and .d -dnl # by module name +dnl ### TEMP ### directories for generated .cpp, .o and .d by module name for src_dir in `cd src; ls -R -1 * | grep : | tr -d : | tr "\n" " "; cd ..`; do mkdir -p temp/\$fb_tgt/\$src_dir done @@ -1071,8 +1090,8 @@ dnl # by module name src/misc/writeBuildNum.sh createMakeVersion gen/Make.Version dnl # sql files for UDF declarations - for sql_file in src/extlib/ib_udf.sql src/extlib/fbudf/fbudf.sql src/extlib/ib_udf2.sql; do - cp \$sql_file gen/\$fb_tgt/firebird/UDF + for sql_file in ib_udf.sql fbudf/fbudf.sql ib_udf2.sql; do + cp src/extlib/\$sql_file gen/\$fb_tgt/firebird/UDF done done @@ -1090,17 +1109,21 @@ MAKE_SRC_DIR=builds/posix dnl common files for all posix hosts dnl TODO: fix "arch-specific/linux/" paths for common posix scripts with SVN +for fb_tgt in $FB_TARGETS; do +AC_CONFIG_FILES([ +gen/$fb_tgt/firebird/firebird.conf:builds/install/misc/firebird.conf.in +gen/$fb_tgt/firebird/aliases.conf:builds/install/misc/aliases.conf.in +gen/$fb_tgt/firebird/fbtrace.conf:src/utilities/ntrace/fbtrace.conf +gen/$fb_tgt/firebird/intl/fbintl.conf:builds/install/misc/fbintl.conf +gen/$fb_tgt/firebird/plugins.conf:builds/install/misc/plugins.conf +]) +done + +if test "x$CROSS" != "x"; then +AC_CONFIG_FILES([gen/make.crossPlatform:builds/posix/make.$CROSS]) +fi + AC_CONFIG_FILES([ -gen/Debug/firebird/firebird.conf:builds/install/misc/firebird.conf.in -gen/Release/firebird/firebird.conf:builds/install/misc/firebird.conf.in -gen/Debug/firebird/aliases.conf:builds/install/misc/aliases.conf.in -gen/Release/firebird/aliases.conf:builds/install/misc/aliases.conf.in -gen/Debug/firebird/fbtrace.conf:src/utilities/ntrace/fbtrace.conf -gen/Release/firebird/fbtrace.conf:src/utilities/ntrace/fbtrace.conf -gen/Debug/firebird/intl/fbintl.conf:builds/install/misc/fbintl.conf -gen/Release/firebird/intl/fbintl.conf:builds/install/misc/fbintl.conf -gen/Debug/firebird/plugins.conf:builds/install/misc/plugins.conf -gen/Release/firebird/plugins.conf:builds/install/misc/plugins.conf gen/Release/firebird/bin/fb_config:builds/install/misc/fb_config.in gen/Release/firebird/bin/posixLibrary.sh:builds/install/misc/posixLibrary.sh.in gen/Release/firebird/bin/changeRunUser.sh:builds/install/misc/changeRunUser.sh.in @@ -1113,12 +1136,11 @@ gen/Release/firebird/bin/preuninstall.sh:builds/install/arch-specific/linux/misc gen/Release/firebird/bin/postuninstall.sh:builds/install/arch-specific/linux/misc/postuninstall.sh.in gen/Release/firebird/bin/taruninstall.sh:builds/install/arch-specific/linux/misc/taruninstall.sh.in gen/Release/firebird/bin/tarMainUninstall.sh:builds/install/arch-specific/linux/misc/tarMainUninstall.sh.in -gen/vers.sh:builds/posix/vers.sh.in gen/Release/firebird/bin/changeDBAPassword.sh:builds/install/misc/changeDBAPassword.sh.in gen/Release/firebird/bin/changeMultiConnectMode.sh:builds/install/misc/changeMultiConnectMode.sh.in gen/Release/firebird/bin/createAliasDB.sh:builds/install/misc/createAliasDB.sh.in -], -[chmod a+x gen/install/scripts/*.sh gen/install/*sh 2>/dev/null]) +gen/vers.sh:builds/posix/vers.sh.in +]) dnl: Platform Specific Files diff --git a/extern/libtommath/makefile b/extern/libtommath/makefile index 70de306106..25effac2fa 100644 --- a/extern/libtommath/makefile +++ b/extern/libtommath/makefile @@ -168,8 +168,6 @@ clean: rm -f *.bat *.pdf *.o *.a *.obj *.lib *.exe *.dll etclib/*.o demo/demo.o test ltmtest mpitest mtest/mtest mtest/mtest.exe \ *.idx *.toc *.log *.aux *.dvi *.lof *.ind *.ilg *.ps *.log *.s mpi.c *.da *.dyn *.dpi tommath.tex `find . -type f | grep [~] | xargs` *.lo *.la rm -rf .libs - cd etc ; MAKE=${MAKE} ${MAKE} clean - cd pics ; MAKE=${MAKE} ${MAKE} clean #zipup the project (take that!) no_oops: clean diff --git a/src/common/ThreadStart.cpp b/src/common/ThreadStart.cpp index 06665f164e..78a9cd0d65 100644 --- a/src/common/ThreadStart.cpp +++ b/src/common/ThreadStart.cpp @@ -165,10 +165,12 @@ void Thread::start(ThreadEntryPoint* routine, void* arg, int priority_arg, Handl if (p_handle) { +#ifdef HAVE_PTHREAD_CANCEL int dummy; // We do not want to know old cancel type state = pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &dummy); if (state) Firebird::system_call_failed::raise("pthread_setcanceltype", state); +#endif *p_handle = thread; } } @@ -182,10 +184,12 @@ void Thread::waitForCompletion(Handle& thread) void Thread::kill(Handle& thread) { +#ifdef HAVE_PTHREAD_CANCEL int state = pthread_cancel(thread); if (state) Firebird::system_call_failed::raise("pthread_cancel", state); waitForCompletion(thread); +#endif } #endif /* USE_POSIX_THREADS */ diff --git a/src/common/classes/alloc.cpp b/src/common/classes/alloc.cpp index a86bf4ea5e..85877769c6 100644 --- a/src/common/classes/alloc.cpp +++ b/src/common/classes/alloc.cpp @@ -284,7 +284,7 @@ void MemoryPool::setStatsGroup(MemoryStats& newStats) throw () stats->increment_usage(sav_used_memory); } -MemBlock* MemoryPool::alloc(const size_t length) throw (std::bad_alloc) +MemBlock* MemoryPool::alloc(const size_t length) throw (OOM_EXCEPTION) { MutexLockGuard guard(mutex, "MemoryPool::alloc"); @@ -473,7 +473,7 @@ void* MemoryPool::allocate(size_t size #ifdef DEBUG_GDS_ALLOC , const char* fileName, int line #endif -) throw (std::bad_alloc) +) throw (OOM_EXCEPTION) { size_t length = ROUNDUP(size + VALGRIND_REDZONE, roundingSize) + OFFSET(MemBlock*, body) + GUARD_BYTES; MemBlock* memory = alloc(length); @@ -669,7 +669,7 @@ void MemoryPool::corrupt(const char* text) throw () #endif } -void MemoryPool::memoryIsExhausted(void) throw (std::bad_alloc) +void MemoryPool::memoryIsExhausted(void) throw (OOM_EXCEPTION) { Firebird::BadAlloc::raise(); } @@ -785,7 +785,7 @@ inline size_t get_map_page_size() } -void* MemoryPool::allocRaw(size_t size) throw (std::bad_alloc) +void* MemoryPool::allocRaw(size_t size) throw (OOM_EXCEPTION) { #ifndef USE_VALGRIND if (size == DEFAULT_ALLOCATION) @@ -976,7 +976,7 @@ void* MemoryPool::calloc(size_t size #ifdef DEBUG_GDS_ALLOC , const char* fileName, int line #endif -) throw (std::bad_alloc) +) throw (OOM_EXCEPTION) { void *block = allocate((int) size #ifdef DEBUG_GDS_ALLOC diff --git a/src/common/classes/alloc.h b/src/common/classes/alloc.h index 0e01a169e6..247dd45083 100644 --- a/src/common/classes/alloc.h +++ b/src/common/classes/alloc.h @@ -75,6 +75,12 @@ #define VALGRIND_REDZONE 8 #endif +#ifdef USE_SYSTEM_NEW +#define OOM_EXCEPTION std::bad_alloc +#else +#define OOM_EXCEPTION Firebird::BadAlloc +#endif + namespace Firebird { @@ -275,7 +281,7 @@ private: AtomicCounter used_memory, mapped_memory; protected: - MemBlock* alloc(const size_t length) throw (std::bad_alloc); + MemBlock* alloc(const size_t length) throw (OOM_EXCEPTION); void releaseBlock(MemBlock *block) throw (); public: @@ -283,16 +289,16 @@ public: #ifdef DEBUG_GDS_ALLOC , const char* fileName = NULL, int line = 0 #endif - ) throw (std::bad_alloc); + ) throw (OOM_EXCEPTION); protected: void corrupt(const char* text) throw (); private: - virtual void memoryIsExhausted(void) throw (std::bad_alloc); + virtual void memoryIsExhausted(void) throw (OOM_EXCEPTION); void remove(MemFreeBlock* block) throw (); void insert(MemFreeBlock* block) throw (); - void* allocRaw(size_t length) throw (std::bad_alloc); + void* allocRaw(size_t length) throw (OOM_EXCEPTION); void validateFreeList(void) throw (); void validateBigBlock(MemBigObject* block) throw (); static void release(void* block) throw (); @@ -312,14 +318,14 @@ public: #ifdef DEBUG_GDS_ALLOC , const char* fileName, int line #endif - ) throw (std::bad_alloc); + ) throw (OOM_EXCEPTION); static void deallocate(void* block) throw (); void validate(void) throw (); #ifdef LIBC_CALLS_NEW - static void* globalAlloc(size_t s) throw (std::bad_alloc); + static void* globalAlloc(size_t s) throw (OOM_EXCEPTION); #else - static void* globalAlloc(size_t s) throw (std::bad_alloc) + static void* globalAlloc(size_t s) throw (OOM_EXCEPTION) { return defaultMemoryManager->allocate(s #ifdef DEBUG_GDS_ALLOC @@ -442,11 +448,11 @@ private: using Firebird::MemoryPool; // Global versions of operators new and delete -inline void* operator new(size_t s) throw (std::bad_alloc) +inline void* operator new(size_t s) throw (OOM_EXCEPTION) { return MemoryPool::globalAlloc(s); } -inline void* operator new[](size_t s) throw (std::bad_alloc) +inline void* operator new[](size_t s) throw (OOM_EXCEPTION) { return MemoryPool::globalAlloc(s); } @@ -461,22 +467,22 @@ inline void operator delete[](void* mem) throw() } #ifdef DEBUG_GDS_ALLOC -inline void* operator new(size_t s, Firebird::MemoryPool& pool, const char* file, int line) +inline void* operator new(size_t s, Firebird::MemoryPool& pool, const char* file, int line) throw (OOM_EXCEPTION) { return pool.allocate(s, file, line); } -inline void* operator new[](size_t s, Firebird::MemoryPool& pool, const char* file, int line) +inline void* operator new[](size_t s, Firebird::MemoryPool& pool, const char* file, int line) throw (OOM_EXCEPTION) { return pool.allocate(s, file, line); } #define FB_NEW(pool) new(pool, __FILE__, __LINE__) #define FB_NEW_RPT(pool, count) new(pool, count, __FILE__, __LINE__) #else -inline void* operator new(size_t s, Firebird::MemoryPool& pool) +inline void* operator new(size_t s, Firebird::MemoryPool& pool) throw (OOM_EXCEPTION) { return pool.allocate(s); } -inline void* operator new[](size_t s, Firebird::MemoryPool& pool) +inline void* operator new[](size_t s, Firebird::MemoryPool& pool) throw (OOM_EXCEPTION) { return pool.allocate(s); } @@ -484,6 +490,21 @@ inline void* operator new[](size_t s, Firebird::MemoryPool& pool) #define FB_NEW_RPT(pool, count) new(pool, count) #endif +#ifndef USE_SYSTEM_NEW +// We must define placement operators NEW & DELETE ourself +inline void* operator new(size_t s, void* place) throw () +{ + return place; +} +inline void* operator new[](size_t s, void* place) throw () +{ + return place; +} +inline void operator delete(void*, void*) throw() +{ } +inline void operator delete[](void*, void*) throw() +{ } +#endif namespace Firebird { diff --git a/src/common/classes/rwlock.h b/src/common/classes/rwlock.h index fc8c09bdd3..ce152a87e4 100644 --- a/src/common/classes/rwlock.h +++ b/src/common/classes/rwlock.h @@ -191,7 +191,7 @@ private: void init() { -#if defined(LINUX) && !defined(USE_VALGRIND) +#if defined(LINUX) && !defined(USE_VALGRIND) && defined(HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP) pthread_rwlockattr_t attr; if (pthread_rwlockattr_init(&attr)) system_call_failed::raise("pthread_rwlockattr_init"); diff --git a/src/common/common.h b/src/common/common.h index f0f79da750..adab3bdf8a 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -291,6 +291,15 @@ #endif /* NETBSD */ +/***************************************************** +* Android +*****************************************************/ +#ifdef ANDROID + +#define NO_NFS /* no MTAB_OPEN or MTAB_CLOSE in isc_file.c */ + +#endif /* NETBSD */ + /***************************************************** * SUN platforms--the 386i is obsolete diff --git a/src/common/isc_f_proto.h b/src/common/isc_f_proto.h index eb275f9a91..12089aec78 100644 --- a/src/common/isc_f_proto.h +++ b/src/common/isc_f_proto.h @@ -28,6 +28,7 @@ #define JRD_ISC_FILE_PROTO_H #include "../common/classes/fb_string.h" +#include "../common/common.h" enum iscProtocol {ISC_PROTOCOL_LOCAL, ISC_PROTOCOL_TCPIP, ISC_PROTOCOL_WLAN}; diff --git a/src/common/isc_file.cpp b/src/common/isc_file.cpp index 3edb521186..aa2f498efe 100644 --- a/src/common/isc_file.cpp +++ b/src/common/isc_file.cpp @@ -184,7 +184,7 @@ namespace { #endif //NO_NFS } // anonymous namespace -#if (!defined NO_NFS || defined FREEBSD || defined NETBSD) +#ifndef WIN_NT static void expand_filename2(tstring&, bool); #endif @@ -523,7 +523,7 @@ iscProtocol ISC_extract_host(Firebird::PathName& file_name, } -#if (!defined NO_NFS || defined FREEBSD || defined NETBSD) +#ifndef WIN_NT bool ISC_expand_filename(tstring& buff, bool expand_mounts) { /************************************** @@ -1027,7 +1027,7 @@ void ISC_expand_share(tstring& file_name) #endif // WIN_NT -#if (!defined NO_NFS || defined FREEBSD || defined NETBSD) +#ifndef WIN_NT static void expand_filename2(tstring& buff, bool expand_mounts) { /************************************** diff --git a/src/common/isc_sync.cpp b/src/common/isc_sync.cpp index 997b47f1db..c90636b1dc 100644 --- a/src/common/isc_sync.cpp +++ b/src/common/isc_sync.cpp @@ -105,14 +105,6 @@ static int process_id; //#define SIGURG SIGINT //#endif -#ifndef HAVE_SEMUN -union semun -{ - int val; - struct semid_ds *buf; - ushort *array; -}; -#endif #endif // UNIX #ifdef HAVE_SYS_PARAM_H @@ -292,6 +284,15 @@ namespace { // Uncomment to trace details of event_init/fini calls //#define DEB_EVNT +#ifndef HAVE_SEMUN +union semun +{ + int val; + struct semid_ds *buf; + ushort *array; +}; +#endif + static SLONG create_semaphores(Arg::StatusVector&, SLONG, int); namespace { diff --git a/src/common/os/posix/SyncSignals.cpp b/src/common/os/posix/SyncSignals.cpp index b80a5da333..a311244011 100644 --- a/src/common/os/posix/SyncSignals.cpp +++ b/src/common/os/posix/SyncSignals.cpp @@ -76,6 +76,17 @@ namespace { } // extern "C" +#ifndef HAVE_SIGSET + typedef void HandlerType(int); + void sigset(int signum, HandlerType* handler) + { + struct sigaction act; + memset(&act, 0, sizeof act); + act.sa_handler = handler; + sigaction(signum, &act, NULL); + } +#endif + } // anonymous namespace namespace Firebird { diff --git a/src/common/os/posix/os_utils.cpp b/src/common/os/posix/os_utils.cpp index 5b6447213f..7f3108d614 100644 --- a/src/common/os/posix/os_utils.cpp +++ b/src/common/os/posix/os_utils.cpp @@ -156,6 +156,13 @@ void createLockDirectory(const char* pathname) changeFileRights(pathname, 0770); } +#ifndef S_IREAD +#define S_IREAD S_IRUSR +#endif +#ifndef S_IWRITE +#define S_IWRITE S_IWUSR +#endif + // open (or create if missing) and set appropriate access rights int openCreateSharedFile(const char* pathname, int flags) { diff --git a/src/include/cross/android.arme b/src/include/cross/android.arme new file mode 100644 index 0000000000..f8cacfba44 --- /dev/null +++ b/src/include/cross/android.arme @@ -0,0 +1,665 @@ +/* src/include/gen/autoconfig.h. Generated from config.h.in by configure. */ +/* builds/make.new/config/config.h.in. Generated from configure.in by autoheader. */ + +/* log file name within log dir (firebird.log) */ +#define FB_LOGFILENAME "firebird.log" + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define this if OS is AIX */ +/* #undef AIX */ + +/* Define this if CPU is Alpha */ +/* #undef ALPHA */ + +/* Define this if CPU is amd64 */ +/* #undef AMD64 */ + +/* Include pthread support for binary relocation? */ +/* #undef BR_PTHREAD */ + +/* Define this if paths are case sensitive */ +#define CASE_SENSITIVITY false + +/* Define this if OS is DARWIN */ +/* #undef DARWIN */ + +/* Use binary relocation? */ +/* #undef ENABLE_BINRELOC */ + +/* Alignment of long */ +#define FB_ALIGNMENT 8 + +/* executables DIR (PREFIX/bin) */ +#define FB_BINDIR "" + +/* config files DIR (PREFIX) */ +#define FB_CONFDIR "" + +/* documentation root DIR (PREFIX/doc) */ +#define FB_DOCDIR "" + +/* Alignment of double */ +#define FB_DOUBLE_ALIGN 8 + +/* guardian lock DIR (PREFIX) */ +#define FB_GUARDDIR "" + +/* QLI help DIR (PREFIX/help) */ +#define FB_HELPDIR "" + +/* C/C++ header files DIR (PREFIX/include) */ +#define FB_INCDIR "" + +/* international DIR (PREFIX/intl) */ +#define FB_INTLDIR "" + +/* Local IPC name */ +#define FB_IPC_NAME "FirebirdIPI" + +/* object code libraries DIR (PREFIX/lib) */ +#define FB_LIBDIR "" + +/* log files DIR (PREFIX) */ +#define FB_LOGDIR "" + +/* misc DIR (PREFIX/misc) */ +#define FB_MISCDIR "" + +/* message files DIR (PREFIX) */ +#define FB_MSGDIR "" + +/* Wnet pipe name */ +#define FB_PIPE_NAME "interbas" + +/* plugins DIR (PREFIX) */ +#define FB_PLUGDIR "" + +/* Installation path prefix */ +#define FB_PREFIX "/opt/firebird" + +/* examples database DIR (PREFIX/examples/empbuild) */ +#define FB_SAMPLEDBDIR "" + +/* examples DIR (PREFIX/examples) */ +#define FB_SAMPLEDIR "" + +/* system admin executables DIR (PREFIX/bin) */ +#define FB_SBINDIR "" + +/* security database DIR (PREFIX) */ +#define FB_SECDBDIR "" + +/* Inet service name */ +#define FB_SERVICE_NAME "gds_db" + +/* Inet service port */ +#define FB_SERVICE_PORT 3050 + +/* UDF DIR (PREFIX/UDF) */ +#define FB_UDFDIR "" + +/* Define this if OS is FreeBSD */ +/* #undef FREEBSD */ + +/* Define this if getmntent needs second argument */ +/* #undef GETMNTENT_TAKES_TWO_ARGUMENTS */ + +/* Define to 1 if the `getpgrp' function requires zero arguments. */ +#define GETPGRP_VOID 1 + +/* Define this if gettimeofday accepts second (timezone) argument */ +#define GETTIMEOFDAY_RETURNS_TIMEZONE 1 + +/* Define this if GPRE should support ADA */ +/* #undef GPRE_ADA */ + +/* Define this if GPRE should support COBOL */ +/* #undef GPRE_COBOL */ + +/* Define this if GPRE should support FORTRAN */ +/* #undef GPRE_FORTRAN */ + +/* Define this if GPRE should support PASCAL */ +/* #undef GPRE_PASCAL */ + +/* Define to 1 if you have the header file. */ +#define HAVE_AIO_H 1 + +/* Define this if AO_compare_and_swap_full() is defined in atomic_ops.h */ +/* #undef HAVE_AO_COMPARE_AND_SWAP_FULL */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ATOMIC_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ATOMIC_OPS_H */ + +/* Define to 1 if the system has the type `caddr_t'. */ +/* #undef HAVE_CADDR_T */ + +/* Define to 1 if you have the header file. */ +#define HAVE_CRYPT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_CTYPE_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the `dirname' function. */ +#define HAVE_DIRNAME 1 + +/* Define to 1 if you have the `dladdr' function. */ +#define HAVE_DLADDR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define this if editline is in use */ +#define HAVE_EDITLINE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the `fchmod' function. */ +#define HAVE_FCHMOD 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `fdatasync' function. */ +#define HAVE_FDATASYNC 1 + +/* Define to 1 if you have the `fegetenv' function. */ +#define HAVE_FEGETENV 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FLOAT_H 1 + +/* Define to 1 if you have the `flock' function. */ +#define HAVE_FLOCK 1 + +/* Define to 1 if you have the `fork' function. */ +#define HAVE_FORK 1 + +/* Define to 1 if you have the `fsync' function. */ +#define HAVE_FSYNC 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `getmntent' function. */ +#define HAVE_GETMNTENT 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the `getwd' function. */ +#define HAVE_GETWD 1 + +/* Define to 1 if you have the `gmtime_r' function. */ +#define HAVE_GMTIME_R 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_GRP_H 1 + +/* Define this if INFINITY is defined in math.h */ +#define HAVE_INFINITY 1 + +/* Define to 1 if you have the `initgroups' function. */ +#define HAVE_INITGROUPS 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `atomic_ops' library (-latomic_ops). */ +/* #undef HAVE_LIBATOMIC_OPS */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBIO_H */ + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +/* #undef HAVE_LIBPTHREAD */ + +/* Define to 1 if you have the `sfio' library (-lsfio). */ +/* #undef HAVE_LIBSFIO */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the `llrint' function. */ +#define HAVE_LLRINT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if you have the `localtime_r' function. */ +#define HAVE_LOCALTIME_R 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MATH_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkstemp' function. */ +#define HAVE_MKSTEMP 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MNTENT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MNTTAB_H */ + +/* Define this if multi-threading should be supported */ +#define HAVE_MULTI_THREAD 1 + +/* Define to 1 if you have the `nanosleep' function. */ +#define HAVE_NANOSLEEP 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETCONFIG_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the `poll' function. */ +#define HAVE_POLL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_POLL_H 1 + +/* Define this if posix_fadvise() is present on the platform */ +#define HAVE_POSIX_FADVISE 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define if you have POSIX threads libraries and header files. */ +/* #undef HAVE_PTHREAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_PTHREAD_H 1 + +/* Define to 1 if you have the `pthread_keycreate' function. */ +/* #undef HAVE_PTHREAD_KEYCREATE */ + +/* Define to 1 if you have the `pthread_key_create' function. */ +#define HAVE_PTHREAD_KEY_CREATE 1 + +/* Define to 1 if you have the `pthread_mutexattr_setprotocol' function. */ +#define HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL 1 + +/* Define to 1 if you have the `pthread_mutexattr_setrobust_np' function. */ +/* #undef HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP */ + +/* Define to 1 if you have the `pthread_mutex_consistent_np' function. */ +/* #undef HAVE_PTHREAD_MUTEX_CONSISTENT_NP */ + +/* Define to 1 if you have the `pthread_rwlockattr_setkind_np' function. */ +/* #undef HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP */ + +/* Define to 1 if you have the header file. */ +#define HAVE_PWD_H 1 + +/* Define to 1 if you have the `pwrite' function. */ +#define HAVE_PWRITE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_RPC_RPC_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_RPC_XDR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SEMAPHORE_H 1 + +/* Define to 1 if you have the `semtimedop' function. */ +#define HAVE_SEMTIMEDOP 1 + +/* Define to 1 if the system has the type `semun'. */ +/* #undef HAVE_SEMUN */ + +/* Define to 1 if you have the `sem_init' function. */ +#define HAVE_SEM_INIT 1 + +/* Define to 1 if you have the `sem_timedwait' function. */ +#define HAVE_SEM_TIMEDWAIT 1 + +/* Define to 1 if you have the `setitimer' function. */ +#define HAVE_SETITIMER 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SETJMP_H 1 + +/* Define to 1 if you have the `setmntent' function. */ +#define HAVE_SETMNTENT 1 + +/* Define to 1 if you have the `setpgid' function. */ +#define HAVE_SETPGID 1 + +/* Define to 1 if you have the `setrlimit' function. */ +#define HAVE_SETRLIMIT 1 + +/* Define to 1 if you have the `sigaction' function. */ +#define HAVE_SIGACTION 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SOCKET_H */ + +/* Define to 1 if the system has the type `socklen_t'. */ +#define HAVE_SOCKLEN_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDARG_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror_r' function. */ +#define HAVE_STRERROR_R 1 + +/* Define to 1 if you have the `stricmp' function. */ +/* #undef HAVE_STRICMP */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strncasecmp' function. */ +#define HAVE_STRNCASECMP 1 + +/* Define to 1 if you have the `strnicmp' function. */ +/* #undef HAVE_STRNICMP */ + +/* Define this if struct dirent has d_type */ +#define HAVE_STRUCT_DIRENT_D_TYPE 1 + +/* Define to 1 if the system has the type `struct xdr_ops'. */ +#define HAVE_STRUCT_XDR_OPS 1 + +/* Define to 1 if the system has the type `struct XDR::xdr_ops'. */ +/* #undef HAVE_STRUCT_XDR__XDR_OPS */ + +/* Define to 1 if you have the `swab' function. */ +#define HAVE_SWAB 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_FILE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IPC_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MNTENT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MNTTAB_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MOUNT_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SELECT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SEM_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SIGINFO_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SIGNAL_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SOCKIO_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIMEB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UIO_H 1 + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the `tcgetattr' function. */ +#define HAVE_TCGETATTR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TERMIOS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TERMIO_H 1 + +/* Define to 1 if you have the `time' function. */ +#define HAVE_TIME 1 + +/* Define to 1 if you have the `times' function. */ +#define HAVE_TIMES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UTIME_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_VARARGS_H */ + +/* Define this if va_copy() is defined in stdarg.h */ +#define HAVE_VA_COPY 1 + +/* Define to 1 if you have the `vfork' function. */ +#define HAVE_VFORK 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_VFORK_H */ + +/* Define to 1 if you have the `vsnprintf' function. */ +#define HAVE_VSNPRINTF 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINSOCK2_H */ + +/* Define to 1 if `fork' works. */ +#define HAVE_WORKING_FORK 1 + +/* Define to 1 if `vfork' works. */ +#define HAVE_WORKING_VFORK 1 + +/* Define to 1 if you have the file `AC_File'. */ +#define HAVE__PROC_SELF_EXE 1 + +/* Define to 1 if you have the `_swab' function. */ +/* #undef HAVE__SWAB */ + +/* Define it if compiler supports ISO syntax for thread-local storage */ +#define HAVE___THREAD 1 + +/* Define this if CPU is HPPA */ +/* #undef HPPA */ + +/* Define this if OS is HP-UX */ +/* #undef HPUX */ + +/* Define this if OS is Linux */ +#define LINUX 1 + +/* Define this if OS is NetBSD */ +/* #undef NETBSD */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* Define to the necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void + +/* Define to 1 if the `setpgrp' function takes no argument. */ +#define SETPGRP_VOID 1 + +/* Architecture is little-endian sh4 */ +/* #undef SH */ + +/* Architecture is big-edian sh4 */ +/* #undef SHEB */ + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + +/* The size of `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 4 + +/* Define this if OS is Solaris Sparc */ +/* #undef SOLARIS */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define this if databases on raw devices should be supported */ +#define SUPPORT_RAW_DEVICES 1 + +/* Define to 1 if you can safely include both and . */ +#define TIME_WITH_SYS_TIME 1 + +/* Define this if OS is Windows NT */ +/* #undef WIN_NT */ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Define this if sem_init() works on the platform */ +#define WORKING_SEM_INIT 1 + +/* Number of bits in a file offset, on hosts where this is settable. */ +#define _FILE_OFFSET_BITS 64 + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to `int' if doesn't define. */ +/* #undef gid_t */ + +/* Define to `long int' if does not define. */ +/* #undef off_t */ + +/* Define to `int' if does not define. */ +/* #undef pid_t */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define this if OS is Solarix x86 */ +/* #undef solx86 */ + +/* Define to `int' if doesn't define. */ +/* #undef uid_t */ + +/* Define as `fork' if `vfork' does not work. */ +/* #undef vfork */ + +/* Define to empty if the keyword `volatile' does not work. Warning: valid + code using `volatile' can become incorrect without. Disable with care. */ +/* #undef volatile */ + +#ifdef GETTIMEOFDAY_RETURNS_TIMEZONE +#define GETTIMEOFDAY(x) gettimeofday((x), (struct timezone *)0) +#else +#define GETTIMEOFDAY(x) gettimeofday((x)) +#endif + +#ifndef HAVE_SOCKLEN_T +typedef int socklen_t; +#endif diff --git a/src/include/fb_exception.h b/src/include/fb_exception.h index 4381ca40a7..2821574544 100644 --- a/src/include/fb_exception.h +++ b/src/include/fb_exception.h @@ -32,7 +32,15 @@ #include #include + +#ifndef ANDROID +#define USE_SYSTEM_NEW +#endif + +#ifdef USE_SYSTEM_NEW #include +#endif + #include "fb_types.h" #include "../common/StatusArg.h" #include "../common/thd.h" @@ -64,13 +72,24 @@ public: }; // Used in MemoryPool +#ifdef USE_SYSTEM_NEW + class BadAlloc : public std::bad_alloc, public Exception { +public: + BadAlloc() throw() : std::bad_alloc(), Exception() { } +#else // USE_SYSTEM_NEW + +class BadAlloc : public Exception +{ +public: + BadAlloc() throw() : Exception() { } +#endif // USE_SYSTEM_NEW + public: virtual ISC_STATUS stuffException(IStatus* status_vector) const throw(); virtual const char* what() const throw(); static void raise(); - BadAlloc() throw() : std::bad_alloc(), Exception() { } }; // Main exception class in firebird diff --git a/src/yvalve/perf.h b/src/yvalve/perf.h index 2a52d2a9ca..d40085cec9 100644 --- a/src/yvalve/perf.h +++ b/src/yvalve/perf.h @@ -31,7 +31,7 @@ #ifndef JRD_PERF_H #define JRD_PERF_H -#ifdef LINUX +#ifdef HAVE_LIBIO_H #include #endif