Commit ce0592dd5a9dcda65207a7d7f88c2b4a8658c718

Thomas de Grivel 2021-02-22T14:36:18

fix library path

diff --git a/cli/configure b/cli/configure
index d2bb5ee..e23c626 100755
--- a/cli/configure
+++ b/cli/configure
@@ -18,6 +18,7 @@ CPPFLAGS=
 if test -d /usr/local/include; then
     CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 fi
+CPPFLAGS="$CPPFLAGS -DVER=$VER"
 echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
 
 if [ x"$DEBUG" = x"yes" ]; then
@@ -26,7 +27,6 @@ else
     CFLAGS="-DNDEBUG -O3"
 fi
 CFLAGS="$CFLAGS -W -Wall -Werror -std=c89 -pedantic"
-CFLAGS="$CFLAGS"
 echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
 
 LDFLAGS="-pthread"
diff --git a/config.subr b/config.subr
index 4596820..95c52e6 100644
--- a/config.subr
+++ b/config.subr
@@ -1,7 +1,5 @@
 #!/bin/sh
 
-VER=0.4
-
 o_rule() {
     $CC $CPPFLAGS -M "$1"
 }
@@ -41,6 +39,9 @@ CONFIG_MK=config.mk
 echo "$PWD/${CONFIG_MK}"
 echo "# config.mk generated by configure" > ${CONFIG_MK}
 
+VER=0.4
+echo "VER = $VER" >> ${CONFIG_MK}
+
 if test -z "$CC"; then
     if test -n $(which cc); then
         CC=cc
diff --git a/gtk3/configure b/gtk3/configure
index ee4cd83..69212b7 100755
--- a/gtk3/configure
+++ b/gtk3/configure
@@ -5,6 +5,8 @@ set -e
 
 PROG=rtbuf-gtk3
 
+touch rtbuf_gtk3_resources.c
+
 SOURCES="$(ls *.c | tr '\n' ' ')"
 echo "SOURCES = $SOURCES" >> ${CONFIG_MK}
 
@@ -49,3 +51,5 @@ echo >> ${CONFIG_MK}
 echo "install: $PROG" >> ${CONFIG_MK}
 echo "\t\${INSTALL} -o \${OWNER} -g \${GROUP} -m 0755 -d \${BINDIR}" >> ${CONFIG_MK}
 echo "\t\${LIBTOOL} --tag=CC --mode=install \${INSTALL} -o \${OWNER} -g \${GROUP} -m 0755 $PROG \${BINDIR}/$PROG" >> ${CONFIG_MK}
+
+rm rtbuf_gtk3_resources.c
diff --git a/librtbuf/configure b/librtbuf/configure
index 0bce1f4..13d7784 100755
--- a/librtbuf/configure
+++ b/librtbuf/configure
@@ -14,7 +14,7 @@ echo "OBJECTS = $OBJECTS" >> ${CONFIG_MK}
 if test -d /usr/local/include; then
     CPPFLAGS="-I/usr/local/include"
 fi
-CPPFLAGS="$CPPFLAGS -I./include"
+CPPFLAGS="$CPPFLAGS -DRTBUF_LIBDIR=\\\"${RTBUF_LIBDIR}\\\" -DVER=\\\"${VER}\\\""
 echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
 
 if [ x"$DEBUG" = x"yes" ]; then
diff --git a/librtbuf/rtbuf_lib.c b/librtbuf/rtbuf_lib.c
index 6d74b20..40ec424 100644
--- a/librtbuf/rtbuf_lib.c
+++ b/librtbuf/rtbuf_lib.c
@@ -35,8 +35,7 @@ s_rtbuf_lib *g_rtbuf_lib;
 char g_rtbuf_lib_user_dir[1024];
 char *g_rtbuf_lib_path[] = { "./lib/",
                              g_rtbuf_lib_user_dir,
-                             "/usr/local/lib/rtbuf/",
-                             "/usr/lib/rtbuf/",
+                             RTBUF_LIBDIR "/",
                              0 };
 
 void rtbuf_lib_init_ ()
@@ -51,7 +50,7 @@ void rtbuf_lib_init_ ()
     in = ".";
   while (*in)
     *out++ = *in++;
-  in = "/.rtbuf/lib/rtbuf/";
+  in = "/.rtbuf/lib/rtbuf/" VER "/";
   while (*in)
     *out++ = *in++;
   *out = 0;