~ubuntu-branches/ubuntu/trusty/psychtoolbox-3/trusty-proposed

« back to all changes in this revision

Viewing changes to .pc/deb_use_system_GLEW/PsychSourceGL/Source/linuxmakeitoctave3_ubuntugutsy.m

  • Committer: Package Import Robot
  • Author(s): Yaroslav Halchenko
  • Date: 2013-11-19 23:34:50 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20131119233450-f7nf92vb8qavjmk8
Tags: 3.0.11.20131017.dfsg1-3
Upload to unsable since fresh glew has arrived to sid!

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
function linuxmakeitoctave3_ubuntugutsy(mode)
2
 
% This is the GNU/Linux version of makeit to build the Linux
3
 
% version of PTB's binary plugins for GNU/Octave V3.2.0 and later.
4
 
% This version is adapted to build on the "funky" Laptop under Ubuntu Linux
5
 
% 10.10 Maverick or any Linux system with similar configuration.
6
 
%
7
 
% CAUTION: You *MUST* make sure that the MEX files are compiled *without*
8
 
% compiler optimization, ie., with a level of -O0 !!! Otherwise the files
9
 
% will be *miscompiled* !!! At first glance they seem to work, but the will
10
 
% malfunction and mysteriously crash in many ways, almost impossible to debug!!
11
 
%
12
 
% UPDATE: This seems to be no longer true for Octave 3.2.4 built on 10.10.
13
 
%         Our compiler settings are -O2 on this system and so far no bugs
14
 
%         or miscompiles were found during daily use and testing.
15
 
%
16
 
%         However, as -O2 never showed a significant speedup vs. -O0, it
17
 
%         pretty much doesn't matter if we do optimized builds or not.
18
 
 
19
 
if nargin < 1
20
 
    mode = 0;
21
 
end;
22
 
 
23
 
fprintf('Building plugin type %i ...\n\n', mode);
24
 
 
25
 
% Target folder depends if this is a 64 bit or 32 bit runtime:
26
 
if ~isempty(findstr(computer, '_64'))
27
 
    target = 'PsychBasic/Octave3LinuxFiles64/';
28
 
else
29
 
    target = 'PsychBasic/Octave3LinuxFiles/';
30
 
end
31
 
 
32
 
if mode==0
33
 
    % Build Screen.mex:
