You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

50 lines
1.4 KiB

:
# -------------------------------------------------------------------
# This is a build file for the lp_solve Java wrapper stub library
# on linux platforms.
#
# Requirements and preconditions:
#
# - gcc and g++ compiler installed (I used gcc Version 3.3.1)
# - Sun JDK 1.4 installed
# - lp_solve archive (lp_solve_5.5_source.tar.gz) unpacked
#
# Change the paths below this line and you should be ready to go!
# -------------------------------------------------------------------
LPSOLVE_DIR=../../lpsolve55/src/lp_solve_5.5
LPSOLVE_LIB_DIR=../../../lib
#JDK_DIR=/usr/local/lib/jdk1.5.0_02
#JDK_DIR=/usr/lib/jvm/java-6-sun-1.6.0.10
#JDK_DIR=$JAVA_DIR
c=g++
if [ "$ARCH" = "" ]; then
CFLAGS="-m32"
fi
if [ "$ARCH" = "amd64" ]; then
CFLAGS="-m64 -fPIC -DPIC"
fi
if [ "$ARCH" = "ia64" ]; then
CFLAGS="-fPIC -DPIC"
fi
#determine platform (32/64 bit)
>/tmp/platform.c
echo '#include <stdlib.h>'>>/tmp/platform.c
echo '#include <stdio.h>'>>/tmp/platform.c
echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c
$c $CFLAGS /tmp/platform.c -o /tmp/platform
PLATFORM=`/tmp/platform`
rm /tmp/platform /tmp/platform.c >/dev/null 2>&1
mkdir $PLATFORM >/dev/null 2>&1
# OK, here we go!
SRC_DIR=../src/c
INCL="-I$JAVA_JNI_H_DIR -I$JAVA_JNI_MD_H_DIR -I $LPSOLVE_DIR -I $SRC_DIR"
$c $CFLAGS $INCL -c $SRC_DIR/lpsolve5j.cpp
$c $CFLAGS -shared -Wl,-soname,liblpsolve55j.so -o $PLATFORM/liblpsolve55j.so lpsolve5j.o -L$LPSOLVE_LIB_DIR -lc -llpsolve55