본문 바로가기

컴퓨터/IT

des java lib 컴파일 방법 참고

http://www.javaservice.net/~java/bbs/read.cgi?m=devtip&b=servlet&c=r_p&n=956659322&p=40&s=t#956659322


[참고] 리눅스에서 컴파일시 사용했던 명령어,

gcc -fPIC -c -I/svc/oil/bin/des_java/des/lib_src/include -I/usr/local/java/include -I/usr/local/java/include/linux desc1.c
gcc -fPIC -c -I/svc/oil/bin/des_java/des/lib_src/include -I/usr/local/java/include -I/usr/local/java/include/linux xecure_util_EDTestJ.c
gcc -shared -o libSSONUM.so desc1.o xecure_util_EDTestJ.o -lc


컴파일1
cc -q64 -fPIC -c -I/home/batch/samsungcard/lib_src/include -I/usr/java14_64/include -I/usr/java14_64/include dess1.c
cc -q64 -fPIC -c -I/home/batch/samsungcard/lib_src/include -I/usr/java14_64/include -I/usr/java14_64/include dess1.c xecure_util_EDTestJ.c
cc -b64 -o libSSOCHAR.so xecure_util_EDTestJ.o dess1.o -lpthread -G

컴파일2
cc -q64 -fPIC -c -I/home/batch/samsungcard/lib_src/include -I/usr/java14_64/include -I/usr/java14_64/include desc1.c
cc -q64 -fPIC -c -I/home/batch/samsungcard/lib_src/include -I/usr/java14_64/include -I/usr/java14_64/include xecure_util_EDTestJ.c
cc -b64 -o libSSONUM.so xecure_util_EDTestJ.o desc1.o -lpthread -G
ld -b64 -o libSSONUM.so xecure_util_EDTestJ.o desc1.o -G -bexpall -bM:SRE -bnoentry -lc
cc -b64 -o libSSONUM.so xecure_util_EDTestJ.o desc1.o -G -bexpall -bM:SRE -bnoentry -lc
cc -b64 -o libSSONUM.a xecure_util_EDTestJ.o desc1.o -G -bexpall -bM:SRE -bnoentry -lc
cc -q64 -L./ -lSSONUM test.c

컴파일2 32비트
cc -q32 -fPIC -c -I/home/batch/samsungcard/lib_src/include -I/usr/java14_64/include -I/usr/java14_64/include desc1.c
cc -q32 -fPIC -c -I/home/batch/samsungcard/lib_src/include -I/usr/java14_64/include -I/usr/java14_64/include xecure_util_EDTestJ.c
cc -b32 -o libSSONUM.a xecure_util_EDTestJ.o desc1.o -G -bexpall -bM:SRE -bnoentry -lc
cc -q32 -L./ -lSSONUM test.c

컴파일2 64비트 옵션2
cc -q64 -c -I/home/batch/samsungcard/lib_src/include -I/usr/java14_64/include -I/usr/java14_64/include desc1.c
cc -q64 -c -I/home/batch/samsungcard/lib_src/include -I/usr/java14_64/include -I/usr/java14_64/include xecure_util_EDTestJ.c
ld -b64 -o libSSONUM.a xecure_util_EDTestJ.o desc1.o -G -bexpall -bM:SRE -bnoentry -lc

 

cc -q32 -fPIC -c -I/home/batch/samsungcard/lib_src/include -I/usr/java14_64/include -I/usr/java14_64/include desc1.c
cc -q32 -fPIC -c -I/home/batch/samsungcard/lib_src/include -I/usr/java14_64/include -I/usr/java14_64/include xecure_util_EDTestJ.c
cc -b32 -o libSSONUM.so xecure_util_EDTestJ.o desc1.o -lpthread -G


cc -b64 -o libSSONUM.so xecure_util_EDTestJ.o desc1.o -G -bexpall -bnoentry -lc
cc -b32 xecure_util_EDTestJ.o test.o -bexpall -bnoentry -lc


javac -d ./ CoopDesManager.java WrongArgumentException.java EncryptionException.java XecureDesChar.java XecureDesNum.java DecryptionException.java
javac DesTest.java
java -classpath ./ DesTest

 

 

## c에서는 잘 돌아감
xlc_r -q64 -c -I. -I/usr/java14_64/include -I/usr/java14_64/include/aix -I/home/batch/samsungcard/lib_src/include desc1.c xecure_util_EDTestJ.c
ld -b64 -o libSSONUM.so desc1.o xecure_util_EDTestJ.o -bnoentry -bM:SRE -bE:cimx.exp -blibpath:/lib/usr/lib -lc_r -L/usr/java14_64/lib/aix/native_threads
ld -b64 -o libSSONUM.a desc1.o xecure_util_EDTestJ.o -bnoentry -bM:SRE -bE:cimx.exp -blibpath:/lib/usr/lib -lc_r -L/usr/java14_64/lib/aix/native_threads
cc -q64 -L./ -lSSONUM test.c


## sample jni
xlc_r -q64 -c -I. -I/usr/java14_64/include -I/usr/java14_64/include/aix cimx.c NativeStringUtil.c
ld -b64 -o libcimx.so cimx.o NativeStringUtil.o -bnoentry -bM:SRE -bE:cimx.exp -blibpath:/lib/usr/lib -lc_r -L/usr/java14_64/lib/aix/native_threads

 

 

<b>[출처]</b> : <a href='http://www.coolx.net/main.jsp' target=_blank>www.coolx.net</a>