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
69 changes: 69 additions & 0 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,75 @@ 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_LIBS="-L$ac_cv_firebird_libs -lfbclient"
fi

# If some path is missing, try to autodetermine with fb_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`"
AC_MSG_RESULT($FIREBIRD_CFLAGS)
fi
if test [ -z "$ac_cv_firebird_libs" ]
then
AC_MSG_CHECKING(Firebird RDBMS linker flags)
FIREBIRD_LIBS="`${fbconfig} --libs`"
AC_MSG_RESULT($FIREBIRD_LIBS)
fi
fi
fi
])

dnl ---------------------------------------------------------------------------
dnl Macro: SPHINX_CONFIGURE_PART
dnl
Expand Down
17 changes: 17 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,23 @@ else
fi
AM_CONDITIONAL(USE_PGSQL, test x$ac_cv_use_pgsql != xno -o x$ac_cv_use_satic_pgsql != xno )

# Check if we should compile with Firebird support
AC_ARG_WITH([firebird],
AC_HELP_STRING([--with-firebird], [compile with Firebird RDMS support (default is disabled)]),
[ac_cv_use_firebird=$withval], [ac_cv_use_firebird=no]
)
AC_MSG_CHECKING([whether to compile with Firebird RDMS support])
if test x$ac_cv_use_firebird != xno; then
AC_MSG_RESULT([yes])
AC_CHECK_FIREBIRD([$ac_cv_use_firebird])
AC_DEFINE(USE_FIREBIRD,1,[Define to 1 if you want to compile with Firebird RDMS support])
AC_SUBST([FIREBIRD_LIBS])
AC_SUBST([FIREBIRD_CFLAGS])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(USE_FIREBIRD, test x$ac_cv_use_firebird != xno)

# add macports include directory
if (echo $MYSQL_LIBS | grep -q -- -L/opt/local/lib); then
MYSQL_CFLAGS="$MYSQL_CFLAGS -I/opt/local/include"
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ RLP_INC =
endif

AM_CPPFLAGS = $(LIBRE2_CFLAGS) $(RLP_INC) -DSYSCONFDIR="\"$(sysconfdir)\"" -DDATADIR="\"$(localstatedir)/data\""
COMMON_LIBS = libsphinx.a $(LIBSTEMMER_LIBS) $(MYSQL_LIBS) $(PGSQL_LIBS) $(LIBRE2_LIBS) $(RLP_LIBS)
COMMON_LIBS = libsphinx.a $(LIBSTEMMER_LIBS) $(MYSQL_LIBS) $(PGSQL_LIBS) $(LIBRE2_LIBS) $(RLP_LIBS) $(FIREBIRD_LIBS)
LDADD = $(COMMON_LIBS)
34 changes: 34 additions & 0 deletions src/indexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,35 @@ CSphSource * SpawnSourceMySQL ( const CSphConfigSection & hSource, const char *
#endif // USE_MYSQL


#if USE_FIREBIRD
CSphSource * SpawnSourceFBSQL(const CSphConfigSection & hSource, const char * sSourceName, bool RLPARG(bProxy) )
{
assert ( hSource["type"]=="firebird" );

CSphSourceParams_FBSQL tParams;
if ( !SqlParamsConfigure ( tParams, hSource, sSourceName ) )
return NULL;

LOC_GETS ( tParams.m_sCharset, "sql_charset" );
LOC_GETS ( tParams.m_sRole, "sql_role" );

CSphSource_FBSQL * pSrcFBSQL;
#if USE_RLP
if (bProxy)
pSrcFBSQL = new CSphSource_Proxy<CSphSource_FBSQL>(sSourceName);
else
#endif
pSrcFBSQL = new CSphSource_FBSQL(sSourceName);

if ( !pSrcFBSQL->Setup ( tParams ) )
SafeDelete ( pSrcFBSQL );

return pSrcFBSQL;
}
#endif // USE_FIREBIRD



#if USE_ODBC
CSphSource * SpawnSourceODBC ( const CSphConfigSection & hSource, const char * sSourceName, bool RLPARG(bProxy) )
{
Expand Down Expand Up @@ -880,6 +909,11 @@ CSphSource * SpawnSource ( const CSphConfigSection & hSource, const char * sSour
return SpawnSourceMySQL ( hSource, sSourceName, bBatchedRLP );
#endif

#if USE_FIREBIRD
if ( hSource["type"]=="firebird")
return SpawnSourceFBSQL(hSource, sSourceName, bBatchedRLP);
#endif

#if USE_ODBC
if ( hSource["type"]=="odbc" )
return SpawnSourceODBC ( hSource, sSourceName, bBatchedRLP );
Expand Down
Loading