Portability fixes.
authorPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 29 Dec 2002 13:05:16 +0000 (13:05 +0000)
committerPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 29 Dec 2002 13:05:16 +0000 (13:05 +0000)
configure.in
gedcom-config.in
intl/config.charset
t/src/Makefile.am

index 5d077544fea54e211f41326d0eb77de12e39c0d2..072dd8967f4467a8ddd30ed9577d077fd9c49c2f 100644 (file)
@@ -98,6 +98,18 @@ point to an existing installation of that library (see README)
   ])
 fi
 
+if test "${with_libiconv_prefix+set}" = set; then
+  withval="$with_libiconv_prefix"
+  
+    for dir in `echo "$withval" | tr : ' '`; do
+      if test -d $dir/lib; then ICONV_LIBPATH="$ICONV_LIBPATH -L$dir/lib"; fi
+    done
+
+  ICONV_PATH=`echo "$withval" | tr : '/bin:'`
+  ICONV_PATH="$ICONV_PATH/bin"
+fi
+AC_SUBST(ICONV_PATH)
+
 AC_MSG_CHECKING(for location of iconv)
 if test "$am_cv_lib_iconv" = yes; then
   AC_MSG_RESULT(libiconv)
@@ -122,6 +134,11 @@ library (see README).
   ])
 fi
 
+case "$host_os" in
+ darwin*) # Hack to get correct locale_charset() function
+          LDFLAGS="$ICONV_LIBPATH -liconv $LDFLAGS";;
+esac
+
 AC_OUTPUT(GNUmakefile
           Makefile
          gedcom-config
index 501d6310621a7266646cef7a09609889233e3745..5a90b948555cb9c847ced46b613c21b1d25efc99 100644 (file)
@@ -7,9 +7,9 @@ exec_prefix=@exec_prefix@
 exec_prefix_set=no
 version=@VERSION@
 
-gedcom_libs="-L@libdir@ -lgedcom -lutf8tools"
+gedcom_libs="-L@libdir@ @LDFLAGS@ -lgedcom -lutf8tools @LIBICONV@"
 gedcom_cflags="-I@includedir@"
-gedcom_gom_libs="-L@libdir@ -lgedcom_gom -lgedcom -lutf8tools"
+gedcom_gom_libs="-L@libdir@ @LDFLAGS@ -lgedcom_gom -lgedcom -lutf8tools @LIBICONV@"
 gedcom_gom_cflags="-I@includedir@"
 
 usage()
index d6f369558d1d4ff9033e664ef31f242f0d3aee92..308eff802607c45909435234fb9cdf4e27d09f22 100755 (executable)
@@ -235,10 +235,13 @@ case "$os" in
        #echo "sun_eu_greek ?" # what is this?
        echo "UTF-8 UTF-8"
        ;;
-    freebsd*)
+    freebsd* | os2* | darwin*)
        # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
        # localcharset.c falls back to using the full locale name
        # from the environment variables.
+       # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just
+       # reuse FreeBSD's locale data for OS/2.
+       # Likewise for darwin (MacOS X), which is derived from FreeBSD.
        echo "C ASCII"
        echo "US-ASCII ASCII"
        for l in la_LN lt_LN; do
index cb84dedfb43503c1dce1ab8767037bed4579c868..919b18f7d424817a72d63f42bb03ee185a502d8a 100644 (file)
@@ -12,33 +12,33 @@ noinst_HEADERS = output.h dump_gom.h portability.h
 
 testgedcom_SOURCES = standalone.c output.c portability.c
 testgedcom_LDFLAGS = -L../../gedcom/.libs -L../../utf8/.libs
-testgedcom_LDADD  = -lgedcom -lutf8tools
+testgedcom_LDADD  = -lgedcom -lutf8tools $(LIBICONV)
 
 pathtest_SOURCES = pathtest.c
 pathtest_LDFLAGS = -L../../gedcom/.libs -L../../utf8/.libs
-pathtest_LDADD = -lgedcom -lutf8tools
+pathtest_LDADD = -lgedcom -lutf8tools $(LIBICONV)
 
 gomtest_SOURCES = gomtest.c output.c dump_gom.c portability.c
 gomtest_LDFLAGS = -L../../gedcom/.libs -L../../gom/.libs -L../../utf8/.libs
-gomtest_LDADD = -lgedcom_gom -lgedcom -lutf8tools
+gomtest_LDADD = -lgedcom_gom -lgedcom -lutf8tools $(LIBICONV)
 
 updatetest_SOURCES = update.c output.c portability.c
 updatetest_LDFLAGS = -L../../gedcom/.libs -L../../utf8/.libs
-updatetest_LDADD = -lgedcom -lutf8tools
+updatetest_LDADD = -lgedcom -lutf8tools $(LIBICONV)
 
 updategomtest_SOURCES = update_gom.c output.c dump_gom.c portability.c
 updategomtest_LDFLAGS = -L../../gedcom/.libs -L../../gom/.libs \
                         -L../../utf8/.libs
-updategomtest_LDADD = -lgedcom_gom -lgedcom -lutf8tools
+updategomtest_LDADD = -lgedcom_gom -lgedcom -lutf8tools $(LIBICONV)
 
 writegomtest_SOURCES = gom_write.c output.c portability.c
 writegomtest_LDFLAGS = -L../../gedcom/.libs -L../../gom/.libs \
                        -L../../utf8/.libs
-writegomtest_LDADD = -lgedcom_gom -lgedcom -lutf8tools
+writegomtest_LDADD = -lgedcom_gom -lgedcom -lutf8tools $(LIBICONV)
 
 testintl_SOURCES = testintl.c output.c
 testintl_LDFLAGS = -L../../gedcom/.libs -L../../utf8/.libs
-testintl_LDADD = -lgedcom -lutf8tools @INTLLIBS@
+testintl_LDADD = -lgedcom -lutf8tools @INTLLIBS@ $(LIBICONV)
 
 TEST_SCRIPT=test_script test_gom test_update test_intl test_updategom test_writegom test_prologue.sh test_bulk.sh