I’ve just recently started using FVWM and OpenBSD,
I’m trying to compile fvwm 2.5.24 with svg support on OpenBSD 4.2, I found the following guide, its a little out of date but the configure line still works for the most part: bsdlamer.dev-zero.de/index.php?/ … .83.9.html
I would like to add svg support but receive the following message during the configure script
according to the set command, my LD_LIBRARY_PATH is set to /usr/local/lib
When I do locate librsvg I receive the following
when I look at the configure script it looks like its trying to use the rsvg.h
is there a switch or OS variable that I can add/modify to allow the cofigure script to see this?
I don’t think copying the png stuff matters since its done after the configure script, also I didn’t copy it with version 2.5.23 and png worked fine. This version (2.5.24) will probably compile, and work, the same, but I would like to add svg support, if it’s possible.
I would imagine OpenBSD doesn’t use LD_LIBRARY_PATH since it aims to be secure by default.
I’m not sure how to remove the code and still have it add svg support… learning C/C++ is on my todo list still… (hopefully once my exams are done I’ll be able to better focus on this)
from what I found I think the -L command in the $LIBS variable should be telling the script where to read the libraries “-L/usr/local/lib -L/usr/X11R6/lib” but I’m not sure why it can’t find them then since they are in /usr/local/lib directory.
“Specifying the location of dynamic libraries not in /usr/lib” - They mention that solaris has a -R option to specify the run time location of libs. Does openbsd have something like that?
Remove the following code from configure.ac:
if test x"$with_rsvg" = xyes ; then
AC_MSG_CHECKING(whether a librsvg program compiles and runs)
original_CFLAGS="$CFLAGS"
original_LIBS="$LIBS"
CFLAGS="$CFLAGS $rsvg_CFLAGS"
LIBS="$LIBS $rsvg_LIBS"
AC_TRY_RUN([
#include <librsvg/rsvg.h>
#include <librsvg/rsvg-cairo.h>
int main() {
RsvgHandle *rsvg;
g_type_init();
if(!(rsvg = rsvg_handle_new())) return 1;
g_object_unref(G_OBJECT(rsvg));
return 0;
}
], [
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
AC_MSG_WARN([*** The librsvg test program failed to run. If your system])
AC_MSG_WARN([*** has shared libraries outside the normal system library])
AC_MSG_WARN([*** path, you need to make sure that the LD_LIBRARY_PATH])
AC_MSG_WARN([*** (or the like) environment variable is correctly set.])
with_rsvg=no
problem_rsvg=": Failed to run test program"
], [echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$original_CFLAGS"
LIBS="$original_LIBS"
fi
… and run ./utils/configure_dev.sh.
The -L/usr/local/lib tells the compiler where to find the libs. I think that part is working just fine. The problem is the run time linker. You may need -R/usr/local/lib or something simular.
LD_RUN_PATH sounds just like what we’ve been looking for:
env LD_RUN_PATH="/usr/local/lib" ./configure
If your system somehow mysteriously also ignores LD_RUN_PATH, you will have to pass the “-R” option to the linker. With gcc, you can use the “-Wl,” option for that. Pass these options to the configure script via the LDFLAGS environment variable. Something like this should do it:
I tried both commands and neither worked, I also tried ‘export LD_RUN_PATH=“/usr/local/lib”’ and then ./configure, but that also didn’t work.
I just noticed one of the other dependencies had corrected itself though and I just broke it again.
The FreeType version changed to yes at some point, and I didn’t notice… was paying more attention to the png and librsvg section i guess.
This is how I broke it again. As root I ran ldconfig -r to see what was in the hints file and noticed that the librsvg was listed as /usr/lib/librsvg-2.* from when I copied the files there earlier, so I went and deleted those files and then ran ldconfig as root with no switches hoping it would update with the /usr/local/lib path. Then as a user I re-ran the configure script and received a ‘no’ to FreeType again. When i checked the hints file again I realised I went from 206 entries down to 38.
I saved a copy of the output from when I listed the hints, and will try to find out how the entries were added in the first place.
Maybe it’s time to simplify the problem. This is the c code from the configure script:
#include <librsvg/rsvg.h>
#include <librsvg/rsvg-cairo.h>
int main() {
RsvgHandle *rsvg;
g_type_init();
if(!(rsvg = rsvg_handle_new())) return 1;
g_object_unref(G_OBJECT(rsvg));
return 0;
}
Put that code in a file, rsvg_test.c, and figure out how to compile it and run it without errors. I do it like this:
You may need to pass some additional flags to gcc, like “-Wl,-R/usr/local/lib”. If you get this working, you should then be able to pass the same set of flags to the configure script.