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

« back to all changes in this revision

Viewing changes to PsychSourceGL/Source/linuxmakeit32.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 linuxmakeit32(mode)
 
2
% This is the GNU/Linux version of makeit to build the Linux
 
3
% mex files for 32-Bit Matlab on Linux.
 
4
 
 
5
if ~IsLinux || Is64Bit || IsOctave
 
6
    error('This script is for 32-Bit Linux on Matlab only!');
 
7
end
 
8
 
 
9
if nargin < 1
 
10
    mode = 0
 
11
end;
 
12
 
 
13
fprintf('Building plugin type %i ...\n\n', mode);
 
14
 
 
15
if mode==0
 
16
    % Build Screen.mexglx:
 
17
    mex CFLAGS='$CFLAGS -fPIC -std=gnu99 -fexceptions' -v -outdir ../Projects/Linux/build/ -output Screen -DPTBMODULE_Screen -DPTB_USE_GSTREAMER -DPTBVIDEOCAPTURE_LIBDC -D_GNU_SOURCE -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/lib/i386-linux-gnu/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 -ldl -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 -lXfixes
 
18
    unix(['mv ../Projects/Linux/build/Screen.' mexext ' ' PsychtoolboxRoot 'PsychBasic/']);
 
19
end;
 
20
 
 
21
if mode==1
 
22
    % Build GetSecs.mexglx:
 
23
    mex CFLAGS='$CFLAGS -fPIC -std=gnu99 -fexceptions' -v -outdir ../Projects/Linux/build/ -output GetSecs -DPTBMODULE_GetSecs -ICommon/Base -ILinux/Base -ICommon/GetSecs -ICommon/Screen "Common/Base/*.cc" "Linux/Base/*.c" "Common/Base/*.c" "Common/GetSecs/*.c" -lc -lrt 
 
24
    unix(['mv ../Projects/Linux/build/GetSecs.' mexext ' ' PsychtoolboxRoot 'PsychBasic/']);
 
25
end;
 
26
 
 
27
if mode==2
 
28
    % Build WaitSecs.mexglx:
 
29
    mex CFLAGS='$CFLAGS -fPIC -std=gnu99 -fexceptions' -v -outdir ../Projects/Linux/build/ -output WaitSecs -DPTBMODULE_WaitSecs -ICommon/Base -ILinux/Base -ICommon/WaitSecs -ICommon/Screen "Common/Base/*.cc" "Linux/Base/*.c" "Common/Base/*.c" "Common/WaitSecs/*.c" -lc -lrt 
 
30
    unix(['mv ../Projects/Linux/build/WaitSecs.' mexext ' ' PsychtoolboxRoot 'PsychBasic/']);
 
31
end;
 
32
 
 
33
if mode==3
 
34
    % Build PsychPortAudio.mexglx:
 
35
    mex CFLAGS='$CFLAGS -fPIC -std=gnu99 -fexceptions' -v -outdir ../Projects/Linux/build/ -output PsychPortAudio -DPTBMODULE_PsychPortAudio -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
 
36
    unix(['mv ../Projects/Linux/build/PsychPortAudio.' mexext ' ' PsychtoolboxRoot 'PsychBasic/']);
 
37
end
 
38
 
 
39
if mode==4
 
40
    % Build Eyelink.mexglx:
 
41
    mex CFLAGS='$CFLAGS -fPIC -std=gnu99 -fexceptions' -v -outdir ../Projects/Linux/build/ -output Eyelink -DPTBMODULE_Eyelink -ICommon/Base -ILinux/Base -ICommon/Eyelink -ICommon/Screen "Common/Base/*.cc" "Linux/Base/*.c" "Common/Base/*.c" "Common/Eyelink/*.c" -leyelink_core -lc -lrt
 
42
    unix(['mv ../Projects/Linux/build/Eyelink.' mexext ' ' PsychtoolboxRoot 'PsychBasic/']);
 
43
end
 
44
 
 
45
if mode==5
 
46
    % Build IOPort.mexglx:
 
47
    mex CFLAGS='$CFLAGS -fPIC -std=gnu99 -fexceptions' -v -outdir ../Projects/Linux/build/ -output IOPort -DPTBMODULE_IOPort -ICommon/Base -ILinux/Base -ICommon/IOPort -ICommon/Screen "Common/Base/*.cc" "Linux/Base/*.c" "Common/Base/*.c" "Common/IOPort/*.c" -lc -lrt
 
48
    unix(['mv ../Projects/Linux/build/IOPort.' mexext ' ' PsychtoolboxRoot 'PsychBasic/']);
 
49
end
 
50
 
 
51
if mode==6
 
52
    % Build moglcore.mexglx:
 
53
    curdir = pwd;
 
54
    cd('../../Psychtoolbox/PsychOpenGL/MOGL/source/')
 
55
    try
 
56
    mex CFLAGS='$CFLAGS -fPIC -fexceptions' -v -outdir ./ -output moglcore -DLINUX -DGLEW_STATIC -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 ftglesGlue.c
 
57
    catch
 
58
    end
 
59
    unix(['mv moglcore.' mexext ' ' PsychtoolboxRoot 'PsychBasic/']);
 
60
    cd(curdir);
 
61
end
 
62
 
 
63
if mode==7
 
64
    % Build PsychKinectCore.mexglx:
 
65
    mex CFLAGS='$CFLAGS -fPIC -std=gnu99 -fexceptions' -v -outdir ../Projects/Linux/build/ -output PsychKinectCore -DPTBMODULE_PsychKinectCore -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
 
66
    unix(['mv ../Projects/Linux/build/PsychKinectCore.' mexext ' ' PsychtoolboxRoot 'PsychBasic/']);
 
67
end;
 
68
 
 
69
if mode==8
 
70
    % Build PsychHID.mexglx:
 
71
    mex CFLAGS='$CFLAGS -fPIC -std=gnu99 -fexceptions' -v -outdir ../Projects/Linux/build/ -output PsychHID -DPTBMODULE_PsychHID -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 -ldl -lrt -lusb-1.0 -lX11 -lXi -lutil
 
72
    unix(['mv ../Projects/Linux/build/PsychHID.' mexext ' ' PsychtoolboxRoot 'PsychBasic/']);
 
73
end;
 
74
 
 
75
if mode==9
 
76
    % Build moalcore.mexglx:
 
77
    curdir = pwd;
 
78
    cd('../../Psychtoolbox/PsychSound/MOAL/source/')
 
79
    try
 
80
       mex CFLAGS='$CFLAGS -fPIC -fexceptions' -v -outdir ../Projects/Linux/build/ -output moalcore -DLINUX -lc -lopenal moalcore.c al_auto.c al_manual.c alm.c 
 
81
    catch
 
82
    end
 
83
    unix(['mv ../Projects/Linux/build/moalcore.' mexext ' ' PsychtoolboxRoot 'PsychBasic/']);
 
84
 
 
85
    cd(curdir);
 
86
end;
 
87
 
 
88
return;