[go: up one dir, main page]

Menu

[r1142]: / legacy / configure.in  Maximize  Restore  History

Download this file

374 lines (333 with data), 8.6 kB

AC_INIT(configure.in)

AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(nghost, 0.1)

AC_LANG_CPLUSPLUS
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET

PKG_PROG_PKG_CONFIG([0.9.0])

AC_ARG_WITH(
	[xprefix],
	[AS_HELP_STRING(
	 	[--with-xprefix],
		[Prefix for X @<:@default=/usr@:>@])],
	[
	 	case $withval in
			yes|ye|y|no|n) AC_MSG_ERROR([invalid X prefix '$withval'])
			;;
			*) XPREFIX=$withval
			;;
		esac
	],
	[XPREFIX=/usr])
AC_SUBST(XPREFIX)

AC_ARG_WITH(
	[configpath],
	[AS_HELP_STRING(
		[--with-configpath],
		[Path to store configuration information @<:@default=/etc/nghost@:>@ NOTE: Use a trailing slash!])],
	[
		case $withval in
			yes|ye|y|no|n) AC_MSG_ERROR([invalid config path '$withval'])
			;;
			*) CONFIGPATH=$withval
			;;
		esac
	],
	[CONFIGPATH=/etc/nghost/])
AC_SUBST(CONFIGPATH)

AC_ARG_WITH(
	[pluginpath],
	[AS_HELP_STRING(
		[--with-pluginpath],
		[Path to store nghost plugins in @<:@default="$libdir/nghost"@:>@])],
	[
		case $withval in
			yes|ye|y|no|n) AC_MSG_ERROR([invalid pluginpath '$withval'])
			;;
			*) pkglibdir=$withval
			;;
		esac
	],
	[pkglibdir='${libdir}/nghost'])
AC_SUBST([pkglibdir])

AC_ARG_WITH(
	[mysqlcppflags],
	[AS_HELP_STRING(
		[--with-mysqlcppflags],
		[CPP flags for MySQL @<:@default="`mysql_config --cflags`"@:>@])],
	[
		case $withval in
			yes|ye|y|no|n) AC_MSG_ERROR([invalid CPPFLAGS '$withval'])
			;;
			*) mysqlcppflags=$withval
			;;
		esac
	],
	[mysqlcppflags=`mysql_config --cflags`])
AC_SUBST(mysqlcppflags)

AC_ARG_WITH(
	[mysqlldflags],
	[AS_HELP_STRING(
		[--with-mysqlldflags],
		[LDFLAGS for MySQL @<:@default="`mysql_config --libs`"@:>@])],
	[
		case $withval in
			yes|ye|y|no|n) AC_MSG_ERROR([invalid LDFLAGS value '$withval'])
			;;
			*) mysqlldflags=$withval
			;;
		esac
	],
	[mysqlldflags=`mysql_config --libs`])
AC_SUBST(mysqlldflags)

AC_ARG_WITH(
	[xinecflags],
	[AS_HELP_STRING(
		[--with-xinecflags],
		[CFLAGS for xine @<:@default="`xine-config --cflags`"@:>@])],
	[
		case $withval in
			yes|ye|y|no|n) AC_MSG_ERROR([invalid CFLAGS value "$withval"])
			;;
			*) xinecflags=$withval
			;;
		esac
	],
	[xinecflags=`xine-config --cflags`])
AC_SUBST(xinecflags)

AC_ARG_WITH(
	[xineldflags],
	[AS_HELP_STRING(
		[--with-xineldflags],
		[LDFLAGS for xine @<:@default="`xine-config --libs`"@:>@])],
	[
		case $withval in
			yes|ye|y|no|n) AC_MSG_ERROR([invalid LDFLAGS value "$withval"])
			;;
			*) xineldflags=$withval
			;;
		esac
	],
	[xineldflags=`xine-config --libs`])
AC_SUBST(xineldflags)

AC_ARG_ENABLE(
	[mysql],
	[AS_HELP_STRING(
		[--enable-mysql],
		[Enables the mysql database plugin @<:@default=no@:>@])],
	[
		case $enableval in
			yes|ye|y) enablemysql=yes
			;;
			no|n) enablemysql=no
			;;
			*) AC_MSG_ERROR([Invalid option '$enableval' - must be yes or no])
			;;
		esac
	],
	[enablemysql=no])
