Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 540572
Collapse All | Expand All

(-)23cf2445ee5d (+49 lines)
Added Link Here
1
# ===========================================================================
2
#       http://www.gnu.org/software/autoconf-archive/ax_define_dir.html
3
# ===========================================================================
4
#
5
# SYNOPSIS
6
#
7
#   AX_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
8
#
9
# DESCRIPTION
10
#
11
#   This macro sets VARNAME to the expansion of the DIR variable, taking
12
#   care of fixing up ${prefix} and such.
13
#
14
#   VARNAME is then offered as both an output variable and a C preprocessor
15
#   symbol.
16
#
17
#   Example:
18
#
19
#     AX_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.])
20
#
21
# LICENSE
22
#
23
#   Copyright (c) 2008 Stepan Kasal <kasal@ucw.cz>
24
#   Copyright (c) 2008 Andreas Schwab <schwab@suse.de>
25
#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
26
#   Copyright (c) 2008 Alexandre Oliva
27
#
28
#   Copying and distribution of this file, with or without modification, are
29
#   permitted in any medium without royalty provided the copyright notice
30
#   and this notice are preserved. This file is offered as-is, without any
31
#   warranty.
32
33
#serial 6
34
35
AU_ALIAS([AC_DEFINE_DIR], [AX_DEFINE_DIR])
36
AC_DEFUN([AX_DEFINE_DIR], [
37
  prefix_NONE=
38
  exec_prefix_NONE=
39
  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
40
  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
41
dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
42
dnl refers to ${prefix}.  Thus we have to use `eval' twice.
43
  eval ax_define_dir="\"[$]$2\""
44
  eval ax_define_dir="\"$ax_define_dir\""
45
  AC_SUBST($1, "$ax_define_dir")
46
  AC_DEFINE_UNQUOTED($1, "$ax_define_dir", [$3])
47
  test "$prefix_NONE" && prefix=NONE
48
  test "$exec_prefix_NONE" && exec_prefix=NONE
49
])
(-)a/configure.ac (+5 lines)
Lines 134-139 Link Here
134
	CXXFLAGS="$CXXFLAGS -msse2"
134
	CXXFLAGS="$CXXFLAGS -msse2"
135
fi
135
fi
136
136
137
AC_ARG_WITH(extdatadir, AC_HELP_STRING([--with-extdatadir], [Search Songs etc. from the configured DATADIR]), with_extdatadr=$withval, with_extdatadir=no)
138
if test "$with_extdatadir" = "yes"; then
139
	AX_DEFINE_DIR([EXT_DATADIR], [datadir], [External datadir])
140
fi
141
137
AC_ARG_WITH(prof, AS_HELP_STRING([--with-prof],[Enable profiling]), with_prof=$withval, with_prof=no)
142
AC_ARG_WITH(prof, AS_HELP_STRING([--with-prof],[Enable profiling]), with_prof=$withval, with_prof=no)
138
if test "$with_prof" = "yes"; then
143
if test "$with_prof" = "yes"; then
139
	test "$DEFAULT_CFLAGS" = "yes" && CFLAGS="$CFLAGS -pg"
144
	test "$DEFAULT_CFLAGS" = "yes" && CFLAGS="$CFLAGS -pg"
(-)a/src/arch/ArchHooks/ArchHooks_Unix.cpp (+13 lines)
Lines 269-283 Link Here
269
	 * (Deprecated; use rootfs.) */
269
	 * (Deprecated; use rootfs.) */
270
	FILEMAN->Mount( "dir", "/proc", "/proc" );
270
	FILEMAN->Mount( "dir", "/proc", "/proc" );
271
#endif
271
#endif
272
	// Get Lower case product family
273
	RString sProductFamily = PRODUCT_FAMILY;
274
	sProductFamily.MakeLower();
272
275
273
	RString Root;
276
	RString Root;
274
	struct stat st;
277
	struct stat st;
278
279
#if defined(EXT_DATADIR)
280
	// Search folders at EXT_DATADIR
281
	RString ext_dir = EXT_DATADIR + RString("/") + sProductFamily;
282
	if( !stat(ext_dir + "/Packages", &st) && st.st_mode&S_IFDIR )
283
		Root = ext_dir;
284
	else if( !stat(ext_dir  + "/Songs", &st) && st.st_mode&S_IFDIR )
285
		Root = ext_dir;
286
#else
275
	if( !stat(sDirOfExecutable + "/Packages", &st) && st.st_mode&S_IFDIR )
287
	if( !stat(sDirOfExecutable + "/Packages", &st) && st.st_mode&S_IFDIR )
276
		Root = sDirOfExecutable;
288
		Root = sDirOfExecutable;
277
	else if( !stat(sDirOfExecutable + "/Songs", &st) && st.st_mode&S_IFDIR )
289
	else if( !stat(sDirOfExecutable + "/Songs", &st) && st.st_mode&S_IFDIR )
278
		Root = sDirOfExecutable;
290
		Root = sDirOfExecutable;
279
	else if( !stat(RageFileManagerUtil::sInitialWorkingDirectory + "/Songs", &st) && st.st_mode&S_IFDIR )
291
	else if( !stat(RageFileManagerUtil::sInitialWorkingDirectory + "/Songs", &st) && st.st_mode&S_IFDIR )
280
		Root = RageFileManagerUtil::sInitialWorkingDirectory;
292
		Root = RageFileManagerUtil::sInitialWorkingDirectory;
293
#endif
281
	else
294
	else
282
		RageException::Throw( "%s", COULDNT_FIND_SONGS.GetValue().c_str() );
295
		RageException::Throw( "%s", COULDNT_FIND_SONGS.GetValue().c_str() );
283
296
(-)a/src/arch/LoadingWindow/LoadingWindow_Gtk.cpp (-1 / +7 lines)
Lines 1-4 Link Here
1
#include "global.h"
1
#include "global.h"
2
#include "ProductInfo.h"
2
#include "RageLog.h"
3
#include "RageLog.h"
3
#include "RageFileManager.h"
4
#include "RageFileManager.h"
4
#include "RageUtil.h"
5
#include "RageUtil.h"
Lines 29-35 Link Here
29
{
30
{
30
	ASSERT( Handle == NULL );
31
	ASSERT( Handle == NULL );
31
32
32
	Handle = dlopen( RageFileManagerUtil::sDirOfExecutable + "/" + "GtkModule.so", RTLD_NOW );
33
	#if defined(EXT_DATADIR)
34
		Handle = dlopen( EXT_DATADIR + RString("/") + RString(PRODUCT_FAMILY).MakeLower() + "/" + "GtkModule.so", RTLD_NOW );
35
	#else
36
 		Handle = dlopen( RageFileManagerUtil::sDirOfExecutable + "/" + "GtkModule.so", RTLD_NOW );
37
	#endif
38
33
	if( Handle == NULL )
39
	if( Handle == NULL )
34
		return ssprintf( "dlopen(): %s", dlerror() );
40
		return ssprintf( "dlopen(): %s", dlerror() );
35
41
(-)a/src/arch/LoadingWindow/LoadingWindow_GtkModule.cpp (+13 lines)
Lines 1-4 Link Here
1
#include "global.h"
1
#include "global.h"
2
#include "ProductInfo.h"
2
#include "LoadingWindow_GtkModule.h"
3
#include "LoadingWindow_GtkModule.h"
3
#include "RageUtil.h"
4
#include "RageUtil.h"
4
#include "RageSurface.h"
5
#include "RageSurface.h"
Lines 15-21 Link Here
15
extern "C" const char *Init( int *argc, char ***argv )
16
extern "C" const char *Init( int *argc, char ***argv )
16
{
17
{
17
	// Need to use external library to load this image. Native loader seems broken :/
18
	// Need to use external library to load this image. Native loader seems broken :/
19
#if defined(EXT_DATADIR)
20
	gchar splash_image_path[50] = EXT_DATADIR;
21
	gchar product[] = PRODUCT_FAMILY;
22
	int i,plen = strlen(product);
23
	for (i = 0; i < plen; i++)
24
		product[i] = tolower(product[i]);
25
	strcat(splash_image_path,"/");
26
	strcat(splash_image_path,product);
27
	strcat(splash_image_path,"/Data/splash.png");
28
#else
18
	const gchar *splash_image_path = "Data/splash.png";
29
	const gchar *splash_image_path = "Data/splash.png";
30
#endif
31
19
	GtkWidget *vbox;
32
	GtkWidget *vbox;
20
33
21
	gtk_disable_setlocale();
34
	gtk_disable_setlocale();

Return to bug 540572