From de179243ce59eb62304eafbefc1b8b34253a7f6d Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Thu, 13 Nov 2014 13:05:14 -0800 Subject: [PATCH] basis/extra: cleanup uses of add-library. --- basis/atk/ffi/ffi.factor | 16 ++++++--------- basis/cairo/ffi/ffi.factor | 10 +++++----- basis/compression/snappy/ffi/ffi.factor | 11 +++++++---- basis/compression/zlib/ffi/ffi.factor | 4 ++-- basis/db/postgresql/ffi/ffi.factor | 8 ++++---- basis/db/sqlite/ffi/ffi.factor | 12 ++++++------ basis/gdk/pixbuf/ffi/ffi.factor | 24 ++++++++++------------- basis/gio/ffi/ffi.factor | 16 ++++++--------- basis/glib/ffi/ffi.factor | 12 +++++------- basis/gmodule/ffi/ffi.factor | 16 ++++++--------- basis/gobject/ffi/ffi.factor | 18 +++++++---------- basis/openssl/libcrypto/libcrypto.factor | 16 +++++++-------- basis/openssl/libssl/libssl.factor | 7 ++++--- basis/pango/cairo/ffi/ffi.factor | 16 ++++++--------- basis/pango/ffi/ffi.factor | 18 +++++++---------- basis/tools/disassembler/udis/udis.factor | 20 +++++++++---------- extra/curl/ffi/ffi.factor | 9 ++++++--- extra/fftw/ffi/ffi.factor | 8 ++++++-- extra/llvm/core/core.factor | 13 +++++++++--- extra/llvm/engine/engine.factor | 6 +++--- extra/lua/lua.factor | 11 ++++++----- extra/magic/ffi/ffi.factor | 7 +++++-- extra/pcre/ffi/ffi.factor | 8 ++++++-- extra/readline/ffi/ffi.factor | 17 ++++++++-------- extra/readline/readline.factor | 5 ++--- extra/zeromq/ffi/ffi.factor | 10 +++++----- 26 files changed, 154 insertions(+), 164 deletions(-) diff --git a/basis/atk/ffi/ffi.factor b/basis/atk/ffi/ffi.factor index 3f7ad28b91..abd04381ec 100644 --- a/basis/atk/ffi/ffi.factor +++ b/basis/atk/ffi/ffi.factor @@ -4,18 +4,14 @@ USING: alien alien.libraries alien.syntax combinators gobject-introspection kernel system vocabs ; IN: atk.ffi -<< -"gobject.ffi" require ->> +<< "gobject.ffi" require >> LIBRARY: atk -<< -"atk" { - { [ os windows? ] [ "libatk-1.0-0.dll" cdecl add-library ] } - { [ os macosx? ] [ "libatk-1.0.dylib" cdecl add-library ] } - { [ os unix? ] [ "libatk-1.0.so" cdecl add-library ] } -} cond ->> +<< "atk" { + { [ os windows? ] [ "libatk-1.0-0.dll" ] } + { [ os macosx? ] [ "libatk-1.0.dylib" ] } + { [ os unix? ] [ "libatk-1.0.so" ] } +} cond cdecl add-library >> GIR: vocab:atk/Atk-1.0.gir diff --git a/basis/cairo/ffi/ffi.factor b/basis/cairo/ffi/ffi.factor index d04564c8d5..ff30dae5a0 100644 --- a/basis/cairo/ffi/ffi.factor +++ b/basis/cairo/ffi/ffi.factor @@ -3,16 +3,16 @@ ! Copyright (C) 2010 Anton Gorenko. ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.c-types alien.destructors alien.libraries -alien.syntax classes.struct combinators kernel system ; +alien.syntax assocs classes.struct combinators kernel system ; IN: cairo.ffi ! Adapted from cairo.h, version 1.8.10 << "cairo" { - { [ os windows? ] [ "libcairo-2.dll" cdecl add-library ] } - { [ os macosx? ] [ "libcairo.dylib" cdecl add-library ] } - { [ os unix? ] [ "libcairo.so" cdecl add-library ] } -} cond >> + { [ os windows? ] [ "libcairo-2.dll" ] } + { [ os macosx? ] [ "libcairo.dylib" ] } + { [ os unix? ] [ "libcairo.so" ] } +} cond cdecl add-library >> LIBRARY: cairo diff --git a/basis/compression/snappy/ffi/ffi.factor b/basis/compression/snappy/ffi/ffi.factor index 5cdad5bd35..da213ccbbc 100644 --- a/basis/compression/snappy/ffi/ffi.factor +++ b/basis/compression/snappy/ffi/ffi.factor @@ -1,11 +1,14 @@ ! Copyright (C) 2014 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.c-types alien.libraries -alien.libraries.finder alien.syntax classes.struct ; -USE: nested-comments +USING: alien alien.c-types alien.libraries alien.syntax +combinators classes.struct system ; IN: compression.snappy.ffi -<< "snappy" "snappy" find-library cdecl add-library >> +<< "snappy" { + { [ os windows? ] [ "snappy.dll" ] } + { [ os macosx? ] [ "libsnappy.dylib" ] } + { [ os unix? ] [ "libsnappy.so" ] } +} cond cdecl add-library >> LIBRARY: snappy diff --git a/basis/compression/zlib/ffi/ffi.factor b/basis/compression/zlib/ffi/ffi.factor index 6c4efbb1ed..5325b588cf 100644 --- a/basis/compression/zlib/ffi/ffi.factor +++ b/basis/compression/zlib/ffi/ffi.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2009 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.c-types alien.syntax combinators system -alien.libraries ; +USING: alien alien.c-types alien.libraries alien.syntax +combinators system ; IN: compression.zlib.ffi << "zlib" { diff --git a/basis/db/postgresql/ffi/ffi.factor b/basis/db/postgresql/ffi/ffi.factor index 9a05d6b1d9..995b361fb5 100644 --- a/basis/db/postgresql/ffi/ffi.factor +++ b/basis/db/postgresql/ffi/ffi.factor @@ -1,14 +1,14 @@ ! Copyright (C) 2007, 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. ! tested on debian linux with postgresql 8.1 -USING: alien alien.c-types alien.syntax combinators system -alien.libraries ; +USING: alien alien.c-types alien.libraries alien.syntax +combinators system ; IN: db.postgresql.ffi << "postgresql" { - { [ os windows? ] [ "libpq.dll" ] } + { [ os windows? ] [ "libpq.dll" ] } { [ os macosx? ] [ "libpq.dylib" ] } - { [ os unix? ] [ "libpq.so" ] } + { [ os unix? ] [ "libpq.so" ] } } cond cdecl add-library >> ! ConnSatusType diff --git a/basis/db/sqlite/ffi/ffi.factor b/basis/db/sqlite/ffi/ffi.factor index 7fcb4babf5..e4c1724563 100644 --- a/basis/db/sqlite/ffi/ffi.factor +++ b/basis/db/sqlite/ffi/ffi.factor @@ -2,15 +2,15 @@ ! See http://factorcode.org/license.txt for BSD license. ! An interface to the sqlite database. Tested against sqlite v3.1.3. ! Not all functions have been wrapped. -USING: alien compiler kernel math namespaces sequences strings alien.syntax -system combinators alien.c-types alien.libraries ; +USING: alien alien.c-types alien.libraries alien.syntax +combinators system ; IN: db.sqlite.ffi << "sqlite" { - { [ os windows? ] [ "sqlite3.dll" ] } - { [ os macosx? ] [ "/usr/lib/libsqlite3.dylib" ] } - { [ os unix? ] [ "libsqlite3.so" ] } - } cond cdecl add-library >> + { [ os windows? ] [ "sqlite3.dll" ] } + { [ os macosx? ] [ "libsqlite3.dylib" ] } + { [ os unix? ] [ "libsqlite3.so" ] } +} cond cdecl add-library >> ! Return values from sqlite functions CONSTANT: SQLITE_OK 0 ! Successful result diff --git a/basis/gdk/pixbuf/ffi/ffi.factor b/basis/gdk/pixbuf/ffi/ffi.factor index f51f554bb5..5c13220173 100644 --- a/basis/gdk/pixbuf/ffi/ffi.factor +++ b/basis/gdk/pixbuf/ffi/ffi.factor @@ -1,24 +1,20 @@ ! Copyright (C) 2010 Anton Gorenko. ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.c-types alien.data alien.libraries alien.syntax -combinators gio.ffi glib.ffi gobject-introspection -gobject-introspection.standard-types kernel libc -sequences system vocabs ; +USING: alien alien.c-types alien.data alien.libraries +alien.syntax combinators gio.ffi glib.ffi gobject-introspection +gobject-introspection.standard-types kernel libc sequences +system vocabs ; IN: gdk.pixbuf.ffi -<< -"gio.ffi" require ->> +<< "gio.ffi" require >> LIBRARY: gdk.pixbuf -<< -"gdk.pixbuf" { - { [ os windows? ] [ "libgdk_pixbuf-2.0-0.dll" cdecl add-library ] } - { [ os macosx? ] [ "libgdk_pixbuf-2.0.dylib" cdecl add-library ] } - { [ os unix? ] [ "libgdk_pixbuf-2.0.so" cdecl add-library ] } -} cond ->> +<< "gdk.pixbuf" { + { [ os windows? ] [ "libgdk_pixbuf-2.0-0.dll" ] } + { [ os macosx? ] [ "libgdk_pixbuf-2.0.dylib" ] } + { [ os unix? ] [ "libgdk_pixbuf-2.0.so" ] } +} cond cdecl add-library >> GIR: vocab:gdk/pixbuf/GdkPixbuf-2.0.gir diff --git a/basis/gio/ffi/ffi.factor b/basis/gio/ffi/ffi.factor index e4df71e69b..a1929f24b1 100644 --- a/basis/gio/ffi/ffi.factor +++ b/basis/gio/ffi/ffi.factor @@ -4,18 +4,14 @@ USING: alien alien.libraries alien.syntax combinators gobject-introspection kernel system vocabs ; IN: gio.ffi -<< -"gobject.ffi" require ->> +<< "gobject.ffi" require >> LIBRARY: gio -<< -"gio" { - { [ os windows? ] [ "libgio-2.0-0.dll" cdecl add-library ] } - { [ os macosx? ] [ "libgio-2.0.dylib" cdecl add-library ] } - { [ os unix? ] [ "libgio-2.0.so" cdecl add-library ] } -} cond ->> +<< "gio" { + { [ os windows? ] [ "libgio-2.0-0.dll" ] } + { [ os macosx? ] [ "libgio-2.0.dylib" ] } + { [ os unix? ] [ "libgio-2.0.so" ] } +} cond cdecl add-library >> GIR: vocab:gio/Gio-2.0.gir diff --git a/basis/glib/ffi/ffi.factor b/basis/glib/ffi/ffi.factor index eb96dd0133..56c1aafc74 100644 --- a/basis/glib/ffi/ffi.factor +++ b/basis/glib/ffi/ffi.factor @@ -8,13 +8,11 @@ IN: glib.ffi LIBRARY: glib -<< -"glib" { - { [ os windows? ] [ "libglib-2.0-0.dll" cdecl add-library ] } - { [ os macosx? ] [ "libglib-2.0.0.dylib" cdecl add-library ] } - { [ os unix? ] [ "libglib-2.0.so" cdecl add-library ] } -} cond ->> +<< "glib" { + { [ os windows? ] [ "libglib-2.0-0.dll" ] } + { [ os macosx? ] [ "libglib-2.0.0.dylib" ] } + { [ os unix? ] [ "libglib-2.0.so" ] } +} cond cdecl add-library >> IMPLEMENT-STRUCTS: GError GPollFD GSource GSourceFuncs ; diff --git a/basis/gmodule/ffi/ffi.factor b/basis/gmodule/ffi/ffi.factor index 7b3a2583bf..a74fa18648 100644 --- a/basis/gmodule/ffi/ffi.factor +++ b/basis/gmodule/ffi/ffi.factor @@ -4,18 +4,14 @@ USING: alien alien.libraries alien.syntax combinators gobject-introspection kernel system vocabs ; IN: gmodule.ffi -<< -"glib.ffi" require ->> +<< "glib.ffi" require >> LIBRARY: gmodule -<< -"gmodule" { - { [ os windows? ] [ "libgmodule-2.0-0.dll" cdecl add-library ] } - { [ os macosx? ] [ drop ] } - { [ os unix? ] [ "libgmodule-2.0.so" cdecl add-library ] } -} cond ->> +<< "gmodule" { + { [ os windows? ] [ "libgmodule-2.0-0.dll" ] } + { [ os macosx? ] [ "libgmodule-2.0.dylib" ] } + { [ os unix? ] [ "libgmodule-2.0.so" ] } +} cond cdecl add-library >> GIR: vocab:gmodule/GModule-2.0.gir diff --git a/basis/gobject/ffi/ffi.factor b/basis/gobject/ffi/ffi.factor index ccdf210a1e..a25741a47a 100644 --- a/basis/gobject/ffi/ffi.factor +++ b/basis/gobject/ffi/ffi.factor @@ -1,25 +1,21 @@ ! Copyright (C) 2010 Anton Gorenko. ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.destructors alien.libraries alien.syntax kernel +USING: alien alien.destructors alien.libraries alien.syntax combinators gobject-introspection literals math system vocabs ; IN: gobject.ffi ! these two are needed for the definition of GError and others. ! otherwise we generate GError and some others in this vocab as well. -<< -"glib.ffi" require ->> +<< "glib.ffi" require >> USE: glib.ffi LIBRARY: gobject -<< -"gobject" { - { [ os windows? ] [ "libobject-2.0-0.dll" cdecl add-library ] } - { [ os macosx? ] [ "libgobject-2.0.dylib" cdecl add-library ] } - { [ os unix? ] [ "libgobject-2.0.so" cdecl add-library ] } -} cond ->> +<< "gobject" { + { [ os windows? ] [ "libobject-2.0-0.dll" ] } + { [ os macosx? ] [ "libgobject-2.0.dylib" ] } + { [ os unix? ] [ "libgobject-2.0.so" ] } +} cond cdecl add-library >> IMPLEMENT-STRUCTS: GValue GParamSpecVariant ; diff --git a/basis/openssl/libcrypto/libcrypto.factor b/basis/openssl/libcrypto/libcrypto.factor index b1f796c959..b047f92900 100644 --- a/basis/openssl/libcrypto/libcrypto.factor +++ b/basis/openssl/libcrypto/libcrypto.factor @@ -5,18 +5,16 @@ ! ! export LD_LIBRARY_PATH=/opt/local/lib -USING: alien alien.c-types alien.syntax combinators kernel system -alien.libraries classes.struct ; +USING: alien alien.c-types alien.libraries alien.syntax +classes.struct combinators system ; IN: openssl.libcrypto -<< -{ - { [ os windows? ] [ "libcrypto" "libeay32.dll" cdecl add-library ] } - { [ os macosx? ] [ "libcrypto" "libcrypto.dylib" cdecl add-library ] } - { [ os unix? ] [ "libcrypto" "libcrypto.so" cdecl add-library ] } -} cond ->> +<< "libcrypto" { + { [ os windows? ] [ "libeay32.dll" ] } + { [ os macosx? ] [ "libcrypto.dylib" ] } + { [ os unix? ] [ "libcrypto.so" ] } +} cond cdecl add-library >> STRUCT: bio-method { type int } diff --git a/basis/openssl/libssl/libssl.factor b/basis/openssl/libssl/libssl.factor index f1c0d2459a..5350fe491d 100644 --- a/basis/openssl/libssl/libssl.factor +++ b/basis/openssl/libssl/libssl.factor @@ -1,9 +1,10 @@ ! Copyright (C) 2007 Elie CHAFTARI ! Portions copyright (C) 2008 Slava Pestov ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.c-types alien.parser alien.syntax classes.struct combinators -kernel openssl.libcrypto system namespaces assocs parser lexer sequences words -quotations math.bitwise alien.libraries literals ; +USING: alien alien.c-types alien.libraries alien.parser +alien.syntax assocs classes.struct combinators kernel lexer +literals namespaces openssl.libcrypto parser quotations +sequences system words ; IN: openssl.libssl diff --git a/basis/pango/cairo/ffi/ffi.factor b/basis/pango/cairo/ffi/ffi.factor index 6537d86c3a..cdf4ee61a6 100644 --- a/basis/pango/cairo/ffi/ffi.factor +++ b/basis/pango/cairo/ffi/ffi.factor @@ -4,19 +4,15 @@ USING: alien alien.libraries alien.syntax cairo.ffi combinators kernel gobject-introspection system vocabs ; IN: pango.cairo.ffi -<< -"pango.ffi" require ->> +<< "pango.ffi" require >> LIBRARY: pango.cairo -<< -"pango.cairo" { - { [ os windows? ] [ "libpangocairo-1.0-0.dll" cdecl add-library ] } - { [ os macosx? ] [ drop ] } - { [ os unix? ] [ "libpangocairo-1.0.so" cdecl add-library ] } -} cond ->> +<< "pango.cairo" { + { [ os windows? ] [ "libpangocairo-1.0-0.dll" ] } + { [ os macosx? ] [ "libpangocairo-1.0.dylib" ] } + { [ os unix? ] [ "libpangocairo-1.0.so" ] } +} cond cdecl add-library >> FOREIGN-RECORD-TYPE: cairo.Context cairo_t FOREIGN-RECORD-TYPE: cairo.ScaledFont cairo_scaled_font_t diff --git a/basis/pango/ffi/ffi.factor b/basis/pango/ffi/ffi.factor index 21ccfa41d2..d848c714cb 100644 --- a/basis/pango/ffi/ffi.factor +++ b/basis/pango/ffi/ffi.factor @@ -1,23 +1,19 @@ ! Copyright (C) 2010 Anton Gorenko. ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.c-types alien.destructors alien.libraries -alien.syntax combinators kernel gobject-introspection +alien.syntax combinators gobject-introspection gobject-introspection.standard-types system vocabs ; IN: pango.ffi -<< -"gobject.ffi" require ->> +<< "gobject.ffi" require >> LIBRARY: pango -<< -"pango" { - { [ os windows? ] [ "libpango-1.0-0.dll" cdecl add-library ] } - { [ os macosx? ] [ drop ] } - { [ os unix? ] [ "libpango-1.0.so" cdecl add-library ] } -} cond ->> +<< "pango" { + { [ os windows? ] [ "libpango-1.0-0.dll" ] } + { [ os macosx? ] [ "libpango-1.0.dylib" ] } + { [ os unix? ] [ "libpango-1.0.so" ] } +} cond cdecl add-library >> IMPLEMENT-STRUCTS: PangoRectangle ; diff --git a/basis/tools/disassembler/udis/udis.factor b/basis/tools/disassembler/udis/udis.factor index fcda932cb2..0ce049fe17 100644 --- a/basis/tools/disassembler/udis/udis.factor +++ b/basis/tools/disassembler/udis/udis.factor @@ -1,19 +1,17 @@ ! Copyright (C) 2008, 2010 Slava Pestov, Jorge Acereda Macia. ! See http://factorcode.org/license.txt for BSD license. -USING: tools.disassembler namespaces combinators alien -alien.syntax alien.c-types lexer parser kernel sequences layouts -math math.order alien.libraries math.parser system make fry -arrays libc destructors tools.memory tools.disassembler.utils -tools.disassembler.private splitting alien.data classes.struct ; +USING: alien alien.c-types alien.libraries alien.syntax arrays +combinators destructors fry kernel layouts libc make math +math.order math.parser namespaces sequences splitting system +tools.disassembler.private tools.disassembler.utils tools.memory +; IN: tools.disassembler.udis -<< -"libudis86" { - { [ os macosx? ] [ "libudis86.0.dylib" ] } - { [ os unix? ] [ "libudis86.so.0" ] } +<< "libudis86" { { [ os windows? ] [ "libudis86.dll" ] } -} cond cdecl add-library ->> + { [ os macosx? ] [ "libudis86.dylib" ] } + { [ os unix? ] [ "libudis86.so" ] } +} cond cdecl add-library >> LIBRARY: libudis86 diff --git a/extra/curl/ffi/ffi.factor b/extra/curl/ffi/ffi.factor index 6d4c78870e..3d92039929 100644 --- a/extra/curl/ffi/ffi.factor +++ b/extra/curl/ffi/ffi.factor @@ -1,10 +1,13 @@ USING: alien alien.c-types alien.enums alien.libraries -alien.libraries.finder alien.syntax classes.struct combinators -kernel math unix.types words ; +alien.syntax classes.struct combinators kernel math +system unix.types words ; IN: curl.ffi -<< "curl" dup find-library cdecl add-library >> +<< "curl" { + { [ os macosx? ] [ "libcurl.dylib" ] } + { [ os unix? ] [ "libcurl.so" ] } +} cond cdecl add-library >> LIBRARY: curl diff --git a/extra/fftw/ffi/ffi.factor b/extra/fftw/ffi/ffi.factor index 89f762fffc..63800a5af7 100644 --- a/extra/fftw/ffi/ffi.factor +++ b/extra/fftw/ffi/ffi.factor @@ -2,13 +2,17 @@ ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.c-types alien.destructors alien.libraries -alien.libraries.finder alien.syntax kernel ; +alien.libraries.finder alien.syntax combinators kernel system ; IN: fftw.ffi LIBRARY: fftw3 -<< "fftw3" { "fftw3" "libfftw3-3" } find-library-from-list cdecl add-library >> +<< "fftw3" { + { [ os windows? ] [ "libfftw3-3.dll" ] } + { [ os macosx? ] [ "libfftw3.dylib" ] } + { [ os unix? ] [ "libfftw3.so" ] } +} cond cdecl add-library >> TYPEDEF: double[2] fftw_complex diff --git a/extra/llvm/core/core.factor b/extra/llvm/core/core.factor index 35105aa3c6..26dece04ad 100644 --- a/extra/llvm/core/core.factor +++ b/extra/llvm/core/core.factor @@ -1,14 +1,21 @@ ! Copyright (C) 2009 Matthew Willis. ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.c-types alien.libraries -alien.libraries.finder alien.syntax kernel sequences ; +USING: alien alien.c-types alien.libraries alien.syntax +combinators kernel sequences system ; IN: llvm.core << +: add-llvm-library ( name -- ) + dup { + { [ os macosx? ] [ "lib" ".dylib" surround ] } + { [ os unix? ] [ "lib" ".so" surround ] } + { [ os windows? ] [ ".dll" append ] } + } cond cdecl add-library ; + { "LLVMSystem" "LLVMSupport" "LLVMCore" "LLVMBitReader" } -[ dup find-library cdecl add-library ] each +[ add-llvm-library ] each >> ! llvm-c/Core.h diff --git a/extra/llvm/engine/engine.factor b/extra/llvm/engine/engine.factor index 62b505a195..e653368332 100644 --- a/extra/llvm/engine/engine.factor +++ b/extra/llvm/engine/engine.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2009 Matthew Willis. ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.c-types alien.libraries -alien.libraries.finder alien.syntax kernel llvm.core sequences ; +USING: alien alien.c-types alien.libraries alien.syntax kernel +llvm.core sequences ; IN: llvm.engine << @@ -10,7 +10,7 @@ IN: llvm.engine "LLVMTransformUtils" "LLVMScalarOpts" "LLVMCodeGen" "LLVMAsmPrinter" "LLVMSelectionDAG" "LLVMX86CodeGen" "LLVMJIT" "LLVMInterpreter" -} [ dup find-library cdecl add-library ] each +} [ add-llvm-library ] each >> ! llvm-c/ExecutionEngine.h diff --git a/extra/lua/lua.factor b/extra/lua/lua.factor index fa997b1d65..190c0bb475 100644 --- a/extra/lua/lua.factor +++ b/extra/lua/lua.factor @@ -6,12 +6,13 @@ locals math system ; IN: lua << "liblua5.1" { - { [ os windows? ] [ "lua5.1.dll" ] } - { [ os macosx? ] [ "liblua5.1.dylib" ] } - { [ os unix? ] [ "liblua5.1.so" ] } - } cond cdecl add-library >> + { [ os windows? ] [ "lua5.1.dll" ] } + { [ os macosx? ] [ "liblua5.1.dylib" ] } + { [ os unix? ] [ "liblua5.1.so" ] } +} cond cdecl add-library >> + LIBRARY: liblua5.1 - + ! luaconf.h TYPEDEF: double LUA_NUMBER TYPEDEF: ptrdiff_t LUA_INTEGER diff --git a/extra/magic/ffi/ffi.factor b/extra/magic/ffi/ffi.factor index 17a2d6209b..00b85f5668 100644 --- a/extra/magic/ffi/ffi.factor +++ b/extra/magic/ffi/ffi.factor @@ -2,11 +2,14 @@ ! See http://factorcode.org/license.txt for BSD license USING: alien alien.c-types alien.destructors alien.libraries -alien.libraries.finder alien.syntax kernel literals ; +alien.syntax combinators kernel literals system ; IN: magic.ffi -<< "magic" dup find-library cdecl add-library >> +<< "magic" { + { [ os macosx? ] [ "libmagic.dylib" ] } + { [ os unix? ] [ "libmagic.so" ] } +} cond cdecl add-library >> LIBRARY: magic diff --git a/extra/pcre/ffi/ffi.factor b/extra/pcre/ffi/ffi.factor index 8a7882479d..f8a6b8cb17 100644 --- a/extra/pcre/ffi/ffi.factor +++ b/extra/pcre/ffi/ffi.factor @@ -1,6 +1,6 @@ USING: alien alien.c-types alien.data - alien.libraries alien.libraries.finder + alien.libraries alien.syntax classes.struct combinators @@ -8,7 +8,11 @@ USING: system ; IN: pcre.ffi -<< "pcre" dup find-library cdecl add-library >> +<< "pcre" { + { [ os windows? ] [ "pcre3.dll" ] } + { [ os macosx? ] [ "libpcre.dylib" ] } + { [ os unix? ] [ "libpcre.so" ] } +} cond cdecl add-library >> LIBRARY: pcre diff --git a/extra/readline/ffi/ffi.factor b/extra/readline/ffi/ffi.factor index 593da687b3..c9c72c3034 100644 --- a/extra/readline/ffi/ffi.factor +++ b/extra/readline/ffi/ffi.factor @@ -1,17 +1,16 @@ ! Copyright (C) 2010 Erik Charlebois ! See http:// factorcode.org/license.txt for BSD license. -USING: alien alien.c-types kernel alien.syntax classes.struct -accessors libc math make unix.types namespaces system -combinators alien.libraries ; +USING: accessors alien alien.c-types alien.libraries +alien.syntax classes.struct combinators kernel libc math +namespaces system unix.types ; IN: readline.ffi -<< -"readline" { +<< "readline" { { [ os windows? ] [ "readline.dll" ] } - { [ os macosx? ] [ "libreadline.dylib" ] } - { [ os unix? ] [ "libreadline.so" ] } -} cond cdecl add-library ->> + { [ os macosx? ] [ "libreadline.dylib" ] } + { [ os unix? ] [ "libreadline.so" ] } +} cond cdecl add-library >> + LIBRARY: readline TYPEDEF: void* histdata_t diff --git a/extra/readline/readline.factor b/extra/readline/readline.factor index b86ebf7f80..75a90545b5 100644 --- a/extra/readline/readline.factor +++ b/extra/readline/readline.factor @@ -1,8 +1,7 @@ ! Copyright (C) 2011 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.strings destructors io.encodings.utf8 kernel libc -sequences macros quotations words compiler.units fry -alien.data alien.libraries ; +USING: alien.data alien.libraries alien.strings compiler.units +destructors fry io.encodings.utf8 kernel libc sequences words ; QUALIFIED: readline.ffi IN: readline diff --git a/extra/zeromq/ffi/ffi.factor b/extra/zeromq/ffi/ffi.factor index 6794be412b..f436c46684 100644 --- a/extra/zeromq/ffi/ffi.factor +++ b/extra/zeromq/ffi/ffi.factor @@ -2,16 +2,16 @@ ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.accessors alien.c-types alien.data -alien.libraries alien.syntax byte-arrays classes.struct +alien.libraries alien.syntax assocs byte-arrays classes.struct combinators kernel literals math system ; IN: zeromq.ffi << "zmq" { - { [ os windows? ] [ "libzmq.dll" cdecl add-library ] } - { [ os macosx? ] [ "libzmq.dylib" cdecl add-library ] } - { [ os unix? ] [ "libzmq.so" cdecl add-library ] } -} cond >> + { [ os windows? ] [ "libzmq.dll" ] } + { [ os macosx? ] [ "libzmq.dylib" ] } + { [ os unix? ] [ "libzmq.so" ] } +} cond cdecl add-library >> LIBRARY: zmq