AM_CONDITIONAL(MYSQL, test "x$enablemysql" = "xyes")

AC_ARG_ENABLE(
	[sqlite],
	[AS_HELP_STRING(
		[--enable-sqlite],
		[Enables the sqlite database plugin @<:@default=yes@:>@])],
	[
		case $enableval in
			yes|ye|y) enablesqlite=yes
			;;
			no|n) enablesqlite=no
			;;
			*) AC_MSG_ERROR([Invalid option '$enableval' - must be yes or no])
			;;
		esac
	],
	[enablesqlite=yes])
AM_CONDITIONAL(SQLITE, test "x$enablesqlite" = "xyes")

AC_ARG_ENABLE(
	[videoipc],
	[AS_HELP_STRING(
		[--enable-videoipc],
		[Enables the video ipc plugin @<:@default=yes@:>@])],
	[
		case $enableval in
			yes|ye|y) enablevideoipc=yes
			;;
			no|n) enablevideoipc=no
			;;
			*) AC_MSG_ERROR([Invalid option '$enableval' - must be yes or no])
			;;
		esac
	],
	[enablevideoipc=yes])
AM_CONDITIONAL(VIDEOIPC, test "x$enablevideoipc" = "xyes")

AC_ARG_ENABLE(
	[videoxine],
	[AS_HELP_STRING(
		[--enable-videoxine],
		[Enables the video xine plugin @<:@default=no@:>@])],
	[
		case $enableval in
			yes|ye|y) enablevideoxine=yes
			;;
			no|n) enablevideoxine=no
			;;
			*) AC_MSG_ERROR([Invalid option '$enableval' - must be yes or no])
			;;
		esac
	],
	[enablevideoxine=no])
AM_CONDITIONAL(VIDEOXINE, test "x$enablevideoxine" = "xyes")


dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
dnl     if-not-found, test-parameter)
dnl AC_DEFUN(KDE_FIND_PATH,
dnl [
dnl    AC_MSG_CHECKING([for $1])
dnl    if test -n "$$2"; then
dnl         kde_cv_path="$$2";
dnl    else
dnl         kde_cache=`echo $1 | sed 'y%./+-%__p_%'`

dnl         AC_CACHE_VAL(kde_cv_path_$kde_cache,
dnl         [
dnl         kde_cv_path="NONE"
dnl         dirs="$3"
dnl         kde_save_IFS=$IFS
dnl         IFS=':'
dnl         for dir in $PATH; do
dnl           dirs="$dirs $dir"
dnl         done
dnl         IFS=$kde_save_IFS

dnl         for dir in $dirs; do
dnl           if test -x "$dir/$1"; then
dnl             if test -n "$5"
dnl             then
dnl               evalstr="$dir/$1 $5 2>&1 "
dnl               if eval $evalstr; then
dnl                 kde_cv_path="$dir/$1"
dnl                 break
dnl               fi
dnl             else
dnl                 kde_cv_path="$dir/$1"
dnl                 break
dnl             fi
dnl           fi
dnl         done

dnl         eval "kde_cv_path_$kde_cache=$kde_cv_path"

dnl         ])

dnl       eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""

dnl    fi

dnl    if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
dnl       AC_MSG_RESULT(not found)
dnl       $4
dnl    else
dnl       AC_MSG_RESULT($kde_cv_path)
dnl       $2=$kde_cv_path

dnl    fi
dnl ])

dnl KDE_FIND_PATH(sdl-config, LIBSDL_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [
dnl   AC_MSG_WARN([Could not find libsdl anywhere, check http://www.sdl.org])
dnl ])

dnl Check for libtool library
AC_CHECK_LIB(
	[ltdl],
	[lt_dlerror],
	[],
	[AC_MSG_ERROR([Require libltdl to load plugins!])])

dnl if test -n "$LIBSDL_CONFIG"; then
dnl      LIBSDL_LIBS="`$LIBSDL_CONFIG --libs`"
dnl      LIBSDL_RPATH=
dnl      for args in $LIBSDL_LIBS; do
dnl           case $args in
dnl             -L*)
dnl                LIBSDL_RPATH="$LIBSDL_RPATH $args"
dnl                ;;
dnl           esac
dnl      done
dnl      LIBSDL_RPATH=`echo $LIBSDL_RPATH | sed -e "s/-L/-R/g"`
dnl      LIBSDL_CFLAGS="`$LIBSDL_CONFIG --cflags`"

dnl      AC_DEFINE_UNQUOTED(HAVE_LIBSDL, 1, [Defines if your system has the LIBSDL library])
dnl fi

if test "x$enablemysql" = "xyes"; then
	store=$CXXFLAGS
	CXXFLAGS="$CXXFLAGS $mysqlcppflags"
	AC_MSG_NOTICE([mysql cppflags=$mysqlcppflags])
	AC_CHECK_HEADER(
		[mysql.h],
		[],
		[AC_MSG_ERROR([unable to find mysql.h])])
	store2=$LDFLAGS
	LDFLAGS="$LDFLAGS $mysqlldflags"
	AC_MSG_NOTICE([mysql ldflags=$mysqlldflags])
	AC_CHECK_LIB(
		[mysqlclient],
		[mysql_close],
		[],
		[AC_MSG_ERROR([Require libmysql to load mysql plugin!])])
	CXXFLAGS=$store
	LDFLAGS=$store2
fi

if test "x$enablesqlite" = "xyes"; then
	PKG_CHECK_MODULES(
		[SQLITE3],
		[sqlite3 >= 3.3])
fi

if test "x$enablevideoxine" = "xyes"; then
	store=$CXXFLAGS
	CXXFLAGS="$CXXFLAGS $xinecflags"
	AC_CHECK_HEADER(
		[xine.h],
		[],
		[AC_MSG_ERROR([unable to find xine.h])])
	store2=$LDFLAGS
	LDFLAGS="$LDFLAGS $xineldflags"
	AC_CHECK_LIB(
		[xine],
		[xine_new],
		[],
		[AC_MSG_ERROR([Require libxine to load xine plugin!])])
	CXXFLAGS=$store
	LDFLAGS=$store2
fi

AC_CHECK_HEADER(SDL/SDL_ttf.h, , AC_MSG_ERROR(unable to find SDL ttf header))
AC_CHECK_HEADER(SDL/SDL_image.h, , AC_MSG_ERROR(unable to find SDL image header))
AC_CHECK_HEADER(taglib/tstring.h, , AC_MSG_ERROR(unable to find taglib headers))
PKG_CHECK_MODULES([SDL], [sdl >= 1.2.11])
dnl AM_PATH_SDLMM(
dnl	[1.2.12],
dnl	[AC_MSG_NOTICE([Found a recent enough version of SDL])],
dnl	[AC_MSG_ERROR([nGhost requires >= SDL 1.2.12. You can find it at http://www.libsdl.org])])
AC_CHECK_TAGLIB('1.4')

PKG_CHECK_MODULES(LIBXML, libxml++-2.6)
AC_SUBST(LIBXML_CFLAGS)
AC_SUBST(LIBXML_LIBS)
CPPFLAGS="$CPPFLAGS $LIBXML_CFLAGS"

PKG_CHECK_MODULES(GLIBMM, glibmm-2.4)
AC_SUBST(GLIBMM_CFLAGS)
AC_SUBST(GLIBMM_LIBS)
CPPFLAGS="$CPPFLAGS $GLIBMM_CFLAGS"


AC_SUBST(LIBSDL_LIBS)
AC_SUBST(LIBSDL_CFLAGS)
AC_SUBST(LIBSDL_RPATH)

AC_SUBST(TAGLIB_CFLAGS)

CPPFLAGS="$CPPFLAGS $TAGLIB_CFLAGS"

AC_MSG_NOTICE([plugin path is: $pluginpath])

AC_OUTPUT(Makefile \
	  m4/Makefile
	  src/Makefile \
	  src/iceskin/Makefile \
	  src/iceskin/screens/Makefile \
	  src/iceskin/screens/images/Makefile \
	  src/icons/Makefile \
	  src/desktop/Makefile \
	  plugins/Makefile \
	  plugins/interface/Makefile \
	  plugins/db/Makefile \
	  plugins/db/mysql/Makefile \
	  plugins/db/sqlite/Makefile \
	  plugins/video/Makefile \
	  plugins/video/ipc/Makefile \
	  plugins/video/xine/Makefile \
	  man/Makefile)