Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
85f5c15f
Commit
85f5c15f
authored
Mar 20, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Linux: determine data path at run-time from library path
parent
e83bc5b9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
4 deletions
+31
-4
src/Makefile.am
src/Makefile.am
+1
-1
src/posix/dirs.c
src/posix/dirs.c
+2
-2
src/posix/linux_specific.c
src/posix/linux_specific.c
+28
-1
No files found.
src/Makefile.am
View file @
85f5c15f
...
@@ -169,7 +169,7 @@ AM_CPPFLAGS = $(INCICONV) \
...
@@ -169,7 +169,7 @@ AM_CPPFLAGS = $(INCICONV) \
-DMODULE_STRING
=
\"
main
\"
\
-DMODULE_STRING
=
\"
main
\"
\
-DLOCALEDIR
=
\"
$(localedir)
\"
\
-DLOCALEDIR
=
\"
$(localedir)
\"
\
-DSYSCONFDIR
=
\"
$(sysconfdir)
\"
\
-DSYSCONFDIR
=
\"
$(sysconfdir)
\"
\
-D
DATA_PATH
=
\"
$(vlcdatadir)
\"
\
-D
PKGDATADIR
=
\"
$(vlcdatadir)
\"
\
-DPKGLIBDIR
=
\"
$(vlclibdir)
\"
-DPKGLIBDIR
=
\"
$(vlclibdir)
\"
AM_CFLAGS
=
$(CFLAGS_libvlccore)
AM_CFLAGS
=
$(CFLAGS_libvlccore)
...
...
src/posix/dirs.c
View file @
85f5c15f
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include <assert.h>
#include <assert.h>
#include <limits.h>
#include <limits.h>
#if !defined (__linux__)
/**
/**
* Determines the shared data directory
* Determines the shared data directory
*
*
...
@@ -42,10 +43,9 @@
...
@@ -42,10 +43,9 @@
*/
*/
char
*
config_GetDataDirDefault
(
void
)
char
*
config_GetDataDirDefault
(
void
)
{
{
return
strdup
(
DATA_PATH
);
return
strdup
(
PKGDATADIR
);
}
}
#if !defined (__linux__)
/**
/**
* Determines the architecture-dependent data directory
* Determines the architecture-dependent data directory
*
*
...
...
src/posix/linux_specific.c
View file @
85f5c15f
...
@@ -26,7 +26,8 @@
...
@@ -26,7 +26,8 @@
#include <string.h>
#include <string.h>
#include <vlc_common.h>
#include <vlc_common.h>
#include "../libvlc.h"
#include "libvlc.h"
#include "config/configuration.h"
char
*
config_GetLibDir
(
void
)
char
*
config_GetLibDir
(
void
)
{
{
...
@@ -73,3 +74,29 @@ char *config_GetLibDir (void)
...
@@ -73,3 +74,29 @@ char *config_GetLibDir (void)
error:
error:
return
(
path
!=
NULL
)
?
path
:
strdup
(
PKGLIBDIR
);
return
(
path
!=
NULL
)
?
path
:
strdup
(
PKGLIBDIR
);
}
}
char
*
config_GetDataDirDefault
(
void
)
{
char
*
libdir
=
config_GetLibDir
();
if
(
libdir
==
NULL
)
return
NULL
;
/* OOM */
char
*
datadir
=
NULL
;
/* There are no clean ways to do this, are there?
* Due to multilibs, we cannot simply append ../share/. */
char
*
p
=
strstr
(
libdir
,
"/lib/"
);
if
(
p
!=
NULL
)
{
char
*
p2
;
/* Deal with nested "lib" directories. Grmbl. */
while
((
p2
=
strstr
(
p
+
4
,
"/lib/"
))
!=
NULL
)
p
=
p2
;
*
p
=
'\0'
;
if
(
unlikely
(
asprintf
(
&
datadir
,
"%s/share/"
PACKAGE
,
libdir
)
==
-
1
))
datadir
=
NULL
;
}
free
(
libdir
);
return
(
datadir
!=
NULL
)
?
datadir
:
strdup
(
PKGDATADIR
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment