curvirgoです。

Takashi Nakamoto wrote:
> http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/waooo/furigana/
> にある、build.batとfurigana.defを使ってコンパイルやリンクを自動的に行う
> ようにしてみました。 (相変わらずmecab使ってます)
とりあえず、__declspec(dllexport)を関数の前につけて回避してました。
それと、batchファイルを使わなくてもパッケージ作成まで自動的に進みます。
コマンドプロンプトを起動し、OOo_SDKのインストール先にあるsetsdkenv_windows.batを実行します。
初回実行時は各ツールのパスを聞かれるので環境にあわせたパスをショートネームで入力します。
初期設定完了後にMakefileをwindowsに合わせて編集すれば、makeコマンド一発でパッケージ作成まで行えます。

以下は、いま私が編集して使っているものです。

==================================== Makefile Start 
====================================
# Copyright (C) 2006 Takashi Nakamoto.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

# base directories
OO_SDK_DIR=$(OO_SDK_HOME)
OO_DIR=c:\progra~1\OPENOF~1.0
OO_PROG_DIR=$(OO_DIR)/program
SDKBINDIR=$(OO_SDK_DIR)/windows/bin

# tools
IDLC=$(SDKBINDIR)/idlc
REGMERGE=$(SDKBINDIR)/regmerge
REGCOMP=$(SDKBINDIR)/regcomp
CPP=cl
LINK=link
ZIP=zip

all: furigana.uno.pkg

furigana.urd: furigana.idl
        $(IDLC) -C -I$(OO_SDK_DIR)/idl furigana.idl

furigana.rdb: furigana.urd
        $(REGMERGE) $@ /UCR furigana.urd

furigana_impl.obj: furigana.rdb furigana_impl.cxx
        cppumaker -BUCR -Tjp.sourceforge.waooo.addin.XFurigana \
        -Tcom.sun.star.sheet.XAddIn \
        -Tcom.sun.star.lang.XServiceName \
        -Tcom.sun.star.lang.XServiceInfo \
        -Tcom.sun.star.lang.XTypeProvider \
        -Tcom.sun.star.uno.XWeak \
        -Tcom.sun.star.uno.XAggregation \
        -Tcom.sun.star.lang.XMultiServiceFactory \
        -Tcom.sun.star.uno.XComponentContext \
        -Tcom.sun.star.lang.XSingleComponentFactory \
        -Tcom.sun.star.lang.XSingleServiceFactory \
        -Tcom.sun.star.registry.XRegistryKey \
        -Tcom.sun.star.lang.XInitialization \
        -Tcom.sun.star.lang.IllegalArgumentException \
        $(OO_PROG_DIR)/types.rdb furigana.rdb

        $(CPP) -Zm500 -Zc:forScope -MD -GR -c -nologo -Gs -Gy -Ob1 -Oxs -Oy- 
-Gd -I. -I$(OO_SDK_DIR)\include 
-I/cygdrive/c/progra~1/java/JDK15~1.0_0/include/win32 
-I/cygdrive/c/progra~1/java/JDK15~1.0_0/include 
-I/cygdrive/c/PROGRA~1/MICROS~4/include 
-I/cygdrive/c/PROGRA~1/MICROS~1.NET/Vc7/include 
-I/cygdrive/c/PROGRA~1/DIRECT~1/include -Zi -Wall -wd4061 -wd4100 -wd4127 
-wd4191 -wd4217 -wd4251 -wd4275 -wd4290 -wd4294 -wd4355 -wd4511 -wd4512 -wd4514 
-wd4611 -wd4625 -wd4626 -wd4640 -wd4668 -wd4675 -wd4710 -wd4711 -wd4716 -wd4786 
-wd4800 -wd4820 -wd4503 -wd4255 -DWNT -DWNT -DNT351 -DMSC -DM1310 -DINTEL 
-D_X86_=1 -DFULL_DESK -DSTLPORT_VERSION=400 -DWINVER=0x400 -D_WIN32_IE=0x400 
-D_MT -DCPPU_ENV=msci -DSUPD=680 -DPRODUCT -DNDEBUG -DPRODUCT_FULL 
-DOSL_DEBUG_LEVEL=0 -DOPTIMIZE -DEXCEPTIONS_OFF -DCUI -DSOLAR_JAVA 
-DOOD680=OOD680 -DSHAREDLIB -D_DLL_ -DWIN32 -D_MT -D_DLL -DWIN32 -D_MT -D_DLL 
-Fofurigana_impl.obj furigana_impl.cxx

libfurigana.dll: furigana_impl.obj symbols.txt
        $(LINK) /DEF:furigana.def /OPT:NOREF /NODEFAULTLIB /RELEASE /DEBUG:full 
/SUBSYSTEM:CONSOLE /DLL -out:libfurigana.dll 
$(OO_SDK_DIR)/windows/lib/icppu.lib $(OO_SDK_DIR)/windows/lib/icppuhelper.lib 
$(OO_SDK_DIR)/windows/lib/isal.lib Imm32.lib User32.lib Msvcrt.lib Kernel32.lib 
furigana_impl.obj

furigana.uno.pkg: furigana.rdb libfurigana.dll META-INF/manifest.xml
        $(REGCOMP) -register -r furigana.rdb -c libfurigana.dll
        $(ZIP) $@ META-INF/manifest.xml furigana.rdb libfurigana.dll

install: furigana.uno.pkg
        $(OO_PROG_DIR)/unopkg add furigana.uno.pkg

uninstall:
        $(OO_PROG_DIR)/unopkg remove furigana.uno.pkg

clean:
        rm -rf com jp *.rdb *.urd *.pkg *.obj *.dll
===================================== Makefile End 
=====================================

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

メールによる返信