summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml32
-rw-r--r--configure.ac14
-rw-r--r--drivers/alsa_midi/port.c20
-rw-r--r--drivers/dummy/dummy_driver.c2
-rw-r--r--drivers/dummy/dummy_driver.h2
-rw-r--r--include/internal.h2
-rw-r--r--jackd/engine.c12
-rw-r--r--jackd/jackd.c3
-rw-r--r--libjack/client.c46
-rw-r--r--man/Makefile.am2
10 files changed, 99 insertions, 36 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..347960c
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,32 @@
+sudo: false
+os:
+ - osx
+ - linux
+language:
+ - c
+compiler:
+ - gcc
+ - clang
+addons:
+ apt:
+ packages:
+ - libsamplerate-dev
+ - libsndfile-dev
+ - libasound2-dev
+ - libdb-dev
+ - doxygen
+
+before_install:
+ - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
+ - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew outdated pkg-config || brew upgrade pkg-config; fi
+ - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew uninstall libtool && brew install libtool; fi
+ - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install libsamplerate; fi
+ - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install libsndfile; fi
+ - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install readline; fi
+ - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install berkeley-db; fi
+ - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install doxygen; fi
+
+script:
+ - ./autogen.sh
+ - ./configure
+ - make
diff --git a/configure.ac b/configure.ac
index 6150970..02bd02c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -291,6 +291,20 @@ AC_CHECK_FUNC(clock_gettime,
])
)
+AC_CHECK_FUNC(clock_nanosleep,
+ [
+ AC_DEFINE(HAVE_CLOCK_NANOSLEEP,0,"Whether or not clock_nanosleep can be found in system libraries")
+ ],
+ #
+ # if not found, check librt specifically
+ #
+ AC_CHECK_LIB(rt, clock_nanosleep,
+ [
+ AC_DEFINE(HAVE_CLOCK_NANOSLEEP,1,"Whether or not clock_nanosleep can be found in system libraries")
+ OS_LDFLAGS="$OS_LDFLAGS -lrt"
+ ])
+)
+
# should we use mlockall() on this platform?
if test "x$JACK_DO_NOT_MLOCK" = "x"; then
AC_CHECK_HEADER(sys/mman.h,
diff --git a/drivers/alsa_midi/port.c b/drivers/alsa_midi/port.c
index 6f1cb04..d217310 100644
--- a/drivers/alsa_midi/port.c
+++ b/drivers/alsa_midi/port.c
@@ -111,34 +111,36 @@ a2j_port_fill_name (struct a2j_port * port_ptr, int dir, snd_seq_client_info_t *
/* entire client name is part of the port name so don't replicate it */
snprintf (port_ptr->name,
sizeof(port_ptr->name),
- "[%d] %s %s",
+ "[%d:%d] %s (%s)",
snd_seq_client_info_get_client (client_info_ptr),
+ snd_seq_port_info_get_port (port_info_ptr),
port_name,
- (dir == A2J_PORT_CAPTURE ? "in" : "out"));
+ (dir == A2J_PORT_CAPTURE ? "out" : "in"));
} else {
snprintf (port_ptr->name,
sizeof(port_ptr->name),
- "%s [%d] %s %s",
- client_name,
+ "[%d:%d] %s %s (%s)",
snd_seq_client_info_get_client (client_info_ptr),
+ snd_seq_port_info_get_port (port_info_ptr),
+ client_name,
port_name,
- (dir == A2J_PORT_CAPTURE ? "in" : "out"));
+ (dir == A2J_PORT_CAPTURE ? "out" : "in"));
}
} else {
if (strstr (port_name, client_name) == port_name) {
/* entire client name is part of the port name so don't replicate it */
snprintf (port_ptr->name,
sizeof(port_ptr->name),
- "%s %s",
+ "%s (%s)",
port_name,
- (dir == A2J_PORT_CAPTURE ? "in" : "out"));
+ (dir == A2J_PORT_CAPTURE ? "out" : "in"));
} else {
snprintf (port_ptr->name,
sizeof(port_ptr->name),
- "%s %s %s",
+ "%s %s (%s)",
client_name,
snd_seq_port_info_get_name (port_info_ptr),
- (dir == A2J_PORT_CAPTURE ? "in" : "out"));
+ (dir == A2J_PORT_CAPTURE ? "out" : "in"));
}
}
diff --git a/drivers/dummy/dummy_driver.c b/drivers/dummy/dummy_driver.c
index 42092c7..361ab9a 100644
--- a/drivers/dummy/dummy_driver.c
+++ b/drivers/dummy/dummy_driver.c
@@ -73,7 +73,7 @@ FakeVideoSync ( dummy_driver_t *driver )
}
}
-#ifdef HAVE_CLOCK_GETTIME
+#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_NANOSLEEP)
static inline unsigned long long ts_to_nsec (struct timespec ts)
{
return ts.tv_sec * 1000000000LL + ts.tv_nsec;
diff --git a/drivers/dummy/dummy_driver.h b/drivers/dummy/dummy_driver.h
index 296f027..4daf182 100644
--- a/drivers/dummy/dummy_driver.h
+++ b/drivers/dummy/dummy_driver.h
@@ -43,7 +43,7 @@ struct _dummy_driver {
jack_nframes_t period_size;
unsigned long wait_time;
-#ifdef HAVE_CLOCK_GETTIME
+#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_NANOSLEEP)
struct timespec next_wakeup;
#else
jack_time_t next_time;
diff --git a/include/internal.h b/include/internal.h
index 5a14237..e3574bd 100644
--- a/include/internal.h
+++ b/include/internal.h
@@ -509,7 +509,7 @@ extern jack_client_t *jack_client_alloc_internal(jack_client_control_t*,
/* internal clients call this. it's defined in jack/engine.c */
void handle_internal_client_request(jack_control_t*, jack_request_t*);
-extern char *jack_tmpdir;
+extern const char *jack_get_tmpdir(void);
extern char *jack_user_dir(void);
diff --git a/jackd/engine.c b/jackd/engine.c
index 1ca6584..ad0a8d6 100644
--- a/jackd/engine.c
+++ b/jackd/engine.c
@@ -227,16 +227,22 @@ make_socket_subdirectories (const char *server_name)
{
struct stat statbuf;
char server_dir[PATH_MAX + 1] = "";
+ const char *tmpdir = jack_get_tmpdir ();
+
+ if (tmpdir == NULL) {
+ jack_error ("Unable to get tmpdir in engine");
+ return -1;
+ }
/* check tmpdir directory */
- if (stat (jack_tmpdir, &statbuf)) {
+ if (stat (tmpdir, &statbuf)) {
jack_error ("cannot stat() %s (%s)\n",
- jack_tmpdir, strerror (errno));
+ tmpdir, strerror (errno));
return -1;
} else {
if (!S_ISDIR (statbuf.st_mode)) {
jack_error ("%s exists, but is not a directory!\n",
- jack_tmpdir);
+ tmpdir);
return -1;
}
}
diff --git a/jackd/jackd.c b/jackd/jackd.c
index ff7242a..b27dde2 100644
--- a/jackd/jackd.c
+++ b/jackd/jackd.c
@@ -812,7 +812,8 @@ main (int argc, char *argv[])
case 'l':
/* special flag to allow libjack to determine jackd's idea of where tmpdir is */
- printf ("%s\n", jack_tmpdir);
+ printf("%s\n", DEFAULT_TMP_DIR);
+
exit (0);
case 'I':
diff --git a/libjack/client.c b/libjack/client.c
index 34e8b09..7724868 100644
--- a/libjack/client.c
+++ b/libjack/client.c
@@ -119,11 +119,10 @@ init_cpu ()
#endif /* USE_DYNSIMD */
-char *jack_tmpdir = DEFAULT_TMP_DIR;
-
-static int
+const char *
jack_get_tmpdir ()
{
+ static char tmpdir[PATH_MAX + 1] = "";
FILE* in;
size_t len;
char buf[PATH_MAX + 2]; /* allow tmpdir to live anywhere, plus newline, plus null */
@@ -131,6 +130,11 @@ jack_get_tmpdir ()
char *pathcopy;
char *p;
+ /* return tmpdir if set */
+ if (tmpdir[0] != '\0') {
+ return tmpdir;
+ }
+
/* some implementations of popen(3) close a security loophole by
resetting PATH for the exec'd command. since we *want* to
use the user's PATH setting to locate jackd, we have to
@@ -138,13 +142,13 @@ jack_get_tmpdir ()
*/
if ((pathenv = getenv ("PATH")) == 0) {
- return -1;
+ return NULL;
}
/* don't let strtok(3) mess with the real environment variable */
if ((pathcopy = strdup (pathenv)) == NULL) {
- return -1;
+ return NULL;
}
p = strtok (pathcopy, ":");
@@ -169,13 +173,13 @@ jack_get_tmpdir ()
if (p == NULL) {
/* no command successfully started */
free (pathcopy);
- return -1;
+ return NULL;
}
if (fgets (buf, sizeof(buf), in) == NULL) {
pclose (in);
free (pathcopy);
- return -1;
+ return NULL;
}
len = strlen (buf);
@@ -184,21 +188,16 @@ jack_get_tmpdir ()
/* didn't get a whole line */
pclose (in);
free (pathcopy);
- return -1;
- }
-
- if ((jack_tmpdir = (char*)malloc (len)) == NULL) {
- free (pathcopy);
- return -1;
+ return NULL;
}
- memcpy (jack_tmpdir, buf, len - 1);
- jack_tmpdir[len - 1] = '\0';
+ memcpy (tmpdir, buf, len - 1);
+ tmpdir[len - 1] = '\0';
pclose (in);
free (pathcopy);
- return 0;
+ return tmpdir;
}
void
@@ -1260,7 +1259,7 @@ jack_client_open_aux (const char *client_name,
/* External clients need to know where the tmpdir used for
communication with the server lives
*/
- if (jack_get_tmpdir ()) {
+ if (jack_get_tmpdir () == NULL) {
*status |= JackFailure;
jack_messagebuffer_exit ();
return NULL;
@@ -1458,15 +1457,24 @@ char *
jack_user_dir (void)
{
static char user_dir[PATH_MAX + 1] = "";
+ const char *tmpdir;
/* format the path name on the first call */
if (user_dir[0] == '\0') {
+ tmpdir = jack_get_tmpdir ();
+
+ /* previous behavior of jack_tmpdir, should be changed later */
+ if (tmpdir == NULL) {
+ jack_error ("Unable to get tmpdir in user dir");
+ tmpdir = DEFAULT_TMP_DIR;
+ }
+
if (getenv ("JACK_PROMISCUOUS_SERVER")) {
snprintf (user_dir, sizeof(user_dir), "%s/jack",
- jack_tmpdir);
+ tmpdir);
} else {
snprintf (user_dir, sizeof(user_dir), "%s/jack-%d",
- jack_tmpdir, getuid ());
+ tmpdir, getuid ());
}
}
diff --git a/man/Makefile.am b/man/Makefile.am
index ca68b74..f889434 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,5 +1,5 @@
.0.1:
- @sed -e "s/!VERSION!/@JACK_RELEASE@/g" -e "s/!DATE!/`date '+%B %Y'`/g" < $*.0 > $@
+ @[ -z "$$SOURCE_DATE_EPOCH" ] || d=--date=@$$SOURCE_DATE_EPOCH ; sed -e "s/!VERSION!/@JACK_RELEASE@/g" -e "s/!DATE!/`date $$d '+%B %Y'`/g" < $*.0 > $@
@echo Built $*.1 from template
manpages = $(patsubst %.0,%.1,$(wildcard *.0))