trunk/scripts/src/osd/modules.lua
| r245711 | r245712 | |
| 1 | function string.starts(String,Start) |
| 2 | return string.sub(String,1,string.len(Start))==Start |
| 3 | end |
| 4 | |
| 5 | function addlibfromstring(str) |
| 6 | if (str==nil) then return end |
| 7 | for w in str:gmatch("%S+") do |
| 8 | if string.starts(w,"-l")==true then |
| 9 | links { |
| 10 | string.sub(w,3) |
| 11 | } |
| 12 | end |
| 13 | end |
| 14 | end |
| 15 | |
| 16 | function addoptionsfromstring(str) |
| 17 | if (str==nil) then return end |
| 18 | for w in str:gmatch("%S+") do |
| 19 | if string.starts(w,"-l")==false then |
| 20 | linkoptions { |
| 21 | w |
| 22 | } |
| 23 | end |
| 24 | end |
| 25 | end |
| 26 | |
| 1 | 27 | function osdmodulesbuild() |
| 2 | 28 | |
| 3 | 29 | removeflags { |
| r245711 | r245712 | |
| 191 | 217 | |
| 192 | 218 | if _OPTIONS["NO_USE_MIDI"]~="1" then |
| 193 | 219 | if _OPTIONS["targetos"]=="linux" then |
| 194 | | linkoptions { |
| 195 | | backtick("pkg-config --libs alsa"), |
| 196 | | } |
| 220 | local str = backtick("pkg-config --libs alsa") |
| 221 | addlibfromstring(str) |
| 222 | addoptionsfromstring(str) |
| 197 | 223 | elseif _OPTIONS["targetos"]=="macosx" then |
| 198 | 224 | links { |
| 199 | 225 | "CoreMIDI.framework", |
| r245711 | r245712 | |
| 223 | 249 | if _OPTIONS["QT_HOME"]~=nil then |
| 224 | 250 | linkoptions { |
| 225 | 251 | "-L" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_LIBS"), |
| 226 | | "-lQtGui", |
| 227 | | "-lQtCore", |
| 228 | 252 | } |
| 253 | links { |
| 254 | "QtGui", |
| 255 | "QtCore", |
| 256 | } |
| 229 | 257 | else |
| 230 | | linkoptions { |
| 231 | | backtick("pkg-config --libs QtGui"), |
| 232 | | } |
| 258 | local str = backtick("pkg-config --libs QtGui") |
| 259 | addlibfromstring(str) |
| 260 | addoptionsfromstring(str) |
| 233 | 261 | end |
| 234 | 262 | end |
| 235 | 263 | end |
trunk/scripts/src/osd/sdl.lua
| r245711 | r245712 | |
| 37 | 37 | "SDL_ttf", |
| 38 | 38 | } |
| 39 | 39 | end |
| 40 | | linkoptions { |
| 41 | | backtick("pkg-config --libs fontconfig"), |
| 42 | | } |
| 40 | local str = backtick("pkg-config --libs fontconfig") |
| 41 | addlibfromstring(str) |
| 42 | addoptionsfromstring(str) |
| 43 | 43 | end |
| 44 | 44 | |
| 45 | 45 | if _OPTIONS["targetos"]=="windows" then |
| r245711 | r245712 | |
| 239 | 239 | } |
| 240 | 240 | end |
| 241 | 241 | else |
| 242 | | linkoptions { |
| 243 | | backtick(sdlconfigcmd() .. " --libs | sed 's/-lSDLmain//'"), |
| 244 | | } |
| 242 | local str = backtick(sdlconfigcmd() .. " --libs | sed 's/-lSDLmain//'") |
| 243 | addlibfromstring(str) |
| 244 | addoptionsfromstring(str) |
| 245 | 245 | end |
| 246 | 246 | else |
| 247 | 247 | if _OPTIONS["NO_X11"]=="1" then |
| r245711 | r245712 | |
| 259 | 259 | } |
| 260 | 260 | end |
| 261 | 261 | end |
| 262 | | linkoptions { |
| 263 | | backtick(sdlconfigcmd() .. " --libs"), |
| 264 | | } |
| 262 | local str = backtick(sdlconfigcmd() .. " --libs") |
| 263 | addlibfromstring(str) |
| 264 | addoptionsfromstring(str) |
| 265 | 265 | if _OPTIONS["targetos"]~="haiku" then |
| 266 | 266 | links { |
| 267 | 267 | "m", |
| r245711 | r245712 | |
| 280 | 280 | end |
| 281 | 281 | end |
| 282 | 282 | elseif BASE_TARGETOS=="os2" then |
| 283 | | linkoptions { |
| 284 | | backtick(sdlconfigcmd() .. " --libs"), |
| 285 | | } |
| 283 | local str = backtick(sdlconfigcmd() .. " --libs") |
| 284 | addlibfromstring(str) |
| 285 | addoptionsfromstring(str) |
| 286 | 286 | links { |
| 287 | 287 | "pthread" |
| 288 | 288 | } |