Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Commit

Permalink
configure support for manual libdbi detection
Browse files Browse the repository at this point in the history
configure now supports the following new commands:

  --with-dbi-lib=DIR      sets location of the dbi library
  --with-dbi-inc=DIR      sets location of the dbi include files,

This should help to use libdbi source users to install idoutils

IssueID #134
  • Loading branch information
andurin committed Sep 3, 2009
1 parent 533de78 commit 3b7860d
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 46 deletions.
82 changes: 59 additions & 23 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1317,34 +1317,48 @@ if test -n "$ac_init_help"; then
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-statusmap=disables compilation of statusmap CGI
--disable-statuswrl=disables compilation of statuswrl (VRML) CGI
--enable-nanosleep enables use of nanosleep (instead sleep) in event timing
--enable-event-broker enables integration of event broker routines
--enable-idoutils enables database connectivity using idoutils
--enable-embedded-perl will enable embedded Perl interpreter
--enable-cygwin enables building under the CYGWIN environment
--disable-statusmap disables compilation of statusmap CGI
--disable-statuswrl disables compilation of statuswrl (VRML) CGI
--enable-nanosleep enables use of nanosleep (instead sleep) in event
timing
--enable-event-broker enables integration of event broker routines
--enable-idoutils enables database connectivity using idoutils
--enable-embedded-perl will enable embedded Perl interpreter
--enable-cygwin enables building under the CYGWIN environment
--enable-libtap Enable built-in libtap for unit-testing (default:
no).
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-icinga-user=<user> sets user name to run icinga
--with-icinga-group=<grp> sets group name to run icinga
--with-command-user=<user> sets user name for command access
--with-command-group=<grp> sets group name for command access
--with-mail=<path_to_mail> sets path to equivalent program to mail
--with-httpd-conf=<path_to_conf> sets path to Apache conf.d directory
--with-checkresult-dir=<path> sets path to check results spool directory
--with-temp-dir=<path> sets path to temp directory
--with-init-dir=<path> sets directory to place init script into
--with-lockfile=<path> sets path and file name for lock file
--with-gd-lib=DIR sets location of the gd library
--with-gd-inc=DIR sets location of the gd include files
--with-cgiurl=<local-url> sets URL for cgi programs (do not use a trailing slash)
--with-htmurl=<local-url> sets URL for public html
--with-perlcache turns on cacheing of internally compiled Perl scripts
--with-icinga-user=<user>
sets user name to run icinga
--with-icinga-group=<grp>
sets group name to run icinga
--with-command-user=<user>
sets user name for command access
--with-command-group=<grp>
sets group name for command access
--with-mail=<path_to_mail>
sets path to equivalent program to mail
--with-httpd-conf=<path_to_conf>
sets path to Apache conf.d directory
--with-checkresult-dir=<path>
sets path to check results spool directory
--with-temp-dir=<path> sets path to temp directory
--with-init-dir=<path> sets directory to place init script into
--with-lockfile=<path> sets path and file name for lock file
--with-gd-lib=DIR sets location of the gd library
--with-gd-inc=DIR sets location of the gd include files
--with-cgiurl=<local-url>
sets URL for cgi programs (do not use a trailing
slash)
--with-htmurl=<local-url>
sets URL for public html
--with-dbi-lib=DIR sets location of the dbi library
--with-dbi-inc=DIR sets location of the dbi include files,
--with-perlcache turns on cacheing of internally compiled Perl
scripts
Some influential environment variables:
CC C compiler command
Expand Down Expand Up @@ -7679,7 +7693,29 @@ if test x$USE_IDOUTILS = xyes; then
echo "$as_me: error: --enable-idoutils needs also --enable-event-broker" >&2;}
{ (exit 1); exit 1; }; }
fi
{ echo "$as_me:$LINENO: checking for libdi" >&5
# Check whether --with-dbi-lib was given.
if test "${with_dbi_lib+set}" = set; then
withval=$with_dbi_lib;
LDFLAGS="${LDFLAGS} -L${withval}"
LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
fi
# Check whether --with-dbi-inc was given.
if test "${with_dbi_inc+set}" = set; then
withval=$with_dbi_inc;
CFLAGS="${CFLAGS} -I${withval}"
fi
cat >>confdefs.h <<\_ACEOF
#define HAVE_DBI_DBI_H "1"
_ACEOF
{ echo "$as_me:$LINENO: checking for libdi" >&5
echo $ECHO_N "checking for libdi... $ECHO_C" >&6; }
{ echo "$as_me:$LINENO: checking for main in -ldbi" >&5
echo $ECHO_N "checking for main in -ldbi... $ECHO_C" >&6; }
Expand Down
57 changes: 34 additions & 23 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ AC_SEARCH_LIBS(nanosleep,[rt posix4],,[
])


AC_ARG_WITH(icinga_user,--with-icinga-user=<user> sets user name to run icinga,icinga_user=$withval,icinga_user=icinga)
AC_ARG_WITH(icinga_group,--with-icinga-group=<grp> sets group name to run icinga,icinga_grp=$withval,icinga_grp=icinga)
AC_ARG_WITH(icinga_user,AC_HELP_STRING([--with-icinga-user=<user>],[sets user name to run icinga]),icinga_user=$withval,icinga_user=icinga)
AC_ARG_WITH(icinga_group,AC_HELP_STRING([--with-icinga-group=<grp>],[sets group name to run icinga]),icinga_grp=$withval,icinga_grp=icinga)
AC_SUBST(icinga_user)
AC_SUBST(icinga_grp)
AC_DEFINE_UNQUOTED(DEFAULT_ICINGA_USER,"$icinga_user")
Expand All @@ -206,16 +206,16 @@ AC_DEFINE_UNQUOTED(DEFAULT_NAGIOS_GROUP,"$icinga_grp")
INSTALL_OPTS="-o $icinga_user -g $icinga_grp"
AC_SUBST(INSTALL_OPTS)

AC_ARG_WITH(command_user,--with-command-user=<user> sets user name for command access,command_user=$withval,command_user=$icinga_user)
AC_ARG_WITH(command_group,--with-command-group=<grp> sets group name for command access,command_grp=$withval,command_grp=$icinga_grp)
AC_ARG_WITH(command_user,AC_HELP_STRING([--with-command-user=<user>],[sets user name for command access]),command_user=$withval,command_user=$icinga_user)
AC_ARG_WITH(command_group,AC_HELP_STRING([--with-command-group=<grp>] ,[sets group name for command access]),command_grp=$withval,command_grp=$icinga_grp)
AC_SUBST(command_user)
AC_SUBST(command_grp)
COMMAND_OPTS="-o $command_user -g $command_grp"
AC_SUBST(COMMAND_OPTS)

dnl Check for location of mail program
MAIL_PROG=no
AC_ARG_WITH(mail,--with-mail=<path_to_mail> sets path to equivalent program to mail,MAIL_PROG=$withval,MAIL_PROG=no)
AC_ARG_WITH(mail,AC_HELP_STRING([--with-mail=<path_to_mail>],[sets path to equivalent program to mail]),MAIL_PROG=$withval,MAIL_PROG=no)
if test x$MAIL_PROG = xno; then
AC_PATH_PROG(MAIL_PROG,mail)
fi
Expand All @@ -227,7 +227,7 @@ AC_SUBST(MAIL_PROG)

dnl Check for location of Apache conf.d directory
HTTP_CONF=no
AC_ARG_WITH(httpd_conf,--with-httpd-conf=<path_to_conf> sets path to Apache conf.d directory,HTTPD_CONF=$withval,HTTPD_CONF=no)
AC_ARG_WITH(httpd_conf,AC_HELP_STRING([--with-httpd-conf=<path_to_conf>],[sets path to Apache conf.d directory]),HTTPD_CONF=$withval,HTTPD_CONF=no)
if test x$HTTPD_CONF = xno; then
if test -d /etc/httpd/conf.d; then
HTTPD_CONF="/etc/httpd/conf.d"
Expand All @@ -243,15 +243,15 @@ AC_SUBST(HTTPD_CONF)

dnl Location of check result path
CHECKRESULTDIR=no
AC_ARG_WITH(checkresult-dir,--with-checkresult-dir=<path> sets path to check results spool directory,CHECKRESULTDIR=$withval,CHECKRESULTDIR=no)
AC_ARG_WITH(checkresult-dir,AC_HELP_STRING([--with-checkresult-dir=<path>],[sets path to check results spool directory]),CHECKRESULTDIR=$withval,CHECKRESULTDIR=no)
if test x$CHECKRESULTDIR = xno; then
CHECKRESULTDIR="$localstatedir/spool/checkresults"
fi
AC_SUBST(CHECKRESULTDIR)

dnl Location of check result path
TMPDIR=no
AC_ARG_WITH(temp-dir,--with-temp-dir=<path> sets path to temp directory,TMPDIR=$withval,TMPDIR=no)
AC_ARG_WITH(temp-dir,AC_HELP_STRING([--with-temp-dir=<path>],[sets path to temp directory]),TMPDIR=$withval,TMPDIR=no)
if test x$TMPDIR = xno; then
TMPDIR="/tmp"
fi
Expand All @@ -272,11 +272,11 @@ elif test -d /sbin/init.d; then
fi

dnl User can override init script location
AC_ARG_WITH(init_dir,--with-init-dir=<path> sets directory to place init script into,init_dir=$withval)
AC_ARG_WITH(init_dir,AC_HELP_STRING([--with-init-dir=<path>],[sets directory to place init script into]),init_dir=$withval)
AC_SUBST(init_dir)

dnl User can override lock file location
AC_ARG_WITH(lockfile,--with-lockfile=<path> sets path and file name for lock file,lockfile=$withval,lockfile=$localstatedir/icinga.lock)
AC_ARG_WITH(lockfile,AC_HELP_STRING([--with-lockfile=<path>],[sets path and file name for lock file]),lockfile=$withval,lockfile=$localstatedir/icinga.lock)
AC_SUBST(lockfile)


Expand Down Expand Up @@ -361,11 +361,11 @@ AC_SUBST(XDDH)


dnl Optional GD library and include paths
AC_ARG_WITH(gd-lib,--with-gd-lib=DIR sets location of the gd library,[
AC_ARG_WITH(gd-lib,AC_HELP_STRING([--with-gd-lib=DIR],[sets location of the gd library]),[
LDFLAGS="${LDFLAGS} -L${withval}"
LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
])
AC_ARG_WITH(gd-inc,--with-gd-inc=DIR sets location of the gd include files,[
AC_ARG_WITH(gd-inc,AC_HELP_STRING([--with-gd-inc=DIR],[sets location of the gd include files]),[
CFLAGS="${CFLAGS} -I${withval}"
])

Expand All @@ -374,12 +374,12 @@ TRYGD=yep

dnl statusmap CGI enabled by default, unless users chooses not to use it
TRYSTATUSMAP=yep
AC_ARG_ENABLE(statusmap,--disable-statusmap=disables compilation of statusmap CGI,TRYSTATUSMAP=nope)
AC_ARG_ENABLE(statusmap, AC_HELP_STRING([--disable-statusmap], [disables compilation of statusmap CGI]),TRYSTATUSMAP=nope)


dnl statuswrl CGI enabled by default, unless users chooses not to use it
TRYSTATUSWRL=yep
AC_ARG_ENABLE(statuswrl,--disable-statuswrl=disables compilation of statuswrl (VRML) CGI,TRYSTATUSWRL=nope)
AC_ARG_ENABLE(statuswrl,AC_HELP_STRING([--disable-statuswrl],[disables compilation of statuswrl (VRML) CGI]),TRYSTATUSWRL=nope)

if test x$TRYSTATUSWRL = xyep; then
AC_DEFINE_UNQUOTED(USE_STATUSWRL)
Expand Down Expand Up @@ -529,19 +529,19 @@ if test x$TRYGD = xyep; then
fi
fi

AC_ARG_WITH(cgiurl,--with-cgiurl=<local-url> sets URL for cgi programs (do not use a trailing slash),cgiurl=$withval,cgiurl=/icinga/cgi-bin)
AC_ARG_WITH(htmurl,--with-htmurl=<local-url> sets URL for public html,htmurl=$withval,htmurl=/icinga)
AC_ARG_WITH(cgiurl,AC_HELP_STRING([--with-cgiurl=<local-url>],[sets URL for cgi programs (do not use a trailing slash)]),cgiurl=$withval,cgiurl=/icinga/cgi-bin)
AC_ARG_WITH(htmurl,AC_HELP_STRING([--with-htmurl=<local-url>],[sets URL for public html]),htmurl=$withval,htmurl=/icinga)
AC_SUBST(htmurl)
AC_SUBST(cgiurl)

USE_NANOSLEEP=yes
AC_ARG_ENABLE(nanosleep,--enable-nanosleep enables use of nanosleep (instead sleep) in event timing,USE_NANOSLEEP=$enableval,USE_NANOSLEEP=yes)
AC_ARG_ENABLE(nanosleep,AC_HELP_STRING([--enable-nanosleep],[enables use of nanosleep (instead sleep) in event timing]),USE_NANOSLEEP=$enableval,USE_NANOSLEEP=yes)
if test x$USE_NANOSLEEP = xyes; then
AC_DEFINE_UNQUOTED(USE_NANOSLEEP)
fi

USE_EVENTBROKER=yes
AC_ARG_ENABLE(event-broker,--enable-event-broker enables integration of event broker routines,USE_EVENTBROKER=$enableval,USE_EVENTBROKER=yes)
AC_ARG_ENABLE(event-broker,AC_HELP_STRING([--enable-event-broker],[enables integration of event broker routines]),USE_EVENTBROKER=$enableval,USE_EVENTBROKER=yes)

BROKER_LDFLAGS=""
BROKERLIBS="";
Expand Down Expand Up @@ -650,12 +650,23 @@ fi

dnl Configure IDOUtils
USE_IDOUTILS=no
AC_ARG_ENABLE(idoutils,--enable-idoutils enables database connectivity using idoutils,USE_IDOUTILS=$enableval,USE_IDOUTILS=no)
AC_ARG_ENABLE(idoutils,AC_HELP_STRING([--enable-idoutils],[enables database connectivity using idoutils]),USE_IDOUTILS=$enableval,USE_IDOUTILS=no)
if test x$USE_IDOUTILS = xyes; then
if test x$USE_EVENTBROKER = xno; then
AC_MSG_ERROR([--enable-idoutils needs also --enable-event-broker])
fi
dnl Checks for libdbi

dnl Optional GD library and include paths
AC_ARG_WITH(dbi-lib,AC_HELP_STRING([--with-dbi-lib=DIR],[sets location of the dbi library]),[
LDFLAGS="${LDFLAGS} -L${withval}"
LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
])
AC_ARG_WITH(dbi-inc,AC_HELP_STRING([--with-dbi-inc=DIR],[sets location of the dbi include files,]),[
CFLAGS="${CFLAGS} -I${withval}"
])
dnl AC_CHECK_HEADER(dbi/dbi.h, [], [], [${withval}])
AC_DEFINE(HAVE_DBI_DBI_H,"1")
AC_MSG_CHECKING(for libdi)
AC_CHECK_LIB([dbi], [main],DBLIBS="$DBCFLAGS -ldbi" , [AC_MSG_ERROR([ERROR - We really need a libdbi to link against])] )
AC_SUBST(DBLIBS)
Expand All @@ -664,13 +675,13 @@ fi

USEPERL=no;
INSTALLPERLSTUFF=no;
AC_ARG_ENABLE(embedded-perl,--enable-embedded-perl will enable embedded Perl interpreter,[
AC_ARG_ENABLE(embedded-perl,AC_HELP_STRING([--enable-embedded-perl],[will enable embedded Perl interpreter]),[
USEPERL=$enableval
]
,USEPERL=no)

PERLCACHE=yes;
AC_ARG_WITH(perlcache,--with-perlcache turns on cacheing of internally compiled Perl scripts,[
AC_ARG_WITH(perlcache,AC_HELP_STRING([--with-perlcache],[turns on cacheing of internally compiled Perl scripts]),[
PERLCACHE=$withval
]
,[
Expand Down Expand Up @@ -719,7 +730,7 @@ icinga_name=icinga
icingastats_name=icingastats
ido2db_name=ido2db
cygwin=no
AC_ARG_ENABLE(cygwin,--enable-cygwin enables building under the CYGWIN environment,[
AC_ARG_ENABLE(cygwin,AC_HELP_STRING([--enable-cygwin],[enables building under the CYGWIN environment]),[
cygwin=$enableval
])
if test x$cygwin = xyes; then
Expand All @@ -733,7 +744,7 @@ AC_SUBST(ido2db_name)


dnl Should predictive failure routines be compiled in?
dnl AC_ARG_ENABLE(failure-prediction,--enable-failure-prediction will enable integration with failure prediction module (NOT HERE YET!),[
dnl AC_ARG_ENABLE(failure-prediction,AC_HELP_STRING([--enable-failure-prediction],[will enable integration with failure prediction module (NOT HERE YET!)]),[
dnl AC_DEFINE_UNQUOTED(PREDICT_FAILURES)
dnl BASEEXTRALIBS="$BASEEXTRALIBS \$(FDATALIBS)"
dnl echo "Failure prediction routines (incomplete!) will be compiled in..."
Expand Down

0 comments on commit 3b7860d

Please sign in to comment.