X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=firmjni%2Fbuild_firm_jni.in;h=3ded39fc43405352f7efb63aacec76ca8c9849ce;hb=a43b15ac7314af2946cbf5519f4f5e5cdc5f630e;hp=dfce6bc4e3c5a92880bf30ad5797c77cba3de1d4;hpb=731688b640632624bf9d77544654cd663c335364;p=libfirm diff --git a/firmjni/build_firm_jni.in b/firmjni/build_firm_jni.in index dfce6bc4e..3ded39fc4 100755 --- a/firmjni/build_firm_jni.in +++ b/firmjni/build_firm_jni.in @@ -15,22 +15,26 @@ srcdir=@srcdir@ topdir=.. subdir=firmjni -############################################################################### -# The directory which shall contain the JNI implementation after installation. -FIRM_JNI_DIR=./ - # This is the list of firm headers a JNI interface is generated for -# If you change this list, also change the list in Makefile.in +# If you change this list, also change FRIM_PATH_HEADERS and the list +# in Makefile.in FIRM_HEADERS="firm.h firm_common.h dbginfo.h ident.h tv.h type.h entity.h type_or_entity.h tpop.h mangle.h irprog.h irgraph.h irnode.h irmode.h irop.h ircons.h ircgcons.h irflag.h irvrfy.h irdump.h iropt.h irgopt.h ircgopt.h irouts.h irdom.h irloop.h cgana.h - irgwalk.h irgmod.h typewalk.h typegmod.h" - -# These directories point to a libfirm installation: -FIRM_INCLUDE_DIR=@includedir@ -FIRM_LIB_DIR=@libdir@ + irgmod.h typegmod.h" +# How to pass function pointers? Therefore removed. +# irgwalk.h typewalk.h + +FIRM_PATH_HEADERS="common/firm.h common/firm_common.h + debug/dbginfo.h ident/ident.h tv/tv.h + tr/type.h tr/entity.h tr/type_or_entity.h tr/tpop.h tr/mangle.h + ir/irprog.h ir/irgraph.h ir/irnode.h ir/irmode.h ir/irop.h + ir/ircons.h ir/ircgcons.h ir/irflag.h ir/irvrfy.h ir/irdump.h + ir/iropt.h ir/irgopt.h ir/ircgopt.h + ana/irouts.h ana/irdom.h ana/irloop.h ana/cgana.h + ir/irgmod.h tr/typegmod.h" # The directory containing crecoder.jar and, for now, # remove_cpp_comands.perl @@ -40,51 +44,11 @@ WORK_DIR=. ############################################################################### -CURRENT_DIR=$PWD SOURCE_DIR=sources -MACHINE=`uname -m` -SYS_OS=`uname -s` -ARCH_DIR=$MACHINE-$SYS_OS - -LOG_FILE=compile-log.txt - REMOVE_CPP_COMMANDS=$FIRM_JNI_TOOLS_DIR/remove_cpp_comands.perl CRECODER=$FIRM_JNI_TOOLS_DIR/crecoder.jar -# -# shell initialization -# -source /afs/info.uni-karlsruhe.de/public/tools/Modules/init/sh - -# -# flags -# -verbose="" - -# -# set up directories -# -#rm -rf $WORK_DIR -#mkdir -p $WORK_DIR -cd $WORK_DIR - -############################################################################### - -analargs () { - while [ $# -gt 0 ]; do - case $1 in - --verbose) verbose="y";; - *) echo "Unknown option "$1;; - esac - shift - done -} - -analargs $* - -############################################################################### - ############################################################################### # Get all the necessary Firm headers. @@ -93,8 +57,8 @@ cd $WORK_DIR rm -rf $SOURCE_DIR mkdir $SOURCE_DIR -for file in $FIRM_HEADERS; do - cp $FIRM_INCLUDE_DIR/$file $SOURCE_DIR +for file in $FIRM_PATH_HEADERS; do + cp $top_srcdir/ir/$file $SOURCE_DIR done; ############################################################################### @@ -119,9 +83,7 @@ done; # the java native interface in C calling the real libfirm functions. # For a file "file.h" files "File.java" and "File.c" are generated. -module add jdk-1.3.1-sun export CLASSPATH=$FIRM_JNI_TOOLS_DIR/crecoder.jar:$CLASSPATH -#echo $CLASSPATH for file in $FIRM_HEADERS; do java crecoder/tools/jniBuilder/BuildJNI $file done; @@ -129,14 +91,10 @@ done; # Remove the C headers which are no more needed. They contain # nonsense no C compiler ever should see ;-) rm -f $FIRM_HEADERS -# Make the JNI Implementation - -export CPPFLAGS="-I. -I/usr/public2/java/jdk1.3.1-sun/include/ -I/usr/public2/java/jdk1.3.1-sun/include/linux/ -I$FIRM_INCLUDE_DIR" -export LDFLAGS="-L$FIRM_LIB_DIR" # javah renames these files. the jnibuilder doesn't anticipate this # and generates #includes with the original names. ln -s Firm_0005fcommon.h Firm_common.h ln -s Type_0005for_0005fentity.h Type_or_entity.h -make -f Makefile +make