Kaydet (Commit) 8d381ae8 authored tarafından Tamas Bunth's avatar Tamas Bunth Kaydeden (comit) Tamás Bunth

Remove dead HSQLDB driver

Change-Id: Id4cfb69079f0150c9cca2626c16df7fab441d916
Reviewed-on: https://gerrit.libreoffice.org/52611Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTamás Bunth <btomi96@gmail.com>
üst 87e7fd16
......@@ -131,7 +131,6 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S
$(call fetch_Optional,GPGMEPP,GPGME_TARBALL) \
$(call fetch_Optional,GRAPHITE,GRAPHITE_TARBALL) \
$(call fetch_Optional,HARFBUZZ,HARFBUZZ_TARBALL) \
$(call fetch_Optional,HSQLDB,HSQLDB_TARBALL) \
$(call fetch_Optional,HUNSPELL,HUNSPELL_TARBALL) \
$(call fetch_Optional,HYPHEN,HYPHEN_TARBALL) \
$(call fetch_Optional,ICU,ICU_TARBALL) \
......
......@@ -604,7 +604,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
dict_ja \
dict_zh \
embobj \
$(if $(ENABLE_JAVA),hsqldb) \
i18nutil \
index_data \
$(if $(and $(ENABLE_GTK3), $(filter LINUX %BSD SOLARIS,$(OS))), libreofficekitgtk) \
......@@ -739,7 +738,6 @@ $(eval $(call gb_Helper_register_jars_for_install,OOO,ooo, \
$(if $(filter-out MACOSX,$(OS)),officebean) \
query \
report \
sdbc_hsqldb \
smoketest \
table \
unoil \
......
......@@ -2856,26 +2856,6 @@ $(call gb_LinkTarget_set_include,$(1),\
)
endef
ifneq ($(SYSTEM_HSQLDB),)
define gb_LinkTarget__use_hsqldb
$(call gb_LinkTarget_add_defs,$(1),\
-DSYSTEM_HSQLDB \
-DHSQLDB_JAR=\""file://$(HSQLDB_JAR)"\" \
)
endef
else # !SYSTEM_HSQLDB
define gb_LinkTarget__use_hsqldb
endef
endif # SYSTEM_HSQLDB
ifneq ($(SYSTEM_OPENLDAP),)
define gb_LinkTarget__use_openldap
......@@ -3632,33 +3612,6 @@ endef
### Jars ############################################################
ifneq ($(SYSTEM_HSQLDB),)
define gb_Jar__use_hsqldb
$(call gb_Jar_use_system_jar,$(1),$(HSQLDB_JAR))
endef
define gb_JunitTest__use_hsqldb
$(call gb_JunitTest_use_system_jar,$(1),$(HSQLDB_JAR))
endef
else # !SYSTEM_HSQLDB
ifeq ($(ENABLE_JAVA),TRUE)
$(eval $(call gb_Helper_register_jars_for_install,OOO,ooo, \
hsqldb \
))
endif
define gb_Jar__use_hsqldb
$(call gb_Jar_use_jar,$(1),hsqldb)
endef
define gb_JunitTest__use_hsqldb
$(call gb_JunitTest_use_jar,$(1),hsqldb)
endef
endif # SYSTEM_HSQLDB
ifeq ($(ENABLE_SCRIPTING_BEANSHELL),TRUE)
ifneq ($(SYSTEM_BSH),)
......
......@@ -45,8 +45,6 @@ gb_Library_FILENAMES := \
$(subst jpipe:libjpipe.dylib,jpipe:libjpipe.jnilib,$(gb_Library_FILENAMES))
gb_Library_FILENAMES := \
$(subst juh:libjuh.dylib,juh:libjuh.jnilib,$(gb_Library_FILENAMES))
gb_Library_FILENAMES := \
$(subst hsqldb:libhsqldb.dylib,hsqldb:libhsqldb.jnilib,$(gb_Library_FILENAMES))
endif
# fixes for all the libraries that are named with too much creativity and do
......
......@@ -254,8 +254,6 @@ export HAVE_POSIX_FALLOCATE=@HAVE_POSIX_FALLOCATE@
export HELP_COMMON_ONLY=@HELP_COMMON_ONLY@
export HELP_ONLINE=@HELP_ONLINE@
export HOST_PLATFORM=@host@
export HSQLDB_JAR=@HSQLDB_JAR@
export HSQLDB_USE_JDBC_4_1=@HSQLDB_USE_JDBC_4_1@
export HUNSPELL_CFLAGS=$(gb_SPACE)@HUNSPELL_CFLAGS@
export HUNSPELL_LIBS=$(gb_SPACE)@HUNSPELL_LIBS@
export HYPHEN_LIB=$(gb_SPACE)@HYPHEN_LIB@
......@@ -528,7 +526,6 @@ export SYSTEM_GLM=@SYSTEM_GLM@
export SYSTEM_GPGMEPP=@SYSTEM_GPGMEPP@
export SYSTEM_GRAPHITE=@SYSTEM_GRAPHITE@
export SYSTEM_HARFBUZZ=@SYSTEM_HARFBUZZ@
export SYSTEM_HSQLDB=@SYSTEM_HSQLDB@
export SYSTEM_HUNSPELL=@SYSTEM_HUNSPELL@
export SYSTEM_HYPH=@SYSTEM_HYPH@
export SYSTEM_ICU=@SYSTEM_ICU@
......
......@@ -1739,15 +1739,6 @@ AC_ARG_WITH(system-libtommath,
[Use libtommath already on system]),,
[with_system_libtommath="$with_system_libs"])
AC_ARG_WITH(system-hsqldb,
AS_HELP_STRING([--with-system-hsqldb],
[Use hsqldb already on system.]))
AC_ARG_WITH(hsqldb-jar,
AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
[Specify path to jarfile manually.]),
HSQLDB_JAR=$withval)
libo_FUZZ_ARG_ENABLE(scripting-beanshell,
AS_HELP_STRING([--disable-scripting-beanshell],
[Disable support for scripts in BeanShell.]),
......@@ -8427,75 +8418,6 @@ int main(int argc, char **argv) {
fi
AC_SUBST(SYSTEM_MYSQL_CONNECTOR_CPP)
dnl ===================================================================
dnl Check for system hsqldb
dnl ===================================================================
if test "$with_java" != "no"; then
HSQLDB_USE_JDBC_4_1=
AC_MSG_CHECKING([which hsqldb to use])
if test "$with_system_hsqldb" = "yes"; then
AC_MSG_RESULT([external])
SYSTEM_HSQLDB=TRUE
if test -z $HSQLDB_JAR; then
HSQLDB_JAR=/usr/share/java/hsqldb.jar
fi
if ! test -f $HSQLDB_JAR; then
AC_MSG_ERROR(hsqldb.jar not found.)
fi
AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
export HSQLDB_JAR
if $PERL -e \
'use Archive::Zip;
my $file = "$ENV{'HSQLDB_JAR'}";
my $zip = Archive::Zip->new( $file );
my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
if ( $mf =~ m/Specification-Version: 1.8.*/ )
{
push @l, split(/\n/, $mf);
foreach my $line (@l)
{
if ($line =~ m/Specification-Version:/)
{
($t, $version) = split (/:/,$line);
$version =~ s/^\s//;
($a, $b, $c, $d) = split (/\./,$version);
if ($c == "0" && $d > "8")
{
exit 0;
}
else
{
exit 1;
}
}
}
}
else
{
exit 1;
}'; then
AC_MSG_RESULT([yes])
else
AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
fi
else
AC_MSG_RESULT([internal])
SYSTEM_HSQLDB=
BUILD_TYPE="$BUILD_TYPE HSQLDB"
AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
if expr "$javanumver" '>=' 000100060000 > /dev/null; then
AC_MSG_RESULT([yes])
HSQLDB_USE_JDBC_4_1=TRUE
else
AC_MSG_RESULT([no])
fi
fi
AC_SUBST(SYSTEM_HSQLDB)
AC_SUBST(HSQLDB_JAR)
AC_SUBST([HSQLDB_USE_JDBC_4_1])
fi
dnl ===================================================================
dnl Check for PostgreSQL stuff
dnl ===================================================================
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_Configuration_Configuration,driver_hsqldb))
$(eval $(call gb_Configuration_add_spool_modules,driver_hsqldb,connectivity/registry/hsqldb,\
org/openoffice/Office/DataAccess/Drivers-hsqldb.xcu \
))
$(eval $(call gb_Configuration_add_localized_datas,driver_hsqldb,connectivity/registry/hsqldb,\
org/openoffice/Office/DataAccess/Drivers.xcu \
))
# vim: set noet sw=4 ts=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_Jar_Jar,sdbc_hsqldb))
$(eval $(call gb_Jar_use_externals,sdbc_hsqldb,\
hsqldb \
))
$(eval $(call gb_Jar_add_manifest_classpath,sdbc_hsqldb,\
$(if $(filter MACOSX,$(OS)),../../Frameworks/,..) \
))
$(eval $(call gb_Jar_set_packageroot,sdbc_hsqldb,com))
$(eval $(call gb_Jar_add_packagedir,sdbc_hsqldb,org))
$(eval $(call gb_Jar_add_sourcefiles,sdbc_hsqldb,\
connectivity/org/hsqldb/lib/FileSystemRuntimeException \
connectivity/com/sun/star/sdbcx/comp/hsqldb/NativeInputStreamHelper \
connectivity/com/sun/star/sdbcx/comp/hsqldb/NativeLibraries \
connectivity/com/sun/star/sdbcx/comp/hsqldb/NativeOutputStreamHelper \
connectivity/com/sun/star/sdbcx/comp/hsqldb/NativeStorageAccess \
connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageAccess \
connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageFileAccess \
connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageNativeInputStream \
connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageNativeOutputStream \
))
# vim: set noet sw=4 ts=4:
......@@ -22,10 +22,6 @@ $(eval $(call gb_JunitTest_use_jars,connectivity_complex,\
unoil \
))
$(eval $(call gb_JunitTest_use_externals,connectivity_complex,\
hsqldb \
))
$(eval $(call gb_JunitTest_add_classes,connectivity_complex,\
org.openoffice.test.UnoApiTest \
))
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_Library_Library,hsqldb))
$(eval $(call gb_Library_set_include,hsqldb,\
-I$(SRCDIR)/connectivity/inc \
-I$(SRCDIR)/connectivity/source/inc \
$$(INCLUDE) \
))
$(eval $(call gb_Library_use_externals,hsqldb,\
boost_headers \
hsqldb \
))
$(eval $(call gb_Library_use_sdk_api,hsqldb))
$(eval $(call gb_Library_use_libraries,hsqldb,\
comphelper \
cppu \
cppuhelper \
dbtools \
jvmfwk \
sal \
salhelper \
tl \
utl \
i18nlangtag \
))
$(eval $(call gb_Library_set_componentfile,hsqldb,connectivity/source/drivers/hsqldb/hsqldb))
$(eval $(call gb_Library_add_exception_objects,hsqldb,\
connectivity/source/drivers/hsqldb/HCatalog \
connectivity/source/drivers/hsqldb/HColumns \
connectivity/source/drivers/hsqldb/HConnection \
connectivity/source/drivers/hsqldb/HDriver \
connectivity/source/drivers/hsqldb/HStorageAccess \
connectivity/source/drivers/hsqldb/HStorageMap \
connectivity/source/drivers/hsqldb/HTable \
connectivity/source/drivers/hsqldb/HTables \
connectivity/source/drivers/hsqldb/HTerminateListener \
connectivity/source/drivers/hsqldb/HTools \
connectivity/source/drivers/hsqldb/HUser \
connectivity/source/drivers/hsqldb/HUsers \
connectivity/source/drivers/hsqldb/HView \
connectivity/source/drivers/hsqldb/HViews \
connectivity/source/drivers/hsqldb/Hservices \
connectivity/source/drivers/hsqldb/StorageFileAccess \
connectivity/source/drivers/hsqldb/StorageNativeInputStream \
connectivity/source/drivers/hsqldb/StorageNativeOutputStream \
connectivity/source/drivers/hsqldb/accesslog \
))
# vim: set noet sw=4 ts=4:
......@@ -40,10 +40,7 @@ $(eval $(call gb_Module_add_l10n_targets,connectivity,\
ifneq ($(ENABLE_JAVA),)
$(eval $(call gb_Module_add_targets,connectivity,\
Configuration_hsqldb \
Configuration_jdbc \
Jar_sdbc_hsqldb \
Library_hsqldb \
Library_jdbc \
))
endif
......
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package com.sun.star.sdbcx.comp.hsqldb;
public class NativeInputStreamHelper extends java.io.InputStream{
private final String key;
private final String file;
private final StorageNativeInputStream in;
/** Creates a new instance of NativeInputStreamHelper */
public NativeInputStreamHelper(String key,String _file) {
file = _file;
this.key = key;
in = new StorageNativeInputStream(key,file);
}
@Override
public int read() throws java.io.IOException {
return in.read(key,file);
}
@Override
public int read(byte[] b, int off, int len) throws java.io.IOException {
return in.read(key,file,b,off,len);
}
@Override
public void close() throws java.io.IOException {
in.close(key,file);
}
@Override
public long skip(long n) throws java.io.IOException {
return in.skip(key,file,n);
}
@Override
public int available() throws java.io.IOException {
return in.available(key,file);
}
@Override
public int read(byte[] b) throws java.io.IOException {
return in.read(key,file,b);
}
}
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package com.sun.star.sdbcx.comp.hsqldb;
import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
final class NativeLibraries {
public static void load() {
if (System.getProperty( "os.name" ).startsWith("Windows")) {
loadLibrary("msvcr71");
loadLibrary("sal3");
loadLibrary("dbtoolsmi");
}
loadLibrary("hsqldb");
}
private static void loadLibrary(String libname) {
// At least on Mac OS X Tiger, System.loadLibrary("hsqldb2") does not
// find the hsqldb2 library one directory above sdbc_hsqldb.jar, even
// though ".." is on the jar's Class-Path; however, the alternative
// code (needing Java 1.5, which is given for Mac OS X Tiger) works
// there:
try {
System.loadLibrary(libname);
} catch (UnsatisfiedLinkError e) {
ClassLoader cl = NativeLibraries.class.getClassLoader();
if (cl instanceof URLClassLoader) {
String sysname = System.mapLibraryName(libname);
// At least Oracle's 1.7.0_51 now maps to .dylib rather than
// .jnilib:
if (System.getProperty("os.name").startsWith("Mac")
&& sysname.endsWith(".dylib"))
{
sysname
= sysname.substring(
0, sysname.length() - "dylib".length())
+ "jnilib";
}
URL url = ((URLClassLoader) cl).findResource(sysname);
if (url != null) {
try {
System.load(new File(url.toURI()).getAbsolutePath());
} catch (Throwable t) {
throw new UnsatisfiedLinkError(
e.toString()+ " - " + t.toString());
}
}
}
}
}
private NativeLibraries() {}
}
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package com.sun.star.sdbcx.comp.hsqldb;
public class NativeOutputStreamHelper extends java.io.OutputStream{
private final String key;
private final String file;
private final StorageNativeOutputStream out;
/** Creates a new instance of NativeOutputStreamHelper */
public NativeOutputStreamHelper(String key,String _file) {
file = _file;
this.key = key;
out = new StorageNativeOutputStream(file,key);
}
@Override
public void write(byte[] b, int off, int len) throws java.io.IOException{
out.write(key,file,b, off, len);
}
@Override
public void write(byte[] b) throws java.io.IOException{
out.write(key,file,b);
}
@Override
public void close() throws java.io.IOException{
out.close(key,file);
}
@Override
public void write(int b) throws java.io.IOException{
out.write(key,file,b);
}
@Override
public void flush() throws java.io.IOException{
out.flush(key,file);
}
public void sync() throws java.io.IOException{
out.sync(key,file);
}
}
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package com.sun.star.sdbcx.comp.hsqldb;
public class NativeStorageAccess {
static { NativeLibraries.load(); }
public static final int READ = 1;
private static final int SEEKABLE = 2;
private static final int SEEKABLEREAD = 3;
public static final int WRITE = 4;
private static final int READWRITE = 7;
public static final int TRUNCATE = 8;
/** Creates a new instance of StorageAccess */
public NativeStorageAccess(String name,String _mode,Object key) throws java.io.IOException{
try {
int mode = NativeStorageAccess.SEEKABLEREAD;
if ( _mode.equals("rw") )
mode = NativeStorageAccess.READWRITE | NativeStorageAccess.SEEKABLE;
openStream(name, (String)key, mode);
} catch(Exception ex1){
java.io.IOException ex2 = new java.io.IOException();
ex2.initCause(ex1);
throw ex2;
}
}
private native void openStream(String name,String key, int mode);
public native void close(String name,String key) throws java.io.IOException;
public native long getFilePointer(String name,String key) throws java.io.IOException;
public native long length(String name,String key) throws java.io.IOException;
public native int read(String name,String key) throws java.io.IOException;
public native int read(String name,String key,byte[] b, int off, int len) throws java.io.IOException;
public native void seek(String name,String key,long position) throws java.io.IOException;
public native void write(String name,String key,byte[] b, int offset, int length) throws java.io.IOException;
}
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package com.sun.star.sdbcx.comp.hsqldb;
@SuppressWarnings("ucd")
public class StorageAccess implements org.hsqldb.lib.Storage {
String key;
String name;
boolean readonly;
NativeStorageAccess access;
/** Creates a new instance of StorageAccess */
public StorageAccess(String name,Boolean readonly,Object key) throws java.io.IOException{
this.key = (String)key;
this.name = name;
this.readonly = readonly.booleanValue();
try {
access = new NativeStorageAccess(name,
this.readonly ? "r" : "rw"
,key);
} catch(Exception ex1){
java.io.IOException ex2 = new java.io.IOException();
ex2.initCause(ex1);
throw ex2;
}
}
public void close() throws java.io.IOException{
access.close(name,key);
}
public long getFilePointer() throws java.io.IOException{
return access.getFilePointer(name,key);
}
public long length() throws java.io.IOException{
return access.length(name,key);
}
public int read() throws java.io.IOException{
return access.read(name,key);
}
public void read(byte[] b, int off, int len) throws java.io.IOException{
access.read(name,key,b,off,len);
}
// based on the same code that reads an int from the .data file in HSQLDB
public int readInt() throws java.io.IOException{
byte [] tmp = new byte [4];
int count = access.read(name,key,tmp,0, 4);
if (count != 4){
throw new java.io.IOException();
}
count = 0;
int ch0 = tmp[count++] & 0xff;
int ch1 = tmp[count++] & 0xff;
int ch2 = tmp[count++] & 0xff;
int ch3 = tmp[count] & 0xff;
return ((ch0 << 24) + (ch1 << 16) + (ch2 << 8) + (ch3));
}
</