diff options
author | waker <wakeroid@gmail.com> | 2010-11-20 18:12:49 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2010-11-20 18:12:49 +0100 |
commit | 625c61f5fd96f8d84bd2a21f5b7951f64f8f5025 (patch) | |
tree | adc0fb11fcf5f6deed9615f4805d55bf0d378828 /main.c | |
parent | d90cdb9cf2344a8891643bdaaeba091603889821 (diff) | |
parent | 38c085d04677559b5232b1ac7ae5469f6bb77e4d (diff) |
Merge branch 'static' into multichannel
Conflicts:
main.c
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 55 |
1 files changed, 34 insertions, 21 deletions
@@ -536,12 +536,18 @@ main (int argc, char *argv[]) { bindtextdomain (PACKAGE, LOCALEDIR); bind_textdomain_codeset (PACKAGE, "UTF-8"); textdomain (PACKAGE); -#endif +#endif + + int staticlink = 0; int portable = 0; +#if STATICLINK + staticlink = 1; +#endif #if PORTABLE portable = 1; #endif - fprintf (stderr, "starting deadbeef " VERSION "%s\n", portable ? " [portable build]" : ""); + + fprintf (stderr, "starting deadbeef " VERSION "%s%s\n", staticlink ? " [static]" : "", portable ? " [portable]" : ""); srand (time (NULL)); #ifdef __linux__ prctl (PR_SET_NAME, "deadbeef-main", 0, 0, 0, 0); @@ -554,31 +560,15 @@ main (int argc, char *argv[]) { e--; } *e = 0; +#endif + +#if PORTABLE_FULL if (snprintf (confdir, sizeof (confdir), "%s/config", dbinstalldir) > sizeof (confdir)) { fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); return -1; } strcpy (dbconfdir, confdir); - - if (snprintf (dbdocdir, sizeof (dbdocdir), "%s/doc", dbinstalldir) > sizeof (dbdocdir)) { - fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); - return -1; - } - if (snprintf (dbplugindir, sizeof (dbplugindir), "%s/plugins", dbinstalldir) > sizeof (dbplugindir)) { - fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); - return -1; - } - if (snprintf (dbpixmapdir, sizeof (dbpixmapdir), "%s/pixmaps", dbinstalldir) > sizeof (dbpixmapdir)) { - fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); - return -1; - } - trace ("installdir: %s\n", dbinstalldir); - trace ("confdir: %s\n", confdir); - trace ("docdir: %s\n", dbdocdir); - trace ("plugindir: %s\n", dbplugindir); - mkdir (dbplugindir, 0755); - trace ("pixmapdir: %s\n", dbpixmapdir); #else char *homedir = getenv ("HOME"); if (!homedir) { @@ -604,6 +594,24 @@ main (int argc, char *argv[]) { return -1; } mkdir (confdir, 0755); +#endif + + +#if PORTABLE + if (snprintf (dbdocdir, sizeof (dbdocdir), "%s/doc", dbinstalldir) > sizeof (dbdocdir)) { + fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); + return -1; + } + if (snprintf (dbplugindir, sizeof (dbplugindir), "%s/plugins", dbinstalldir) > sizeof (dbplugindir)) { + fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); + return -1; + } + if (snprintf (dbpixmapdir, sizeof (dbpixmapdir), "%s/pixmaps", dbinstalldir) > sizeof (dbpixmapdir)) { + fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); + return -1; + } + mkdir (dbplugindir, 0755); +#else if (snprintf (dbdocdir, sizeof (dbdocdir), "%s", DOCDIR) > sizeof (dbdocdir)) { fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); return -1; @@ -617,6 +625,11 @@ main (int argc, char *argv[]) { return -1; } #endif + trace ("installdir: %s\n", dbinstalldir); + trace ("confdir: %s\n", confdir); + trace ("docdir: %s\n", dbdocdir); + trace ("plugindir: %s\n", dbplugindir); + trace ("pixmapdir: %s\n", dbpixmapdir); mkdir (dbconfdir, 0755); |