summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgregory guy <gregory-tde@laposte.net>2020-01-20 22:05:37 +0100
committergregory guy <gregory-tde@laposte.net>2020-01-25 13:34:33 +0100
commitdf80d18956a2b83903618eed2e0df89f63b06273 (patch)
treebbfe53e6394e05fe13de095e2a7cd87815936c23
parentecd1e4bd401a00be11f4d8bbaff01718f29f9118 (diff)
downloadtdelibs-feat/shared_libisofs.tar.gz
tdelibs-feat/shared_libisofs.zip
Build libisofs as a shared library.feat/shared_libisofs
Signed-off-by: gregory guy <gregory-tde@laposte.net>
-rw-r--r--tdeioslave/iso/CMakeLists.txt79
-rw-r--r--tdeioslave/iso/iso.cpp2
-rw-r--r--tdeioslave/iso/kiso.cpp2
-rw-r--r--tdeioslave/iso/libisofs/CMakeLists.txt62
-rw-r--r--tdeioslave/iso/libisofs/bswap_tde.h (renamed from tdeioslave/iso/libisofs/bswap.h)6
-rw-r--r--tdeioslave/iso/libisofs/el_torito_tde.h (renamed from tdeioslave/iso/libisofs/el_torito.h)8
-rw-r--r--tdeioslave/iso/libisofs/iso_fs_tde.h (renamed from tdeioslave/iso/libisofs/iso_fs.h)8
-rw-r--r--tdeioslave/iso/libisofs/isofs-tde.pc.cmake12
-rw-r--r--tdeioslave/iso/libisofs/isofs_tde.c (renamed from tdeioslave/iso/libisofs/isofs.c)5
-rw-r--r--tdeioslave/iso/libisofs/isofs_tde.h (renamed from tdeioslave/iso/libisofs/isofs.h)23
-rw-r--r--tdeioslave/iso/libisofs/isofs_tde_export.h.cmake37
-rw-r--r--tdeioslave/iso/libisofs/rock_tde.h (renamed from tdeioslave/iso/libisofs/rock.h)6
-rw-r--r--tdeioslave/iso/tdeiso_info.cpp2
13 files changed, 176 insertions, 76 deletions
diff --git a/tdeioslave/iso/CMakeLists.txt b/tdeioslave/iso/CMakeLists.txt
index 79c795ce..36153904 100644
--- a/tdeioslave/iso/CMakeLists.txt
+++ b/tdeioslave/iso/CMakeLists.txt
@@ -1,17 +1,16 @@
-#################################################
-#
-# (C) 2010 Serghei Amelian
-# serghei (DOT) amelian (AT) gmail.com
-#
-# Improvements and feedback are welcome
-#
-# This file is released under GPL >= 2
-#
-#################################################
+###########################################
+# #
+# (C) 2010 Serghei Amelian #
+# serghei (DOT) amelian (AT) gmail.com #
+# #
+# Improvements and feedback are welcome #
+# #
+# This file is released under GPL >= 2 #
+# #
+###########################################
add_subdirectory( libisofs )
-
include_directories(
${TQT_INCLUDE_DIRS}
${CMAKE_BINARY_DIR}
@@ -21,47 +20,53 @@ include_directories(
${CMAKE_SOURCE_DIR}/tdecore
${CMAKE_SOURCE_DIR}/tdeio
${CMAKE_SOURCE_DIR}/tdeio/tdeio
+ ${CMAKE_BINARY_DIR}/tdeioslave/iso/libisofs
)
link_directories(
${TQT_LIBRARY_DIRS}
)
-
-##### other data ################################
-
-install( FILES iso.protocol DESTINATION ${SERVICES_INSTALL_DIR} )
-install( FILES isoservice.desktop DESTINATION ${DATA_INSTALL_DIR}/konqueror/servicemenus )
-install( FILES tdeio_isorc DESTINATION ${CONFIG_INSTALL_DIR} )
-install( FILES tdeio_iso.desktop DESTINATION ${APPS_INSTALL_DIR} )
+set( SRCS kisodirectory.cpp
+ kisofile.cpp
+ qfilehack.cpp
+ kiso.cpp
+)
-##### tdeio_iso ###################################
+##### tdeio_iso (plugin)
-set( target tdeio_iso )
+tde_add_kpart( tdeio_iso AUTOMOC
-set( ${target}_SRCS
- kisodirectory.cpp kisofile.cpp qfilehack.cpp
- kiso.cpp iso.cpp
-)
+ SOURCES
+ ${SRCS}
+ iso.cpp
+ LINK
+ isofs-tde-shared
+ tdeio-shared
-tde_add_kpart( ${target} AUTOMOC
- SOURCES ${${target}_SRCS}
- LINK isofs-static tdeio-shared
DESTINATION ${PLUGIN_INSTALL_DIR}
)
-##### tdeiso_info #################################
-set( target tdeiso_info )
+##### tdeiso_info (executable)
-set( ${target}_SRCS
- kisodirectory.cpp kisofile.cpp qfilehack.cpp
- kiso.cpp tdeiso_info.cpp
-)
+tde_add_executable( tdeiso_info AUTOMOC
+
+ SOURCES
+ ${SRCS}
+ tdeiso_info.cpp
+ LINK
+ isofs-tde-shared
+ tdeio-shared
-tde_add_executable( ${target} AUTOMOC
- SOURCES ${${target}_SRCS}
- LINK isofs-static tdeio-shared
DESTINATION ${BIN_INSTALL_DIR}
-) \ No newline at end of file
+)
+
+
+##### other data
+
+install( FILES iso.protocol DESTINATION ${SERVICES_INSTALL_DIR} )
+install( FILES isoservice.desktop DESTINATION ${DATA_INSTALL_DIR}/konqueror/servicemenus )
+install( FILES tdeio_isorc DESTINATION ${CONFIG_INSTALL_DIR} )
+install( FILES tdeio_iso.desktop DESTINATION ${APPS_INSTALL_DIR} )
diff --git a/tdeioslave/iso/iso.cpp b/tdeioslave/iso/iso.cpp
index 8696b0c6..0daa26fd 100644
--- a/tdeioslave/iso/iso.cpp
+++ b/tdeioslave/iso/iso.cpp
@@ -36,7 +36,7 @@
#include <errno.h> // to be removed
-#include "libisofs/iso_fs.h"
+#include "libisofs/iso_fs_tde.h"
#include "kisofile.h"
#include "kisodirectory.h"
diff --git a/tdeioslave/iso/kiso.cpp b/tdeioslave/iso/kiso.cpp
index 513bd7c0..9529b810 100644
--- a/tdeioslave/iso/kiso.cpp
+++ b/tdeioslave/iso/kiso.cpp
@@ -38,7 +38,7 @@
#include <kfilterbase.h>
#include "kiso.h"
-#include "libisofs/isofs.h"
+#include "libisofs/isofs_tde.h"
#include "qfilehack.h"
diff --git a/tdeioslave/iso/libisofs/CMakeLists.txt b/tdeioslave/iso/libisofs/CMakeLists.txt
index a9ef936a..0daf99b2 100644
--- a/tdeioslave/iso/libisofs/CMakeLists.txt
+++ b/tdeioslave/iso/libisofs/CMakeLists.txt
@@ -1,23 +1,57 @@
-#################################################
-#
-# (C) 2010 Serghei Amelian
-# serghei (DOT) amelian (AT) gmail.com
-#
-# Improvements and feedback are welcome
-#
-# This file is released under GPL >= 2
-#
-#################################################
+###########################################
+# #
+# (C) 2010 Serghei Amelian #
+# serghei (DOT) amelian (AT) gmail.com #
+# #
+# Improvements and feedback are welcome #
+# #
+# This file is released under GPL >= 2 #
+# #
+###########################################
+
+set( LIB_NAME isofs-tde )
+configure_file( isofs_tde_export.h.cmake isofs_tde_export.h @ONLY )
include_directories(
${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+
+##### isofs-tde (shared)
+
+tde_add_library( ${LIB_NAME} SHARED
+
+ SOURCES
+ isofs_tde.c
+
+ DESTINATION ${LIB_INSTALL_DIR}
+)
+
+
+##### pkg-config
+
+string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_EXEC_PREFIX ${EXEC_INSTALL_PREFIX} )
+string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_INCLUDE_DIR ${INCLUDE_INSTALL_DIR} )
+string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_LIB_DIR ${LIB_INSTALL_DIR} )
+
+configure_file( ${LIB_NAME}.pc.cmake ${LIB_NAME}.pc @ONLY )
+
+install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}.pc
+ DESTINATION ${PKGCONFIG_INSTALL_DIR}
)
-##### isofs-static ##############################
+##### headers
-set( target isofs )
+install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/isofs_tde_export.h
+ el_torito_tde.h
+ isofs_tde.h
+ rock_tde.h
+ iso_fs_tde.h
+ bswap_tde.h
-tde_add_library( ${target} STATIC_PIC
- SOURCES isofs.c
+ DESTINATION ${INCLUDE_INSTALL_DIR}
)
diff --git a/tdeioslave/iso/libisofs/bswap.h b/tdeioslave/iso/libisofs/bswap_tde.h
index 95520c6e..e878a0a9 100644
--- a/tdeioslave/iso/libisofs/bswap.h
+++ b/tdeioslave/iso/libisofs/bswap_tde.h
@@ -1,7 +1,7 @@
/* From the mplayer project (www.mplayerhq.hu) */
-#ifndef __BSWAP_H__
-#define __BSWAP_H__
+#ifndef BSWAP_TDE
+#define BSWAP_TDE
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -91,4 +91,4 @@ inline static unsigned long long int ByteSwap64(unsigned long long int x)
#define le2me_64(x) (x)
#endif
-#endif
+#endif /* BSWAP_TDE */
diff --git a/tdeioslave/iso/libisofs/el_torito.h b/tdeioslave/iso/libisofs/el_torito_tde.h
index cba83f78..a5937fe1 100644
--- a/tdeioslave/iso/libisofs/el_torito.h
+++ b/tdeioslave/iso/libisofs/el_torito_tde.h
@@ -1,7 +1,7 @@
-#ifndef ELTORITO_H
-#define ELTORITO_H 1
+#ifndef EL_TORITO_TDE
+#define EL_TORITO_TDE
-#include "iso_fs.h"
+#include "iso_fs_tde.h"
#define EL_TORITO_ID "EL TORITO SPECIFICATION\0\0\0\0\0\0\0\0\0"
@@ -60,4 +60,4 @@ struct section_entry_ext {
char vendor_selcrit [ISODCL ( 3, 32)];
};
-#endif
+#endif /* EL_TORITO_TDE */
diff --git a/tdeioslave/iso/libisofs/iso_fs.h b/tdeioslave/iso/libisofs/iso_fs_tde.h
index 43353b0d..2f04a0b9 100644
--- a/tdeioslave/iso/libisofs/iso_fs.h
+++ b/tdeioslave/iso/libisofs/iso_fs_tde.h
@@ -1,9 +1,9 @@
/* From the linux kernel */
-#ifndef _ISO_FS_H
-#define _ISO_FS_H 1
+#ifndef ISO_FS_TDE
+#define ISO_FS_TDE
-#include "bswap.h"
+#include "bswap_tde.h"
/*
* The isofs filesystem constants/structures
@@ -215,5 +215,5 @@ __inline unsigned int isonum_733(char *p)
return le2me_32(*(unsigned int *)p);
}
-#endif /*_ISOFS_H*/
+#endif /* ISO_FS_TDE */
diff --git a/tdeioslave/iso/libisofs/isofs-tde.pc.cmake b/tdeioslave/iso/libisofs/isofs-tde.pc.cmake
new file mode 100644
index 00000000..36b904cc
--- /dev/null
+++ b/tdeioslave/iso/libisofs/isofs-tde.pc.cmake
@@ -0,0 +1,12 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@PC_EXEC_PREFIX@
+libdir=@PC_LIB_DIR@
+includedir=@PC_INCLUDE_DIR@
+
+Name: @LIB_NAME@
+Description: @LIB_NAME@ implements the ISO-9660 file system found on CD-ROM media.
+URL: https://mirror.git.trinitydesktop.org/gitea/TDE/tdelibs.git
+Requires:
+Version:
+Libs: -L${libdir} -l@LIB_NAME@
+Cflags: -I${includedir}
diff --git a/tdeioslave/iso/libisofs/isofs.c b/tdeioslave/iso/libisofs/isofs_tde.c
index f1db4427..90a5a9fd 100644
--- a/tdeioslave/iso/libisofs/isofs.c
+++ b/tdeioslave/iso/libisofs/isofs_tde.c
@@ -20,10 +20,13 @@
#include <stdlib.h>
#include <string.h>
-#include "isofs.h"
+#include "isofs_tde.h"
/**************************************************************/
+extern __inline unsigned char isonum_711(char *);
+extern __inline unsigned short isonum_721(char *);
+extern __inline unsigned int isonum_733(char *);
/* internal function from the linux kernel (isofs fs) */
static time_t getisotime(int year,int month,int day,int hour,
diff --git a/tdeioslave/iso/libisofs/isofs.h b/tdeioslave/iso/libisofs/isofs_tde.h
index 1d17de4b..8d553290 100644
--- a/tdeioslave/iso/libisofs/isofs.h
+++ b/tdeioslave/iso/libisofs/isofs_tde.h
@@ -15,17 +15,18 @@
* *
***************************************************************************/
-#ifndef ISOFS_H
-#define ISOFS_H
+#ifndef ISOFS_TDE
+#define ISOFS_TDE
#include <sys/time.h>
#ifdef __cplusplus
extern "C" {
#endif
-#include "iso_fs.h"
-#include "el_torito.h"
-#include "rock.h"
+#include "iso_fs_tde.h"
+#include "el_torito_tde.h"
+#include "rock_tde.h"
+#include "isofs_tde_export.h"
typedef struct _rr_entry {
int len; /* length of structure */
@@ -90,6 +91,7 @@ typedef int dircallback(struct iso_directory_record *,void *);
* This function is from the linux kernel.
* Set 'hs' to non-zero if it's a HighSierra volume
*/
+LIBISOFS_EXPORT
time_t isodate_915(char * p, int hs);
/**
@@ -107,6 +109,7 @@ time_t isodate_84261(char * p, int hs);
* If the function fails, returns NULL
* Don't forget to call FreeISO9660 after using the volume descriptor list!
*/
+LIBISOFS_EXPORT
iso_vol_desc *ReadISO9660(readfunc *read,long long sector,void *udata);
/**
@@ -120,42 +123,48 @@ void FreeISO9660(iso_vol_desc *data);
* the size of the directory is 'size'. 'callback' is called for each
* directory entry with the parameter 'udata'.
*/
+LIBISOFS_EXPORT
int ProcessDir(readfunc *read,int extent,int size,dircallback *callback,void *udata);
/**
* Parses the System Use area and fills rr_entry with values
*/
+LIBISOFS_EXPORT
int ParseRR(struct iso_directory_record *idr, rr_entry *rrentry);
/**
* Frees the strings in 'rrentry'
*/
+LIBISOFS_EXPORT
void FreeRR(rr_entry *rrentry);
/**
* returns the joliet level from the volume descriptor
*/
+LIBISOFS_EXPORT
int JolietLevel(struct iso_volume_descriptor *ivd);
/**
* Returns the size of the boot image (in 512 byte sectors)
*/
+LIBISOFS_EXPORT
int BootImageSize(int media,long long len);
/**
* Frees the boot catalog entries in 'boot'. If you ever called ReadBootTable,
* then don't forget to call FreeBootTable!
*/
+LIBISOFS_EXPORT
void FreeBootTable(boot_head *boot);
/**
* Reads the boot catalog into 'head'. Don't forget to call FreeBootTable!
*/
+LIBISOFS_EXPORT
int ReadBootTable(readfunc *read,long long sector, boot_head *head, void *udata);
#ifdef __cplusplus
} //extern "C"
#endif
-#endif
-
+#endif /* ISOFS_TDE */
diff --git a/tdeioslave/iso/libisofs/isofs_tde_export.h.cmake b/tdeioslave/iso/libisofs/isofs_tde_export.h.cmake
new file mode 100644
index 00000000..ed3a53de
--- /dev/null
+++ b/tdeioslave/iso/libisofs/isofs_tde_export.h.cmake
@@ -0,0 +1,37 @@
+/* This file is part of the TDE libraries
+ Copyright (c) 2020 TDE Team
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef ISOFS_TDE_EXPORT_H
+#define ISOFS_TDE_EXPORT_H
+
+/* Defined if you have fvisibility and fvisibility-inlines-hidden support. */
+#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1
+
+#if defined(__KDE_HAVE_GCC_VISIBILITY)
+#define LIBISOFS_NO_EXPORT __attribute__ ((visibility("hidden")))
+#define LIBISOFS_EXPORT __attribute__ ((visibility("default")))
+#elif defined(_WIN32)
+#define LIBISOFS_NO_EXPORT
+#define LIBISOFS_EXPORT __declspec(dllexport)
+#else
+#define LIBISOFS_NO_EXPORT
+#define LIBISOFS_EXPORT
+#endif
+
+#endif /* ISOFS_TDE_EXPORT_H */
diff --git a/tdeioslave/iso/libisofs/rock.h b/tdeioslave/iso/libisofs/rock_tde.h
index e8591926..243a1160 100644
--- a/tdeioslave/iso/libisofs/rock.h
+++ b/tdeioslave/iso/libisofs/rock_tde.h
@@ -1,7 +1,7 @@
/* this header is from the linux kernel */
-#ifndef ROCK_H
-#define ROCK_H 1
+#ifndef ROCK_TDE
+#define ROCK_TDE
/* These structs are used by the system-use-sharing protocol, in which the
Rock Ridge extensions are embedded. It is quite possible that other
@@ -124,4 +124,4 @@ struct rock_ridge{
#define RR_RE 64 /* Relocation directory */
#define RR_TF 128 /* Timestamps */
-#endif /* ROCK_H */
+#endif /* ROCK_TDE */
diff --git a/tdeioslave/iso/tdeiso_info.cpp b/tdeioslave/iso/tdeiso_info.cpp
index 4b9bbee6..8b5cdc9b 100644
--- a/tdeioslave/iso/tdeiso_info.cpp
+++ b/tdeioslave/iso/tdeiso_info.cpp
@@ -26,7 +26,7 @@
#include <kuniqueapplication.h>
#include <tdeaboutdata.h>
-#include "libisofs/iso_fs.h"
+#include "libisofs/iso_fs_tde.h"
#include "kiso.h"
#include "kisofile.h"