From ee169288a59653fa712d683e916bfbd6ee7e2bd2 Mon Sep 17 00:00:00 2001 From: "[CST] Bas" Date: Tue, 29 Jan 2013 01:18:38 +0800 Subject: [PATCH] neutrino: add multiple paths so they can be configured and not be hard-coded in multiple files. --- acinclude.m4 | 45 +++++++++++++++++++++++++++--------------- configure.ac | 8 ++++++++ src/nhttpd/nhttpd.conf | 23 --------------------- 3 files changed, 37 insertions(+), 39 deletions(-) delete mode 100644 src/nhttpd/nhttpd.conf diff --git a/acinclude.m4 b/acinclude.m4 index 08a8c1e41..163824de4 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -11,7 +11,7 @@ AC_ARG_WITH(target, AC_ARG_WITH(targetprefix, [ --with-targetprefix=PATH prefix relative to target root (only applicable in cdk mode)], - [targetprefix="$withval"],[targetprefix="NONE"]) + [TARGET_PREFIX="$withval"],[TARGET_PREFIX="NONE"]) AC_ARG_WITH(debug, [ --without-debug disable debugging code], @@ -21,6 +21,7 @@ if test "$DEBUG" = "yes"; then DEBUG_CFLAGS="-g3 -ggdb" AC_DEFINE(DEBUG,1,[Enable debug messages]) fi + AC_ARG_ENABLE(tmsdk, AS_HELP_STRING(--enable-tmsdk, compile inside sdk), ,[enable_tmsdk=no]) @@ -38,7 +39,7 @@ if test "$TARGET" = "native"; then if test "$prefix" = "NONE"; then prefix=/usr/local fi - targetprefix=$prefix + TARGET_PREFIX=$prefix elif test "$TARGET" = "cdk"; then AC_MSG_RESULT(cdk) @@ -50,13 +51,14 @@ elif test "$TARGET" = "cdk"; then CXXFLAGS="-Wall -Os -mcpu=823 -pipe $DEBUG_CFLAGS" fi if test "$prefix" = "NONE"; then - AC_MSG_ERROR(invalid prefix, you need to specify one in cdk mode) + AC_MSG_ERROR([invalid prefix, you need to specify one in cdk mode]) fi - if test "$targetprefix" != "NONE"; then - AC_DEFINE_UNQUOTED(TARGETPREFIX, "${targetprefix}",[The targets prefix]) + if test "$TARGET_PREFIX" != "NONE"; then + AC_DEFINE_UNQUOTED(TARGET_PREFIX, "$TARGET_PREFIX",[The targets prefix]) fi - if test "$targetprefix" = "NONE"; then - targetprefix="" + if test "$TARGET_PREFIX" = "NONE"; then + AC_MSG_ERROR([invalid targetprefix, you need to specify one in cdk mode]) + TARGET_PREFIX="" fi if test "$host_alias" = ""; then cross_compiling=yes @@ -80,7 +82,7 @@ AC_DEFUN([TUXBOX_APPS_DIRECTORY_ONE],[ AC_ARG_WITH($1,[ $6$7 [[PREFIX$4$5]]],[ _$2=$withval if test "$TARGET" = "cdk"; then - $2=`eval echo "${targetprefix}$withval"` + $2=`eval echo "$TARGET_PREFIX$withval"` else $2=$withval fi @@ -95,7 +97,6 @@ AC_ARG_WITH($1,[ $6$7 [[PREFIX$4$5]]],[ TARGET_$2=$_$2 ]) -dnl automake <= 1.6 don't support this dnl AC_SUBST($2) AC_DEFINE_UNQUOTED($2,"$_$2",$7) AC_SUBST(TARGET_$2) @@ -109,10 +110,10 @@ if test "$TARGET" = "cdk"; then sysconfdir="\${prefix}/etc" localstatedir="\${prefix}/var" libdir="\${prefix}/lib" - targetdatadir="\${targetprefix}/share" - targetsysconfdir="\${targetprefix}/etc" - targetlocalstatedir="\${targetprefix}/var" - targetlibdir="\${targetprefix}/lib" + targetdatadir="\${TARGET_PREFIX}/share" + targetsysconfdir="\${TARGET_PREFIX}/etc" + targetlocalstatedir="\${TARGET_PREFIX}/var" + targetlibdir="\${TARGET_PREFIX}/lib" fi TUXBOX_APPS_DIRECTORY_ONE(configdir,CONFIGDIR,localstatedir,/var,/tuxbox/config, @@ -136,8 +137,17 @@ TUXBOX_APPS_DIRECTORY_ONE(plugindir,PLUGINDIR,libdir,/lib,/tuxbox/plugins, TUXBOX_APPS_DIRECTORY_ONE(ucodedir,UCODEDIR,localstatedir,/var,/tuxbox/ucodes, [--with-ucodedir=PATH ],[where to find the ucodes]) -TUXBOX_APPS_DIRECTORY_ONE(themesdir,THEMESDIR,datadir,/share,/tuxbox/neutrino/themes, +TUXBOX_APPS_DIRECTORY_ONE(themesdir,THEMESDIR,datadir,/share/tuxbox, /neutrino/themes, [--with-themesdir=PATH ],[where to find the themes (don't change)]) + +TUXBOX_APPS_DIRECTORY_ONE(iconsdir,ICONSDIR,datadir,/share/tuxbox, /neutrino/icons, + [--with-iconssdir=PATH ],[where to find the icons (don't change)]) + +TUXBOX_APPS_DIRECTORY_ONE(private_httpddir,PRIVATE_HTTPDDIR,datadir,/share,/tuxbox/neutrino/httpd, + [--with-private_httpddir=PATH ],[where to find the the private httpd files]) + +TUXBOX_APPS_DIRECTORY_ONE(public_httpddir,PUBLIC_HTTPDDIR,localstatedir,/var,/httpd, + [--with-public_httpddir=PATH ],[where to find the the public httpd files]) ]) dnl automake <= 1.6 needs this specifications @@ -149,6 +159,9 @@ AC_SUBST(LIBDIR) AC_SUBST(PLUGINDIR) AC_SUBST(UCODEDIR) AC_SUBST(THEMESDIR) +AC_SUBST(ICONSDIR) +AC_SUBST(PRIVATE_HTTPDDIR) +AC_SUBST(PUBLIC_HTTPDDIR) dnl end workaround AC_DEFUN([TUXBOX_APPS_ENDIAN],[ @@ -231,8 +244,8 @@ if test "$$1_CONFIG" != "no"; then $1_CFLAGS=$($$1_CONFIG --cflags) $1_LIBS=$($$1_CONFIG --libs) else - $1_CFLAGS=$($$1_CONFIG --prefix=$targetprefix --cflags) - $1_LIBS=$($$1_CONFIG --prefix=$targetprefix --libs) + $1_CFLAGS=$($$1_CONFIG --prefix=$TARGET_PREFIX --cflags) + $1_LIBS=$($$1_CONFIG --prefix=$TARGET_PREFIX --libs) fi fi fi diff --git a/configure.ac b/configure.ac index d71a7885d..94eee787a 100644 --- a/configure.ac +++ b/configure.ac @@ -122,15 +122,22 @@ AC_ARG_ENABLE(cleanup, [ --enable-cleanup enable cleanup on exit], [AC_DEFINE(EXIT_CLEANUP,1,[enable cleanup on exit])]) +if test "$BOXTYPE" = "coolstream"; then +if test "$BOXMODEL" = "nevis"; then if test -e ${srcdir}/lib/libcoolstream/nevis_ir.h; then AC_DEFINE(HAVE_COOLSTREAM_NEVIS_IR_H,1,[Define to 1 if you have the header file.]) fi +fi + +if test "$BOXMODEL" = "apollo"; then if test -e ${srcdir}/lib/libcoolstream2/cs_ir_generic.h; then AC_DEFINE(HAVE_COOLSTREAM_CS_IR_GENERIC_H,1,[Define to 1 if you have the header file.]) fi if test -e ${srcdir}/lib/libcoolstream2/cs_frontpanel.h; then AC_DEFINE(HAVE_COOLSTREAM_CS_FRONTPANEL_H,1,[Define to 1 if you have the header file.]) fi +fi +fi # # Check for libtdservicedb - the new one - for testing only @@ -179,6 +186,7 @@ src/nhttpd/tuxboxapi/Makefile src/nhttpd/tuxboxapi/coolstream/Makefile src/nhttpd/yhttpd_core/Makefile src/nhttpd/yhttpd_mods/Makefile +src/nhttpd/nhttpd.conf src/Makefile src/daemonc/Makefile src/driver/pictureviewer/Makefile diff --git a/src/nhttpd/nhttpd.conf b/src/nhttpd/nhttpd.conf deleted file mode 100644 index de955798e..000000000 --- a/src/nhttpd/nhttpd.conf +++ /dev/null @@ -1,23 +0,0 @@ -Language.directory=languages -Language.selected=Deutsch -Tuxbox.LogosURL=/usr/share/tuxbox/neutrino/icons/logo -WebsiteMain.directory=/share/tuxbox/neutrino/httpd -WebsiteMain.override_directory=/var/httpd -WebsiteMain.port=80 -WebsiteMain.hosted_directory=/var/hosted -configfile.version=4 -mod_auth.authenticate=false -mod_auth.no_auth_client= -mod_auth.password=coolstream -mod_auth.username=root -mod_cache.cache_directory=/tmp/.cache -mod_sendfile.mime_types=htm:text/html,html:text/html,xml:text/xml,txt:text/plain,jpg:image/jpeg,jpeg:image/jpeg,gif:image/gif,png:image/png,bmp:image/bmp,css:text/css,js:text/plain,img:application/octet-stream,ico:image/x-icon,m3u:application/octet-stream,tar:application/octet-stream,gz:text/x-gzip,ts:application/octet-stream -mod_weblog.log_format= -mod_weblog.logfile=/tmp/yhhtpd.log -server.chroot= -server.group_name= -server.log.loglevel=0 -server.no_keep-alive_ips= -server.user_name= -webserver.threading=false -webserver.websites=WebsiteMain