34
 
    mex -v -g --output ../Projects/Linux/build/Screen.mex -DPTBMODULE_Screen -DPTB_USE_GSTREAMER -DPTBVIDEOCAPTURE_LIBDC -DPTBOCTAVE3MEX -I/usr/X11R6/include -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -ICommon/Base -ICommon/Screen -ILinux/Base -ILinux/Screen -L/usr/X11R6/lib  Common/Base/*.cc Linux/Base/*.c Linux/Screen/*.c Common/Screen/*.c Common/Base/*.c -lc -lrt -lGL -lGLU -lX11 -lXext -lgstreamer-0.10 -lgstbase-0.10 -lgstapp-0.10 -lgstinterfaces-0.10 -lgobject-2.0 -lgmodule-2.0 -lxml2 -lgthread-2.0 -lglib-2.0 -lXxf86vm -ldc1394 -lusb-1.0 -lpciaccess -lXi -lXrandr
35
 
    unix(['mv ../Projects/Linux/build/Screen.mex ' PsychtoolboxRoot target]);
36
 
    striplibsfrommexfile([PsychtoolboxRoot target 'Screen.mex']);
37
 
end;
38
 
 
39
 
if mode==1
40
 
    % Build GetSecs.mex:
41
 
    mex -v -g --output ../Projects/Linux/build/GetSecs.mex -DPTBMODULE_GetSecs -DPTBOCTAVE3MEX -ICommon/Base -ILinux/Base -ICommon/GetSecs -ICommon/Screen Common/Base/*.cc Linux/Base/*.c Common/Base/*.c Common/GetSecs/*.c -lc -lrt 
42
 
    unix(['mv ../Projects/Linux/build/GetSecs.mex ' PsychtoolboxRoot target]);
43
 
    striplibsfrommexfile([PsychtoolboxRoot target 'GetSecs.mex']);
44
 
end;
45
 
 
46
 
if mode==2
47
 
    % Build WaitSecs.mex:
48
 
    mex -v -g --output ../Projects/Linux/build/WaitSecs.mex -DPTBMODULE_WaitSecs -DPTBOCTAVE3MEX -ICommon/Base -ILinux/Base -ICommon/WaitSecs -ICommon/Screen Common/Base/*.cc Linux/Base/*.c Common/Base/*.c Common/WaitSecs/*.c -lc -lrt 
49
 
    unix(['mv ../Projects/Linux/build/WaitSecs.mex ' PsychtoolboxRoot target]);
50
 
    striplibsfrommexfile([PsychtoolboxRoot target 'WaitSecs.mex']);
51
 
end;
52
 
 
53
 
if mode==3
54
 
    % Build PsychPortAudio.mex:
55
 
    mex -v -g --output ../Projects/Linux/build/PsychPortAudio.mex -DPTBMODULE_PsychPortAudio -DPTBOCTAVE3MEX -ICommon/Base -ILinux/Base -ICommon/PsychPortAudio -ICommon/Screen Common/Base/*.cc Linux/Base/*.c Common/Base/*.c Common/PsychPortAudio/*.c /usr/local/lib/libportaudio.a -lc -lrt -lasound
56
 
    unix(['mv ../Projects/Linux/build/PsychPortAudio.mex ' PsychtoolboxRoot target]);
57
 
    striplibsfrommexfile([PsychtoolboxRoot target 'PsychPortAudio.mex']);
58
 
end
59
 
 
60
 
if mode==4
61
 
    % Build Eyelink.mex:
62
 
    mex -v -g --output ../Projects/Linux/build/Eyelink.mex -DPTBMODULE_Eyelink -DPTBOCTAVE3MEX -ICommon/Base -ILinux/Base -ICommon/Eyelink -ICommon/Screen Common/Base/*.cc Linux/Base/*.c Common/Base/*.c Common/Eyelink/*.c -leyelink_core -lc -lrt
63
 
    unix(['mv ../Projects/Linux/build/Eyelink.mex ' PsychtoolboxRoot target]);
64
 
    striplibsfrommexfile([PsychtoolboxRoot target 'Eyelink.mex']);
65
 
end
66
 
 
67
 
if mode==5
68
 
    % Build IOPort.mex:
69
 
    mex -v -g --output ../Projects/Linux/build/IOPort.mex -DPTBMODULE_IOPort -DPTBOCTAVE3MEX -ICommon/Base -ILinux/Base -ICommon/IOPort -ICommon/Screen Common/Base/*.cc Linux/Base/*.c Common/Base/*.c Common/IOPort/*.c -lc -lrt
70
 
    unix(['mv ../Projects/Linux/build/IOPort.mex ' PsychtoolboxRoot target]);
71
 
    striplibsfrommexfile([PsychtoolboxRoot target 'IOPort.mex']);
72
 
end
73
 
 
74
 
if mode==6
75
 
    % Build moglcore.mex:
76
 
    curdir = pwd;
77
 
    cd('../../Psychtoolbox/PsychOpenGL/MOGL/source/')
78
 
    try
79
 
       mex -v -g --output moglcore.mex -DLINUX -DGLEW_STATIC -DPTBOCTAVE3MEX -I/usr/X11R6/include -L/usr/X11R6/lib -lc -lGL -lGLU -lglut moglcore.c gl_auto.c gl_manual.c glew.c mogl_rebinder.c
80
 
    catch
81
 
    end
82
 
    unix(['mv moglcore.mex ' PsychtoolboxRoot target]);
83
 
    cd(curdir);
84
 
    striplibsfrommexfile([PsychtoolboxRoot target 'moglcore.mex']);
85
 
end;
86
 
 
87
 
if mode==7
88
 
    % Build PsychKinectCore.mex:
89
 
    mex -v -g --output ../Projects/Linux/build/PsychKinectCore.mex -DPTBMODULE_PsychKinectCore -DPTBOCTAVE3MEX -I/usr/include/libusb-1.0 -I/usr/include/libfreenect -ICommon/Base -ILinux/Base -ICommon/PsychKinect -ICommon/Screen Common/Base/*.cc Linux/Base/*.c Common/Base/*.c Common/PsychKinect/*.c -lc -lrt -lfreenect -lusb-1.0
90
 
    unix(['mv ../Projects/Linux/build/PsychKinectCore.mex ' PsychtoolboxRoot target]);
91
 
    striplibsfrommexfile([PsychtoolboxRoot target 'PsychKinectCore.mex']);
92
 
end;
93
 
 
94
 
if mode==8
95
 
    % Build PsychHID.mex:
96
 
    mex -v -g --output ../Projects/Linux/build/PsychHID.mex -DPTBMODULE_PsychHID -DPTBOCTAVE3MEX -I/usr/include/libusb-1.0 -ICommon/Base -ILinux/Base -ICommon/PsychHID -ILinux/PsychHID -ICommon/Screen Common/Base/*.cc Linux/Base/*.c Common/Base/*.c Common/PsychHID/*.c Linux/PsychHID/*.c -lc -lrt -lusb-1.0 -lX11 -lXi
97
 
    unix(['mv ../Projects/Linux/build/PsychHID.mex ' PsychtoolboxRoot target]);
98
 
    striplibsfrommexfile([PsychtoolboxRoot target 'PsychHID.mex']);
99
 
end;
100
 
 
101
 
if mode==9
102
 
    % Build moalcore.mex:
103
 
    curdir = pwd;
104
 
    cd('../../Psychtoolbox/PsychSound/MOAL/source/')
105
 
    try
106
 
       mex -v -g --output moalcore.mex -DLINUX -DPTBOCTAVE3MEX -lc -lopenal moalcore.c al_auto.c al_manual.c alm.c 
107
 
    catch
108
 
    end
109
 
    unix(['mv moalcore.mex ' PsychtoolboxRoot target]);
110
 
    cd(curdir);
111
 
    striplibsfrommexfile([PsychtoolboxRoot target 'moalcore.mex']);
112
 
end;
113
 
 
114
 
return;