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
72 changes: 71 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,23 @@ if (WIN32)
endif ()
endif ()
endif ()

if (HAVE_firebird)
option (WITH_FIREBIRD "compile with firebird rdbms support" ON)
if (WITH_FIREBIRD)
set (USE_FIREBIRD 1)
include_directories (${firebird_INCLUDE})

CMAKE_DEPENDENT_OPTION (DL_FIREBIRD "load firebird rdbms library dynamically" OFF "USE_FIREBIRD" ON)
if (DL_FIREBIRD)
set (DL_FIREBIRD 1)
set (FIREBIRD_LIB fbclient.dll)
else( DL_FIREBIRD )
list (APPEND EXTRA_LIBRARIES ${firebird_LIB})
endif ()
install (FILES ${firebird_ROOT}/fbclient.dll DESTINATION bin COMPONENT APPLICATIONS)
endif ()
endif ()
mark_as_advanced(CMAKE_CONFIGURATION_TYPES)
else (WIN32)

Expand Down Expand Up @@ -185,7 +202,8 @@ else (WIN32)
ac_check_funcs ("backtrace;backtrace_symbols")
ac_check_funcs ("mremap")
ac_check_funcs ("nanosleep;pthread_mutex_timedlock")
ac_check_funcs ( "eventfd")
ac_check_funcs ("eventfd")
ac_check_funcs ("kqueue")
check_function_exists (epoll_ctl HAVE_EPOLL)
ac_search_libs ("rt" "clock_gettime" HAVE_CLOCK_GETTIME EXTRA_LIBRARIES)

Expand Down Expand Up @@ -363,6 +381,55 @@ else (WIN32)
endif (PostgreSQL_FOUND)
endif (WITH_PGSQL)

# test for FIREBIRD RDBMS
message (STATUS "Option WITH_FIREBIRD ${WITH_FIREBIRD}")
option (WITH_FIREBIRD "compile with Firebird RDBMS support" OFF)
set (WITH_FIREBIRD_INCLUDES "" CACHE PATH "path to Firebird RDBMS header files")
set (WITH_FIREBIRD_LIBS "" CACHE PATH "path to Firebird RDBMS library")

if (WITH_FIREBIRD)
if (WITH_FIREBIRD_INCLUDES)
set (Firebird_INCLUDE_DIR ${WITH_FIREBIRD_INCLUDES})
endif (WITH_FIREBIRD_INCLUDES)

if (WITH_FIREBIRD_LIBS)
set (Firebird_LIBRARIES ${WITH_FIREBIRD_LIBS}/libfbclient.so)
endif (WITH_FIREBIRD_LIBS)

if (NOT (WITH_FIREBIRD_INCLUDES AND WITH_FIREBIRD_LIBS))
find_package (Firebird)
endif ()

if (Firebird_FOUND)
set (USE_FIREBIRD 1)
include_directories (${Firebird_INCLUDE_DIRS})

CMAKE_DEPENDENT_OPTION (DL_FIREBIRD "load firebird rdbms library dynamically" ON "Firebird_FOUND;HAVE_DL;NOT STATIC_FIREBIRD" OFF)
CMAKE_DEPENDENT_OPTION (STATIC_FIREBIRD "link to firebird rdbms library statically" OFF "Firebird_FOUND;NOT DL_FIREBIRD" OFF)
if (STATIC_FIREBIRD)
message (STATUS "Firebird RDBMS will be linked statically")
string (REGEX REPLACE "fbclient" "libfbclient.a" FIREBIRD_LIBRARIES "${FIREBIRD_LIBRARIES}")
endif (STATIC_FIREBIRD)

