Make libidn default when not specifiying a IDN lib.
authorTobias Markmann <tm@ayena.de>
Tue, 14 Dec 2010 17:54:55 +0000 (18:54 +0100)
committerTobias Markmann <tm@ayena.de>
Tue, 14 Dec 2010 17:54:55 +0000 (18:54 +0100)
configure
util-src/encodings.cpp

index 6a1d656eccd8ab6823054c0ee606c151dbd67294..50591f29170fe863cb2012a86bde35703acbd9ef 100755 (executable)
--- a/configure
+++ b/configure
@@ -20,6 +20,7 @@ LD=gcc
 CFLAGS="-fPIC -Wall"
 LDFLAGS="-shared"
 
+IDN_LIBRARY=idn
 # Help
 
 show_help() {
@@ -272,15 +273,12 @@ if [ "$IDN_LIBRARY" = "icu" ]
 then
        IDNA_LIBS="$ICU_FLAGS"
        CFLAGS="$CFLAGS -DUSE_STRINGPREP_ICU"
-else
-       if [ "$IDN_LIBRARY" = "idn" ] 
-       then
-               IDNA_LIBS="-l$IDN_LIB"
-       else
-               echo "Must use idn or icu as argument for --idn-library!"
-               exit 1
-       fi
 fi
+if [ "$IDN_LIBRARY" = "idn" ] 
+then
+       IDNA_LIBS="-l$IDN_LIB"
+fi
+
 LDFLAGS="$LDFLAGS -llua$LUA_SUFFIX"
 
 echo -n "Checking Lua includes... "
index da2d10bb7e3c53e4a6fce56aa92e73ddc88a5a69..81230afee312abfc5dd568ee5424a84c02ec865e 100644 (file)
@@ -122,8 +122,9 @@ static const luaL_Reg Reg_base64[] =
 /***************** STRINGPREP *****************/
 #ifndef USE_STRINGPREP_ICU
 /****************** libidn ********************/
+extern "C" {
 #include <stringprep.h>
-
+}
 static int stringprep_prep(lua_State *L, const Stringprep_profile *profile)
 {
        size_t len;
@@ -140,7 +141,7 @@ static int stringprep_prep(lua_State *L, const Stringprep_profile *profile)
                return 1; // TODO return error message
        }
        strcpy(string, s);
-       ret = stringprep(string, 1024, 0, profile);
+       ret = stringprep(string, 1024, (Stringprep_profile_flags)0, profile);
        if (ret == STRINGPREP_OK) {
                lua_pushstring(L, string);
                return 1;
@@ -169,7 +170,6 @@ static const luaL_Reg Reg_stringprep[] =
 
 #else
 #include <unicode/usprep.h>
-//#include <unicode/stringpiece.h>
 #include <unicode/unistr.h>
 #include <unicode/utrace.h>