Commit 10137e3b authored by User Claes's avatar User Claes

FreeBSD build

parent 7bad33d8
......@@ -45,7 +45,9 @@
#if defined OS_LYNX
# define LOG_QUEUE_NAME "/pwrlogqueue"
#elif defined OS_POSIX
# if defined _POSIX_MESSAGE_PASSING
# if defined OS_FREEBSD
# define LOG_QUEUE_NAME "/tmp/pwrlogqueue"
# elif defined _POSIX_MESSAGE_PASSING
# define LOG_QUEUE_NAME "/pwrlogqueue"
# else
# define LOG_QUEUE_NAME "/tmp/pwrlogqueue"
......
......@@ -151,7 +151,7 @@ sub configure()
exit 1;
}
my $fname = $ENV{"pwre_bin"} . "/pwre_configure.sh";
my $fname = $ENV{"pwre_bin"} . "/pwre_configure.sh"." ".$_[0]." ".$_[1]." ".$_[2];
system( $fname);
}
......@@ -277,6 +277,7 @@ sub ebuild # args: pass flavour
my $build_opc = 0;
my $build_profibus = 0;
my $build_otherio = 0;
my $build_misc = 0;
my $build_ssabox = 0;
my $build_tlog = 0;
my $build_othermanu = 0;
......@@ -298,6 +299,7 @@ sub ebuild # args: pass flavour
elsif ( $value[0] eq "opc" && $value[1] eq "1" ) { $build_opc = 1; printf( "-- opc\n");}
elsif ( $value[0] eq "profibus" && $value[1] eq "1" ) { $build_profibus = 1; printf( "-- profibus\n");}
elsif ( $value[0] eq "otherio" && $value[1] eq "1" ) { $build_otherio = 1; printf( "-- otherio\n");}
elsif ( $value[0] eq "misc" && $value[1] eq "1" ) { $build_ssabox = 1; printf( "-- misc\n");}
elsif ( $value[0] eq "ssabox" && $value[1] eq "1" ) { $build_ssabox = 1; printf( "-- ssabox\n");}
elsif ( $value[0] eq "tlog" && $value[1] eq "1" ) { $build_tlog = 1; printf( "-- tlog\n");}
elsif ( $value[0] eq "othermanu" && $value[1] eq "1" ) { $build_othermanu = 1; printf( "-- othermanu\n");}
......@@ -368,6 +370,11 @@ sub ebuild # args: pass flavour
_build("lib", "rt", "src", "all");
merge();
}
if ( $build_misc == 1) {
_module("misc");
_build("lib", "misc", "src", "all");
merge();
}
if ( $build_ssabox == 1) {
_module("ssabox");
_build("lib", "rt", "src", "all");
......@@ -436,6 +443,10 @@ sub ebuild # args: pass flavour
_module("telemecanique");
merge();
}
if ( $build_misc == 1) {
_module("misc");
merge();
}
}
elsif ( $pass eq "op" ) {
_module("xtt");
......@@ -512,6 +523,11 @@ sub ebuild # args: pass flavour
_build("mmi", "*", "src", "copy");
merge();
}
if ( $build_misc == 1) {
_module("misc");
_build("mmi", "*", "src", "copy");
merge();
}
if ( $build_ssabox == 1) {
_module("ssabox");
_build("mmi", "*", "src", "copy");
......@@ -592,6 +608,9 @@ sub build_all_modules ()
_module("opc");
build_all( $flavour);
merge();
_module("misc");
build_all( $flavour);
merge();
_module("ssabox");
build_all( $flavour);
merge();
......@@ -690,6 +709,11 @@ sub build_all_wbl ()
system( "rm $load_dir/*.dbs");
_build("wbl", "bcomp", "src", "lib");
merge();
_module("misc");
my($load_dir) = $ENV{"pwr_load"};
system( "rm $load_dir/*.dbs");
_build("wbl", "misc", "src", "lib");
merge();
_module("ssabox");
my($load_dir) = $ENV{"pwr_load"};
system( "rm $load_dir/*.dbs");
......@@ -826,6 +850,8 @@ sub create_all_modules ()
create();
_module("bcomp");
create();
_module("misc");
create();
_module("profibus");
create();
_module("sev");
......
#!/bin/bash
pwre_help()
{
cat <<EOF
pwre_configure.h
Arguments
--help Display help.
--version State fix version of loadfiles, eg
> pwre configure --version "29-MAY-2011 16:00:00"
--reset-version Reset previous version
EOF
}
pwre_config_init()
{
d=`eval date +\"%F %X\"`
......@@ -97,7 +115,7 @@ pwre_config_check_lib()
elif test $4 == "motif"; then
conf_libmotif=$conf_libmotif" -l${lib%.*}"
else
conf_lib=$conf_lib" -l${lib%%.*}"
conf_lib=$conf_lib" -l${lib%.*}"
fi
elif test $3 == "gtk"; then
conf_libgtk=$conf_libgtk" \\\`pkg-config --libs gtk+-2.0\\\`"
......@@ -175,14 +193,13 @@ pwre_create_makedir()
done
}
#pwre_os="os_linux"
#pwre_hw="hw_x86"
cfile="$pwre_broot/pwre_${pwre_hw:3}_${pwre_os:3}.cnf"
dos=`eval echo ${pwre_os} | tr [:lower:] [:upper:]`
dhw=`eval echo ${pwre_hw} | tr [:lower:] [:upper:]`
conf_cc_define="-D$dos=1 -D$dhw=1 -DOS=${pwre_os:3} -DHW=${pwre_hw:3} -D_${dos:3}"
conf_cc_define="-D$dos=1 -DOS_POSIX -D$dhw=1 -DOS=${pwre_os:3} -DHW=${pwre_hw:3} -D_${dos:3}"
conf_lib=""
conf_libgtk=""
conf_libmotif=""
......@@ -225,38 +242,68 @@ if test ! -e $pwre_croot; then
exit
fi
# Options
if [ "$1" = "--help" ]; then
pwre_help
exit
elif [ "$1" = "--version" ] && [ "$2" != "" ] && [ "$3" != "" ]; then
buildversion=$2" "$3
elif [ "$1" = "--reset-version" ]; then
buildversion=""
elif [ "$1" != "" ]; then
echo "Unknown option \"$1\""
exit
else
# Catch current version
if [ -e $cfile ]; then
ver=`eval cat $cfile | grep "\\bexport PWRE_CONF_BUILDVERSION"`
ver=${ver#*=\"}
ver=${ver%\"}
buildversion=$ver
fi
fi
pwre_create_blddir
pwre_create_makedir
pwre_config_init
if [ "$buildversion" != "" ]; then
echo "export PWRE_CONF_BUILDVERSION=\"$buildversion\"" >> $cfile
else
echo "export PWRE_CONF_BUILDVERSION=\"0\"" >> $cfile
fi
#Gtk
pwre_config_check_lib gtk GTK gtk gtk 0 /usr/local/lib/libgtk-x11-2.0.so
echo ""
echo "Mandatory :"
pwre_config_check_lib gtk GTK gtk gtk 0 /usr/local/lib/libgtk-x11-2.0.a
pwre_config_check_lib libantlr LIBANTLR lib lib 0 /usr/local/lib/libantlr.a
pwre_config_check_lib librpcsvc LIBRPCSVC lib lib 0 /usr/lib/librpcsvc.so:/usr/lib/librpcsvc.a
pwre_config_check_lib libasound LIBASOUND lib lib 0 /usr/lib/libasound.so:/usr/lib/libasound.a
#pwre_config_check_lib libasound LIBASOUND lib lib 0 /usr/lib/libasound.so:/usr/lib/libasound.a
pwre_config_check_lib libpthread LIBPTHREAD lib lib 0 /usr/lib/libpthread.so:/usr/lib/libpthread.a
pwre_config_check_lib libm LIBM lib lib 0 /usr/lib/libm.so:/usr/lib/libm.a
pwre_config_check_lib libdb_cxx LIBDB_CXX lib lib 0 /usr/local/lib/libdb_cxx-4.8.so
pwre_config_check_lib libz LIBZ lib lib 0 /usr/lib/libz.so:/usr/lib/libz.a
pwre_config_check_lib libcrypt LIBCRYPT lib lib 0 /usr/lib/libcrypt.so:/usr/lib/libcrypt.a
pwre_config_check_lib mysql MYSQL lib lib 1 /usr/lib/libmysqlclient.so
pwre_config_check_lib mq MQ lib lib 1 /usr/lib/libdmq.so
pwre_config_check_lib libpnioif PNAK lib lib 1 /usr/lib/libpnioif.so:/usr/local/lib/libpnioif.a
pwre_config_check_lib libusb LIBUSB lib lib 1 /usr/lib/libusb-1.0.so
pwre_config_check_lib librt LIBRT lib lib 0 /usr/lib/librt.dylib:/usr/lib/librt.a
pwre_config_check_lib libiconv LIBICONV lib lib 0 /usr/local/lib/libiconv.so:usr/local/lib/libiconv.a
pwre_config_check_lib libfl LIBFL lib lib 0 /usr/lib/libfl.os:/usr/lib/libfl.a
#set -o xtrace
pwre_config_check_include antlr ANTLR 1 /usr/local/include/antlr/CommonAST.hpp
pwre_config_check_include gtk GTK 1 /usr/local/include/gtk-2.0/gtk/gtk.h
pwre_config_check_include jni JNI 1 /usr/local/jdk1.6.0/include/jni.h
pwre_config_check_include jni JNI 0 /usr/local/jdk1.6.0/include/freebsd/jni_md.h
pwre_config_check_include libdb_cxx LIBDB_CXX 0 /usr/local/include/db48/db_cxx.h
echo ""
echo "Optional :"
pwre_config_check_lib mysql MYSQL lib lib 1 /usr/lib/libmysqlclient.so
pwre_config_check_lib mq MQ lib lib 1 /usr/lib/libdmq.so
pwre_config_check_lib libpnioif PNAK lib lib 1 /usr/lib/libpnioif.so:/usr/local/lib/libpnioif.a
pwre_config_check_lib libusb LIBUSB lib lib 1 /usr/lib/libusb-1.0.so
export pwre_conf_alsa=1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment