mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 23:13:13 +02:00
- introduce TARGET_ROOT define to fix paths in native mode
Conflicts: src/neutrino.cpp
This commit is contained in:
74
acinclude.m4
74
acinclude.m4
@@ -9,10 +9,15 @@ AC_ARG_WITH(target,
|
||||
[TARGET="$withval"],
|
||||
[TARGET="native"])
|
||||
|
||||
AC_ARG_WITH(targetroot,
|
||||
AS_HELP_STRING([--with-targetroot=PATH], [the target root (only applicable in native mode)]),
|
||||
[TARGET_ROOT="$withval"],
|
||||
[TARGET_ROOT="NONE"])
|
||||
|
||||
AC_ARG_WITH(targetprefix,
|
||||
AS_HELP_STRING([--with-targetprefix=PATH], [prefix relative to target root (only applicable in cdk mode)]),
|
||||
AS_HELP_STRING([--with-targetprefix=PATH], [prefix relative to target root, e.g. /usr (only applicable in cdk mode)]),
|
||||
[TARGET_PREFIX="$withval"],
|
||||
[TARGET_PREFIX=""])
|
||||
[TARGET_PREFIX="NONE"])
|
||||
|
||||
AC_ARG_WITH(debug,
|
||||
AS_HELP_STRING([--without-debug], [disable debugging code @<:@default=no@:>@]),
|
||||
@@ -163,40 +168,48 @@ AC_MSG_CHECKING(target)
|
||||
if test "$TARGET" = "native"; then
|
||||
AC_MSG_RESULT(native)
|
||||
|
||||
if test "$prefix" = "NONE"; then
|
||||
prefix=/usr/local
|
||||
fi
|
||||
|
||||
if test "$TARGET_ROOT" = "NONE"; then
|
||||
AC_MSG_ERROR([invalid targetroot, you need to specify one in native mode])
|
||||
TARGET_ROOT=""
|
||||
fi
|
||||
TARGET_PREFIX=$prefix
|
||||
|
||||
if test "$CFLAGS" = "" -a "$CXXFLAGS" = ""; then
|
||||
CFLAGS="-Wall -O2 -pipe $DEBUG_CFLAGS"
|
||||
CXXFLAGS="-Wall -O2 -pipe $DEBUG_CFLAGS"
|
||||
fi
|
||||
if test "$prefix" = "NONE"; then
|
||||
prefix=/usr/local
|
||||
fi
|
||||
targetprefix=$prefix
|
||||
TARGET_PREFIX=$prefix
|
||||
AC_DEFINE_UNQUOTED(TARGET_PREFIX, "$TARGET_PREFIX", [The targets prefix])
|
||||
elif test "$TARGET" = "cdk"; then
|
||||
AC_MSG_RESULT(cdk)
|
||||
|
||||
if test "$CC" = "" -a "$CXX" = ""; then
|
||||
AC_MSG_ERROR([you need to specify variables CC or CXX in cdk])
|
||||
fi
|
||||
if test "$CFLAGS" = "" -o "$CXXFLAGS" = ""; then
|
||||
AC_MSG_ERROR([you need to specify variables CFLAGS and CXXFLAGS in cdk])
|
||||
fi
|
||||
if test "$prefix" = "NONE"; then
|
||||
AC_MSG_ERROR([invalid prefix, you need to specify one in cdk mode])
|
||||
fi
|
||||
if test "$TARGET_PREFIX" != "NONE"; then
|
||||
AC_DEFINE_UNQUOTED(TARGET_PREFIX, "$TARGET_PREFIX", [The targets prefix])
|
||||
fi
|
||||
|
||||
TARGET_ROOT=""
|
||||
if test "$TARGET_PREFIX" = "NONE"; then
|
||||
AC_MSG_ERROR([invalid targetprefix, you need to specify one in cdk mode])
|
||||
TARGET_PREFIX=""
|
||||
fi
|
||||
|
||||
if test "$CC" = "" -a "$CXX" = ""; then
|
||||
AC_MSG_ERROR([you need to specify variables CC or CXX in cdk mode])
|
||||
fi
|
||||
if test "$CFLAGS" = "" -o "$CXXFLAGS" = ""; then
|
||||
AC_MSG_ERROR([you need to specify variables CFLAGS and CXXFLAGS in cdk mode])
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(none)
|
||||
AC_MSG_ERROR([invalid target $TARGET, choose on from native,cdk]);
|
||||
AC_MSG_ERROR([invalid target "$TARGET", choose "native" or "cdk"]);
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED([TARGET], ["$TARGET"], [target for compilation])
|
||||
AC_DEFINE_UNQUOTED([TARGET_ROOT], ["$TARGET_ROOT"], [native: the target root; cdk: empty])
|
||||
AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["$TARGET_PREFIX"], [native: auto-assigned path; cdk: path relative to target root])
|
||||
|
||||
if test "$exec_prefix" = "NONE"; then
|
||||
exec_prefix=$prefix
|
||||
fi
|
||||
@@ -249,19 +262,30 @@ AC_SUBST(TARGET_$2)
|
||||
AC_DEFUN([TUXBOX_APPS_DIRECTORY], [
|
||||
AC_REQUIRE([TUXBOX_APPS])
|
||||
|
||||
#
|
||||
# FIXME:
|
||||
# This breaks --sysconfdir= etc. switches in cdk mode.
|
||||
# Is --with-targetprefix= and the resulting ${TARGET_PREFIX} really needed?
|
||||
#
|
||||
if test "$TARGET" = "cdk"; then
|
||||
datadir="\${prefix}/share"
|
||||
sysconfdir="/etc"
|
||||
localstatedir="/var"
|
||||
libdir="\${prefix}/lib"
|
||||
mntdir="/mnt"
|
||||
targetdatadir="\${TARGET_PREFIX}/share"
|
||||
targetsysconfdir="/etc"
|
||||
targetlocalstatedir="/var"
|
||||
|
||||
libdir="\${prefix}/lib"
|
||||
targetlibdir="\${TARGET_PREFIX}/lib"
|
||||
|
||||
sysconfdir="/etc"
|
||||
targetsysconfdir="/etc"
|
||||
|
||||
localstatedir="/var"
|
||||
targetlocalstatedir="/var"
|
||||
|
||||
mntdir="/mnt"
|
||||
targetmntdir="/mnt"
|
||||
MNTDIR=$targetmntdir
|
||||
else
|
||||
mntdir="/mnt" # hack
|
||||
mntdir="/mnt"
|
||||
MNTDIR=$mntdir
|
||||
fi
|
||||
|
||||
TUXBOX_APPS_DIRECTORY_ONE(configdir, CONFIGDIR, localstatedir, /var, /tuxbox/config,
|
||||
|
@@ -29,7 +29,7 @@
|
||||
#define NEUTRINO_CPP extern
|
||||
#endif
|
||||
|
||||
#define IMAGE_VERSION_FILE "/.version"
|
||||
#define IMAGE_VERSION_FILE TARGET_ROOT "/.version"
|
||||
|
||||
#define NEUTRINO_SETTINGS_FILE CONFIGDIR "/neutrino.conf"
|
||||
#define NEUTRINO_SCAN_SETTINGS_FILE CONFIGDIR "/scan.conf"
|
||||
@@ -112,8 +112,4 @@ NEUTRINO_CPP CRadioTextGUI *g_RadiotextWin;
|
||||
#define ENABLE_GUI_MOUNT
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_PREFIX
|
||||
#define TARGET_PREFIX ""
|
||||
#endif
|
||||
|
||||
#endif /* __neutrino_global_h__ */
|
||||
|
@@ -54,8 +54,8 @@
|
||||
#include <nhttpd/yconfig.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#define OS_RELEASE_FILE "/usr/lib/os-release"
|
||||
#define OE_IMAGE_VERSION_FILE "/etc/image-version"
|
||||
#define OS_RELEASE_FILE TARGET_ROOT "/usr/lib/os-release"
|
||||
#define OE_IMAGE_VERSION_FILE TARGET_ROOT "/etc/image-version"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@@ -383,7 +383,7 @@ int CNeutrinoApp::loadSetup(const char *fname)
|
||||
CGLCDThemes::getInstance()->getTheme(configfile);
|
||||
|
||||
g_settings.glcd_enable = configfile.getInt32("glcd_enable", strcmp(g_info.hw_caps->boxvendor, "VU+") == 0 || strcmp(g_info.hw_caps->boxvendor, "AXAS") == 0 || strcmp(g_info.hw_caps->boxvendor, "Protek") == 0);
|
||||
g_settings.glcd_logodir = configfile.getString("glcd_logodir", "/media/sda1/logos");
|
||||
g_settings.glcd_logodir = configfile.getString("glcd_logodir", TARGET_ROOT "/media/sda1/logos");
|
||||
|
||||
g_settings.glcd_brightness = configfile.getInt32("glcd_brightness", GLCD_DEFAULT_BRIGHTNESS);
|
||||
g_settings.glcd_brightness_dim = configfile.getInt32("glcd_brightness_dim", GLCD_DEFAULT_BRIGHTNESS_DIM);
|
||||
@@ -403,7 +403,7 @@ int CNeutrinoApp::loadSetup(const char *fname)
|
||||
|
||||
#ifdef ENABLE_LCD4LINUX
|
||||
g_settings.lcd4l_support = configfile.getInt32("lcd4l_support", 0);
|
||||
g_settings.lcd4l_logodir = configfile.getString("lcd4l_logodir", "/media/sda1/logos");
|
||||
g_settings.lcd4l_logodir = configfile.getString("lcd4l_logodir", TARGET_ROOT "/media/sda1/logos");
|
||||
g_settings.lcd4l_display_type = configfile.getInt32("lcd4l_display_type", 0);
|
||||
g_settings.lcd4l_skin = configfile.getInt32("lcd4l_skin", 0);
|
||||
g_settings.lcd4l_skin_radio = configfile.getInt32("lcd4l_skin_radio", 0);
|
||||
@@ -736,7 +736,7 @@ int CNeutrinoApp::loadSetup(const char *fname)
|
||||
g_settings.timezone = configfile.getString("timezone", "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Vienna");
|
||||
|
||||
// epg
|
||||
g_settings.epg_dir = configfile.getString("epg_dir", "/media/sda1/epg");
|
||||
g_settings.epg_dir = configfile.getString("epg_dir", TARGET_ROOT "/media/sda1/epg");
|
||||
g_settings.epg_cache = configfile.getInt32("epg_cache_time", 7);
|
||||
g_settings.epg_extendedcache = configfile.getInt32("epg_extendedcache_time", 168);
|
||||
g_settings.epg_max_events = configfile.getInt32("epg_max_events", 30000);
|
||||
@@ -791,14 +791,14 @@ int CNeutrinoApp::loadSetup(const char *fname)
|
||||
g_settings.network_nfs[i].password = configfile.getString("network_nfs_password_" + i_str, "");
|
||||
}
|
||||
|
||||
g_settings.network_nfs_audioplayerdir = configfile.getString("network_nfs_audioplayerdir", "/media/sda1/music");
|
||||
g_settings.network_nfs_moviedir = configfile.getString("network_nfs_moviedir", "/media/sda1/movies");
|
||||
g_settings.network_nfs_picturedir = configfile.getString("network_nfs_picturedir", "/media/sda1/pictures");
|
||||
g_settings.network_nfs_recordingdir = configfile.getString("network_nfs_recordingdir", "/media/sda1/movies");
|
||||
g_settings.network_nfs_streamripperdir = configfile.getString("network_nfs_streamripperdir", "/media/sda1/music/streamripper");
|
||||
g_settings.network_nfs_audioplayerdir = configfile.getString("network_nfs_audioplayerdir", TARGET_ROOT "/media/sda1/music");
|
||||
g_settings.network_nfs_moviedir = configfile.getString("network_nfs_moviedir", TARGET_ROOT "/media/sda1/movies");
|
||||
g_settings.network_nfs_picturedir = configfile.getString("network_nfs_picturedir", TARGET_ROOT "/media/sda1/pictures");
|
||||
g_settings.network_nfs_recordingdir = configfile.getString("network_nfs_recordingdir", TARGET_ROOT "/media/sda1/movies");
|
||||
g_settings.network_nfs_streamripperdir = configfile.getString("network_nfs_streamripperdir", TARGET_ROOT "/media/sda1/music/streamripper");
|
||||
|
||||
g_settings.downloadcache_dir = configfile.getString("downloadcache_dir", g_settings.network_nfs_recordingdir.c_str());
|
||||
g_settings.logo_hdd_dir = configfile.getString("logo_hdd_dir", "/media/sda1/logos");
|
||||
g_settings.logo_hdd_dir = configfile.getString("logo_hdd_dir", TARGET_ROOT "/media/sda1/logos");
|
||||
|
||||
// recording
|
||||
g_settings.record_hours = configfile.getInt32("record_hours", 4);
|
||||
@@ -977,7 +977,7 @@ int CNeutrinoApp::loadSetup(const char *fname)
|
||||
g_settings.livestreamScriptPath = configfile.getString("livestreamScriptPath", WEBTVDIR);
|
||||
|
||||
// plugins
|
||||
g_settings.plugin_hdd_dir = configfile.getString("plugin_hdd_dir", "/media/sda1/plugins");
|
||||
g_settings.plugin_hdd_dir = configfile.getString("plugin_hdd_dir", TARGET_ROOT "/media/sda1/plugins");
|
||||
g_settings.plugins_disabled = configfile.getString("plugins_disabled", "");
|
||||
g_settings.plugins_game = configfile.getString("plugins_game", "");
|
||||
g_settings.plugins_lua = configfile.getString("plugins_lua", "");
|
||||
@@ -988,7 +988,7 @@ int CNeutrinoApp::loadSetup(const char *fname)
|
||||
g_settings.movieplayer_plugin = configfile.getString("movieplayer_plugin", "---");
|
||||
|
||||
// screenshot
|
||||
g_settings.screenshot_dir = configfile.getString("screenshot_dir", "/media/sda1/movies");
|
||||
g_settings.screenshot_dir = configfile.getString("screenshot_dir", TARGET_ROOT "/media/sda1/movies");
|
||||
g_settings.screenshot_count = configfile.getInt32("screenshot_count", 1);
|
||||
g_settings.screenshot_cover = configfile.getInt32("screenshot_cover", 0);
|
||||
g_settings.screenshot_format = configfile.getInt32("screenshot_format", 1);
|
||||
@@ -1074,7 +1074,7 @@ int CNeutrinoApp::loadSetup(const char *fname)
|
||||
g_settings.flashupdate_createimage_add_uldr = configfile.getInt32("flashupdate_createimage_add_uldr", 1);
|
||||
g_settings.flashupdate_createimage_add_var = configfile.getInt32("flashupdate_createimage_add_var", 1);
|
||||
|
||||
g_settings.backup_dir = configfile.getString("backup_dir", "/media");
|
||||
g_settings.backup_dir = configfile.getString("backup_dir", TARGET_ROOT "/media");
|
||||
g_settings.update_dir = configfile.getString("update_dir", "/tmp");
|
||||
g_settings.update_dir_opkg = configfile.getString("update_dir_opkg", g_settings.update_dir);
|
||||
|
||||
|
Reference in New Issue
Block a user