Fixed function implemenation type
[libfirm] / firmjni / build_firm_jni.in
index dfce6bc..3ded39f 100755 (executable)
@@ -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