source: Makefile.gcj @ 16d2bdc

i2p-0.9.40
Last change on this file since 16d2bdc was 3a1c042c, checked in by zzz <zzz@…>, 11 years ago

gcj makefile fixups

  • Property mode set to 100644
File size: 5.0 KB
Line 
1# Makefile for building native I2P binaries and libraries with GCJ
2#
3# WARNING: Do not use this yet, as it may explode (etc).
4#
5GCJ=gcj #/usr/local/gcc-4.0.2/bin/gcj
6EXTRA_LD_PATH= #/usr/local/gcc-4.0.2/lib
7ANT=ant #/opt/apache-ant-1.6.5/bin/ant
8ANT_TARGET=build2
9NATIVE_DIR=native
10
11##
12# Define what jar files get into libi2p.so.  The current setup is
13# *incredibly* lazy, throwing everything in the .so, rather than
14# give each .jar file its own .so.
15#  i2p.jar: base SDK
16#  mstreaming.jar: streaming API
17#  streaming.jar: full streaming lib implementation
18#  i2ptunnel.jar: I2PTunnel proxy
19#  sam.jar: SAM bridge and API
20#  i2psnark.jar: bittorrent client
21#  router.jar: full I2P router
22#  jbigi.jar: collection of native optimized GMP routines for crypto
23JAR_BASE=i2p.jar mstreaming.jar streaming.jar
24JAR_CLIENTS=i2ptunnel.jar sam.jar
25JAR_ROUTER=router.jar
26JAR_JBIGI=jbigi.jar
27JAR_CONSOLE=\
28            javax.servlet.jar \
29            commons-el.jar \
30            commons-logging.jar \
31            jasper-runtime.jar \
32            jasper-compiler.jar \
33            org.mortbay.jetty.jar \
34            routerconsole.jar
35LIBI2P_JARS=${JAR_BASE} ${JAR_CLIENTS} ${JAR_ROUTER} ${JAR_JBIGI}
36LIBSAM_JARS=${JAR_BASE} sam.jar
37LIBROUTER_JARS=i2p.jar ${JAR_ROUTER} ${JAR_JBIGI}
38LIBCONSOLE_JARS=${LIBROUTER_JARS} ${JAR_CONSOLE}
39LIBSNARK_JARS=${LIBROUTER_JARS} i2psnark.jar
40# update:
41# similar error with gcj 4.3.3.
42#
43# unfortunately, its not quite ready for most end users, as the
44# ${JAR_CONSOLE} fails to compile with:
45# org/apache/commons/logging/impl/LogKitLogger.java: In class 'org.apache.commons.logging.impl.LogKitLogger':
46# .../LogKitLogger.java: In constructor '(java.lang.String)':
47# .../LogKitLogger.java:91: error: cannot find file for class org.apache.log.Hierarchy
48# .../LogKitLogger.java:91: error: cannot find file for class org.apache.log.Hierarchy
49# .../LogKitLogger.java:104: error: cannot find file for class org.apache.log.Hierarchy
50# .../LogKitLogger.java:104: confused by earlier errors, bailing out
51
52#${JAR_CONSOLE}\
53#${JAR_XML} \
54#${JAR_SUCKER}
55#${JAR_CONSOLE}
56
57SYSTEM_PROPS=-DloggerFilenameOverride=logs/log-router-@.txt \
58             -Dorg.mortbay.http.Version.paranoid=true \
59             -Dorg.mortbay.util.FileResource.checkAliases=false \
60             -Dorg.mortbay.xml.XmlParser.NotValidating=true
61#SYSTEM_PROPS=-Di2p.weakPRNG=true
62OPTIMIZE=-O2
63#OPTIMIZE=-O3
64
65LD_LIBRARY_PATH=${EXTRA_LD_PATH}:.
66
67all: jars native
68        @echo "* Build complete"
69
70jars:
71        @${ANT} ${ANT_TARGET}
72
73clean: native_clean
74
75native: native_clean native_shared
76        @echo "* Native code build in ${NATIVE}"
77
78native_clean:
79        @rm -rf ${NATIVE_DIR}
80        @mkdir ${NATIVE_DIR}
81
82native_shared: libi2p.so
83        @cd build ; ${GCJ} ${OPTIMIZE} -fjni -L../${NATIVE_DIR} -li2p ${SYSTEM_PROPS} -o ../${NATIVE_DIR}/i2p_dsa --main=net.i2p.crypto.DSAEngine
84        @echo "* i2p_dsa is a simple test app with the DSA engine and Fortuna PRNG to make sure crypto is working"
85        @cd build ; ${GCJ} ${OPTIMIZE} -fjni -L../${NATIVE_DIR} -li2p ${SYSTEM_PROPS} -o ../${NATIVE_DIR}/prng --main=gnu.crypto.prng.FortunaStandalone
86        @cd build ; ${GCJ} ${OPTIMIZE} -fjni -L../${NATIVE_DIR} -li2p ${SYSTEM_PROPS} -o ../${NATIVE_DIR}/i2ptunnel --main=net.i2p.i2ptunnel.I2PTunnel
87        @echo "* i2ptunnel is mihi's I2PTunnel CLI"
88        @echo "  run it as ./i2ptunnel -cli to avoid awt complaints"
89        @cd build ; ${GCJ} ${OPTIMIZE} -fjni -L../${NATIVE_DIR} -li2p ${SYSTEM_PROPS} -o ../${NATIVE_DIR}/i2ptunnelctl --main=net.i2p.i2ptunnel.TunnelControllerGroup
90        @echo "* i2ptunnelctl is a controller for I2PTunnel, reading i2ptunnel.config"
91        @echo "  and launching the appropriate proxies"
92        #@cd build ; ${GCJ} ${OPTIMIZE} -fjni -L../${NATIVE_DIR} -li2p ${SYSTEM_PROPS} -o ../${NATIVE_DIR}/i2psnark --main=org.klomp.snark.Snark
93        #@echo "* i2psnark is an anonymous bittorrent client"
94        @cd build ; ${GCJ} ${OPTIMIZE} -fjni -L../${NATIVE_DIR} -li2p ${SYSTEM_PROPS} -o ../${NATIVE_DIR}/i2prouter --main=net.i2p.router.Router
95        @echo "* i2prouter is the main I2P router"
96        @echo "  it can be used, and while the router console won't load,"
97        @echo "  i2ptunnel will, so it will start all the proxies defined in i2ptunnel.config"
98
99libi2p.so:
100        @echo "* Building $@"
101        @(cd build ; time ${GCJ} ${OPTIMIZE} -fPIC -fjni -shared -o ../${NATIVE_DIR}/$@ ${LIBI2P_JARS} ; cd .. )
102        @ls -l ${NATIVE_DIR}/$@
103        @echo "* $@ built"
104
105sam: jars libi2psam.so
106
107libi2psam.so:
108        @echo "* Building $@"
109        @rm -f ${NATIVE_DIR}/$@
110        @(cd build ; time ${GCJ} ${OPTIMIZE} -fPIC -fjni -shared -o ../${NATIVE_DIR}/$@ ${LIBSAM_JARS} ; cd .. )
111        @ls -l ${NATIVE_DIR}/$@
112        @echo "* $@ built"
113
114router: jars libi2prouter.so
115
116libi2prouter.so:
117        @echo "* Building $@"
118        @rm -f ${NATIVE_DIR}/$@
119        @(cd build ; time ${GCJ} ${OPTIMIZE} -fPIC -fjni -shared -o ../${NATIVE_DIR}/$@ ${LIBROUTER_JARS} ; cd .. )
120        @ls -l ${NATIVE_DIR}/$@
121        @echo "* $@ built"
122
123console: jars libi2pconsole.so
124
125# doesn't work, see above
126libi2pconsole.so:
127        @echo "* Building $@"
128        @rm -f ${NATIVE_DIR}/$@
129        @(cd build ; time ${GCJ} ${OPTIMIZE} -fPIC -fjni -shared -o ../${NATIVE_DIR}/$@ ${LIBCONSOLE_JARS} ; cd .. )
130        @ls -l ${NATIVE_DIR}/$@
131        @echo "* $@ built"
132
Note: See TracBrowser for help on using the repository browser.