aboutsummaryrefslogtreecommitdiff
path: root/pd/src/s_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'pd/src/s_main.c')
-rw-r--r--pd/src/s_main.c38
1 files changed, 14 insertions, 24 deletions
diff --git a/pd/src/s_main.c b/pd/src/s_main.c
index a246e38a..058f0232 100644
--- a/pd/src/s_main.c
+++ b/pd/src/s_main.c
@@ -13,7 +13,7 @@
#include <fcntl.h>
#include <stdlib.h>
-#ifdef UNISTD
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef MSW
@@ -51,7 +51,6 @@ int sys_nosleep = 0; /* skip all "sleep" calls and spin instead */
char *sys_guicmd;
t_symbol *sys_libdir;
-t_symbol *sys_guidir;
static t_namelist *sys_openlist;
static t_namelist *sys_messagelist;
static int sys_version;
@@ -63,12 +62,12 @@ int sys_midiindevlist[MAXMIDIINDEV] = {1};
int sys_midioutdevlist[MAXMIDIOUTDEV] = {1};
char sys_font[100] =
-#ifdef MSW
- "Courier";
+#ifdef __APPLE__
+ "Monaco";
#else
"Courier";
#endif
-char sys_fontweight[] = "bold "; /* currently only used for iemguis */
+char sys_fontweight[] = "bold ";
static int sys_main_srate;
static int sys_main_advance;
static int sys_main_callback;
@@ -297,7 +296,7 @@ int sys_main(int argc, char **argv)
pd_version, pd_compiletime, pd_compiledate);
if (sys_version) /* if we were just asked our version, exit here. */
return (0);
- if (sys_startgui(sys_guidir->s_name)) /* start the gui */
+ if (sys_startgui(sys_libdir->s_name)) /* start the gui */
return(1);
if (sys_externalschedlib)
return (sys_run_scheduler(sys_externalschedlibname,
@@ -391,7 +390,7 @@ static char *(usagemessage[]) = {
"-guicmd \"cmd...\" -- start alternatve GUI program (e.g., remote via ssh)\n",
"-send \"msg...\" -- send a message at startup, after patches are loaded\n",
"-noprefs -- suppress loading preferences on startup\n",
-#ifdef UNISTD
+#ifdef HAVE_UNISTD_H
"-rt or -realtime -- use real-time priority\n",
"-nrt -- don't use real-time priority\n",
#endif
@@ -441,7 +440,7 @@ void sys_findprogdir(char *progname)
{
char sbuf[MAXPDSTRING], sbuf2[MAXPDSTRING], *sp;
char *lastslash;
-#ifdef UNISTD
+#ifdef HAVE_UNISTD_H
struct stat statbuf;
#endif
@@ -451,7 +450,7 @@ void sys_findprogdir(char *progname)
sbuf2[MAXPDSTRING-1] = 0;
sys_unbashfilename(sbuf2, sbuf);
#endif /* MSW */
-#ifdef UNISTD
+#ifdef HAVE_UNISTD_H
strncpy(sbuf, progname, MAXPDSTRING);
sbuf[MAXPDSTRING-1] = 0;
#endif
@@ -483,22 +482,23 @@ void sys_findprogdir(char *progname)
pd was found in. We now want to infer the "lib" directory and the
"gui" directory. In "simple" unix installations, the layout is
.../bin/pd
- .../bin/pd-gui
+ .../bin/pd-watchdog (etc)
+ .../tcl/pd.tcl
.../doc
and in "complicated" unix installations, it's:
.../bin/pd
- .../lib/pd/bin/pd-gui
+ .../lib/pd/bin/pd-watchdog
+ .../lib/tcl/pd.tcl
.../lib/pd/doc
To decide which, we stat .../lib/pd; if that exists, we assume it's
the complicated layout. In MSW, it's the "simple" layout, but
- the gui program is straight wish80:
+ "wish" is found in bin:
.../bin/pd
.../bin/wish80.exe
.../doc
*/
#ifdef MSW
sys_libdir = gensym(sbuf2);
- sys_guidir = &s_; /* in MSW the guipath just depends on the libdir */
#else
strncpy(sbuf, sbuf2, MAXPDSTRING-30);
sbuf[MAXPDSTRING-30] = 0;
@@ -507,21 +507,11 @@ void sys_findprogdir(char *progname)
{
/* complicated layout: lib dir is the one we just stat-ed above */
sys_libdir = gensym(sbuf);
- /* gui lives in .../lib/pd/bin */
- strncpy(sbuf, sbuf2, MAXPDSTRING-30);
- sbuf[MAXPDSTRING-30] = 0;
- strcat(sbuf, "/lib/pd/bin");
- sys_guidir = gensym(sbuf);
}
else
{
/* simple layout: lib dir is the parent */
sys_libdir = gensym(sbuf2);
- /* gui lives in .../bin */
- strncpy(sbuf, sbuf2, MAXPDSTRING-30);
- sbuf[MAXPDSTRING-30] = 0;
- strcat(sbuf, "/bin");
- sys_guidir = gensym(sbuf);
}
#endif
}
@@ -839,7 +829,7 @@ int sys_argparse(int argc, char **argv)
sys_noautopatch = 1;
argc--; argv++;
}
-#ifdef UNISTD
+#ifdef HAVE_UNISTD_H
else if (!strcmp(*argv, "-rt") || !strcmp(*argv, "-realtime"))
{
sys_hipriority = 1;