summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2007-05-09 14:37:44 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2007-05-09 14:37:44 +0000
commitc72478ce90d83e355ad7782991d20cbbd2664fd3 (patch)
treeda172589b72c9d2c5b1d2311d50b7a60d55585b5 /src
parent8ca43646a6c87d00d5b2cb74cebf65a8d0ea5e8e (diff)
downloadlibrcc-c72478ce90d83e355ad7782991d20cbbd2664fd3.tar.gz
librcc-c72478ce90d83e355ad7782991d20cbbd2664fd3.tar.bz2
librcc-c72478ce90d83e355ad7782991d20cbbd2664fd3.tar.xz
librcc-c72478ce90d83e355ad7782991d20cbbd2664fd3.zip
FreeBSD fixes
- Autoconf: try to locate libraries in /usr/local - Autoconf: Help FreeBSD to locate BerkeleyDB - Autoconf: Search for dlopen in libc library - Autoconf: Support of --disable-bdb option is added to configure script - Fixed compilation with missing dlopen functionality - Suppress various warnings
Diffstat (limited to 'src')
-rw-r--r--src/fs.c5
-rw-r--r--src/plugin.c4
-rw-r--r--src/rcciconv.c2
-rw-r--r--src/rcctranslate.c12
4 files changed, 14 insertions, 9 deletions
diff --git a/src/fs.c b/src/fs.c
index f8f6094..675e061 100644
--- a/src/fs.c
+++ b/src/fs.c
@@ -80,11 +80,14 @@ static char *rccCheckFile(const char *prefix, const char *name) {
/* Converts: 'filename' to 'prefix/name' using 'fspath' */
int rccFS0(rcc_language_config config, const char *fspath, const char *filename, char **prefix, char **name) {
+#ifdef HAVE_MNTENT_H
FILE *mtab;
struct mntent *fsentry;
+ char *lastprefix;
+#endif /* HAVE_MNTENT_H */
+
const char *tmp = NULL;
size_t len;
- char *lastprefix;
if (fspath) {
len = strlen(fspath);
diff --git a/src/plugin.c b/src/plugin.c
index c1f0074..38337fb 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -125,10 +125,10 @@ rcc_plugin_handle rccPluginLoad(rcc_plugin_type type, const char *name) {
if (!pluginfn) return NULL;
sprintf(pluginfn, "%s/.rcc/engines/lib%s.so", rcc_home_dir, name);
- res = dlopen(pluginfn, RTLD_NOW);
+ res = rccLibraryOpen(pluginfn);
if (!res) {
sprintf(pluginfn, LIBRCC_DATA_DIR "/engines/lib%s.so", name);
- res = dlopen(pluginfn, RTLD_NOW);
+ res = rccLibraryOpen(pluginfn);
}
free(pluginfn);
diff --git a/src/rcciconv.c b/src/rcciconv.c
index 6d3d1b0..3037dc2 100644
--- a/src/rcciconv.c
+++ b/src/rcciconv.c
@@ -74,7 +74,7 @@ loop_restart:
out_left = outsize;
loop:
- err=iconv(icnv->icnv, &in_buf, &in_left, &out_buf, &out_left);
+ err=iconv(icnv->icnv, (const char**)&in_buf, &in_left, &out_buf, &out_left);
if (err<0) {
if (errno==E2BIG) {
*(int*)(outbuf+(RCC_MAX_STRING_CHARS-sizeof(int)))=0;
diff --git a/src/rcctranslate.c b/src/rcctranslate.c
index 98c0f1b..7c79d8b 100644
--- a/src/rcctranslate.c
+++ b/src/rcctranslate.c
@@ -87,16 +87,17 @@ int rccTranslateAllowOfflineMode(rcc_translate translate) {
return rccExternalAllowOfflineMode();
}
-#define RCC_UNLOCK_W 1
-#define RCC_UNLOCK_R 2
-#define RCC_UNLOCK_RW 3
-#define RCC_UNLOCK_WR 3
+#ifdef HAVE_LIBTRANSLATE
+# define RCC_UNLOCK_W 1
+# define RCC_UNLOCK_R 2
+# define RCC_UNLOCK_RW 3
+# define RCC_UNLOCK_WR 3
static char *rccTranslateReturn(rcc_translate translate, char *ret, int unlock) {
if (unlock&RCC_UNLOCK_R) rccMutexUnLock(translate->mutex);
if (unlock&RCC_UNLOCK_W) rccMutexUnLock(translate->wmutex);
return ret;
}
-#define rccTranslateReturnNULL(translate, unlock) rccTranslateReturn(translate, NULL, unlock)
+# define rccTranslateReturnNULL(translate, unlock) rccTranslateReturn(translate, NULL, unlock)
static int rccTranslateQueue(rcc_translate translate, const char *buf) {
size_t len, err;
@@ -109,6 +110,7 @@ static int rccTranslateQueue(rcc_translate translate, const char *buf) {
if (!err) err = rccExternalWrite(translate->sock, buf, len + 1, 0);
return err?1:0;
}
+#endif /* HAVE_LIBTRANSLATE */
char *rccTranslate(rcc_translate translate, const char *buf) {
#ifdef HAVE_LIBTRANSLATE