UPD: libmime 64-bit.

This commit is contained in:
cobines 2009-08-03 12:06:12 +00:00
commit f226d2437a
16 changed files with 37 additions and 12 deletions

View file

@ -2,13 +2,28 @@
CPPFLAGS = -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include # -g3
all: libmime
ifndef CPU_TARGET
CPU_TARGET=i386
endif
ifeq ($(CPU_TARGET),x86_64)
CPPFLAGS += -m64
else
ifeq ($(CPU_TARGET),i386)
CPPFLAGS += -m32
else
$(error Invalid target CPU)
endif
endif
all: clean libmime
clean:
rm -f *.o *.a *.so.*
libmime: mime-action.o mime-cache.o mime-type.o mime-util.o
$(AR) rc libmime.a *.o
cp libmime.a ../../$(CPU_TARGET)
# shared library:
# $(CC) -shared -Wl,-soname,libmime.so.1 -o libmime.so.1.0.1 libmime.a
# ln -s libmime.so.1 libmime.so

BIN
libraries/x86_64/libmime.a Normal file

Binary file not shown.

6
src/doublecmd-fpc.cfg Normal file
View file

@ -0,0 +1,6 @@
#IFDEF CPU64
-Fl../libraries/x86_64
#ELSE
-Fl../libraries/i386
#ENDIF

View file

@ -579,7 +579,6 @@
</Target>
<SearchPaths>
<IncludeFiles Value="$(LazarusDir)\ide\;$(ProjOutDir)\"/>
<Libraries Value="$(ProjPath)\..\libraries\"/>
<OtherUnitFiles Value="$(ProjPath)\platform\;$(ProjPath)\platform\$(SrcOS)\;..\sdk\;$(ProjPath)\newdesign\;$(ProjPath)\newdesign\fileproperties\;newdesign\columnsview\"/>
<UnitOutputDirectory Value="..\units\$(TargetCPU)-$(TargetOS)-$(LCLWidgetType)"/>
<SrcPath Value="$(LazarusDir)\lcl\;$(LazarusDir)\lcl\interfaces\$(LCLWidgetType)\;$(fpcsrcdir)\packages\fcl-base\src\"/>
@ -608,6 +607,10 @@
</Debugging>
</Linking>
<Other>
<ConfigFile>
<CustomConfigFile Value="True"/>
<ConfigFilePath Value="doublecmd-fpc.cfg"/>
</ConfigFile>
<CompilerPath Value="$(CompPath)"/>
<ExecuteBefore>
<Command Value="_getsvnrev.cmd $(LazarusDir)"/>

View file

@ -6,9 +6,7 @@ interface
uses
Classes,
glib2, libc;
{$linklib libmime.a}
glib2;
type
PDesktopFileEntry = ^TDesktopFileEntry;
@ -43,13 +41,16 @@ type
Hidden: gboolean;
end;
procedure mime_type_init; cdecl; external 'libmime';
procedure mime_type_finalize; cdecl; external 'libmime';
function mime_type_get_by_filename(filename: PChar; stat: Pointer) : PChar; cdecl; external 'libmime';
function mime_type_get_actions(mimeType: PChar): PPChar; cdecl; external 'libmime';
function mime_type_locate_desktop_file(DirectoryToCheck: PChar; DesktopFileId: PChar): PChar; cdecl; external 'libmime';
function mime_get_desktop_entry(DesktopFileName: PChar): TCDesktopFileEntry; cdecl; external 'libmime';
function translate_app_exec_to_command_line(const app: PCDesktopFileEntry; file_list: PGList): PChar; cdecl; external 'libmime';
const
libmime = 'libmime';
procedure mime_type_init; cdecl; external libmime;
procedure mime_type_finalize; cdecl; external libmime;
function mime_type_get_by_filename(filename: PChar; stat: Pointer) : PChar; cdecl; external libmime;
function mime_type_get_actions(mimeType: PChar): PPChar; cdecl; external libmime;
function mime_type_locate_desktop_file(DirectoryToCheck: PChar; DesktopFileId: PChar): PChar; cdecl; external libmime;
function mime_get_desktop_entry(DesktopFileName: PChar): TCDesktopFileEntry; cdecl; external libmime;
function translate_app_exec_to_command_line(const app: PCDesktopFileEntry; file_list: PGList): PChar; cdecl; external libmime;
function GetDesktopEntries(FileNames: TStringList): TList;
var