commit 530fa2dba6a5bf5104f5eaf902771acf0fb51423
parent af5439f3c63f456090c0ba7943134823718e0b16
Author: Nils Durner <durner@gnunet.org>
Date: Fri, 3 Jun 2005 18:20:50 +0000
- Windows
- intl
- OGG support
- add -ldl for other platforms
Diffstat:
6 files changed, 67 insertions(+), 8 deletions(-)
diff --git a/configure.ac b/configure.ac
@@ -77,6 +77,13 @@ AC_CONFIG_SUBDIRS(libltdl)
AM_ICONV
+# We define the paths here, because MinGW/GCC expands paths
+# passed through the command line ("-DLOCALEDIR=..."). This would
+# lead to hard-coded paths ("C:\mingw\mingw\bin...") that do
+# not contain the actual installation.
+AC_DEFINE_DIR([LOCALEDIR], [datadir/locale], [gettext catalogs])
+
+
# large file support
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
diff --git a/m4/ac_define_dir.m4 b/m4/ac_define_dir.m4
@@ -0,0 +1,35 @@
+dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
+dnl
+dnl This macro _AC_DEFINEs VARNAME to the expansion of the DIR
+dnl variable, taking care of fixing up ${prefix} and such.
+dnl
+dnl VARNAME is offered as both a C preprocessor symbol, and an output
+dnl variable.
+dnl
+dnl Note that the 3 argument form is only supported with autoconf 2.13
+dnl and later (i.e. only where _AC_DEFINE supports 3 arguments).
+dnl
+dnl Examples:
+dnl
+dnl AC_DEFINE_DIR(DATADIR, datadir)
+dnl AC_DEFINE_DIR(PROG_PATH, bindir, [Location of installed binaries])
+dnl
+dnl @category Misc
+dnl @author Stepan Kasal <kasal@ucw.cz>
+dnl @author Andreas Schwab <schwab@suse.de>
+dnl @author Guido Draheim <guidod@gmx.de>
+dnl @author Alexandre Oliva
+dnl @version 2005-01-17
+dnl @license AllPermissive
+
+AC_DEFUN([AC_DEFINE_DIR], [
+ prefix_NONE=
+ exec_prefix_NONE=
+ test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+ test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+ eval ac_define_dir="\"[$]$2\""
+ AC_SUBST($1, "$ac_define_dir")
+ AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
+ test "$prefix_NONE" && prefix=NONE
+ test "$exec_prefix_NONE" && exec_prefix=NONE
+])
diff --git a/src/main/Makefile.am b/src/main/Makefile.am
@@ -8,10 +8,6 @@ plugindir = $(libdir)/libextractor
LIBS = \
@LTLIBINTL@ @LIBS@
-# Define a C macro LOCALEDIR indicating where catalogs will be installed.
-localedir = $(datadir)/locale
-DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
-
lib_LTLIBRARIES = \
libextractor.la
@@ -23,10 +19,14 @@ AM_CFLAGS = \
extract_LDADD = \
$(top_builddir)/src/main/libextractor.la
+if !MINGW
+ dlflag=-ldl
+endif
+
libextractor_la_LDFLAGS = \
-export-dynamic -version-info 1:1:0 $(LIBICONV)
libextractor_la_LIBADD = \
- $(LIBLTDL)
+ $(LIBLTDL) $(dlflag)
libextractor_la_DEPENDENCIES = \
$(LIBLTDL)
diff --git a/src/main/extract.c b/src/main/extract.c
@@ -392,9 +392,13 @@ main (int argc, char *argv[])
int bibtex = NO;
char * binary = NULL;
+#ifdef MINGW
+ InitWinEnv();
+#endif
+
setlocale(LC_ALL, "");
textdomain(PACKAGE);
- bindtextdomain(PACKAGE, LOCALEDIR);
+ BINDTEXTDOMAIN(PACKAGE, LOCALEDIR);
print = malloc (sizeof (int) * EXTRACTOR_getHighestKeywordTypeNumber ());
for (i = 0; i < EXTRACTOR_getHighestKeywordTypeNumber (); i++)
print[i] = YES; /* default: print everything */
@@ -524,12 +528,18 @@ main (int argc, char *argv[])
"Unknown keyword type '%s', use option '%s' to get a list.\n",
optarg,
"-L");
+#ifdef MINGW
+ ShutdownWinEnv();
+#endif
return -1;
}
break;
default:
fprintf (stderr,
_("Use --help to get a list of options.\n"));
+#ifdef MINGW
+ ShutdownWinEnv();
+#endif
return -1;
} /* end of parsing commandline */
} /* while (1) */
@@ -538,6 +548,9 @@ main (int argc, char *argv[])
{
fprintf (stderr,
"Invoke with list of filenames to extract keywords form!\n");
+#ifdef MINGW
+ ShutdownWinEnv();
+#endif
return -1;
}
@@ -601,5 +614,9 @@ main (int argc, char *argv[])
free (print);
EXTRACTOR_removeAll (extractors);
+#ifdef MINGW
+ ShutdownWinEnv();
+#endif
+
return 0;
}
diff --git a/src/main/extractor.c b/src/main/extractor.c
@@ -185,7 +185,7 @@ void __attribute__ ((constructor)) le_ltdl_init(void) {
int err;
setlocale(LC_ALL, "");
- bindtextdomain(PACKAGE, LOCALEDIR);
+ BINDTEXTDOMAIN(PACKAGE, LOCALEDIR);
err = lt_dlinit ();
if (err > 0)
{
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
@@ -65,7 +65,7 @@ if HAVE_VORBISFILE
libextractor_ogg_la_SOURCES = \
oggextractor.c
libextractor_ogg_la_LDFLAGS = \
- -lvorbisfile $(PLUGINFLAGS)
+ -lvorbisfile -lvorbis $(PLUGINFLAGS)
endif
noinst_LTLIBRARIES = \