Commit 7001f0b7 authored by Claes Sjofors's avatar Claes Sjofors

pwre build of both qt and gtk

parent 42ff1aaa
......@@ -37,7 +37,7 @@ silent :
$(exe_dir)/pwrrt.so : pwrrtmodule.c
@ if [ "$(PWRE_CONF_PYDEV)" == "1" ]; then\
echo "Bulding Python c extension pwrrt";\
python setup_pwrrt.py build --build-base $(bld_dir);\
python setup_pwrrt.py -q build --build-base $(bld_dir);\
if [ "$(pwre_hw)" == "hw_x86_64" ]; then \
mv $(bld_dir)/lib.linux-x86_64-2.7/pwrrt.so $(pwr_exe); \
elif [ "$(pwre_hw)" == "hw_x86" ]; then \
......
......@@ -87,10 +87,11 @@ linkcp = :
pre_so =
log_done =
csetos := $(pwre_conf_cc_define)
ifeq ($(pwre_conf_qt),1)
csetos := -DPWRE_CONF_QT $(pwre_conf_cc_define)
cinc := -I$(inc_dir) -I$(einc_dir) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirqt)
else
csetos := -DPWRE_CONF_GTK $(pwre_conf_cc_define)
cinc := -I$(inc_dir) -I$(einc_dir) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirgtk) $(pwre_conf_incdirgst)
endif
rm := rm
......
......@@ -151,6 +151,22 @@ sub configure()
system($ENV{"pwre_bin"} . "/pwre_configure.sh"." ".$_[0]." ".$_[1]." ".$_[2]);
}
sub set_flavour # args: flavour
{
if ($_[0] eq "qt") {
$ENV{pwre_conf_qt} = "1";
}
else {
delete $ENV{"pwre_conf_qt"};
}
if ($_[0] eq "gtk") {
$ENV{"pwre_conf_gtk"} = "1";
}
else {
delete $ENV{"pwre_conf_gtk"};
}
}
#
# build()
#
......@@ -176,13 +192,16 @@ sub build() # args: branch, subbranch, flavour, phase
shift(@_);
}
my($flavour);
if ($_[0] eq "all") {
build_all_modules();
$flavour = $_[1];
build_all_modules($flavour);
return;
}
if ($_[0] eq "module" || $_[0] eq "") {
build_module();
$flavour = $_[1];
build_module($flavour);
return;
}
......@@ -207,6 +226,7 @@ sub build() # args: branch, subbranch, flavour, phase
$flavour = $_[0];
shift(@_);
}
set_flavour($flavour);
printf("--\n");
printf("-- Build\n");
......@@ -597,7 +617,13 @@ sub import()
#
sub build_all_modules()
{
my $flavour = $_[0];
my $flavour;
if ($_[0] eq "") {
$flavour = "qt";
} else {
$flavour = $_[0];
}
set_flavour($flavour);
build_kernel($flavour);
_module("nmps");
......@@ -814,7 +840,7 @@ sub method_build()
_module("rt");
$ENV{"export_type"} = "exp";
my($exe_dir) = $ENV{"pwr_exe"};
system("rm $exe_dir/rt_io_comm");
system("if [ -e $exe_dir/rt_io_comm ]; then rm $exe_dir/rt_io_comm; fi");
_build("exe", "rt_io_comm", "src", "all");
merge();
}
......@@ -827,7 +853,7 @@ sub method_build()
_module("wb");
$ENV{"export_type"} = "exp";
my($exe_dir) = $ENV{"pwr_exe"};
system("rm $exe_dir/wb_$flavour");
system("if [ -e $exe_dir/wb_$flavour ]; then rm $exe_dir/wb_$flavour; fi");
_build("exe", "wb", $flavour, "all");
_build("exe", "wb", "src", "all");
merge();
......@@ -838,7 +864,7 @@ sub method_build()
_module("xtt");
$ENV{"export_type"} = "exp";
my($exe_dir) = $ENV{"pwr_exe"};
system("rm $exe_dir/rt_xtt_$flavour");
system("if [ -e $exe_dir/rt_xtt_$flavour ]; then rm $exe_dir/rt_xtt_$flavour; fi");
_build("exe", "rt_xtt", $flavour, "all");
_build("exe", "rt_xtt", "src", "all");
merge();
......@@ -918,13 +944,12 @@ sub build_module()
$lib = 1;
$exe = 1;
}
if ($_[0] eq "motif" || $_[1] eq "motif" || $_[2] eq "motif" || $_[3] eq "motif") {
$flavour = "motif";
} elsif ($_[0] eq "qt" || $_[1] eq "qt" || $_[2] eq "qt" || $_[3] eq "qt") {
$flavour = "qt";
} else {
if ($_[0] eq "gtk" || $_[1] eq "gtk" || $_[2] eq "gtk" || $_[3] eq "gtk") {
$flavour = "gtk";
} else {
$flavour = "qt";
}
set_flavour($flavour);
if (!defined($ENV{"pwre_env"})) {
print("++ Environment is not initialized!\n");
......@@ -1021,6 +1046,8 @@ sub build_module()
_build("exe", "pwr_rtmon", "src", "all");
_build("exe", "pwr_rtmon", "$flavour", "all");
_build("exp", "ge", "src", "all");
_build("exp", "py", "src", "all");
_build("exp", "*", "src", "exe");
_build("mmi", "*", "src", "copy");
_build("mmi", "*", $flavour, "copy");
_build("wbl", "pwrs", "src", "lib");
......@@ -1098,6 +1125,7 @@ sub build_module()
_build("wbl", "*", "src", "exe");
_build("exe", "*", "src", "all");
_build("exe", "*", $flavour, "all");
_build("exp", "*", "src", "exe");
_build("doc", "dsh", "src", "copy");
_build("doc", "orm", "src", "copy");
}
......
......@@ -341,6 +341,9 @@ if [ "$buildversion" != "" ]; then
else
echo "export PWRE_CONF_BUILDVERSION=\"0\"" >> $cfile
fi
echo "export pwrp_root=/dev/null" >> $cfile
echo "export pwrp_exe=/dev/null" >> $cfile
echo "export pwrp_db=/dev/null" >> $cfile
echo "export PWRE_CONF_LOCKDBS=$lockdbs" >> $cfile
echo "export PWRE_CONF_PARALLEL=$parallel" >> $cfile
......@@ -349,14 +352,14 @@ if [ $pwre_hw == "hw_arm" ] && [ $ebuild -eq 1 ]; then
# if [ $pwre_conf_qt -eq 1 ]; then
pwre_config_check_lib qt QT qt qt 0 "/usr/lib/libQtGui.so:/usr/lib/$hwpl-linux-$gnu/libQtGui.so"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtCore/QtCore"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui/QtGui"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtNetwork/QtNetwork"
pwre_config_check_include qt QT 0 "/usr/include/qt4/QtGui"
pwre_config_check_include qt QT 0 "/usr/include/qt4/QtCore/QtCore"
pwre_config_check_include qt QT 0 "/usr/include/qt4/QtGui/QtGui"
pwre_config_check_include qt QT 0 "/usr/include/qt4/QtNetwork/QtNetwork"
# fi
# if [ $pwre_conf_gtk -eq 1 ]; then
pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/libgtk-x11-2.0.so:/usr/lib/$hwpl-linux-$gnu/libgtk-x11-2.0.so"
pwre_config_check_include gtk GTK 1 "/usr/local/include/gtk-2.0/gtk.h:/usr/local/include/gtk-2.0/gtk/gtk.h:/usr/include/gtk-2.0/gtk/gtk.h"
pwre_config_check_include gtk GTK 0 "/usr/local/include/gtk-2.0/gtk.h:/usr/local/include/gtk-2.0/gtk/gtk.h:/usr/include/gtk-2.0/gtk/gtk.h"
# fi
pwre_config_check_include jni JNI 1 $jdk/include/jni.h
......@@ -425,17 +428,17 @@ else
pwre_config_check_include alsa ALSA 1 "/usr/include/alsa/asoundlib.h"
echo ""
echo "Gui Qt/Gtk:"
if [ ! -z $pwre_conf_qt ]; then
echo "Gui either Qt or Gtk :"
# if [ ! -z $pwre_conf_qt ]; then
pwre_config_check_lib qt QT qt qt 0 "/usr/lib/libQtGui.so:/usr/lib/$hwpl-linux-$gnu/libQtGui.so"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtCore/QtCore"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui/QtGui"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtNetwork/QtNetwork"
else
pwre_config_check_include qt QT 0 "/usr/include/qt4/QtGui"
pwre_config_check_include qt QT 0 "/usr/include/qt4/QtCore/QtCore"
pwre_config_check_include qt QT 0 "/usr/include/qt4/QtGui/QtGui"
pwre_config_check_include qt QT 0 "/usr/include/qt4/QtNetwork/QtNetwork"
# else
pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/libgtk-x11-2.0.so:/usr/lib/$hwpl-linux-$gnu/libgtk-x11-2.0.so"
pwre_config_check_include gtk GTK 1 "/usr/local/include/gtk-2.0/gtk.h:/usr/local/include/gtk-2.0/gtk/gtk.h:/usr/include/gtk-2.0/gtk/gtk.h"
fi
pwre_config_check_include gtk GTK 0 "/usr/local/include/gtk-2.0/gtk.h:/usr/local/include/gtk-2.0/gtk/gtk.h:/usr/include/gtk-2.0/gtk/gtk.h"
# fi
echo ""
echo "Optional :"
......@@ -472,6 +475,7 @@ else
pwre_config_check_include powerlink EPL 1 "$epl/Include/Epl.h"
pwre_config_check_include powerlinkuser EPLU 0 "$epl/Examples/X86/Generic/powerlink_user_lib/EplCfg.h"
pwre_config_check_include rsvg RSVG 1 "/usr/include/librsvg-2/librsvg/rsvg.h:/usr/include/librsvg-2.0/librsvg/rsvg.h"
pwre_config_check_include pydev PYDEV 0 "/usr/include/python2.7/pymath.h"
pwre_config_check_tool android ANDROID "/usr/local/android-sdk-linux/tools/android"
......
......@@ -6,6 +6,27 @@ import os
pwr_lib = os.environ['pwr_elib']
pwr_obj = os.environ['pwr_eobj']
pwr_inc = os.environ['pwr_einc']
try:
pwre_conf_qt = os.environ['PWRE_CONF_QT']
except:
pwre_conf_qt = ""
if pwre_conf_qt == "":
libs = ['pwr_wb_gtk', 'pwr_xtt_gtk', 'pwr_ge_gtk', 'pwr_cow_gtk',
'pwr_flow_gtk', 'pwr_glow_gtk',
'pwr_wb', 'pwr_xtt', 'pwr_ge', 'pwr_cow', 'pwr_flow', 'pwr_glow',
'pwr_wb_gtk', 'pwr_xtt_gtk', 'pwr_ge_gtk', 'pwr_cow_gtk', 'pwr_flow_gtk', 'pwr_glow_gtk',
'pwr_wb', 'pwr_xtt', 'pwr_ge', 'pwr_cow',
'pwr_flow', 'pwr_glow',
'pwr_rt', 'pwr_statussrv', 'pwr_co', 'pwr_msg_dummy']
else:
libs = ['pwr_wb_qt', 'pwr_xtt_qt', 'pwr_ge_qt', 'pwr_cow_qt',
'pwr_flow_qt', 'pwr_glow_qt',
'pwr_wb', 'pwr_xtt', 'pwr_ge', 'pwr_cow', 'pwr_flow', 'pwr_glow',
'pwr_wb_qt', 'pwr_xtt_qt', 'pwr_ge_qt', 'pwr_cow_qt', 'pwr_flow_qt', 'pwr_glow_qt',
'pwr_wb', 'pwr_xtt', 'pwr_ge', 'pwr_cow',
'pwr_flow', 'pwr_glow',
'pwr_rt', 'pwr_statussrv', 'pwr_co', 'pwr_msg_dummy']
pwrwbmodule = Extension( name='pwrwb',
sources=['pwrwbmodule.cpp'],
......@@ -21,17 +42,11 @@ pwrwbmodule = Extension( name='pwrwb',
pwr_obj + '/stdsoap2.o'],
include_dirs=[pwr_inc],
library_dirs=[pwr_lib],
libraries=['pwr_wb_gtk', 'pwr_xtt_gtk', 'pwr_ge_gtk', 'pwr_cow_gtk',
'pwr_flow_gtk', 'pwr_glow_gtk',
'pwr_wb', 'pwr_xtt', 'pwr_ge', 'pwr_cow', 'pwr_flow', 'pwr_glow',
'pwr_wb_gtk', 'pwr_wb', 'pwr_xtt_gtk', 'pwr_ge_gtk', 'pwr_cow_gtk',
'pwr_flow_gtk', 'pwr_glow_gtk', 'pwr_xtt', 'pwr_ge', 'pwr_cow',
'pwr_flow', 'pwr_glow',
'pwr_rt', 'pwr_statussrv', 'pwr_co',
'pwr_msg_dummy', 'db_cxx', 'rpcsvc', 'asound', 'pthread',
'm', 'db', 'z', 'crypt', 'rt', 'fl', 'X11', 'mysqlclient',
'sqlite3', 'rsvg-2','gtk-x11-2.0'],
# extra_link_args=['-L/usr/lib/x86_64-linux-gnu', commands.getoutput('pkg-config --libs gtk+-2.0')],
libraries=libs +
['db_cxx', 'rpcsvc', 'asound', 'pthread',
'm', 'db', 'z', 'crypt', 'rt', 'fl', 'X11', 'mysqlclient',
'sqlite3', 'rsvg-2','gtk-x11-2.0'],
# extra_link_args=['-L/usr/lib/x86_64-linux-gnu', commands.getoutput('pkg-config --libs gtk+-2.0')],
language='c++'
)
......
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