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

pwre build of both qt and gtk

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