if (DL_FIREBIRD)
message (STATUS "Firebird RDBMS will not be linked (will be loaded at runtime)")
set (DL_FIREBIRD 1)
GET_FILENAME_COMPONENT (FIREBIRD_LIB ${Firebird_LIBRARY} NAME)
else ( DL_FIREBIRD )
list (APPEND EXTRA_LIBRARIES ${Firebird_LIBRARIES})
endif ()
else (Firebird_FOUND)
message (SEND_ERROR
"********************************************************************************
ERROR: cannot find Firebird RDBMS libraries. If you want to compile with Firebird RDBMS support,
you must either specify file locations explicitly using
-D WITH_FIREBIRD_INCLUDES=... and -D WITH_FIREBIRD_LIBS=... options, or make sure path to
fb_config is listed in your PATH environment variable. If you want to
disable Firebird RDBMS support, use -D WITH_FIREBIRD=OFF option.
********************************************************************************")
endif (Firebird_FOUND)
endif (WITH_FIREBIRD)

endif (WIN32)

if (NOT CMAKE_BUILD_TYPE MATCHES Debug)
Expand Down Expand Up @@ -581,6 +648,9 @@ LIST (APPEND BANNER "WITH_ODBC=${WITH_ODBC}")
LIST (APPEND BANNER "WITH_PGSQL=${WITH_PGSQL}")
LIST (APPEND BANNER "WITH_PGSQL_INCLUDES=${WITH_PGSQL_INCLUDES}")
LIST (APPEND BANNER "WITH_PGSQL_LIBS=${WITH_PGSQL_LIBS}")
LIST (APPEND BANNER "WITH_FIREBIRD=${WITH_FIREBIRD}")
LIST (APPEND BANNER "WITH_FIREBIRD_INCLUDES=${WITH_FIREBIRD_INCLUDES}")
LIST (APPEND BANNER "WITH_FIREBIRD_LIBS=${WITH_FIREBIRD_LIBS}")
LIST (APPEND BANNER "WITH_RE2=${WITH_RE2}")
LIST (APPEND BANNER "WITH_RE2_INCLUDES=${WITH_RE2_INCLUDES}")
LIST (APPEND BANNER "WITH_RE2_LIBS=${WITH_RE2_LIBS}")
Expand Down
2 changes: 2 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PGSQL_CFLAGS = @PGSQL_CFLAGS@
PGSQL_LIBS = @PGSQL_LIBS@
FIREBIRD_CFLAGS = @FIREBIRD_CFLAGS@
FIREBIRD_LIBS = @FIREBIRD_LIBS@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
Expand Down
76 changes: 76 additions & 0 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,82 @@ ERROR: cannot find PostgreSQL libraries. If you want to compile with PosgregSQL
fi
])

dnl ---------------------------------------------------------------------------
dnl Macro: AC_CHECK_FIREBIRD
dnl First check for custom Firebird RDBMS paths in --with-firebird-* options.
dnl If some paths are missing, check if fb_config exists.
dnl ---------------------------------------------------------------------------

AC_DEFUN([AC_CHECK_FIREBIRD],[

# Check for custom includes path
if test [ -z "$ac_cv_firebird_includes" ]
then
AC_ARG_WITH([firebird-includes],
AC_HELP_STRING([--with-firebird-includes], [path to Firebird RDBMS header files]),
[ac_cv_firebird_includes=$withval])
fi
if test [ -n "$ac_cv_firebird_includes" ]
then
AC_CACHE_CHECK([Firebird RDBMS includes], [ac_cv_firebird_includes], [ac_cv_firebird_includes=""])
FIREBIRD_CFLAGS="-I$ac_cv_firebird_includes"
fi

# Check for custom library path
if test [ -z "$ac_cv_firebird_libs" ]
then
AC_ARG_WITH([firebird-libs],
AC_HELP_STRING([--with-firebird-libs], [path to Firebird RDBMS libraries]),
[ac_cv_firebird_libs=$withval])
fi
if test [ -n "$ac_cv_firebird_libs" ]
then
AC_CACHE_CHECK([Firebird RDBMS libraries], [ac_cv_firebird_libs], [ac_cv_firebird_libs=""])
FIREBIRD_PKGLIBDIR="$ac_cv_firebird_libs"
FIREBIRD_LIBS="-L$FIREBIRD_PKGLIBDIR -lfbclient"
fi

# If some path is missing, try to autodetermine with firebird_config
if test [ -z "$ac_cv_firebird_includes" -o -z "$ac_cv_firebird_libs" ]
then
if test [ -z "$fbconfig" ]
then
AC_PATH_PROG(fbconfig,fb_config)
fi
if test [ -z "$fbconfig" ]
then
AC_MSG_ERROR([fb_config executable not found
********************************************************************************
ERROR: cannot find Firebird RDBMS libraries. If you want to compile with Firebird RDBMS support,
you must either specify file locations explicitly using
--with-firebird-includes and --with-firebird-libs options, or make sure path to
fb_config is listed in your PATH environment variable. If you want to
disable Firebird RDBMS support, use --without-firebird option.
********************************************************************************
])
else
if test [ -z "$ac_cv_firebird_includes" ]
then
AC_MSG_CHECKING(Firebird RDBMS C flags)
FIREBIRD_CFLAGS="`${fbconfig} --cflags`"
### /opt/firebird/bin/fb_config --cflags:
### -I/opt/firebird/include
AC_MSG_RESULT($FIREBIRD_CFLAGS)
fi
if test [ -z "$ac_cv_firebird_libs" ]
then
AC_MSG_CHECKING(Firebird RDBMS linker flags)
FIREBIRD_PKGLIBDIR=`${fbconfig} --libs`
### /opt/firebird/bin/fb_config --libs:
### -L/opt/firebird/lib -lfbclient
FIREBIRD_LIBS="$FIREBIRD_PKGLIBDIR"
AC_MSG_RESULT($FIREBIRD_LIBS)
fi
fi
fi
])


dnl ---------------------------------------------------------------------------
dnl Macro: AC_CHECK_LIBSTEMMER
dnl Check the libstemmer first in custom include path in --with-libstemmer=*
Expand Down
2 changes: 1 addition & 1 deletion cmake/select_library_dir.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (LIBS_BUNDLE)

# here is the list of the libs we expect to find
foreach (req_lib expat iconv mysql pq)
file(GLOB list_libs "${LIBS_BUNDLE}/*${req_lib}*" "${LIBS_BUNDLE}/*pgsql*")
file(GLOB list_libs "${LIBS_BUNDLE}/*${req_lib}*" "${LIBS_BUNDLE}/*pgsql*" "${LIBS_BUNDLE}/*firebird*")
SET (flib FALSE)
# select whether we need -x64 or simple lib for our current arch
FOREACH (lib ${list_libs})
Expand Down
6 changes: 6 additions & 0 deletions config/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
/* Define to 1 if runtime load PosgreSQL using dlopen */
#undef DL_PGSQL

/* Define to 1 if runtime load Firebird RDBMS using dlopen */
#undef DL_FIREBIRD

/* Define to 1 if you want runtime load odbc/iodbc using dlopen */
#undef DL_UNIXODBC

Expand Down Expand Up @@ -288,6 +291,9 @@
/* Define to 1 if you want to compile with PostgreSQL support */
#undef USE_PGSQL

/* Define to 1 if you want to compile with Firebird RDBMS support */
#undef USE_FIREBIRD

/* RE2 library support */
#undef USE_RE2

Expand Down
10 changes: 10 additions & 0 deletions config/config_cmake.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#cmakedefine DL_PGSQL ${DL_PGSQL}
#cmakedefine PGSQL_LIB "${PGSQL_LIB}"

/* Define to 1 if runtime load Firebird RDBMS using dlopen */
#cmakedefine DL_FIREBIRD ${DL_FIREBIRD}
#cmakedefine FIREBIRD_LIB "${FIREBIRD_LIB}"

/* Define to 1 if you want runtime load odbc/iodbc using dlopen */
#cmakedefine DL_UNIXODBC ${DL_UNIXODBC}
#cmakedefine UNIXODBC_LIB "${UNIXODBC_LIB}"
Expand All @@ -43,6 +47,9 @@
/* Define if your system supports the epoll system calls */
#cmakedefine HAVE_EPOLL ${HAVE_EPOLL}

/* Define if your system supports the kqueue system calls */
#cmakedefine HAVE_KQUEUE ${HAVE_KQUEUE}

/* Define if your system supports the eventfd system calls */
#cmakedefine01 HAVE_EVENTFD

Expand Down Expand Up @@ -121,6 +128,9 @@
/* Define to 1 if you want to compile with PostgreSQL support */
#cmakedefine USE_PGSQL ${USE_PGSQL}

/* Define to 1 if you want to compile with Firebird RDBMS support */
#cmakedefine USE_FIREBIRD ${USE_FIREBIRD}

/* re2 library support */
#cmakedefine USE_RE2 ${USE_RE2}

Expand Down
Loading