加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
configure.ac 149.02 KB
一键复制 编辑 原始数据 按行查看 历史
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982
dnl Autoconf settings for vlc
AC_COPYRIGHT([Copyright 1999-2024 VLC authors and VideoLAN])
AC_INIT([vlc], [4.0.0-dev])
VERSION_MAJOR=4
VERSION_MINOR=0
VERSION_REVISION=0
VERSION_EXTRA=0
VERSION_DEV=dev
# libvlc .so version values
LIBVLC_ABI_MAJOR=12
LIBVLC_ABI_MINOR=0
LIBVLC_ABI_MICRO=0
PKGDIR="vlc"
AC_SUBST([PKGDIR])
CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
CODENAME="Otto Chriek"
COPYRIGHT_YEARS="1996-2024"
AC_CONFIG_SRCDIR([src/libvlc.c])
AC_CONFIG_AUX_DIR([autotools])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_LIBOBJ_DIR([compat])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_PRESERVE_HELP_ORDER
AM_INIT_AUTOMAKE([tar-ustar color-tests foreign])
AC_CONFIG_HEADERS([config.h])
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE([enable])
dnl
dnl Check for tools
dnl
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
VLC_PROG_CC_C17
AH_VERBATIM([FORTIFY_SOURCE],
[/* Enable compile-time and run-time bounds-checking, and some warnings,
without upsetting glibc 2.15+ or toolchains predefining _FORTIFY_SOURCE */
#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
# define _FORTIFY_SOURCE 2
#endif])
AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
AC_DEFINE([LIBVLC_INTERNAL_],, [Define within the LibVLC source code tree.])
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_OBJC
AC_PROG_EGREP
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AM_PROG_AS
AC_PROG_LEX([noyywrap])
AC_PROG_YACC
AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
AC_CHECK_PROGS([DESKTOP_FILE_VALIDATE], [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
AC_ARG_VAR([BUILDCC], [Build system C11 or C99 compiler command])
AC_CHECK_PROGS([BUILDCC], [c17-gcc c17 c11-gcc c11 c99-gcc c99], [false])
AS_IF([test "$BUILDCC" = "false"], [
AC_MSG_ERROR([Cannot find native C99 compiler: please define BUILDCC.])
])
dnl Check for compiler properties
AC_C_CONST
AC_C_INLINE
AC_C_RESTRICT
AC_LANG_PUSH([C++])
AX_CXX_COMPILE_STDCXX_17([noext], [mandatory])
AX_CXX_TYPEOF
AC_LANG_POP([C++])
dnl Extend the --help string at the current spot.
AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
dnl Allow binary package maintainer to pass a custom string to avoid
dnl cache problem
AC_ARG_WITH([binary-version],
AS_HELP_STRING([--with-binary-version=STRING],
[To avoid plugins cache problem between binary version]),[],[])
AS_IF([test -n "${with_binary_version}"],[
AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
[Binary specific version])
])
dnl Prevent clang from accepting unknown flags with a mere warning
AX_CHECK_COMPILE_FLAG([-Werror=invalid-command-line-argument], [
AX_APPEND_FLAG([-Werror=invalid-command-line-argument], [CFLAGS])
AX_APPEND_FLAG([-Werror=invalid-command-line-argument], [CXXFLAGS])
AX_APPEND_FLAG([-Werror=invalid-command-line-argument], [OBJCFLAGS])
])
AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option], [
AX_APPEND_FLAG([-Werror=unknown-warning-option], [CFLAGS])
AX_APPEND_FLAG([-Werror=unknown-warning-option], [CXXFLAGS])
AX_APPEND_FLAG([-Werror=unknown-warning-option], [OBJCFLAGS])
])
dnl
dnl Check the operating system
dnl
HAVE_WIN64="0"
HAVE_IOS="0"
HAVE_OSX="0"
HAVE_TVOS="0"
HAVE_IOS_OR_TVOS="0"
HAVE_XROS="0"
HAVE_WATCHOS="0"
dnl Set x86 asm flags and defines
X86ASMFLAGS=""
case "${host_cpu}" in
i?86)
X86ASMFLAGS="-f elf32"
X86ASMDEFS="-DARCH_X86_32=1 -DARCH_X86_64=0"
;;
x86_64)
X86ASMFLAGS="-f elf64"
X86ASMDEFS="-DARCH_X86_32=0 -DARCH_X86_64=1"
;;
esac
case "${host_os}" in
"")
SYS=unknown
;;
linux*)
SYS=linux
CFLAGS="${CFLAGS} -pthread"
CXXFLAGS="${CXXFLAGS} -pthread"
;;
bsdi*)
SYS=bsdi
CFLAGS="${CFLAGS} -pthread"
CXXFLAGS="${CXXFLAGS} -pthread"
;;
freebsd*)
SYS=freebsd
CFLAGS="${CFLAGS} -pthread"
CXXFLAGS="${CXXFLAGS} -pthread"
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
LDFLAGS="${LDFLAGS} -L/usr/local/lib"
ac_cv_ld_z_defs=no
;;
openbsd*)
SYS=openbsd
CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
;;
netbsd*)
SYS=netbsd
;;
dragonfly*)
SYS=dragonfly
;;
darwin*)
SYS=darwin
ac_cv_func_aligned_alloc=no
dnl Work around an Xcode 11 bug, fixed in Xcode 11.3.1
AX_APPEND_FLAG([-fno-stack-check], [CFLAGS])
AX_APPEND_FLAG([-fno-stack-check], [CXXFLAGS])
AX_APPEND_FLAG([-fno-stack-check], [OBJCFLAGS])
case "${host_cpu}" in
i?86)
X86ASMFLAGS="-f macho32"
AX_APPEND_FLAG([-DPREFIX], [X86ASMDEFS])
;;
x86_64)
X86ASMFLAGS="-f macho64"
AX_APPEND_FLAG([-DPREFIX], [X86ASMDEFS])
;;
arm*)
ac_cv_c_bigendian="no"
ac_cv_c_attribute_packed="no"
;;
esac
AX_APPEND_FLAG([-D_INTL_REDIRECT_MACROS], [CPPFLAGS])
AX_APPEND_FLAG([-stdlib=libc++], [CXXFLAGS])
AX_APPEND_FLAG([-Werror=partial-availability], [OBJCFLAGS])
AX_APPEND_FLAG([-Wl,-headerpad_max_install_names], [LDFLAGS])
VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation])
dnl This is not supported when bitcode is enabled. In that case, we need
dnl to disable the static bank loader.
AC_MSG_CHECKING([if -Wl,-U is allowed])
VLC_SAVE_FLAGS
AX_APPEND_FLAG([-Wl,-U,_my_array],[LDFLAGS])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[
__attribute__((visibility("default"))) extern int my_array[];
int foo() { return my_array[0]; }
]],[[return foo();]])],
[
VLC_ADD_LDFLAGS([libvlccore],[-Wl,-U,_vlc_static_modules])
VLC_ADD_LDFLAGS([libvlc vlc],[-Wl,-undefined,dynamic_lookup])
VLC_ADD_CPPFLAGS([libvlccore],[-DHAVE_DYLIB_DYNAMIC_LOOKUP=1])
AC_MSG_RESULT([yes])
],[AC_MSG_RESULT([no])])
VLC_RESTORE_FLAGS
AC_EGREP_CPP(yes,
[#import <TargetConditionals.h>
#if TARGET_OS_IPHONE
yes
#endif],
[HAVE_IOS="1"
HAVE_IOS_OR_TVOS="1"
ac_cv_func_wordexp=no],
[HAVE_OSX="1"])
AC_EGREP_CPP(yes,
[#import <TargetConditionals.h>
#if TARGET_OS_TV
yes
#endif],
[HAVE_TVOS="1"
HAVE_IOS_OR_TVOS="1"
HAVE_IOS="0"
HAVE_OSX="0"
HAVE_XROS="0"
ac_cv_func_fork=no
],)
AC_EGREP_CPP(yes,
[#import <TargetConditionals.h>
#if TARGET_OS_VISION
yes
#endif],
[HAVE_XROS="1"
HAVE_IOS="0"
HAVE_OSX="0"
HAVE_TVOS="0"
HAVE_IOS_OR_TVOS="0"
ac_cv_func_fork=no
],)
AC_EGREP_CPP(yes,
[#import <TargetConditionals.h>
#if TARGET_OS_WATCH
yes
#endif],
[HAVE_WATCHOS="1"
HAVE_IOS="0"
HAVE_OSX="0"
HAVE_TVOS="0"
HAVE_IOS_OR_TVOS="0"
ac_cv_func_fork=no
],)
AS_IF([test "${HAVE_OSX}" = "1"],[VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreServices])])
dnl
dnl Handle Mac OS X SDK flags
dnl
AC_ARG_WITH(macosx-sdk,
AS_HELP_STRING([--with-macosx-sdk=DIR],
[compile using the SDK in DIR]))
if test "${with_macosx_sdk}" != "" ; then
test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
CPP="${CPP} -isysroot ${with_macosx_sdk}"
CC="${CC} -isysroot ${with_macosx_sdk}"
CXX="${CXX} -isysroot ${with_macosx_sdk}"
OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
LD="${LD} -syslibroot ${with_macosx_sdk}"
fi
AC_ARG_WITH(macosx-version-min,
AS_HELP_STRING([--with-macosx-version-min=VERSION],
[compile for Mac OS X VERSION and above]))
if test "${with_macosx_version_min}" != "" ; then
CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
fi
;;
*mingw32* | *cygwin* | *wince* | *mingwce*)
dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
AC_LANG_PUSH(C++)
AX_APPEND_COMPILE_FLAGS([-static-libgcc], [CXXFLAGS], [-Werror])
AC_LANG_POP(C++)
AC_CHECK_TOOL(WINDRES, windres, :)
AC_CHECK_TOOL(OBJCOPY, objcopy, :)
AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
[[#ifdef _WIN32_WINNT
# error _WIN32_WINNT already defined
#else
# include <sdkddkver.h>
# if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0601
# error _WIN32_WINNT toolchain default high enough
# endif
#endif
]],[[;]])
],[
AC_DEFINE([_WIN32_WINNT], [0x0601], [Define to '0x0601' for Windows 7 APIs.])
])
AC_MSG_CHECKING([if libsynchronization is needed])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
[[#if _WIN32_WINNT >= 0x0602
# error building for Win8+ and above
#endif
]],[[;]])
],[
AC_MSG_RESULT([no])
],[
AC_MSG_RESULT([yes])
VLC_ADD_LIBS([libvlccore], [-lsynchronization])
])
AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
AC_ARG_WITH(packagedir,
AS_HELP_STRING([--with-packagedir=DIR],
[output the packaged VLC files in DIR (default vlc-$PACKAGE_VERSION)]))
AS_IF([test "${with_packagedir}" != ""], [
AS_IF([test -d "${with_packagedir}"], [
PACKAGE_DIR=`cd "${with_packagedir}" && pwd -P`
],[
dnl this should be an absolute path
PACKAGE_DIR="${with_packagedir}"
])
], [
PACKAGE_DIR=`pwd -P`"/vlc-${PACKAGE_VERSION}"
])
AC_SUBST([PACKAGE_DIR])
case "${host_os}" in
*mingw32*)
SYS=mingw32
;;
*cygwin*)
dnl Check if we are using the mno-cygwin mode in which case we are
dnl actually dealing with a mingw32 compiler.
AC_EGREP_CPP(yes,
[#ifdef _WIN32
yes
#endif],
SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
;;
esac
if test "${SYS}" = "mingw32"; then
# DEP, ASLR, NO SEH
LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
ac_default_prefix="`pwd`/_win32"
DESTDIR="`pwd`/_win32/"
dnl
dnl NSIS/MSI Installer prefix and WIN64
dnl
case "${host_cpu}" in
aarch64)
HAVE_WIN64="1"
WINDOWS_ARCH="arm64"
PROGRAMFILES="PROGRAMFILES64"
LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
;;
amd64|x86_64)
HAVE_WIN64="1"
WINDOWS_ARCH="x64"
PROGRAMFILES="PROGRAMFILES64"
LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
X86ASMFLAGS="-f win64"
;;
armv7)
WINDOWS_ARCH="arm"
PROGRAMFILES="PROGRAMFILES"
;;
*)
WINDOWS_ARCH="x86"
PROGRAMFILES="PROGRAMFILES"
X86ASMFLAGS="-f win32"
X86ASMDEFS="${X86ASMDEFS} -DPREFIX"
;;
esac
AC_SUBST([WINDOWS_ARCH])
AC_SUBST([PROGRAMFILES])
fi
;;
*nto*)
SYS=nto
;;
solaris*)
SYS=solaris
;;
hpux*)
SYS=hpux
;;
*os2*)
SYS=os2
LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
AC_LIBOBJ([freeaddrinfo])
AC_LIBOBJ([gai_strerror])
AC_CHECK_FUNCS([if_nametoindex])
X86ASMFLAGS="-f aout"
X86ASMDEFS="-DARCH_X86_32=1 -DARCH_X86_64=0 -DPREFIX"
;;
*emscripten*)
SYS=emscripten
# tdestroy() is a GNU extension
CFLAGS="${CFLAGS} -pthread -D_GNU_SOURCE"
CXXFLAGS="${CXXFLAGS} -pthread"
ac_cv_func_if_nameindex=yes
ac_cv_header_sys_shm_h=no
;;
*)
SYS="${host_os}"
;;
esac
ANDROID_API=17
dnl Vendor-specific configuration
case "${host_os}" in
linux-android*)
VENDOR=android
AC_MSG_CHECKING([Check Android API version])
ANDROID_API="`echo ${host_os} | tr -c -d '[[:digit:]]'`"
AC_MSG_RESULT([${ANDROID_API}])
dnl GLESv2 and EGL are provided by android NDK without .pc files
GLES2_LIBS="-lGLESv2"
GLES2_CFLAGS=" "
EGL_LIBS="-lEGL"
EGL_CFLAGS=" "
AS_IF([test -n "$ANDROID_API" -a "$ANDROID_API" -lt "26"],[
ac_cv_header_sys_shm_h=no
])
dnl Those functions and headers are not functional on android, use vlc_fixups instead
ac_cv_header_search_h=no
ac_cv_func_tdestroy=no
ac_cv_func_tfind=no
;;
esac
dnl WinRT
AC_ARG_ENABLE([winstore_app],
AS_HELP_STRING([--enable-winstore-app],
[Build targetted for Windows Store apps (default disabled)]))
vlc_winstore_app=0
AS_IF([test "${SYS}" = "mingw32"],[
LIBCOM="-lole32 -loleaut32"
AC_LANG_PUSH(C++)
AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing], [
LIBCOMCXXFLAGS="-fno-strict-aliasing"
],[
# fno-strict-aliasing is necessary for WRL and IID_PPV_ARGS to work safely
# MSVC doesn't have this option but doesn't do pointer aliasing, so it
# should work too
AC_MSG_ERROR([-fno-strict-aliasing is necessary for Windows C++ modules])
])
AC_LANG_POP(C++)
AS_IF([test "${enable_winstore_app}" = "yes"], [
vlc_winstore_app=1
LIBCOM="-loleaut32"
LDFLAGS="${LDFLAGS} -lwindowsappcompat"
VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
AC_LIBOBJ([gai_strerror])
],[])
AC_SUBST([LIBCOM])
AC_SUBST([LIBCOMCXXFLAGS])
])
vlc_build_pdb=0
AC_ARG_ENABLE([pdb],
AS_HELP_STRING([--enable-pdb],
[Build PDB files for windows targets (default off)]))
AS_IF([test "${SYS}" = "mingw32"],[
AS_IF([test "${enable_pdb}" = "yes"], [
vlc_build_pdb=1
AX_APPEND_FLAG([-g -gcodeview],[CPPFLAGS])
LDFLAGS="${LDFLAGS} -Wl,-pdb="
],[])
])
AM_CONDITIONAL([HAVE_FREEBSD], [test "${SYS}" = "freebsd"])
AM_CONDITIONAL([HAVE_LINUX], [test "${SYS}" = "linux"])
AM_CONDITIONAL([HAVE_ANDROID], [test "${VENDOR}" = "android"])
AM_CONDITIONAL([HAVE_OS2], [test "${SYS}" = "os2"])
AM_CONDITIONAL([HAVE_DARWIN], [test "${SYS}" = "darwin"])
AM_CONDITIONAL([HAVE_IOS], [test "${HAVE_IOS}" = "1"])
AM_CONDITIONAL([HAVE_OSX], [test "${HAVE_OSX}" = "1"])
AM_CONDITIONAL([HAVE_TVOS], [test "${HAVE_TVOS}" = "1"])
AM_CONDITIONAL([HAVE_IOS_OR_TVOS], [test "${HAVE_IOS_OR_TVOS}" = "1"])
AM_CONDITIONAL([HAVE_XROS], [test "${HAVE_XROS}" = "1"])
AM_CONDITIONAL([HAVE_WATCHOS], [test "${HAVE_WATCHOS}" = "1"])
AM_CONDITIONAL([HAVE_LIBANL], [test "${HAVE_LIBANL}" = "1"])
AM_CONDITIONAL([HAVE_WIN32], [test "${SYS}" = "mingw32"])
AM_CONDITIONAL([HAVE_WIN64], [test "${HAVE_WIN64}" = "1"]) dnl Only used for the packaging
AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
AM_CONDITIONAL([ENABLE_PDB], [test "$vlc_build_pdb" = "1"])
dnl Use nasm/yasm only on x86
AC_CHECK_PROGS(X86ASM, [nasm yasm])
AM_CONDITIONAL([HAVE_X86ASM], [test -n "${X86ASM}" && test -n "${X86ASMFLAGS}"])
AM_COND_IF([HAVE_X86ASM], [
AC_DEFINE([HAVE_X86ASM], [1], [Use external asm on x86.])
])
dnl Because DOLT is not able to handle --with-pic
dnl correctly, manually add -DPIC to the options for
dnl nasm / yasm here.
AS_IF([test "$with_pic" = "yes"], [X86ASMDEFS="${X86ASMDEFS} -DPIC"])
AC_SUBST([X86ASMFLAGS])
AC_SUBST([X86ASMDEFS])
AM_CONDITIONAL([HAVE_EMSCRIPTEN], [test "${SYS}" = "emscripten"])
dnl
dnl Sadly autoconf does not think about testing foo.exe when ask to test
dnl for program foo on win32
case "${build_os}" in
cygwin|msys|mingw32)
ac_executable_extensions=".exe"
BUILDEXEEXT=".exe"
;;
os2*)
BUILDEXEEXT=".exe"
;;
*)
;;
esac
AC_SUBST([BUILDEXEEXT])
dnl
dnl Check for the contrib directory
dnl
AC_ARG_WITH(contrib,
AS_HELP_STRING([--with-contrib[=DIR]],
[search for 3rd party libraries in DIR/include and DIR/lib])
)
AC_MSG_CHECKING([for 3rd party libraries path])
AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
CONTRIB_DIR="${srcdir}/contrib/${host}"
AS_IF([test ! -d "${CONTRIB_DIR}"], [
echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
AS_IF([test ! -d "${CONTRIB_DIR}"], [
echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
CONTRIB_DIR=""
AC_MSG_RESULT([not found])
])
])
], [
AS_IF([test "${with_contrib}" != "no"], [
CONTRIB_DIR="${with_contrib}"
AC_MSG_RESULT([${CONTRIB_DIR}])
], [
CONTRIB_DIR=""
AC_MSG_RESULT([disabled])
])
])
AS_IF([test -n "${CONTRIB_DIR}"], [
AS_IF([test -d "${CONTRIB_DIR}/lib"],[
SRC_CONTRIB_DIR="${CONTRIB_DIR}"
CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd -P`
AC_MSG_RESULT([${CONTRIB_DIR} from ${SRC_CONTRIB_DIR}])
], [
echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
CONTRIB_DIR=""
AC_MSG_RESULT([not usable])
])
])
AS_IF([test -n "${CONTRIB_DIR}"], [
CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include -F${CONTRIB_DIR} -F${CONTRIB_DIR}/Frameworks"
PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:${CONTRIB_DIR}/share/pkgconfig:${PKG_CONFIG_PATH}"
case "${build_os}" in
mingw32)
export PKG_CONFIG_PATH="$(cygpath -mp "${PKG_CONFIG_PATH}")"
;;
*)
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
;;
esac
LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
AS_IF([test -z "$LUAC"], [
AC_MSG_CHECKING([if contribs provide luac])
AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([no])
])
])
AS_IF([test "${SYS}" = "darwin"], [
export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
])
], [
AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
AC_MSG_ERROR([Third party libraries not found!])
])
])
AC_SUBST([CONTRIB_DIR])
dnl Add extras/tools to the PATH
TOOLS_DIR="${srcdir}/extras/tools/build/bin"
AS_IF([test -d "${TOOLS_DIR}"], [
TOOLS_DIR="$(cd "${TOOLS_DIR}" && pwd)"
export PATH="${TOOLS_DIR}:$PATH"
])
dnl
dnl Libtool
dnl It's very bad, but our former custom system was worst
dnl -- Courmisch
dnl
dnl override platform specific check for dependent libraries
dnl otherwise libtool linking of shared libraries will
dnl fail on anything other than pass_all.
AC_CACHE_VAL(lt_cv_deplibs_check_method,
[lt_cv_deplibs_check_method=pass_all])
LT_INIT([dlopen win32-dll shared disable-static])
LT_LANG([C++])
LT_LANG([Windows Resource])
DOLT
lt_cv_deplibs_check_method=pass_all
AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
])
dnl
dnl Gettext stuff
dnl
AM_GNU_GETTEXT_VERSION([0.21])
AM_GNU_GETTEXT([external], [need-formatstring-macros])
dnl
dnl Iconv stuff
dnl
AM_ICONV
dnl
dnl checks for mingw
AS_IF([test "${SYS}" = "mingw32"], [
dnl Check if this is a UCRT build
AC_MSG_CHECKING([whether compiling with Universal C Runtime])
win_ucrt_build=no
AC_PREPROC_IFELSE([AC_LANG_SOURCE([
#include <crtdefs.h>
#if !(defined(_UCRT) || (__MSVCRT_VERSION__ >= 0x1400) || (__MSVCRT_VERSION__ >= 0xE00 && __MSVCRT_VERSION__ < 0x1000))
# error This is NOT a UCRT build
#endif
])], [
AC_MSG_RESULT([yes])
win_ucrt_build=yes
], [
AC_MSG_RESULT([no])
])
AC_PREPROC_IFELSE([AC_LANG_SOURCE([
#if !defined(__MINGW32__)
# error Not compiling with mingw
#endif
])], [
dnl Check for broken versions of mingw-runtime compatability library
AC_MSG_CHECKING(for broken mingw-runtime)
AC_PREPROC_IFELSE([AC_LANG_SOURCE([
#include <_mingw.h>
#if defined(__MINGW64_VERSION_MAJOR)
# if __MINGW64_VERSION_MAJOR < 6
# error Update your mingw-w64! This one is too old.
# endif
#else
# error You cannot compile with Mingw. Use Mingw-w64!
#endif
])], [
AC_MSG_RESULT([ok])
], [
AC_MSG_RESULT([present])
AC_MSG_ERROR([LibVLC requires Mingw-w64 version 6.0 or higher!])
])
AS_IF([test "${win_ucrt_build}" = "no"], [
dnl force use of mingw provided c99 *printf over msvcrt
CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
],[
dnl for UCRT build we use the standard compatibility define of UCRT
CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=0"
])
dnl Check for the need to include the mingwex lib for mingw32
VLC_SAVE_FLAGS
AC_CHECK_LIB([mingwex], [opendir],
AC_CHECK_LIB([mingw32], [opendir],,
[VLC_ADD_LIBS([libvlccore],[-lmingwex])])
)
VLC_RESTORE_FLAGS
], [
AC_MSG_RESULT([Not compiling with mingw])
])
dnl Check for fnative-struct or mms-bitfields support for mingw32
AX_CHECK_COMPILE_FLAG([-mms-bitfields], [
AX_APPEND_FLAG([-mms-bitfields], [CFLAGS])
AX_APPEND_FLAG([-mms-bitfields], [CXXFLAGS])
# Check for the warning flag without "-Wno-", GCC accepts
# -Wno-<anything> for unsupported warnings, which can trigger
# other warnings instead.
AX_CHECK_COMPILE_FLAG([-Wincompatible-ms-struct], [
AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CFLAGS])
AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CXXFLAGS])
])
], [
AX_CHECK_COMPILE_FLAG([-fnative-struct], [
AX_APPEND_FLAG([-fnative-struct], [CFLAGS])
AX_APPEND_FLAG([-fnative-struct], [CXXFLAGS])
])
])
])
dnl
dnl Buggy glibc prevention. Purposedly not cached.
dnl See sourceware.org bugs 5058 and 5443.
dnl Ubuntu alone has 20 bug numbers for this...
dnl
AC_MSG_CHECKING(for buggy GNU/libc versions)
AC_PREPROC_IFELSE([AC_LANG_SOURCE([
#include <limits.h>
#if defined (__GLIBC__) && (__GLIBC__ == 2) \
&& (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
# error GNU/libc with dcgettext killer bug!
#endif
])], [
AC_MSG_RESULT([not present])
], [
AC_MSG_RESULT([found])
AS_IF([test "${enable_nls}" != "no"], [
AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
work-around for this. Check with your distribution vendor on how to update the
glibc run-time. Alternatively, build with --disable-nls.])
])
])
dnl Plugin compilation stuff
VLC_LIBRARY_SUFFIX
dnl Check for system libs needed
need_libc=false
dnl Check for usual libc functions
AC_CHECK_FUNCS([accept4 dup3 fcntl flock fstatat fstatvfs fork getmntent_r getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale pipe2 posix_fadvise setlocale uselocale wordexp])
AC_REPLACE_FUNCS([aligned_alloc asprintf atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r lfind lldiv localtime_r memrchr nrand48 poll posix_memalign readv recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp vasprintf writev])
AC_REPLACE_FUNCS([gettimeofday])
AC_CHECK_FUNC(fdatasync,,
[AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
])
VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
# Windows CE does not have strcoll()
AC_FUNC_STRCOLL
dnl Check for non-standard system calls
case "$SYS" in
"linux")
AC_CHECK_FUNCS([eventfd vmsplice sched_getaffinity recvmmsg memfd_create])
AC_REPLACE_FUNCS([getauxval])
;;
"mingw32")
AC_CHECK_FUNCS([_lock_file])
;;
esac
AH_BOTTOM([#include <vlc_fixups.h>])
dnl Check for struct timespec
AC_CHECK_TYPES([struct timespec],,,
[#include <time.h>])
dnl Check for max_align_t
AC_CHECK_TYPES([max_align_t],,,
[#include <stddef.h>])
dnl Checks for socket stuff
VLC_SAVE_FLAGS
SOCKET_LIBS=""
AS_IF([test "${SYS}" = "mingw32"], [
SOCKET_LIBS="-lws2_32 -liphlpapi"
],[
AC_SEARCH_LIBS(connect, [socket], [
AS_IF([test "$ac_cv_search_connect" != "none required"], [
SOCKET_LIBS="$ac_cv_search_connect"
])
])
])
AC_SEARCH_LIBS([inet_pton], [nsl], [
AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
])
],, [${SOCKET_LIBS}])
LIBS="${LIBS} ${SOCKET_LIBS}"
AC_LINK_IFELSE([
AC_LANG_PROGRAM([#ifdef _WIN32
#include <ws2tcpip.h>
#include <windows.h>
#else
#include <sys/socket.h>
#include <arpa/inet.h>
#endif], [
char dst[[sizeof(struct in_addr)]];
inet_pton(AF_INET, "127.0.0.1", dst);
])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
AC_CHECK_TYPES([struct if_nameindex],,,[#include <net/if.h>])
AC_CHECK_FUNCS([if_nameindex])
VLC_RESTORE_FLAGS
AC_SUBST([SOCKET_LIBS])
dnl Check for socklen_t
AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
AC_CACHE_CHECK([for socklen_t in sys/socket.h],
ac_cv_type_socklen_t,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[#include <sys/types.h>
#ifdef _WIN32
# include <winsock2.h>
# include <ws2tcpip.h>
#else
# include <sys/socket.h>
#endif]], [[socklen_t len; len = 0;]])],
ac_cv_type_socklen_t=yes,
ac_cv_type_socklen_t=no)])
AS_IF([test "$ac_cv_type_socklen_t" = no], [
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#include <sys/types.h>
#ifdef _WIN32
# include <winsock2.h>
# include <ws2tcpip.h>
#else
# include <sys/socket.h>
#endif
]], [[
_Generic(getpeername, int (*)(int, struct sockaddr *, int *): 0);
]])
], AC_DEFINE(socklen_t, int), AC_DEFINE(socklen_t, unsigned int))
])
dnl Check for struct sockaddr_storage
AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#if defined( _WIN32 )
# include <winsock2.h>
#else
# include <sys/socket.h>
#endif]], [[struct sockaddr_storage addr;]])],
[ac_cv_struct_sockaddr_storage=yes],
[ac_cv_struct_sockaddr_storage=no])])
AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
AC_DEFINE(sockaddr_storage, sockaddr)
AC_DEFINE(ss_family, sa_family)
])
dnl FreeBSD has a gnugetopt library for this:
GNUGETOPT_LIBS=""
AC_CHECK_FUNC(getopt_long,, [
AC_CHECK_LIB([gnugetopt],[getopt_long], [
GNUGETOPT_LIBS="-lgnugetopt"
])
])
AC_SUBST([GNUGETOPT_LIBS])
AC_CHECK_LIB([m], [cos], [
LIBM="-lm"
], [
LIBM=""
])
AC_SUBST([LIBM])
AC_CHECK_LIB([m], [lrintf], [
AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
VLC_ADD_LIBS([skins2],[-lm])
])
AC_CHECK_LIB([m], [nanf],
AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
)
AC_CHECK_LIB([m], [sincos], [
AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
], [
AC_LIBOBJ([sincos])
])
AC_MSG_CHECKING([broken qsort_r prototype])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>
_Static_assert(_Generic((qsort_r),
void (*)(void *, size_t, size_t, void *,
int (*)(void *, const void *, const void *)) : 1, default: 0),
"Bad prototype not matched");
])], [
AC_MSG_RESULT([broken])
AC_DEFINE([HAVE_BROKEN_QSORT_R], 1, [Defined to 1 if the qsort_r() prototype contradicts the upcoming POSIX standard.])
], [
AC_MSG_RESULT([no])
])
AC_MSG_CHECKING([_Thread_local support])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
int main() {}])], [
AC_MSG_RESULT([ok])
AC_DEFINE(HAVE_THREAD_LOCAL, 1, [Defined to 1 if C11 _Thread_local storage qualifier is supported])
],[ AC_MSG_RESULT([no])])
dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
dnl check for its availability explicitely
AC_CHECK_HEADERS([threads.h])
AC_CHECK_LIB([anl],[getaddrinfo_a],[
AC_DEFINE(HAVE_LIBANL, 1, [Define to 1 if you have the anl library])
])
dnl Check for dynamic plugins
LIBDL=""
have_dynamic_objects="no"
VLC_SAVE_FLAGS
AC_SEARCH_LIBS(dlsym, [dl svld], [
AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
LIBDL="$ac_cv_search_dlsym"
])
have_dynamic_objects="yes"
])
VLC_RESTORE_FLAGS
# Windows
AS_IF([test "${SYS}" = "mingw32"], [
LIBDL=""
have_dynamic_objects="yes" #assume we can use shared objects
])
AC_ARG_WITH([libfuzzer],
AS_HELP_STRING([--with-libfuzzer=DIR],
[use libFuzzer library from DIR and triggers sanitize coverage (default disabled)]),
[],
[with_libfuzzer=no])
AS_VAR_IF(with_libfuzzer, no, [], [
enable_shared=no
enable_static=yes
enable_vlc=no
])
AM_CONDITIONAL([HAVE_LIBFUZZER], [test "${with_libfuzzer}" != "no"])
AS_IF([test "${enable_shared}" = "no"], [
have_dynamic_objects=no
])
AM_CONDITIONAL([HAVE_DYNAMIC_PLUGINS], [test "${have_dynamic_objects}" != "no"])
AC_SUBST([LIBDL])
AS_IF([test "${SYS}" != "mingw32"], [
AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
LIBRT="$ac_cv_search_clock_nanosleep"
])
], [
AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
LIBRT="$ac_cv_search_nanosleep"
])
])
])
])
AC_SUBST([LIBRT])
dnl Check for clock_* functions, needs to be done here,
dnl after the -lrt check
AC_REPLACE_FUNCS([clock_gettime clock_nanosleep clock_getres])
dnl
dnl Check for headers
dnl
AC_CHECK_HEADER([stdbit.h],, [
CPPFLAGS="${CPPFLAGS} -I\$(top_srcdir)/compat/stdbit"
])
AC_CHECK_HEADER([stdckdint.h],, [
CPPFLAGS="${CPPFLAGS} -I\$(top_srcdir)/compat/stdckdint"
])
dnl POSIX
AC_CHECK_HEADERS([arpa/inet.h poll.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h wordexp.h])
AC_CHECK_HEADERS([net/if.h], [], [],
[
#include <sys/types.h>
#include <sys/socket.h>
])
AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
dnl BSD
AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
dnl GNU/Linux
AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h sys/auxv.h sys/eventfd.h])
dnl MacOS
AC_CHECK_HEADERS([xlocale.h])
dnl Check for struct pollfd
AC_CHECK_TYPES([struct pollfd],,,
[#include <sys/types.h>
#if HAVE_POLL_H
# include <poll.h>
#elif defined (_WIN32)
# include <winsock2.h>
#endif
])
dnl Check if C++ headers define locale_t
AC_LANG_PUSH(C++)
AC_CACHE_CHECK([if C++ headers define locale_t],
[ac_cv_cxx_locale_t],
[ac_cv_cxx_locale_t=no
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <locale>]], [[locale_t loc;]])],
[ac_cv_cxx_locale_t=yes],[])])
if test "${ac_cv_cxx_locale_t}" != "no"; then
AC_DEFINE(HAVE_CXX_LOCALE_T, 1, Define to 1 if C++ headers define locale_t)
fi
AC_LANG_POP(C++)
dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
AH_TEMPLATE(ssize_t, [Define to `ptrdiff_t' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
AC_CHECK_TYPE(ssize_t,, [
AC_DEFINE(ssize_t, ptrdiff_t)
AC_DEFINE([SSIZE_MAX], [PTRDIFF_MAX], [Max possible value of the ssize_t type])
])
dnl It seems that autoconf detects pkg-config only during the first
dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
dnl it is nested within a conditional block, so it was not working right.
PKG_PROG_PKG_CONFIG()
dnl On some OS we need static linking
AS_IF([test -n "${PKG_CONFIG}" ],[
AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
PKG_CONFIG="${PKG_CONFIG} --static"
])
])
dnl
dnl Check for zlib.h and -lz if available
dnl
have_zlib="no"
AC_CHECK_HEADERS([zlib.h], [
AC_CHECK_LIB([z], [inflate], [
have_zlib=yes
AC_DEFINE([HAVE_ZLIB], 1, [Define to 1 if you have zlib.])
LIBZ="-lz"
])
])
AC_SUBST([LIBZ])
AM_CONDITIONAL([HAVE_ZLIB], [ test "${have_zlib}" = "yes" ])
dnl
dnl Domain name i18n support via GNU libidn
dnl
PKG_CHECK_MODULES([IDN], [libidn], [
have_libidn="yes"
AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
], [
have_libidn="no"
])
dnl Check for dbus
AC_ARG_ENABLE([dbus],
AS_HELP_STRING([--enable-dbus],
[compile D-Bus message bus support (default enabled)]))
have_dbus="no"
AS_IF([test "${enable_dbus}" != "no"], [
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
have_dbus="yes"
], [
AS_IF([test -n "${enable_dbus}"], [
AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
], [
AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
])
])
])
AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
dnl Check for systemd
PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
have_systemd="yes"
], [
AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
])
AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
dnl Check for sdbus
have_sdbus="no"
AS_IF([test "${have_systemd}" = "yes"], [
SDBUS_CFLAGS="${SYSTEMD_CFLAGS} -DSDBUS_HEADER='<systemd/sd-bus.h>'"
SDBUS_LIBS="${SYSTEMD_LIBS}"
have_sdbus="yes"
])
dnl Check for elogind
AC_ARG_ENABLE([elogind],
AS_HELP_STRING([--disable-elogind], [ignore elogind as a sd-bus provider]), [], [enable_elogind="yes"])
AS_IF([test "${have_sdbus}" != "yes" && test "${enable_elogind}" != "no"], [
PKG_CHECK_MODULES([ELOGIND], [libelogind], [
have_elogind="yes"
SDBUS_CFLAGS="${ELOGIND_CFLAGS} -DSDBUS_HEADER='<elogind/sd-bus.h>'"
SDBUS_LIBS="${ELOGIND_LIBS}"
have_sdbus="yes"
], [
AC_MSG_WARN([${ELOGIND_PKG_ERRORS}.])
])
])
dnl Check for basu
AC_ARG_ENABLE([basu],
AS_HELP_STRING([--disable-basu], [ignore basu as a sd-bus provider]), [], [enable_basu="yes"])
AS_IF([test "${have_sdbus}" != "yes" && test "${enable_basu}" != "no"], [
PKG_CHECK_MODULES([BASU], [basu], [
have_basu="yes"
SDBUS_CFLAGS="${BASU_CFLAGS} -DSDBUS_HEADER='<basu/sd-bus.h>'"
SDBUS_LIBS="${BASU_LIBS}"
have_sdbus="yes"
], [
AC_MSG_WARN([${BASU_PKG_ERRORS}.])
])
])
AS_IF([test "$have_sdbus" = "yes" ], [
AC_SUBST([SDBUS_CFLAGS])
AC_SUBST([SDBUS_LIBS])
], [
AC_MSG_WARN([no sd-bus provider found.])
])
AM_CONDITIONAL([HAVE_SDBUS], [test "$have_sdbus" = "yes"])
EXTEND_HELP_STRING([Optimization options:])
dnl
dnl Compiler warnings
dnl
AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CFLAGS])
AC_LANG_PUSH(C++)
AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CXXFLAGS])
AC_LANG_POP(C++)
dnl -Werror-implicit-function-declaration is used for the if_nametoindex detection with winstore
AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local -Wmultistatement-macros], [CFLAGS])
AX_APPEND_COMPILE_FLAGS([-pipe], [CFLAGS])
AC_ARG_ENABLE([extra_checks],
AS_HELP_STRING([--enable-extra-checks],
[Turn some warnings into compilation error (default disabled)]),,
[enable_extra_checks="no"])
AS_IF([test "${enable_extra_checks}" = "yes"], [
AX_APPEND_COMPILE_FLAGS([-Werror=missing-field-initializers -Werror=format -Werror=incompatible-pointer-types -Werror=restrict -Werror=int-conversion -Werror=implicit-int -Werror=return-mismatch -Werror=declaration-missing-parameter-type], [CFLAGS])
AC_LANG_PUSH(C++)
AX_APPEND_COMPILE_FLAGS([-Werror=missing-field-initializers -Werror=format -Werror=return-mismatch], [CXXFLAGS])
AC_LANG_POP(C++)
])
dnl UWP forbidden checks
AS_IF([test "${SYS}" = "mingw32"], [
AC_MSG_CHECKING(for if_nametoindex availability)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <windows.h>
#include <iphlpapi.h>
static void test (void) {
if_nametoindex("");
}
]],[[;]])
],[
AC_MSG_RESULT([present])
AC_DEFINE([HAVE_IF_NAMETOINDEX], [1], [Define to 1 if you have if_nametoindex function])
],[
AC_MSG_RESULT([not present])
])
])
dnl
dnl Debugging mode
dnl
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--disable-debug],
[disable run-time assertions (default enabled)]),,
[enable_debug="yes"])
AH_TEMPLATE(NDEBUG,
[Define to 1 if debug code should NOT be compiled])
AS_IF([test "${enable_debug}" != "no"], [
AC_CHECK_HEADERS([valgrind/valgrind.h])
], [
AC_DEFINE(NDEBUG)
])
dnl
dnl Profiling
dnl
AC_ARG_ENABLE([gprof],
AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)]),,
[enable_gprof="no"])
AS_IF([test "${enable_gprof}" != "no"], [
CFLAGS="${CFLAGS} -pg"
CXXFLAGS="${CXXFLAGS} -pg"
OBJCFLAGS="${OBJCFLAGS} -pg"
LDFLAGS="${LDFLAGS} -pg"
])
AC_ARG_ENABLE([cprof],
AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)]),,
[enable_cprof="no"])
AS_IF([test "${enable_gprof}" != "no"], [
CFLAGS="${CFLAGS} -finstrument-functions"
CXXFLAGS="${CXXFLAGS} -finstrument-functions"
OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
LDFLAGS="${LDFLAGS} -finstrument-functions"
])
dnl
dnl Test coverage
dnl
AC_ARG_ENABLE([coverage],
AS_HELP_STRING([--enable-coverage],
[build for test coverage (default disabled)]),,
[enable_coverage="no"])
AS_IF([test "${enable_coverage}" != "no"], [
CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
LDFLAGS="-lgcov ${LDFLAGS}"
])
AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -fvisibility=hidden"
CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
[ac_cv_c_visibility_hidden], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_visibility_hidden=yes
], [
ac_cv_c_visibility_hidden=no
])
])
AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
])
dnl
dnl Sanitizer flags
dnl
AC_ARG_WITH([sanitizer],
AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
[build with sanitizer flags (default disabled)]),
[],
[with_sanitizer=no])
AS_VAR_IF(with_sanitizer, no, [], [
AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [CXXFLAGS])
AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
], [
AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
])
AX_APPEND_FLAG([-g])
AX_APPEND_FLAG([-g], [CXXFLAGS])
AS_IF([test -z "${with_sanitizer##*address*}" ], [
AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract])
AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract], [CXXFLAGS])
])
])
dnl
dnl Enable/disable optimizations
dnl
AC_ARG_ENABLE([optimizations],
AS_HELP_STRING([--disable-optimizations],
[disable compiler optimizations (default enabled)]),,
[enable_optimizations="yes"])
dnl Check for various optimization flags
AS_IF([test "${enable_optimizations}" != "no"], [
dnl -O3 only in production builds
AS_IF([test "${enable_debug}" = "no"], [
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -O3"
CXXFLAGS="${CXXFLAGS} -O3"
OBJCFLAGS="${OBJCFLAGS} -O3"
AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_o3=yes
], [
ac_cv_c_o3=no
])
])
AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
])
dnl Check for fast maths
AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CFLAGS])
AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CXXFLAGS])
AH_BOTTOM([
#if defined(_MSC_VER) && !defined(__clang__)
# pragma fenv_access(off)
# pragma fp_contract(on)
#elif defined(__GNUC__)
/* Not supported so far */
#else
# pragma STDC FENV_ACCESS OFF
# pragma STDC FP_CONTRACT ON
#endif
])
dnl Check for -funroll-loops
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -funroll-loops"
CXXFLAGS="${CXXFLAGS} -funroll-loops"
OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_unroll_loops=yes
], [
ac_cv_c_unroll_loops=no
])
])
AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
AS_IF([test "$enable_debug" = "no"], [
dnl Check for -fomit-frame-pointer
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -fomit-frame-pointer"
CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
[ac_cv_c_omit_frame_pointer], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_omit_frame_pointer=yes
], [
ac_cv_c_omit_frame_pointer=no
])
])
AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
])
])
AC_ARG_ENABLE([ssp],
AS_HELP_STRING([--disable-ssp],
[disable stack smashing protection (default enabled for optimized builds)]), [],
[enable_ssp="yes"])
AS_IF([test "${enable_ssp}" != "no" -a "${enable_optimizations}" != "no"], [
VLC_SAVE_FLAGS
AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong], [CXXFLAGS])
dnl Win32 requires linking to ssp for stack-protection
AS_IF([test "${SYS}" = "mingw32"], [
LDFLAGS="${LDFLAGS} -lssp"
AC_CACHE_CHECK([if linker supports stack protectors], [ac_cv_ld_ssp], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[char buf[100]; fgets(buf, sizeof(buf), stdin);]])],[
ac_cv_ld_ssp="yes"
], [
ac_cv_ld_ssp="no"
])
])
AS_IF([test "${ac_cv_ld_ssp}" = "no"], [VLC_RESTORE_FLAGS])
])
])
VLC_SAVE_FLAGS
LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[
ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
], [
ac_cv_ld_bsymbolic=""
])
])
VLC_RESTORE_FLAGS
SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
AC_SUBST([SYMBOLIC_LDFLAGS])
VLC_SAVE_FLAGS
LDFLAGS="${LDFLAGS} -Wl,-z,defs"
AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[
ac_cv_ld_z_defs="yes"
], [
ac_cv_ld_z_defs="no"
])
])
AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
dnl Check for __attribute__((packed))
AC_CACHE_CHECK([for __attribute__((packed))],
[ac_cv_c_attribute_packed],
[ac_cv_c_attribute_packed=no
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
[[struct __attribute__((__packed__)) foo { int a; } b; (void)b;]])],
[ac_cv_c_attribute_packed=yes],[])])
if test "${ac_cv_c_attribute_packed}" != "no"; then
AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
fi
WIN32_PATH_CMD=
AS_IF([test "${SYS}" = "mingw32"], [
AC_MSG_CHECKING([how to transform windows pathes])
win32_path_cmd=no
for win_path in "cygpath" "wslpath" "wine winepath"
do
ac_try="$win_path -u c: >/dev/null"
(eval "$ac_try") 2>&5
ac_status=$?
if test $ac_status = 0; then
win32_path_cmd=$win_path
break
fi
done
AS_IF([test "${win32_path_cmd}" != "no"],[
WIN32_PATH_CMD=${win32_path_cmd}
AC_MSG_RESULT([using '${win32_path_cmd}'])
],[
AC_MSG_RESULT([not possible])
])
])
AC_SUBST([WIN32_PATH_CMD])
AC_ARG_WITH([wix],
AS_HELP_STRING([--with-wix=DIR], [location of WIX binary (default: contribs)])
)
AS_IF([test -z "${with_wix}"], [
AS_IF([test -n "${CONTRIB_DIR}"], [
with_wix="${CONTRIB_DIR}/bin"
])
])
AS_IF([test "${with_wix}" != "no"], [
WIXPATH="${with_wix}"
])
AC_SUBST([WIXPATH])
dnl
dnl Check the CPU
dnl
case "${host_cpu}" in
"")
ARCH=unknown
;;
armv*)
ARCH="arm"
host_cpu="arm"
;;
*)
ARCH="${host_cpu}"
;;
esac
dnl Check for backtrace() support
AC_CHECK_HEADERS([execinfo.h])
AC_CHECK_FUNCS([backtrace],, [
AC_CHECK_LIB([execinfo], [backtrace], [
LIBEXECINFO="-lexecinfo"])
])
AC_SUBST(LIBEXECINFO)
dnl
dnl default modules
dnl
ALIASES="${ALIASES} cvlc rvlc"
dnl
dnl Accelerated modules
dnl
dnl Check for fully working SSE2 intrinsics
dnl We need support for -msse2, we need <emmintrin.h>, and we also need a
dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
AC_ARG_ENABLE([sse],
AS_HELP_STRING([--disable-sse],
[disable SSE (2-4) optimizations (default auto)]),, [
case "${host_cpu}" in
i?86|x86_64)
enable_sse=yes
;;
*)
enable_sse=no
;;
esac
])
have_sse2="no"
AS_IF([test "${enable_sse}" != "no"], [
ARCH="${ARCH} sse2"
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -msse2"
AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[#include <emmintrin.h>
#include <stdint.h>
uint64_t frobzor;]], [
[__m128i a, b, c;
a = b = c = _mm_set1_epi64((__m64)frobzor);
a = _mm_slli_epi16(a, 3);
a = _mm_adds_epi16(a, b);
c = _mm_srli_epi16(c, 8);
c = _mm_slli_epi16(c, 3);
b = _mm_adds_epi16(b, c);
a = _mm_unpacklo_epi8(a, b);
frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
ac_cv_c_sse2_intrinsics=yes
], [
ac_cv_c_sse2_intrinsics=no
])
])
VLC_RESTORE_FLAGS
AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
])
VLC_SAVE_FLAGS
AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
]])
], [
ac_cv_sse2_inline=yes
], [
ac_cv_sse2_inline=no
])
])
AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
have_sse2="yes"
])
# SSE3
AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
]])
], [
ac_cv_sse3_inline=yes
], [
ac_cv_sse3_inline=no
])
])
AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
# SSSE3
AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
]])
], [
ac_cv_ssse3_inline=yes
], [
ac_cv_ssse3_inline=no
])
])
AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
# SSE4.1
AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
[ac_cv_sse4_1_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
]])
], [
ac_cv_sse4_1_inline=yes
], [
ac_cv_sse4_1_inline=no
])
])
AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
VLC_RESTORE_FLAGS
])
AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
dnl Check for fully working AVX2 intrinsics
dnl We need support for -mavx[2], we need <immintrin.h>, and we also need a
dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
AC_ARG_ENABLE([avx],
AS_HELP_STRING([--disable-avx],
[disable AVX (1-2) optimizations (default auto)]),, [
case "${host_cpu}" in
i?86|x86_64)
enable_avx=yes
;;
*)
enable_avx=no
;;
esac
])
have_avx2="no"
AS_IF([test "${enable_avx}" != "no"], [
ARCH="${ARCH} avx avx2"
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -mavx2"
AC_CACHE_CHECK([if $CC groks AVX2 intrinsics], [ac_cv_c_avx2_intrinsics], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[#include <immintrin.h>
#include <stdint.h>
uint64_t frobzor;]], [
[__m256i a, b, c;
a = b = c = _mm256_set1_epi64x((int64_t)frobzor);
a = _mm256_slli_epi16(a, 3);
a = _mm256_adds_epi16(a, b);
c = _mm256_srli_epi16(c, 8);
c = _mm256_slli_epi16(c, 3);
b = _mm256_adds_epi16(b, c);
a = _mm256_unpacklo_epi8(a, b);
frobzor = (uint64_t)_mm256_extract_epi64(a, 0);]])], [
ac_cv_c_avx2_intrinsics=yes
], [
ac_cv_c_avx2_intrinsics=no
])
])
VLC_RESTORE_FLAGS
AS_IF([test "${ac_cv_c_avx2_intrinsics}" != "no"], [
AC_DEFINE(HAVE_AVX2_INTRINSICS, 1, [Define to 1 if AVX2 intrinsics are available.])
])
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -mavx"
AC_CACHE_CHECK([if $CC groks AVX inline assembly], [ac_cv_avx_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("vxorps %%ymm1,%%ymm2,%%ymm3"::"r"(p):"ymm1", "ymm2", "ymm3");
]])
], [
ac_cv_avx_inline=yes
], [
ac_cv_avx_inline=no
])
])
AS_IF([test "${ac_cv_avx_inline}" != "no" -a "${SYS}" != "solaris"], [
AC_DEFINE(CAN_COMPILE_AVX, 1, [Define to 1 if AVX inline assembly is available.])
])
AC_CACHE_CHECK([if $CC groks AVX2 inline assembly], [ac_cv_avx2_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("vpunpckhqdq %%ymm1,%%ymm2,%%ymm3"::"r"(p):"ymm1", "ymm2", "ymm3");
]])
], [
ac_cv_avx2_inline=yes
], [
ac_cv_avx2_inline=no
])
])
VLC_RESTORE_FLAGS
AS_IF([test "${ac_cv_avx2_inline}" != "no" -a "${SYS}" != "solaris"], [
AC_DEFINE(CAN_COMPILE_AVX2, 1, [Define to 1 if AVX2 inline assembly is available.])
have_avx2="yes"
])
])
AM_CONDITIONAL([HAVE_AVX2], [test "$have_avx2" = "yes"])
AC_ARG_ENABLE([neon],
AS_HELP_STRING([--disable-neon],
[disable ARM NEON optimizations (default auto)]),, [
case "${host_cpu}" in
"arm")
enable_neon="32"
;;
"aarch64")
enable_neon="64"
;;
*)
enable_neon="no"
;;
esac
])
AS_IF([test "${enable_neon}" != "no"], [
VLC_SAVE_FLAGS
AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
AS_IF([test "${enable_neon}" != "64"], [
CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(,[[
asm volatile("vqmovun.s64 d0, q1":::"d0");
]])
], [
ac_cv_arm_neon="32"
], [
ac_cv_arm_neon="no"
])
], [
CFLAGS="${CFLAGS} -march=armv8-a+simd"
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(,[[
asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
]])
], [
ac_cv_arm_neon="64"
], [
ac_cv_arm_neon="no"
])
])
])
VLC_RESTORE_FLAGS
])
AM_CONDITIONAL([HAVE_NEON], [test "${ac_cv_arm_neon}" = "32"])
AM_CONDITIONAL([HAVE_ARM64], [test "${ac_cv_arm_neon}" = "64"])
AC_ARG_ENABLE([sve],
AS_HELP_STRING([--disable-sve],
[disable ARM SVE optimizations (default auto)]),, [
AS_IF([test "${host_cpu}" = "aarch64"], [enable_sve="yes"] ,[enable_sve="no"])
])
AS_IF([test "${enable_sve}" != "no"], [
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -march=armv8-a+sve"
AC_CACHE_CHECK([if $CCAS groks ARM SVE assembly], [ac_cv_arm_sve], [
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(,[[
asm volatile("ptrue p0.s" ::: "p0");
]])
], [
ac_cv_arm_sve="yes"
], [
ac_cv_arm_sve="no"
])
])
VLC_RESTORE_FLAGS
])
AM_CONDITIONAL([HAVE_SVE], [test "${ac_cv_arm_sve}" = "yes"])
AC_ARG_ENABLE([branch-protection],
AS_HELP_STRING([--disable-branch-protection],
[disable AArch64 branch protection (default auto)]),, [
AS_IF([test "${host_cpu}" = "aarch64"],
[enable_branch_protection="yes"], [enable_branch_protection="no"])
])
AS_IF([test "${enable_branch_protection}" != "no"], [
AX_CHECK_COMPILE_FLAG([-mbranch-protection=standard], [
AX_APPEND_FLAG([-mbranch-protection=standard], [CPPFLAGS])
])
])
AC_ARG_ENABLE([altivec],
AS_HELP_STRING([--disable-altivec],
[disable AltiVec optimizations (default auto)]),, [
AS_CASE("${host_cpu}", [powerpc*],
[enable_altivec=yes], [enable_altivec=no])
])
have_altivec="no"
AS_IF([test "${enable_altivec}" = "yes"], [
ARCH="${ARCH} altivec";
VLC_SAVE_FLAGS
AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
[ac_cv_c_altivec], [
CFLAGS="${CFLAGS} -maltivec"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[#include <altivec.h>]], [
[vec_ld(0, (unsigned char *)0);]])], [
ac_cv_c_altivec="-maltivec"
], [
ac_cv_c_altivec="no"
])
])
VLC_RESTORE_FLAGS
AS_IF([test "${ac_cv_c_altivec}" != "no"], [
have_altivec="yes"
])
AC_CHECK_HEADERS([altivec.h])
])
AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
AC_ARG_ENABLE([rvv],
AS_HELP_STRING([--disable-rvv],
[disable RISC-V Vector extension (default auto)]),, [
AS_CASE([${host_cpu}], [riscv*], [enable_rvv="yes"], [enable_rvv="no"])
])
AS_IF([test "${enable_rvv}" != "no"], [
AC_CACHE_CHECK([if $CCAS groks RISC-V V assembly], [ac_cv_riscv_v], [
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(,[[
asm volatile(".option arch, +v\nvsetvli x0, x0, e8");
]])
], [
ac_cv_riscv_v="yes"
], [
ac_cv_riscv_v="no"
])
])
])
AM_CONDITIONAL([HAVE_RVV], [test "${ac_cv_riscv_v}" = "yes"])
dnl
dnl Memory usage
dnl
AC_ARG_ENABLE([optimize-memory],
AS_HELP_STRING([--enable-optimize-memory],
[optimize memory usage over performance]))
if test "${enable_optimize_memory}" = "yes"; then
AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
fi
dnl
dnl Allow running as root (useful for people running on embedded platforms)
dnl
AC_ARG_ENABLE([run-as-root],
AS_HELP_STRING([--enable-run-as-root],
[allow running VLC as root (default disabled)]))
AS_IF([test "${enable_run_as_root}" = "yes"],[
AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
[Define to 1 to allow running VLC as root (uid 0).])
])
dnl
dnl Stream output
dnl
AC_ARG_ENABLE([sout],
AS_HELP_STRING([--disable-sout],
[disable streaming output (default enabled)]))
AS_IF([test "${enable_sout}" != "no"], [
AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
])
AM_CONDITIONAL([ENABLE_SOUT], [test "${enable_sout}" != "no"])
dnl
dnl Rust Modules
dnl
AC_ARG_ENABLE([rust],
AS_HELP_STRING([--enable-rust],
[enable building Rust modules (default disabled)]))
AS_IF([test "${enable_rust}" = "yes"],[
rust_target_flags=
AS_IF([test "$vlc_winstore_app" = "1"],[
rust_target_flags="${rust_target_flags} --uwp"
])
AS_IF([test "${win_ucrt_build}" = "yes"],[
rust_target_flags="${rust_target_flags} --ucrt"
])
AS_IF([test "${HAVE_TVOS}" = "1"],[
rust_target_flags="${rust_target_flags} --darwin=tvos"
],[
AS_IF([test "${HAVE_WATCHOS}" = "1"],[
rust_target_flags="${rust_target_flags} --darwin=watchos"
],[
AS_IF([test "${HAVE_XROS}" = "1"],[
rust_target_flags="${rust_target_flags} --darwin=xros"
],[
AS_IF([test "${HAVE_IOS}" = "1"],[
rust_target_flags="${rust_target_flags} --darwin=ios"
],[
AS_IF([test "${HAVE_OSX}" = "1"],[
rust_target_flags="${rust_target_flags} --darwin=macos"
])
])
])
])
])
AC_MSG_CHECKING([Rust target])
rust_target=$(${srcdir}/contrib/src/get-rust-target.sh \
${rust_target_flags} \
${host})
ac_status=$?
AS_IF([test $ac_status = 0],[
AC_MSG_RESULT([${rust_target}])
AC_SUBST([RUST_TARGET], ["${rust_target}"])
],[
AC_MSG_RESULT([unsupported])
AC_MSG_ERROR([Unsupported Rust target for ${host}])
])
AS_IF([test -z "${CARGO_HOME}" -a "${host}" != "${build}"],[
AC_MSG_CHECKING([CARGO_HOME from contribs])
AS_IF([test -d "${CONTRIB_DIR}/../bin/.cargo"],[
CARGO_HOME=$(cd "${CONTRIB_DIR}/../bin/.cargo" && pwd -P)
AC_MSG_RESULT([${CARGO_HOME}])
],[
AC_MSG_RESULT([not found])
])
])
RUST_ENV=
AS_IF([test -n "${CARGO_HOME}"],[
RUST_ENV="${RUST_ENV} CARGO_HOME=\"${CARGO_HOME}\""
AS_IF([test -x "${CARGO_HOME}/bin/cargo"],[
ac_cv_prog_CARGO="${CARGO_HOME}/bin/cargo"
])
AS_IF([test -x "${CARGO_HOME}/bin/rustc"],[
ac_cv_prog_RUSTC="${CARGO_HOME}/bin/rustc"
])
])
AS_IF([test "${host}" != "${build}"],[
dnl RUSTUP_HOME is needed to cross-compile Rust
AS_IF([test -z "${RUSTUP_HOME}"],[
AC_MSG_CHECKING([RUSTUP_HOME from contribs])
AS_IF([test -d "${CONTRIB_DIR}/../bin/.rustup"],[
RUSTUP_HOME=$(cd "${CONTRIB_DIR}/../bin/.rustup" && pwd -P)
AC_MSG_RESULT([${RUSTUP_HOME}])
],[
AC_MSG_RESULT([not found])
])
])
])
AS_IF([test -n "${RUSTUP_HOME}"],[
RUST_ENV="${RUST_ENV} RUSTUP_HOME=\"${RUSTUP_HOME}\""
])
AC_CHECK_PROGS(RUSTC, [rustc], [no])
AS_IF([test "$RUSTC" = "no"],[
AC_MSG_ERROR([rustc not found but required to build Rust modules])
])
AC_MSG_CHECKING([Rust compiler supports ${rust_target}])
ac_try="echo 'fn main() {}' | ${RUST_ENV} \"${RUSTC}\" --target=${rust_target} --emit=dep-info - -o -"
(eval "$ac_try") 2>&5
ac_status=$?
AS_IF([test $ac_status = 0],[
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([no])
AC_MSG_ERROR([Required target ${rust_target} missing (using ${RUST_ENV})])
])
AC_CHECK_PROGS(CARGO, [cargo], [no])
AS_IF([test "$CARGO" = "no"],[
AC_MSG_ERROR([cargo not found. cargo is required to build Rust modules])
])
AC_SUBST([RUST_ENV])
AC_DEFINE(ENABLE_RUST, 1, [Define to 1 for building rust modules.])
])
AM_CONDITIONAL([HAVE_RUST], [test "${enable_rust}" = "yes"])
dnl Lua modules
AC_ARG_ENABLE([lua],
AS_HELP_STRING([--disable-lua],
[disable LUA scripting support (default enabled)]))
if test "${enable_lua}" != "no"
then
PKG_CHECK_MODULES(LUA, lua5.2, [ have_lua=yes ], [:])
AS_IF([test "${have_lua}" != "yes"], [
AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
PKG_CHECK_MODULES(LUA, lua5.1, [ have_lua=yes ], [:]) ])
AS_IF([test "${have_lua}" != "yes"], [
AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
PKG_CHECK_MODULES(LUA, lua >= 5.1, [ have_lua=yes ], [:]) ])
AS_IF([test "${have_lua}" != "yes"], [
AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
have_lua_lib=no
AC_CHECK_LIB( lua5.2 , luaL_newstate, [
LUA_LIBS="-llua5.2"
have_lua_lib=yes], [])
AS_IF([test "${have_lua_lib}" != "yes"], [
AC_CHECK_LIB( lua5.1 , luaL_newstate, [
LUA_LIBS="-llua5.1"
have_lua_lib=yes], [] ) ])
AS_IF([test "${have_lua_lib}" != "yes"], [
AC_CHECK_LIB( lua51 , luaL_newstate, [
LUA_LIBS="-llua51"
have_lua_lib=yes], [] ) ])
AS_IF([test "${have_lua_lib}" != "yes"], [
AC_CHECK_LIB( lua , luaL_newstate,
[LUA_LIBS="-llua"
have_lua_lib=yes],
[ have_lua=no ], [-lm] ) ])
dnl If we found any lib, check that we have the headers too
AS_IF([test "${have_lua_lib}" = "yes"], [
AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h], [ have_lua=yes ], []) ])
])
if test "${have_lua}" != "yes" ; then
AC_MSG_ERROR([Could not find lua. Lua is needed for some interfaces (rc, telnet, http) as well as many other custom scripts. Use --disable-lua to ignore this error.])
fi
AC_ARG_VAR([LUAC], [LUA byte compiler])
AS_IF([test -z "$LUAC"], [
AC_CHECK_TOOL(LUAC, [luac], [false])
])
AS_IF([test "${LUAC}" = "false"], [
AC_MSG_ERROR([Could not find the LUA byte compiler.])
])
AS_IF([test -d "${CONTRIB_DIR}" -a -f "${CONTRIB_DIR}/lib/liblua5.4.a" -a `echo|${LUAC} -o - -|od -j 12 -N 2 -t x2|head -n 1|tr -s ' '|cut -d' ' -f2` != 0804], [
AC_MSG_ERROR([You need 64bit luac when using lua from contrib.])
])
fi
AM_CONDITIONAL([BUILD_LUA], [test "${have_lua}" = "yes"])
dnl
dnl VideoLAN manager
dnl
AC_ARG_ENABLE([vlm],
AS_HELP_STRING([--disable-vlm],
[disable the stream manager (default enabled)]),,
[enable_vlm="${enable_sout}"])
AS_IF([test "${enable_vlm}" != "no"], [
AS_IF([test "${enable_sout}" = "no"], [
AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
])
AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
])
AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
dnl
dnl Addons manager storage and repositories modules
dnl
AC_ARG_ENABLE([addonmanagermodules],
AS_HELP_STRING([--disable-addonmanagermodules],
[disable the addons manager modules (default enabled)]))
if test "${enable_addonmanagermodules}" != "no"
then
AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
fi
AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
dnl
dnl Input plugins
dnl
EXTEND_HELP_STRING([Input plugins:])
dnl
dnl libarchive access module
dnl
PKG_ENABLE_MODULES_VLC([ARCHIVE], [archive], [libarchive >= 3.1.0], (libarchive support), [auto])
dnl
dnl live555 input
dnl
AC_ARG_ENABLE([live555],
AS_HELP_STRING([--enable-live555],
[enable RTSP input through live555 (default enabled)]))
AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
PKG_CHECK_MODULES(LIVE555, live555, [
VLC_ADD_PLUGIN([live555])
VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
], [
AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
AC_LANG_PUSH(C++)
VLC_SAVE_FLAGS
dnl detect include paths
AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
], [
AS_IF([test "${SYS}" != "os2"], [
LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
], [
LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
])
])
dnl CPP Flags
AS_IF([test "${SYS}" = "solaris"], [
CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
])
CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
dnl version check
AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
[#include <liveMedia_version.hh>
#if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
# error BOOM
#endif]])
], [
ac_cv_live555="yes"
], [
ac_cv_live555="no"
])
])
AS_IF([test "$ac_cv_live555" = "no"], [
AC_MSG_WARN([live555 is missing or its installed version is too old:
Version 2011.12.23 or later is required to proceed.
You can get an updated one from http://www.live555.com/liveMedia .])
AS_IF([test -n "${enable_live555}"], [
AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
])
], [
other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
AS_IF([test "${SYS}" = "mingw32"], [
# add ws2_32 for closesocket, select, recv
other_libs="$other_libs -lws2_32"
])
dnl We need to check for pic because live555 does not provide shared libs
dnl and we want to build a plugins so we need -fPIC on some arch.
VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
AC_CHECK_LIB([liveMedia_pic], [main], [
VLC_ADD_PLUGIN([live555])
VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
],[
AC_CHECK_LIB([liveMedia], [main], [
VLC_ADD_PLUGIN([live555])
VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
],[],[${other_libs}])
],[${other_libs_pic}])
])
VLC_RESTORE_FLAGS
AC_LANG_POP(C++)
])
])
dnl
dnl IIDC and DV FireWire input modules
dnl
PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
dnl
dnl - linsys modules: access module check for libzvbi
dnl
AC_ARG_ENABLE([linsys],
AS_HELP_STRING([--enable-linsys],
[Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)]))
AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
VLC_ADD_PLUGIN([linsys_hdsdi])
PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
VLC_ADD_PLUGIN([linsys_sdi])
], [
AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
])
])
dnl
dnl dvdread module: check for libdvdread
dnl
PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 6.0.0], [dvdread input module], [auto])
dnl
dnl libdvdnav plugin
dnl
PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav >= 6.0.0], [DVD with navigation input module (dvdnav)], [auto])
dnl
dnl Blu-ray Disc Support with libbluray
dnl
PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 1.1.0], (libbluray for Blu-ray disc support ) )
dnl
dnl OpenCV wrapper and example filters
dnl
PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
dnl
dnl libsmbclient plugin
dnl
PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smbc], [smbclient], (SMB/CIFS support), [auto])
dnl
dnl liBDSM access module
dnl
PKG_HAVE_WITH_MODULES([DSM], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
dnl
dnl sftp access support
dnl
PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
dnl
dnl nfs access support
dnl
PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
dnl
dnl smb2 access support
dnl
PKG_ENABLE_MODULES_VLC([SMB2], [smb2], [libsmb2 >= 3.0.0], (support smb2 protocol via libsmb2), [auto])
dnl
dnl Video4Linux 2
dnl
AC_ARG_ENABLE([v4l2], AS_HELP_STRING([--disable-v4l2],
[disable Video4Linux version 2 (default auto)]))
have_v4l2="no"
AS_IF([test "$enable_v4l2" != "no"], [
AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
have_v4l2="yes"
])
])
AM_CONDITIONAL([HAVE_V4L2], [test "${have_v4l2}" != "no"])
dnl
dnl NVDEC decoder/encoder
dnl
AC_ARG_ENABLE([nvdec], AS_HELP_STRING([--disable-nvdec],
[disable NVDEC decoder (default auto)]))
have_nvdec="no"
AS_IF([test "$enable_nvdec" != "no"], [
AC_CHECK_HEADERS([ffnvcodec/dynlink_loader.h], [
have_nvdec="yes"
])
])
AM_CONDITIONAL([HAVE_NVDEC], [test "${have_nvdec}" != "no"])
dnl
dnl AMD Advanced Media Framework API
dnl
AC_ARG_ENABLE([amf-scaler], AS_HELP_STRING([--disable-amf-scaler],
[disable AMD Scaler API (default auto)]))
have_amf_scaler="no"
AS_IF([test "$enable_amf_scaler" != "no"], [
AC_CHECK_HEADERS([AMF/core/PropertyStorage.h AMF/components/HQScaler.h], [
have_amf_scaler="yes"
AC_DEFINE(HAVE_AMF_SCALER, 1, AMD HQScaler supported)
])
])
AM_CONDITIONAL([HAVE_AMF_SCALER], [test "${have_amf_scaler}" != "no"])
AC_ARG_ENABLE([amf-enhancer], AS_HELP_STRING([--disable-amf-enhancer],
[disable AMD Enhancer API (default auto)]))
have_amf_enhancer="no"
AS_IF([test "$enable_amf_enhancer" != "no"], [
AC_CHECK_HEADERS([AMF/core/PropertyStorage.h AMF/components/VQEnhancer.h], [
have_amf_enhancer="yes"
])
])
AM_CONDITIONAL([HAVE_AMF_ENHANCER], [test "${have_amf_enhancer}" != "no"])
dnl
dnl special access module for Blackmagic SDI cards
dnl
AC_ARG_ENABLE([decklink],
AS_HELP_STRING([--disable-decklink],
[disable Blackmagic DeckLink SDI input (default auto)]))
AC_ARG_WITH([decklink_sdk],
AS_HELP_STRING([--with-decklink-sdk=DIR],
[location of Blackmagic DeckLink SDI SDK]))
have_decklink=no
if test "${enable_decklink}" != "no"
then
if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
then
VLC_ADD_CPPFLAGS([decklink decklinkoutput stream_out_sdi],[-I${with_decklink_sdk}/include])
elif test -d "${CONTRIB_DIR}/include/decklink"
then
VLC_ADD_CPPFLAGS([decklink decklinkoutput stream_out_sdi],[-I${CONTRIB_DIR}/include/decklink])
fi
VLC_SAVE_FLAGS
CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([DeckLinkAPI.h], [
have_decklink=yes
AS_IF([test "${SYS}" = "darwin"], [
VLC_ADD_LIBS([decklink decklinkoutput stream_out_sdi],[-Wl,-framework,CoreFoundation])
])
], [
AS_IF([test "${enable_decklink}" = "yes"], [
AC_MSG_ERROR([Blackmagic DeckLink SDI include files not found!])
], [
AC_MSG_WARN([Blackmagic DeckLink SDI include files not found, decklink disabled])
])
])
AC_LANG_POP([C++])
VLC_RESTORE_FLAGS
fi
AM_CONDITIONAL([HAVE_DECKLINK], [ test "${have_decklink}" != "no" ])
dnl
dnl Built-in CD-DA and VCD module
dnl
AC_ARG_ENABLE([vcd],
AS_HELP_STRING([--disable-vcd],
[disable built-in VCD and CD-DA support (default enabled)]))
AC_ARG_ENABLE([libcddb],
AS_HELP_STRING([--disable-libcddb],
[disable CDDB for Audio CD (default enabled)]))
if test "${enable_vcd}" != "no" -a "${enable_winstore_app}" != "yes"
then
AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
AC_MSG_RESULT(yes)
VLC_ADD_PLUGIN([vcd cdda])
],[
AC_MSG_RESULT(no)
])
AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
AC_MSG_RESULT(yes)
VLC_ADD_PLUGIN([vcd cdda])
AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
],[
AC_MSG_RESULT(no)
])
AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
AC_MSG_RESULT(yes)
VLC_ADD_PLUGIN([vcd cdda])
AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
],[
AC_MSG_RESULT(no)
])
if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
then
VLC_ADD_PLUGIN([vcd cdda])
fi
if test "$enable_libcddb" != "no"; then
PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
HAVE_LIBCDDB=yes
AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
],:
[AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
HAVE_LIBCDDB=no])
fi
fi
dnl
dnl Linux DVB
dnl
AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
[#include <linux/dvb/version.h>
#if (DVB_API_VERSION < 5)
# error Linux DVB API v3.2 and older are not supported.
#endif
#if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
# error Linux DVB API v5.0 is unsupported. Please update.
#endif
]])], [
ac_cv_linux_dvb_5_1=yes
], [
ac_cv_linux_dvb_5_1=no
])])
AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
dnl
dnl Screen capture module
dnl
AC_ARG_ENABLE([screen],
AS_HELP_STRING([--enable-screen],
[disable screen capture (default enabled)]))
if test "${enable_screen}" != "no"; then
if test "${SYS}" = "darwin"; then
AC_CHECK_HEADERS([ApplicationServices/ApplicationServices.h], [
VLC_ADD_PLUGIN([screen])
])
fi
fi
AM_CONDITIONAL([HAVE_MAC_SCREEN], [test "${SYS}" = "darwin" -a "${enable_screen}" != "no"])
dnl
dnl VNC/RFB access module
dnl
PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
dnl RDP/Remote Desktop access module
dnl
PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp2 >= 2.0.0], (RDP/Remote Desktop client support) )
dnl
dnl AVFoundation
AC_SUBST([have_avfoundation], ["no"])
AC_ARG_ENABLE([macosx-avfoundation],
AS_HELP_STRING([--enable-macosx-avfoundation], [Mac OS X avcapture (video) module (default enabled on Mac OS X)]))
if test "${enable_macosx_avfoundation}" != "no" &&
(test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
then
SAVED_LIBS="${LIBS}"
LIBS="-framework AVFoundation"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
LIBS="${SAVED_LIBS}"
if test "${have_avfoundation}" != "no"
then
VLC_ADD_PLUGIN([avcapture])
fi
fi
AM_CONDITIONAL([HAVE_AVFOUNDATION], [test "${have_avfoundation}" != "no"])
dnl
dnl DCP plugin (using asdcplib)
dnl
PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
AM_CONDITIONAL([HAVE_ASDCP], [test "${have_asdcp}" = "yes"])
dnl
dnl Demux plugins
dnl
EXTEND_HELP_STRING([Mux/Demux plugins:])
dnl
dnl libdvbpsi check for ts mux/demux
dnl
have_dvbpsi="no"
PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
AM_CONDITIONAL([HAVE_DVBPSI], [test "${have_dvbpsi}" = "yes"])
dnl
dnl libdvbcsa check for ts mux/demux
dnl
dnl doesn't provide pkgconfig yet (as for 1.1.0)
PKG_WITH_MODULES([DVBCSA], [dvbcsa], [have_dvbcsa="yes"], [
VLC_SAVE_FLAGS
CPPFLAGS="${CPPFLAGS} ${DVBCSA_CFLAGS}"
LDFLAGS="${LDFLAGS} ${DVBCSA_LIBS}"
AC_CHECK_HEADER([dvbcsa/dvbcsa.h], [
AC_CHECK_LIB([dvbcsa], [dvbcsa_decrypt], [
have_dvbcsa="yes"
DVBCSA_LIBS="${DVBCSA_LIBS} -ldvbcsa"
AC_SUBST([DVBCSA_LIBS])
])
])
VLC_RESTORE_FLAGS
])
AS_IF([test "${have_dvbcsa}" = "yes"], [AC_DEFINE(HAVE_DVBCSA, 1, [Define if libdvbcsa is available.])])
dnl
dnl GME demux plugin
dnl
PKG_ENABLE_MODULES_VLC([GME], [], [libgme], [Game Music Emu support (default auto)], [auto])
dnl
dnl SIDPlay plugin
dnl
AC_ARG_ENABLE([sid],
AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)]))
AS_IF([test "${enable_sid}" != "no"], [
PKG_CHECK_MODULES(SID, [libsidplay2], [
AC_LANG_PUSH(C++)
oldCPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
AC_CHECK_HEADER([sidplay/builders/resid.h], [
VLC_ADD_PLUGIN([sid])
VLC_ADD_CXXFLAGS([sid], [$SID_CFLAGS])
VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
], [
AS_IF([test -n "${enable_sid}"],
[AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
[AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
)
])
CPPFLAGS="$oldCPPFLAGS"
AC_LANG_POP(C++)
], [
AS_IF([test "${enable_sid}" = "yes"],
[AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
[AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
)
])
])
dnl
dnl ogg demux plugin
dnl
PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
],[true])
PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
if test "${enable_sout}" != "no"; then
dnl Check for libshout
PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.4.3], [libshout output plugin], [auto])
fi
dnl
dnl matroska demux plugin
dnl
PKG_WITH_MODULES([MATROSKA], [libebml >= 1.3.6 libmatroska], [
VLC_ADD_PLUGIN([mkv])
VLC_ADD_CFLAGS([mkv], [$MATROSKA_CFLAGS])
VLC_ADD_LIBS([mkv], [$MATROSKA_LIBS])
have_matroska="yes"
],,[MKV format support], [auto])
AM_CONDITIONAL([HAVE_MATROSKA], [test "${have_matroska}" = "yes"])
dnl
dnl modplug demux plugin
dnl
AC_ARG_ENABLE([mod],
AS_HELP_STRING([--disable-mod],
[do not use libmodplug (default auto)]))
if test "${enable_mod}" != "no" ; then
PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.9.0], [
VLC_ADD_PLUGIN([mod])
VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
],[
AS_IF([test -n "${enable_mod}"],
[AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
[AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
])
fi
dnl
dnl mpc demux plugin
dnl
AC_ARG_ENABLE([mpc],
AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)]))
if test "${enable_mpc}" != "no"
then
AC_CHECK_HEADERS([mpc/mpcdec.h], [
VLC_ADD_PLUGIN([mpc])
VLC_ADD_LIBS([mpc],[-lmpcdec])
])
fi
dnl
dnl Codec plugins
dnl
EXTEND_HELP_STRING([Codec plugins:])
dnl
dnl shine encoder plugin
dnl
PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
dnl
dnl openmax il codec plugin
dnl
AC_ARG_ENABLE([omxil],
AS_HELP_STRING([--enable-omxil], [openmax il codec module (default disabled)]))
if test "${enable_omxil}" = "yes"
then
VLC_ADD_PLUGIN([omxil])
fi
dnl
dnl raspberry pi openmax il configuration
dnl
AC_ARG_ENABLE([rpi-omxil],
AS_HELP_STRING([--enable-rpi-omxil], [openmax il configured for raspberry pi (default disabled)]))
if test "${enable_rpi_omxil}" = "yes"
then
VLC_ADD_PLUGIN([omxil])
VLC_ADD_CFLAGS([omxil],[-DRPI_OMX])
fi
dnl
dnl mad plugin
dnl
have_mad="no"
MAD_CFLAGS=""
MAD_LIBS=""
AC_ARG_WITH(mad, AS_HELP_STRING([--with-mad=PATH], [path to libmad]), [
enable_mad="yes"
], [
with_mad="no"
])
AS_IF([test "${with_mad}" != "no"], [
MAD_CFLAGS="-I${with_mad}/include"
MAD_LIBS="-L${with_mad}/lib"
])
AC_ARG_ENABLE([mad],
AS_HELP_STRING([--enable-mad], [libmad module (default enabled)]))
AS_IF([test "${enable_mad}" != "no"], [
VLC_SAVE_FLAGS
CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
AC_CHECK_HEADERS([mad.h], [
AC_CHECK_LIB([mad], [mad_bit_init], [
have_mad="yes"
MAD_LIBS="${MAD_LIBS} -lmad"
])
])
VLC_RESTORE_FLAGS
AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
])
])
AC_SUBST([MAD_CFLAGS])
AC_SUBST([MAD_LIBS])
AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
dnl mpg123 plugin
dnl
dnl
PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
dnl
dnl gstreamer stuff
dnl
AC_ARG_ENABLE([gst-decode],
AS_HELP_STRING([--enable-gst-decode], [GStreamer based decoding support (currently supports only video decoding) (default auto)]))
have_gst_decode="no"
AS_IF([test "${enable_gst_decode}" != "no"], [
PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0 gstreamer-allocators-1.0], [
have_gst_decode="yes"
], [
AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
])
], [
AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
])
])
AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
dnl
dnl avcodec decoder/encoder plugin
dnl
AC_ARG_ENABLE([merge-ffmpeg],
AS_HELP_STRING([--enable-merge-ffmpeg], [merge FFmpeg-based plugins (default disabled)]),, [
enable_merge_ffmpeg="no"
])
AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
dnl We require ffmpeg >= 4.2
dnl Ubuntu Focal (20.04 LTS) has 4.2, debian stable (bookworm) has 5.1
PKG_HAVE_WITH_MODULES([AVCODEC], [libavcodec >= 58.54.100 libavutil >= 56.31.100],
[libavcodec codec (default enabled)], [yes])
dnl
dnl libva needs avcodec
dnl
AC_ARG_ENABLE([libva],
AS_HELP_STRING([--enable-libva], [VAAPI GPU decoding support (libVA) (default auto)]))
have_vaapi="no"
have_vaapi_drm="no"
have_vaapi_x11="no"
have_vaapi_wl="no"
AS_IF([test "${enable_libva}" != "no"], [
PKG_CHECK_MODULES([LIBVA], [libva >= 1.0], [
have_vaapi="yes"
], [
AS_IF([test -n "${enable_libva}"], [
AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
], [
AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
])
])
PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
have_vaapi_drm="yes"
], [
AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
])
PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
have_vaapi_x11="yes"
], [
AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
])
PKG_CHECK_MODULES(LIBVA_WL, [libva-wayland], [
have_vaapi_wl="yes"
], [
AC_MSG_WARN([${LIBVA_WL_PKG_ERRORS}.])
])
])
AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"])
AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"])
dnl
dnl dxva2 needs avcodec
dnl
AC_ARG_ENABLE([dxva2],
AS_HELP_STRING([--enable-dxva2], [DxVA2 GPU decoding support (default auto)]))
have_avcodec_dxva2="no"
AS_IF([test "${enable_dxva2}" != "no"], [
AS_IF([test "${SYS}" = "mingw32"], [
AS_IF([test "${enable_avcodec}" != "no"], [
AC_CHECK_HEADERS([libavcodec/dxva2.h], [
AC_MSG_NOTICE([DxVA2 acceleration activated])
have_avcodec_dxva2="yes"
],[
AS_IF([test "${enable_dxva2}" = "yes"],[
AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])
],[
AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])
])
])
],[
AS_IF([test "x${enable_dxva2}" != "x"], [
AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
])
])
])
])
AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
dnl
dnl d3d11va needs avcodec
dnl
AC_ARG_ENABLE([d3d11va],
AS_HELP_STRING([--enable-d3d11va], [D3D11 GPU decoding support (default auto)]))
have_avcodec_d3d11va="no"
AS_IF([test "${enable_d3d11va}" != "no"], [
AS_IF([test "${SYS}" = "mingw32"], [
AS_IF([test "${enable_avcodec}" != "no"], [
AC_CHECK_HEADERS([libavcodec/d3d11va.h], [
AC_MSG_NOTICE([D3D11 acceleration activated])
have_avcodec_d3d11va="yes"
],[
AS_IF([test "${enable_d3d11va}" = "yes"], [
AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])
],[
AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])
])
])
],[
AS_IF([test "x${enable_d3d11va}" != "x"], [
AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
])
])
])
])
AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
dnl
dnl DXGI debug
dnl
AC_CHECK_HEADERS([dxgidebug.h dxgi1_6.h d3d11_4.h])
dnl
dnl IStorageFolder
dnl
AS_IF([test "$vlc_winstore_app" = "1"],
[
AC_MSG_CHECKING([for proper __x_ABI_CWindows_CStorage_CIStorageFolder definition])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <windows.storage.h>
__x_ABI_CWindows_CStorage_CIStorageFolder *toto;
]])], [
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
AC_MSG_ERROR([IStorageFolder not properly defined, use mingw-w64 8.0.1 or higher])
])
AC_MSG_CHECKING([for proper __x_ABI_CWindows_CStorage_CIApplicationData2 definition])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <windows.storage.h>
__x_ABI_CWindows_CStorage_CIApplicationData2 *toto;
]])], [
AC_MSG_RESULT([yes])
have_iapplication_data2="yes"
], [
AC_MSG_RESULT([no])
])
])
AM_CONDITIONAL([HAVE_WINDOWS_STORAGE], [test "${have_iapplication_data2}" = "yes"])
dnl
dnl DirectComposition
dnl
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([dcomp.h], [
have_dcomp="yes"
], [], [
#include <windows.h>
])
AC_LANG_POP([C++])
AM_CONDITIONAL([HAVE_DCOMP], [test "${have_dcomp}" = "yes"])
dnl
dnl avformat demuxer/muxer plugin
dnl
AC_ARG_ENABLE([avformat],
AS_HELP_STRING([--enable-avformat], [libavformat containers (default enabled)]),, [
enable_avformat="${enable_avcodec}"
])
have_avformat="no"
AS_IF([test "${enable_avformat}" != "no"], [
PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 58.29.100 libavcodec libavutil], [
have_avformat="yes"
VLC_SAVE_FLAGS
CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
AC_CHECK_HEADERS([libavformat/avformat.h libavformat/avio.h])
AS_IF([test "$enable_merge_ffmpeg" = "no"], [
have_avformat="no"
])
VLC_RESTORE_FLAGS
],[
AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
])
])
AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
dnl
dnl swscale image scaling and conversion plugin
dnl
AC_ARG_ENABLE([swscale],
AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
(default enabled)]))
if test "${enable_swscale}" != "no"
then
PKG_CHECK_MODULES(SWSCALE,[libswscale >= 0.5.0],
[
VLC_ADD_PLUGIN([swscale])
VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
],[
AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
])
fi
dnl
dnl postproc plugin
dnl
AC_ARG_ENABLE([postproc],
AS_HELP_STRING([--enable-postproc], [libpostproc image post-processing (default auto)]))
if test "${enable_postproc}" != "no"
then
PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
[
VLC_SAVE_FLAGS
CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
AC_CHECK_HEADERS([postproc/postprocess.h])
VLC_ADD_PLUGIN([postproc])
VLC_RESTORE_FLAGS
],[
AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
])
fi
dnl
dnl faad decoder plugin
dnl
PKG_WITH_MODULES([FAAD],[faad2],
VLC_ADD_PLUGIN(faad)
VLC_ADD_CFLAGS(faad, [$FAAD_CFLAGS])
VLC_ADD_LIBS(faad,[$FAAD_LIBS]),
AS_IF([test "${enable_faad}" != "no"],[
AC_CHECK_HEADERS([neaacdec.h], [
AC_CHECK_LIB([faad], [NeAACDecOpen],[
VLC_ADD_PLUGIN([faad])
VLC_ADD_LIBS([faad],[-lfaad])
found_faad="yes"
],[], [$LIBM])
])
AS_IF([test "${found_faad}" != "yes"],
AS_IF([test "${enable_faad}" == "yes"],
AC_MSG_ERROR([${FAAD_PKG_ERRORS}.]),
AC_MSG_WARN([${FAAD_PKG_ERRORS}.]))
)
]),
[faad AAC audio decoder])
dnl
dnl AOM encoder/decoder plugin
dnl
PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [libaom AV1 encoder and decoder (default auto)])
dnl
dnl Rav1e encoder plugin
dnl
PKG_ENABLE_MODULES_VLC([RAV1E], [], [rav1e], [rav1e encoder module codec (default auto)])
dnl
dnl Dav1d decoder plugin
dnl
PKG_ENABLE_MODULES_VLC([DAV1D], [], [dav1d >= 0.5.0], [AV1 decoder (default auto)])
dnl
dnl libvpx decoder plugin
dnl
AC_ARG_ENABLE([vpx],
AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
AS_IF([test "${enable_vpx}" != "no"],[
PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
VLC_ADD_PLUGIN([vpx])
VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
], [], [${VPX_LIBS}])
AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
], [], [${VPX_LIBS}])
AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
], [], [${VPX_LIBS}])
AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
], [], [${VPX_LIBS}])
], [
AS_IF([test "${enable_vpx}" = "yes"],[
AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
])])
])
dnl
dnl twolame encoder plugin
dnl
PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
dnl
dnl fdk-aac encoder plugin
dnl
PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
dnl
dnl A52/AC3 decoder plugin
dnl
AC_ARG_ENABLE([a52],
AS_HELP_STRING([--enable-a52], [A/52 support with liba52 (default enabled)]))
if test "${enable_a52}" != "no"
then
AC_ARG_WITH([a52],
AS_HELP_STRING([--with-a52=PATH], [a52 headers and libraries]))
if test -z "${with_a52}"
then
LDFLAGS_test=""
CPPFLAGS_test=""
else
LDFLAGS_test="-L${with_a52}/lib"
CPPFLAGS_test="-I${with_a52}/include"
fi
VLC_SAVE_FLAGS
CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
AC_CHECK_HEADERS([a52dec/a52.h], [
AC_CHECK_LIB([a52], [a52_free], [
VLC_ADD_PLUGIN([a52])
VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
],[
AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
], [$LIBM])
],[
AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
])
VLC_RESTORE_FLAGS
fi
dnl
dnl DTS Coherent Acoustics decoder plugin
dnl
PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
dnl
dnl Flac plugin
dnl
PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
dnl
dnl Libmpeg2 plugin
dnl
PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
dnl
dnl Vorbis plugin
dnl
PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
dnl
dnl Tremor plugin
dnl
AC_ARG_ENABLE([tremor],
AS_HELP_STRING([--enable-tremor], [Tremor decoder support (default disabled)]))
if test "${enable_tremor}" = "yes"
then
AC_CHECK_HEADERS([tremor/ivorbiscodec.h], [
VLC_ADD_PLUGIN([tremor])
],[])
fi
dnl
dnl Speex plugins
dnl
PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
have_speexdsp="no"
AS_IF([test "${enable_speex}" != "no"], [
PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
have_speexdsp="yes"
], [
AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
])
])
AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
dnl
dnl RNNoise plugin - Recurrent neural network for audio noise reduction
dnl
PKG_ENABLE_MODULES_VLC([RNNOISE], [], [rnnoise], [Rnnoise denoiser], [auto])
dnl
dnl Opus plugin
dnl
PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
dnl
dnl Ambisonic channel mixer and binauralizer plugin
dnl
PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto])
dnl
dnl theora decoder plugin
dnl
PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
dnl
dnl OggSpots decoder plugin
dnl
PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
dnl
dnl Daala decoder plugin
dnl
PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
dnl
dnl schroedinger decoder plugin (for dirac format video)
dnl
PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
dnl
dnl PNG decoder module
dnl
AC_ARG_ENABLE([png],
AS_HELP_STRING([--enable-png], [PNG support (default enabled)]))
AS_IF([test "${enable_png}" != "no"], [
AC_CHECK_HEADERS([png.h], [
VLC_SAVE_FLAGS
LDFLAGS="${LDFLAGS} -lz $LIBM"
AC_CHECK_LIB([png], [png_set_alpha_mode], [
VLC_ADD_PLUGIN([png])
], [], [-lz $LIBM])
VLC_RESTORE_FLAGS
])
])
dnl
dnl JPEG decoder module
dnl
AC_ARG_ENABLE([jpeg],
AS_HELP_STRING([--enable-jpeg], [JPEG support (default enabled)]))
AS_IF([test "${enable_jpeg}" != "no"], [
AC_CHECK_HEADERS([jpeglib.h], [
AC_MSG_CHECKING([for JPEG library source/destination support])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
#include <jpeglib.h>
#if (JPEG_LIB_VERSION < 80) && !defined(MEM_SRCDST_SUPPORTED)
#error JPEG library too old
#endif]],[[;]])
],[
AC_MSG_RESULT([yes])
VLC_ADD_PLUGIN([jpeg])
], [
AC_MSG_RESULT([no])
])
])
])
dnl
dnl BPG decoder module
dnl
AC_ARG_ENABLE([bpg],
AS_HELP_STRING([--enable-bpg], [BPG support (default disabled)]))
AS_IF([test "${enable_bpg}" != "no"], [
AC_CHECK_HEADERS([libbpg.h], [
VLC_ADD_PLUGIN([bpg])
])
])
dnl
dnl H262 encoder plugin (lib262)
dnl
AC_ARG_ENABLE([x262],
AS_HELP_STRING([--enable-x262], [H262 encoding support with static libx262 (default disabled)]))
AS_IF([test "${enable_x262}" != "no"], [
PKG_CHECK_MODULES(X262, x262, [
VLC_ADD_PLUGIN([x262])
VLC_ADD_LIBS([x262],[${X262_LIBS}])
VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
],[
AS_IF([test "${enable_x262}" = "yes"], [
AC_MSG_ERROR([x262 module does not work without statically compiled libx262.a])
])
])
])
dnl x265 encoder
PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
dnl
dnl H264 encoder plugin (using libx264)
dnl
AC_ARG_ENABLE([x264],
AS_HELP_STRING([--enable-x264], [H264 encoding support with libx264 (default enabled)]))
if test "${enable_x264}" != "no"; then
PKG_CHECK_MODULES(X264,x264 >= 0.148, [
VLC_ADD_PLUGIN([x264])
VLC_ADD_LIBS([x264],[${X264_LIBS}])
VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
],[
if test "${enable_x264}" = "yes"; then
AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
fi
])
fi
dnl
dnl H264 encoder plugin (libx264 > 153)
dnl
AC_ARG_ENABLE([x26410b],
AS_HELP_STRING([--enable-x26410b], [H264 10-bit encoding support with libx264 (default enabled)]))
if test "${enable_x26410b}" != "no"; then
PKG_CHECK_MODULES(X26410b,x264 >= 0.153, [
VLC_ADD_PLUGIN([x26410b])
VLC_ADD_LIBS([x26410b],[${X264_LIBS}])
VLC_ADD_CFLAGS([x26410b],[${X264_CFLAGS}])
],[
if test "${enable_x26410b}" = "yes"; then
AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
fi
])
fi
dnl
dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
dnl
PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
dnl
dnl AVS2 decoder module (davs2)
dnl
PKG_ENABLE_MODULES_VLC([DAVS2], [davs2], [davs2], [AVS2 video decoder with libdavs2], [auto])
dnl
dnl libfluidsynth (MIDI synthetizer) plugin
dnl
PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
AC_CHECK_HEADERS([fluidlite.h], [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
dnl
dnl Teletext Modules
dnl vbi decoder plugin (using libzbvi)
dnl telx module
dnl uncompatible
dnl
AC_ARG_ENABLE([zvbi],
AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
libzvbi (default enabled)]))
AC_ARG_ENABLE([telx],
AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
zvbi) (default enabled if zvbi is absent)]))
AS_IF( [test "${enable_zvbi}" != "no"],[
PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
[
VLC_ADD_PLUGIN([zvbi])
AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
have_zvbi="yes"
AS_IF( [test "${enable_telx}" = "yes"],[
AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
])
],[
AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
])
])
AM_CONDITIONAL([HAVE_ZVBI], [test "x${have_zvbi}" = x"yes"])
AS_IF( [test "${enable_telx}" != "no" ],[
VLC_ADD_PLUGIN([telx])
have_telx="yes"
AC_DEFINE(TELX_COMPILED, 1, [Define if the telx module is built])
])
AM_CONDITIONAL([HAVE_TELX], [test "x${have_telx}" = x"yes"])
dnl
dnl ARIB caption rendering module
dnl
PKG_ENABLE_MODULES_VLC([ARIBCAPTION], [], [libaribcaption], [ARIB caption decoder/renderer], [auto])
dnl
dnl ARIB subtitles rendering module
dnl
AC_ARG_ENABLE([aribsub],
AS_HELP_STRING([--enable-aribsub],[ARIB Subtitles support (default enabled)]))
AS_IF( [test "${enable_aribsub}" != "no" ],[
PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
have_aribb24="yes"
VLC_ADD_PLUGIN([aribsub])
VLC_ADD_LIBS([aribsub],[-laribb24])
AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
],[
AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
have_aribb24="no"
])
])
AM_CONDITIONAL([HAVE_ARIBB24], [test "${have_aribb24}" = "yes"])
dnl
dnl ARIB B25
dnl
PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
dnl
dnl kate decoder plugin
dnl
PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
dnl
dnl tiger rendering for kate decoder plugin
dnl
AC_ARG_ENABLE([tiger],
AS_HELP_STRING([--enable-tiger], [Tiger rendering library for Kate streams (default auto)]))
AS_IF([test "${enable_tiger}" != "no"], [
PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
AS_IF([test -n "${enable_tiger}"], [
AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
])
])
])
dnl
dnl check if we can build the css selector engine
dnl
AC_ARG_ENABLE([css],
AS_HELP_STRING([--enable-css], [CSS selector engine (default auto)]))
AS_IF([test "${enable_css}" != "no"], [
with_css="yes"
AC_DEFINE(HAVE_CSS, 1, [Define if CSS engine is built])
])
AM_CONDITIONAL([ENABLE_CSS], [test "${with_css}" = "yes"])
dnl
dnl Video plugins
dnl
EXTEND_HELP_STRING([Video plugins:])
dnl
dnl libplacebo support
dnl
AC_ARG_ENABLE([libplacebo],
AS_HELP_STRING([--disable-libplacebo],
[disable libplacebo support (default auto)]))
have_libplacebo_gl="no"
AS_IF([test "$enable_libplacebo" != "no"], [
PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 4.192], [
AC_DEFINE([HAVE_LIBPLACEBO], [1], [Define to 1 if libplacebo is enabled.])
AC_CHECK_HEADER([libplacebo/vulkan.h], [VLC_ADD_PLUGIN([placebo_vk])])
AC_CHECK_HEADER([libplacebo/opengl.h], [
AC_DEFINE([HAVE_LIBPLACEBO_GL], [1], [Define to 1 if <libplacebo/opengl.h> is available.])
VLC_ADD_PLUGIN([placebo_gl])
VLC_ADD_PLUGIN([placebo_gles2])
have_libplacebo_gl="yes"
])
], [
AS_IF([test -n "${enable_libplacebo}"], [
AC_MSG_ERROR([${LIBPLACEBO_PKG_ERRORS}.])
])
enable_libplacebo="no"
])
])
AM_CONDITIONAL([HAVE_LIBPLACEBO], [test "$enable_libplacebo" != "no"])
AM_CONDITIONAL([HAVE_LIBPLACEBO_GL], [test "$have_libplacebo_gl" = "yes"])
dnl
dnl OpenGL
dnl
PKG_HAVE_WITH_MODULES([EGL], [egl])
have_gl="no"
PKG_CHECK_MODULES([GL], [gl], [
have_gl="yes"
], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef _WIN32
# include <GL/glew.h>
#endif
#include <GL/gl.h>
]], [
[int t0 = GL_TEXTURE0;]])
], [
GL_CFLAGS=""
AS_IF([test "${SYS}" != "mingw32"], [
AC_CHECK_LIB([GL], [glTexture2D], [
have_gl="yes"
GL_LIBS="-lGL"
])
], [
have_gl="yes"
GL_LIBS="-lopengl32"
])
AC_CHECK_HEADERS([GL/glew.h], [
AC_CHECK_HEADERS([GL/wglew.h], [
VLC_ADD_PLUGIN([glwin32 wgl])
], [], [
#include <windows.h>
#include <GL/glew.h>
])
], [], [#include <windows.h>])
])
AC_MSG_CHECKING([for OpenGL])
AC_MSG_RESULT([${have_gl}])
])
AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
AS_IF([test "${have_gl}" = "yes"], [
AC_DEFINE([HAVE_GL], 1, [Defined if having OpenGL])
])
dnl OpenGL ES 2: depends on EGL 1.1
PKG_HAVE_WITH_MODULES([GLES2], [glesv2], [enable GLES2 support (default auto)])
dnl
dnl Vulkan
dnl
AC_ARG_ENABLE(vulkan,
[AS_HELP_STRING([--disable-vulkan],
[disable Vulkan support (default auto)])])
AS_IF([test "$enable_vulkan" != "no"], [
PKG_CHECK_MODULES([VULKAN], [vulkan >= 1.0.26], [
AC_DEFINE([HAVE_VULKAN], [1], [Define to 1 if vulkan is enabled.])
], [
AS_IF([test -n "${enable_vulkan}"], [
AC_MSG_ERROR([${VULKAN_PKG_ERRORS}.])
])
enable_vulkan="no"
])
])
AM_CONDITIONAL(HAVE_VULKAN, [test "$enable_vulkan" != "no"])
dnl
dnl Xlib
dnl
AC_PATH_XTRA()
AM_CONDITIONAL([HAVE_X], [test "$no_x" != "yes"])
dnl
dnl X C Bindings modules
dnl
AC_ARG_ENABLE([xcb],
AS_HELP_STRING([--enable-xcb], [X11 support with XCB (default enabled)]),, [
AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
enable_xcb="yes"
], [
enable_xcb="no"
])
])
have_xcb="no"
have_xkbcommon_x11="no"
have_xcb_keysyms="no"
have_xcb_damage="no"
have_xcb_xfixes="no"
AS_IF([test "${enable_xcb}" != "no"], [
xcb_err=""
dnl libxcb
PKG_CHECK_MODULES([XCB], [xcb >= 1.8],, [
xcb_err="$xcb_err ${XCB_PKG_ERRORS}."])
PKG_CHECK_MODULES([XCB_COMPOSITE], [xcb-composite],, [
xcb_err="$xcb_err ${XCB_COMPOSITE_PKG_ERRORS}."])
PKG_CHECK_MODULES([XCB_RANDR], [xcb-randr >= 1.3],, [
xcb_err="$xcb_err ${XCB_RANDR_PKG_ERRORS}."])
PKG_CHECK_MODULES([XCB_RENDER], [xcb-render],, [
xcb_err="$xcb_err ${XCB_RENDER_PKG_ERRORS}."])
PKG_CHECK_MODULES([XCB_SHM], [xcb-shm >= 1.9.2],, [
xcb_err="$xcb_err ${XCB_SHM_PKG_ERRORS}."])
PKG_CHECK_MODULES([XCB_XKB], [xcb-xkb],, [
xcb_err="$xcb_err ${XCB_XKB_PKG_ERRORS}."])
dnl xproto
PKG_CHECK_MODULES(XPROTO, [xproto],, [
xcb_err="$xcb_err ${XPROTO_PKG_ERRORS}."])
AS_IF([test -n "$xcb_err"], [
AC_MSG_ERROR([$xcb_err Pass --disable-xcb to skip X11 support.])
])
dnl xkbcommon
PKG_CHECK_MODULES([XKBCOMMON_X11], [xkbcommon-x11], [
have_xkbcommon_x11="yes"
], [
AC_MSG_WARN([${XKBCOMMON_X11_PKG_ERRORS}. Hotkeys are disabled.])
])
dnl xcb-utils
PKG_CHECK_MODULES([XCB_KEYSYMS], [xcb-keysyms >= 0.3.4], [
have_xcb_keysyms="yes"
], [
AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Global hotkeys are disabled.])
])
dnl xcb-damage
PKG_CHECK_MODULES([XCB_DAMAGE], [xcb-damage], [
have_xcb_damage="yes"
], [
AC_MSG_WARN([${XCB_DAMAGE_PKG_ERRORS}. Qt X11 composition disabled.])
])
dnl xcb-fixes
PKG_CHECK_MODULES([XCB_XFIXES], [xcb-xfixes], [
have_xcb_xfixes="yes"
], [
AC_MSG_WARN([${XCB_XFIXES_PKG_ERRORS}. Qt X11 composition disabled.])
])
have_xcb="yes"
])
AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
AM_CONDITIONAL([HAVE_XKBCOMMON_X11], [test "${have_xkbcommon_x11}" = "yes"])
AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
AM_CONDITIONAL([HAVE_XCB_DAMAGE], [test "${have_xcb_damage}" = "yes"])
AM_CONDITIONAL([HAVE_XCB_XFIXES], [test "${have_xcb_xfixes}" = "yes"])
dnl
dnl VDPAU needs X11
dnl
AC_ARG_ENABLE([vdpau],
[AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
have_vdpau="no"
AS_IF([test "${enable_vdpau}" != "no"], [
PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
have_vdpau="yes"
AS_IF([test "${no_x}" = "yes"], [
AC_MSG_ERROR([VDPAU requires Xlib (X11).])
])
], [
AS_IF([test -n "${enable_vdpau}"], [
AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
])
])
])
AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
have_avcodec_vdpau="no"
AS_IF([test "${have_vdpau}" = "yes" -a "${enable_avcodec}" != "no"], [
have_avcodec_vdpau="yes"
AC_MSG_NOTICE([VDPAU decoding acceleration activated])
])
AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
dnl
dnl Wayland
dnl
AC_ARG_ENABLE([wayland],
AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)]))
have_wayland="no"
AS_IF([test "${enable_wayland}" != "no"], [
wl_err=""
dnl wayland
PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.19.91],, [
wl_err="$wl_err ${WAYLAND_CLIENT_PKG_ERRORS}."
])
PKG_CHECK_MODULES([WAYLAND_CURSOR], [wayland-cursor],, [
wl_err="$wl_err ${WAYLAND_CURSOR_PKG_ERRORS}."
])
PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl],, [
wl_err="$wl_err ${WAYLAND_EGL_PKG_ERRORS}."
])
AS_VAR_SET_IF(WAYLAND_SCANNER, [],[
PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner >= 1.15], [
WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
], [
wl_err="$wl_err ${WAYLAND_SCANNER_PKG_ERRORS}."
])
])
dnl wayland-protocols
PKG_CHECK_MODULES([WAYLAND_PROTOCOLS], [wayland-protocols >= 1.15], [
WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
], [
wl_err="$wl_err ${WAYLAND_PROTOCOLS_PKG_ERRORS}."
])
AS_IF([test -n "$wl_err"], [
AS_IF([test -n "$enable_wayland"], [
AC_MSG_ERROR([$wl_err])
], [
AC_MSG_WARN([$wl_err])
])
], [
have_wayland="yes"
])
dnl xkbcommon
PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon], [
have_xkbcommon="yes"
], [
AC_MSG_WARN([${XKBCOMMON_PKG_ERRORS}. Hotkeys are disabled.])
])
])
AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
AC_SUBST([WAYLAND_PROTOCOLS])
AC_SUBST([WAYLAND_SCANNER])
AM_CONDITIONAL([HAVE_XKBCOMMON], [test "${have_xkbcommon}" = "yes"])
dnl
dnl freetype module
dnl
AC_ARG_ENABLE([freetype],
AS_HELP_STRING([--enable-freetype], [freetype support (default auto)]))
AC_ARG_ENABLE([fribidi],
AS_HELP_STRING([--enable-fribidi], [fribidi support (default auto)]))
AC_ARG_ENABLE([harfbuzz],
AS_HELP_STRING([--enable-harfbuzz], [harfbuzz support (default auto)]))
AC_ARG_ENABLE([fontconfig],
AS_HELP_STRING([--enable-fontconfig], [fontconfig support (default auto)]))
AC_ARG_WITH([default-font],
AS_HELP_STRING([--with-default-font=PATH],
[Path to the default font]),
[AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
"$withval", [Default font])])
AC_ARG_WITH([default-monospace-font],
AS_HELP_STRING([--with-default-monospace-font=PATH],
[Path to the default font]),
[AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
"$withval", [Default monospace font])])
AC_ARG_WITH([default-font-family],
AS_HELP_STRING([--with-default-font-family=NAME],
[Name of the default font family]),
[AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
"$withval", [Default font family])])
AC_ARG_WITH([default-monospace-font-family],
AS_HELP_STRING([--with-default-monospace-font-family=NAME],
[Name of the default font family]),
[AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
"$withval", [Default monospace font family])])
have_freetype="no"
have_fontconfig="no"
have_fribidi="no"
have_harfbuzz="no"
if test "${enable_freetype}" != "no"; then
PKG_CHECK_MODULES(FREETYPE, freetype2, [
have_freetype="yes"
VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
dnl fontconfig support
AS_IF([test "${enable_fontconfig}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
PKG_CHECK_MODULES(FONTCONFIG, [fontconfig >= 2.11], [
have_fontconfig="yes"
], [
AC_MSG_WARN([${FONTCONFIG_PKG_ERRORS}. Styles will be disabled in FreeType.])
])
])
dnl fribidi support
if test "${enable_fribidi}" != "no"; then
PKG_CHECK_MODULES(FRIBIDI, fribidi, [
have_fribidi="yes"
VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
fi
dnl harfbuzz support
if test "${have_fribidi}" != "no"; then
if test "${enable_harfbuzz}" != "no"; then
PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
have_harfbuzz="yes"
VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
fi
fi
],[
AS_IF([test -n "${enable_freetype}"],[
AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
])
])
fi
AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
dnl
dnl libass subtitle rendering module
dnl
AC_ARG_ENABLE([libass],
AS_HELP_STRING([--enable-libass], [Subtitle support using libass (default enabled)]))
AS_IF( [test "${enable_libass}" != "no"], [
PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
[
VLC_ADD_PLUGIN([libass])
if test "${have_fontconfig}" != "no"; then
VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
VLC_ADD_LIBS([libass],[${FONTCONFIG_LIBS}])
fi
],[
AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
])
])
dnl
dnl SAPI (text to Speech renderer for Windows)
dnl
AC_LANG_PUSH([C++])
AC_CHECK_TYPES([ISpObjectToken],[
have_sapi="yes"
],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
[#include <windows.h>
#include <sapi.h>
#include <sphelper.h>])
AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
AC_LANG_POP([C++])
dnl
dnl SVG module (text rendering and image decoding)
dnl
PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
dnl
dnl Windows DirectX module
dnl
AC_ARG_ENABLE([directx],
AS_HELP_STRING([--enable-directx],
[Microsoft DirectX support (default enabled on Windows)]),, [
AS_IF([test "${SYS}" = "mingw32"], [
enable_directx="yes"
], [
enable_directx="no"
])
])
AS_IF([test "${enable_directx}" != "no"], [
dnl Direct3D11
VLC_ADD_PLUGIN([direct3d11 direct3d11_filters])
dnl Direct3D9
VLC_ADD_PLUGIN([direct3d9 direct3d9_filters])
])
dnl
dnl Direct Rendering Manager (DRM) plugins
dnl
AC_CHECK_HEADER([drm/drm_mode.h], [
have_drm="yes"
], [
have_drm="no"
])
AM_CONDITIONAL([HAVE_DRM], [test "$have_drm" = "yes"])
PKG_HAVE_WITH_MODULES([LIBDRM], [libdrm >= 2.4.83], [Linux kernel mode setting output], [auto])
dnl
dnl libcaca plugin
dnl
PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
dnl
dnl OS/2 KVA plugin
dnl
AC_ARG_ENABLE([kva],
AS_HELP_STRING([--enable-kva],
[support the K Video Accelerator KVA (default enabled on OS/2)]),, [
AS_IF([test "$SYS" = "os2"], [
enable_kva="yes"
])
])
have_kva="no"
KVA_LIBS=""
AS_IF([test "$enable_kva" != "no"], [
AC_CHECK_HEADERS([kva.h], [
have_kva="yes"
AC_CHECK_LIB([kva], [main], [
KVA_LIBS="-lkva"
])
])
])
AC_SUBST([KVA_LIBS])
AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
dnl
dnl MMAL plugin
dnl
MMAL_CFLAGS=""
MMAL_LIBS=""
AC_ARG_ENABLE([mmal],
AS_HELP_STRING([--enable-mmal],
[Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
if test "${enable_mmal}" != "no"; then
VLC_SAVE_FLAGS
LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
AC_CHECK_HEADERS([interface/mmal/mmal.h],
[ AC_CHECK_LIB([bcm_host], [vc_tv_unregister_callback_full], [
have_mmal="yes"
MMAL_CFLAGS="-isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
MMAL_LIBS="-L/opt/vc/lib -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif -lvcsm -lvchiq_arm"
],[
AS_IF([test "${enable_mmal}" = "yes"],
[ AC_MSG_ERROR([Cannot find bcm library...]) ],
[ AC_MSG_WARN([Cannot find bcm library...]) ])
],
[])
] , [ AS_IF([test "${enable_mmal}" = "yes"],
[ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
[ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
VLC_RESTORE_FLAGS
fi
AC_SUBST([MMAL_CFLAGS])
AC_SUBST([MMAL_LIBS])
AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
dnl
dnl Audio plugins
dnl
EXTEND_HELP_STRING([Audio plugins:])
dnl
dnl Pulseaudio module
dnl
AC_ARG_ENABLE([pulse],
AS_HELP_STRING([--enable-pulse],
[use the PulseAudio client library (default auto)]))
have_pulse="no"
AS_IF([test "${enable_pulse}" != "no"], [
PKG_CHECK_MODULES([PULSE], [libpulse >= 6.0], [
have_pulse="yes"
], [
AS_IF([test "x${enable_pulse}" != "x"], [
AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 6.0 or later required.])
])
])
])
AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
dnl
dnl ALSA module
dnl
AC_ARG_ENABLE([alsa],
AS_HELP_STRING([--enable-alsa],
[support the Advanced Linux Sound Architecture (default auto)]),, [
AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
enable_alsa="yes"
])
])
have_alsa="no"
AS_IF([test "${enable_alsa}" != "no"], [
PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
have_alsa="yes"
], [
AS_IF([test "x${enable_alsa}" != "x"], [
AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.])
])
])
])
AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
dnl
dnl Open Sound System module
dnl
AC_ARG_ENABLE([oss],
AS_HELP_STRING([--enable-oss],
[support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)]),, [
AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux"], [
enable_oss="no"
])
])
have_oss="no"
OSS_LIBS=""
AS_IF([test "$enable_oss" != "no"], [
AC_CHECK_HEADERS([sys/soundcard.h], [
have_oss="yes"
AC_CHECK_LIB([ossaudio], [main], [
OSS_LIBS="-lossaudio"
])
])
])
AC_SUBST([OSS_LIBS])
AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
dnl
dnl OpenBSD sndio module
dnl
AC_ARG_ENABLE([sndio],
AS_HELP_STRING([--disable-sndio],
[support the OpenBSD sndio (default auto)]),, [
AS_IF([test "$SYS" = "openbsd"], [
enable_sndio="yes"
])
])
have_sndio="no"
AS_IF([test "$enable_sndio" != "no"], [
PKG_CHECK_MODULES([SNDIO], [sndio], [
have_sndio="yes"
], [
AS_IF([test -n "$enable_sndio"], [
AC_MSG_ERROR([${SNDIO_PKG_ERRORS}.)])
])
])
])
AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
dnl
dnl Windows Audio Session plugin
dnl
AC_ARG_ENABLE([wasapi],
AS_HELP_STRING([--enable-wasapi],
[use the Windows Audio Session API (default auto)])
)
have_wasapi="no"
AS_IF([test "$enable_wasapi" != "no"], [
AC_CHECK_HEADER([audioclient.h], [
have_wasapi="yes"
], [
AS_IF([test "x${enable_wasapi}" != "x"], [
AC_MSG_ERROR([Windows Audio Session API not found.])
])
])
])
AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
dnl
dnl JACK modules
dnl
AC_ARG_ENABLE([jack],
AS_HELP_STRING([--disable-jack],
[do not use jack (default auto)]))
have_jack="no"
AS_IF([test "${enable_jack}" != "no"], [
PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
[ have_jack=yes ],
[
AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
[ have_jack=yes ],
[
AS_IF([test -n "${enable_jack}"],
[AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
[AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
])
])
])
AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
dnl
dnl OpenSLES Android
dnl
AC_ARG_ENABLE([opensles],
AS_HELP_STRING([--enable-opensles], [Android OpenSL ES audio module (default disabled)]))
AS_IF([test "${VENDOR}" = "android" -a "${enable_opensles}" = "yes"],[
AC_CHECK_HEADERS([SLES/OpenSLES.h],
[ VLC_ADD_PLUGIN([opensles_android]) ],
[ AC_MSG_ERROR([cannot find OpenSLES headers])] )
])
dnl
dnl libsamplerate plugin
dnl
PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
dnl
dnl soxr module
dnl
PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
dnl
dnl libebur128 module
dnl
PKG_ENABLE_MODULES_VLC([EBUR128], [], [libebur128 >= 1.2.4], [EBU R 128 standard for loudness normalisation], [auto])
dnl
dnl OS/2 KAI plugin
dnl
AC_ARG_ENABLE([kai],
AS_HELP_STRING([--enable-kai],
[support the K Audio Interface KAI (default enabled on OS/2)]),, [
AS_IF([test "$SYS" = "os2"], [
enable_kai="yes"
])
])
have_kai="no"
KAI_LIBS=""
AS_IF([test "$enable_kai" != "no"], [
AC_CHECK_HEADERS([kai.h], [
have_kai="yes"
AC_CHECK_LIB([kai], [main], [
KAI_LIBS="-lkai"
])
])
])
AC_SUBST([KAI_LIBS])
AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
dnl
dnl chromaprint audio track fingerprinter
dnl
PKG_ENABLE_MODULES_VLC([CHROMAPRINT], [stream_out_chromaprint], [libchromaprint >= 0.6.0], [Chromaprint audio fingeprinter], [auto])
dnl
dnl Chromecast streaming support
dnl
PKG_WITH_MODULES([CHROMECAST],[protobuf-lite], [],[
AS_IF([test "${enable_chromecast}" = "yes"],[
AC_MSG_ERROR(Library protobuf-lite needed for [chromecast] was not found)
],[
AC_MSG_WARN(Library protobuf-lite needed for [chromecast] was not found)
])
enable_chromecast=no
], [(Chromecast streaming support)], [auto])
AC_ARG_VAR(PROTOC, [protobuf compiler])
AS_IF([test -n "$PKG_CONFIG"],[
AC_PATH_PROGS(PROTOC, [protoc], no, ["${CONTRIB_DIR}/../bin:$PATH"])
AS_IF([test "${PROTOC}" != "no"], [
dnl silently checks the protoc version matches the protobuf library
PROTOBUF_VERSION="$(eval ${PROTOC} --version 2>/dev/null | head -1 | sed s/'.* '// | cut -d '.' -f -2)"
protoc_ver_next="${PROTOBUF_VERSION%.*}.$((${PROTOBUF_VERSION##*.}+1))"
AC_MSG_CHECKING([protobuf-lite matches ${PROTOC} version ${PROTOBUF_VERSION}])
($PKG_CONFIG --exists --print-errors "protobuf-lite >= ${PROTOBUF_VERSION} protobuf-lite < ${protoc_ver_next}") 2>&AS_MESSAGE_FD
ac_status=$?
AS_IF([test $ac_status = 0],[
protoc_matching=yes
AC_MSG_RESULT([yes])
],[
protoc_matching=no
AC_MSG_RESULT([no])
])
],[
protoc_matching=no
])
])
AC_SUBST([PROTOBUF_VERSION])
AM_CONDITIONAL([BUILD_CHROMECAST], [test "${enable_chromecast}" != "no" -a "${protoc_matching}" = yes])
dnl
dnl Interface plugins
dnl
EXTEND_HELP_STRING([Interface plugins:])
dnl
dnl KF6WindowSystem
dnl
PKG_CHECK_MODULES([KF6WINDOWSYSTEM], [KF6WindowSystem >= 6.0.0], [
have_kf6windowsystem="yes"
], [
have_kf6windowsystem="no"
])
AM_CONDITIONAL([HAVE_KF6WINDOWSYSTEM], [test "${have_kf6windowsystem}" = "yes"])
dnl
dnl QT
dnl
AC_ARG_ENABLE([qt],
AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)]),, [
AS_IF([test "${enable_vlc}" != "no"], [enable_qt="yes"])
AS_IF([test "${SYS}" = "darwin"], [
enable_qt="no"
])
])
have_qt_gtk="no"
have_qt_quick_test="no"
have_qt_declarative_private="no"
have_qt_gui_private="no"
have_qt_core_private="no"
have_fxc="no"
AS_IF([test "${enable_qt}" != "no"], [
have_qt="yes"
AC_PATH_PROGS(QMAKE6, [qmake6], qmake6, ["$PATH:${CONTRIB_DIR}/../bin"])
AC_ARG_WITH([qtconf],
AS_HELP_STRING([--with-qtconf=PATH], [location of Qt6 qt.conf file (auto)])
)
AS_IF([test -z "${with_qtconf}"], [
AC_MSG_CHECKING([if contribs provide target_qt.conf])
AS_IF([test -e "${CONTRIB_DIR}/bin/target_qt.conf"], [
with_qtconf=${CONTRIB_DIR}/bin/target_qt.conf
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([no])
])
])
QT_PATHS=${QMAKE6}
AS_IF([test -n "${with_qtconf}"], [
QT_PATHS="${QMAKE6} -qtconf ${with_qtconf}"
])
QT_MINIMUM_VERSION=6.2
AC_MSG_CHECKING([Qt is at least ${QT_MINIMUM_VERSION}])
QT_VERSION_CORE="$(${QT_PATHS} -query QT_VERSION 2>/dev/null)"
QT_MINIMUM_MAJ=$(echo ${QT_MINIMUM_VERSION} | cut -d "." -f -1)
QT_MINIMUM_MIN=$(echo ${QT_MINIMUM_VERSION} | cut -d "." -f 2-2)
QT_VERSION_MAJ=$(echo ${QT_VERSION_CORE} | cut -d "." -f -1)
QT_VERSION_MIN=$(echo ${QT_VERSION_CORE} | cut -d "." -f 2-2)
AS_IF([ test "${QT_VERSION_MAJ}" -lt "${QT_MINIMUM_MAJ}" || (test "${QT_VERSION_MAJ}" = "${QT_MINIMUM_MAJ}" && test "${QT_VERSION_MIN}" -lt "${QT_MINIMUM_MIN}") ], [
AC_MSG_RESULT([(${QT_VERSION_CORE}) no])
have_qt="no"
],[
AC_MSG_RESULT([(${QT_VERSION_CORE}) yes])
QT_BIN_DIRECTORY="$(${QT_PATHS} -query QT_HOST_BINS 2>/dev/null)"
QMAKE="${QT_PATHS}"
AC_MSG_NOTICE([using ${QMAKE}])
AC_MSG_CHECKING([for Qt libraries])
mkdir -p ${ac_pwd}/modules/gui/qt
touch ${ac_pwd}/modules/gui/qt/.qmake.stash
QT_PKG_ERRORS=$(${QMAKE} ${srcdir}/modules/gui/qt/qt6.pro -o ${ac_pwd}/modules/gui/qt/qmake-qt 2>&1)
ac_status=$?
AS_IF([test $ac_status = 0 && test -f ${ac_pwd}/modules/gui/qt/qmake-qt],[
echo "get_cflags:" > ${ac_pwd}/modules/gui/qt/qmake-common.mk
echo ' $(info $(DEFINES) $(INCPATH))' >> ${ac_pwd}/modules/gui/qt/qmake-common.mk
echo "get_libs:" >> ${ac_pwd}/modules/gui/qt/qmake-common.mk
dnl transform /foo/bar/libbaz.so arguments to -L/foo/bar -lbaz
dnl RS: each arguments (space separated) are treated as a new line
dnl FS: split fields using /[^/]* to extract the file basepath ($1)
dnl /lib.*\.so/ lines (arguments) will add -Lxxx if this is not the current path (p), then transform into a -lxxx argument
dnl other arguments are kept as-is
echo ' echo $(LIBS) | awk '\''BEGIN{FS="/[[^/]]*$$";RS=" ";ORS=" "}{if($$0 ~ /\/lib.*\.so/){ if(p != $$1){ print "-L" $$1; p=$$1}; sub(/.*\/lib/, "-l"); sub(/\.so.*/, "")}; print $$0}'\' >> ${ac_pwd}/modules/gui/qt/qmake-common.mk
echo 'get_ldflags:' >> ${ac_pwd}/modules/gui/qt/qmake-common.mk
echo ' echo $(LFLAGS)' >> ${ac_pwd}/modules/gui/qt/qmake-common.mk
echo "include ${ac_pwd}/modules/gui/qt/qmake-common.mk" >> ${ac_pwd}/modules/gui/qt/qmake-qt
AC_MSG_RESULT([yes])
QT_LIBS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-qt get_libs)
QT_CFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-qt get_cflags)
QT_LDFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-qt get_ldflags)
AC_SUBST([QT_LIBS])
AC_SUBST([QT_CFLAGS])
AC_SUBST([QT_LDFLAGS])
QT_LIBEXEC_DIRECTORY="$(${QT_PATHS} -query QT_HOST_LIBEXECS 2>/dev/null)"
QT_QML_LIBEXEC_DIRECTORY=${QT_LIBEXEC_DIRECTORY}
QT_SHADERTOOLS_BIN_DIRECTORY=${QT_BIN_DIRECTORY}
dnl check native in contribs and keep the full path if found there
AC_PATH_PROGS(MOC, [moc], moc, ["${QT_LIBEXEC_DIRECTORY}"])
AC_PATH_PROGS(RCC, [rcc], rcc, ["${QT_LIBEXEC_DIRECTORY}"])
AC_PATH_PROGS(UIC, [uic], uic, ["${QT_LIBEXEC_DIRECTORY}"])
AC_PATH_PROGS(QSB, [qsb], qsb, ["${QT_SHADERTOOLS_BIN_DIRECTORY}"])
AC_PATH_PROGS(QMLCACHEGEN, [qmlcachegen], no, ["${QT_QML_LIBEXEC_DIRECTORY}"])
AS_IF([test "${QMLCACHEGEN}" = "no"], [
AC_MSG_WARN([qmlcachegen not found])
])
AC_CHECK_PROGS(PYTHON3, [python3], [no])
AC_MSG_CHECKING([if required Qt plugins are installed with ${QMAKE6} and conf ${with_qtconf}])
AS_IF([test "$PYTHON3" != "no" && ${PYTHON3} ${srcdir}/buildsystem/check_qml_module.py \
--qmake "${QMAKE6}" \
--qtconf "${with_qtconf}" \
--modules \
QtQml.Models="" \
QtQml.WorkerScript="" \
QtQuick.Layouts="" \
QtQuick.Window="" \
QtQuick.Controls="" \
Qt5Compat.GraphicalEffects="" \
>&AS_MESSAGE_FD ], [
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([no])
AC_MSG_WARN([qt runtime dependencies are missing, disabling qt interface])
have_qt="no"
])
AC_MSG_CHECKING([for QuickTest])
(${QMAKE} ${srcdir}/modules/gui/qt/quicktest.pro -o ${ac_pwd}/modules/gui/qt/qmake-quicktest) 2>/dev/null
ac_status=$?
AS_IF([test $ac_status = 0 && test -f ${ac_pwd}/modules/gui/qt/qmake-quicktest],[
AS_IF([test "$PYTHON3" != "no" && ${PYTHON3} ${srcdir}/buildsystem/check_qml_module.py \
--qmake "${QMAKE6}" \
--qtconf "${with_qtconf}" \
--modules QtTest="" \
>&AS_MESSAGE_FD ], [
echo "include ${ac_pwd}/modules/gui/qt/qmake-common.mk" >> ${ac_pwd}/modules/gui/qt/qmake-quicktest
AC_MSG_RESULT([yes])
QT_QUICK_TEST_LIBS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-quicktest get_libs)
QT_QUICK_TEST_CFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-quicktest get_cflags)
QT_QUICK_TEST_LDFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-quicktest get_ldflags)
AC_SUBST([QT_QUICK_TEST_LIBS])
AC_SUBST([QT_QUICK_TEST_CFLAGS])
AC_SUBST([QT_QUICK_TEST_LDFLAGS])
have_qt_quick_test="yes"
], [
AC_MSG_RESULT([no])
])
],[
AC_MSG_RESULT([no])
])
rm -f ${ac_pwd}/modules/gui/qt/qmake-quicktest
AC_PATH_PROGS(FXC, [fxc], [no], [${CONTRIB_DIR}/bin])
AS_IF([test "$FXC" != "no"],[
have_fxc="yes"
FXC_PATH=$(echo $FXC | head -c-5)
AC_SUBST([FXC_PATH])
])
AC_MSG_CHECKING([for Qt Core private])
(${QMAKE} ${srcdir}/modules/gui/qt/private-core.pro -o ${ac_pwd}/modules/gui/qt/qmake-private-core) 2>/dev/null
ac_status=$?
AS_IF([test $ac_status = 0 && test -f ${ac_pwd}/modules/gui/qt/qmake-private-core],[
echo "include ${ac_pwd}/modules/gui/qt/qmake-common.mk" >> ${ac_pwd}/modules/gui/qt/qmake-private-core
AC_MSG_RESULT([yes])
QT_CORE_PRIVATE_LIBS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-core get_libs)
QT_CORE_PRIVATE_CFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-core get_cflags)
QT_CORE_PRIVATE_LDFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-core get_cflags)
AC_SUBST([QT_CORE_PRIVATE_LIBS])
AC_SUBST([QT_CORE_PRIVATE_CFLAGS])
AC_SUBST([QT_CORE_PRIVATE_LDFLAGS])
have_qt_core_private="yes"
],[
AC_MSG_RESULT([no])
])
rm -f ${ac_pwd}/modules/gui/qt/qmake-private-core
AC_MSG_CHECKING([for Qt GUI private])
(${QMAKE} ${srcdir}/modules/gui/qt/private-gui.pro -o ${ac_pwd}/modules/gui/qt/qmake-private-gui) 2>/dev/null
ac_status=$?
AS_IF([test $ac_status = 0 && test -f ${ac_pwd}/modules/gui/qt/qmake-private-gui],[
echo "include ${ac_pwd}/modules/gui/qt/qmake-common.mk" >> ${ac_pwd}/modules/gui/qt/qmake-private-gui
AC_MSG_RESULT([yes])
QT_GUI_PRIVATE_LIBS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-gui get_libs)
QT_GUI_PRIVATE_CFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-gui get_cflags)
QT_GUI_PRIVATE_LDFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-gui get_ldflags)
AC_SUBST([QT_GUI_PRIVATE_LIBS])
AC_SUBST([QT_GUI_PRIVATE_CFLAGS])
AC_SUBST([QT_GUI_PRIVATE_LDFLAGS])
have_qt_gui_private="yes"
],[
AC_MSG_RESULT([no])
])
rm -f ${ac_pwd}/modules/gui/qt/qmake-private-gui
AC_MSG_CHECKING([for Qt Quick private])
(${QMAKE} ${srcdir}/modules/gui/qt/private-quick.pro -o ${ac_pwd}/modules/gui/qt/qmake-private-quick) 2>/dev/null
ac_status=$?
AS_IF([test $ac_status = 0 && test -f ${ac_pwd}/modules/gui/qt/qmake-private-quick],[
echo "include ${ac_pwd}/modules/gui/qt/qmake-common.mk" >> ${ac_pwd}/modules/gui/qt/qmake-private-quick
AC_MSG_RESULT([yes])
QT_QUICK_PRIVATE_LIBS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-quick get_libs)
QT_QUICK_PRIVATE_CFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-quick get_cflags)
QT_QUICK_PRIVATE_LDFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-quick get_ldflags)
AC_SUBST([QT_QUICK_PRIVATE_LIBS])
AC_SUBST([QT_QUICK_PRIVATE_CFLAGS])
AC_SUBST([QT_QUICK_PRIVATE_LDFLAGS])
have_qt_declarative_private="yes"
],[
AC_MSG_RESULT([no])
])
rm -f ${ac_pwd}/modules/gui/qt/qmake-private-quick
dnl gtk theme provider
PKG_CHECK_MODULES([GTK3], [gtk+-3.0 >= 3.20], [
have_qt_gtk="yes"
], [:])
], [
AC_MSG_RESULT([no])
have_qt="no"
])
])
rm -f ${ac_pwd}/modules/gui/qt/qmake-common.mk
rm -f ${ac_pwd}/modules/gui/qt/qmake-qt
rm -f ${ac_pwd}/modules/gui/qt/.qmake.stash
AS_IF([test "${have_qt}" = "no"],[
AS_IF([test -n "${enable_qt}"],[
AC_MSG_ERROR([${QT_PKG_ERRORS}. If you want to build VLC without GUI, pass --disable-qt.])
],[
AC_MSG_WARN([${QT_PKG_ERRORS}.])
])
enable_qt="no"
])
])
AC_ARG_ENABLE([qt-qml-cache],
AS_HELP_STRING([--enable-qt-qml-cache],
[enable qml cache generation]))
AM_CONDITIONAL([HAVE_QMLCACHEGEN], [test "${enable_qt_qml_cache}" = "yes" && test "$QMLCACHEGEN" != "no"])
AC_ARG_ENABLE([qt-qml-debug],
AS_HELP_STRING([--enable-qt-qml-debug], [enable qml debugger]))
AM_CONDITIONAL(QT_QML_DEBUG, [test "${enable_qt_qml_debug}" = "yes"])
AS_IF([test "${enable_qt}" != "no"], [
ALIASES="${ALIASES} qvlc"
])
AC_SUBST([QT_INDIRECT_LIBS])
AM_CONDITIONAL([ENABLE_QT], [test "$enable_qt" != "no"])
AM_CONDITIONAL([HAVE_QT_GTK], [test "${have_qt_gtk}" = "yes"])
AM_CONDITIONAL([HAVE_QT_QUICK_TEST], [test "${have_qt_quick_test}" = "yes"])
AM_CONDITIONAL([HAVE_QT_DECLARATIVE_PRIVATE], [test "${have_qt_declarative_private}" = "yes"])
AM_CONDITIONAL([HAVE_QT_GUI_PRIVATE], [test "${have_qt_gui_private}" = "yes"])
AM_CONDITIONAL([HAVE_QT_CORE_PRIVATE], [test "${have_qt_core_private}" = "yes"])
AM_CONDITIONAL([HAVE_FXC], [test "${have_fxc}" = "yes"])
AM_CONDITIONAL([HAVE_QT67], [test "${QT_VERSION_MAJ}" -gt "6" || (test "${QT_VERSION_MAJ}" = "6" && test "${QT_VERSION_MIN}" -ge "7")])
dnl
dnl detect kde4-config patch (used for kde solids).
dnl
AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
AS_IF([test "x$KDE4_CONFIG" = "x"], [
KDE4_CONFIG="kde4-config"
])
dnl
dnl Simple test for skins2 dependency
dnl
AS_IF([test "$enable_qt" = "no"], [
AS_IF([test "${enable_skins2}" = "yes"], [
AC_MSG_ERROR([The skins2 module depends on the Qt interface. Without it you will not be able to open any dialog box from the interface, which makes the skins2 interface rather useless. Install the Qt development package or alternatively you can also configure with: --disable-qt --disable-skins2.])
], [
enable_skins2="no"
AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
])
])
dnl
dnl Skins2 module
dnl
AC_ARG_ENABLE([skins2],
AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)]))
AS_IF([test "${enable_skins2}" != "no"], [
have_skins_deps="yes"
dnl Win32
AS_IF([test "${SYS}" = "mingw32"], [
VLC_ADD_CPPFLAGS([skins2],[-DWIN32_SKINS])
VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
dnl OS/2
], [test "${SYS}" = "os2"], [
VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
dnl Linux/Unix
], [
PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
PKG_CHECK_MODULES([XCURSOR], [xcursor],, [have_skins_deps="no"])
PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} ${XCURSOR_LIBS} -lX11])
])
dnl we need freetype
AS_IF([test "${have_freetype}" != "yes"], [
have_skins_deps="no"
])
AS_IF([test "${have_skins_deps}" = "no"], [
AS_IF([test "x${enable_skins2}" = "x"], [
AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
], [
AC_MSG_ERROR([Skins2 interface requires FreeType, libxcursor, libxpm, libxext and libxinerama])
])
enable_skins2="no"
], [
ALIASES="${ALIASES} svlc"
enable_skins2="yes"
])
])
AM_CONDITIONAL([BUILD_SKINS], [test "${enable_skins2}" = "yes"])
dnl
dnl MacOS X gui module
dnl
AC_ARG_ENABLE([macosx],
AS_HELP_STRING([--enable-macosx], [Mac OS X gui support (default enabled on Mac OS X)]))
if test "${enable_macosx}" != "no" -a "${SYS}" = "darwin"
then
dnl
dnl If possible, use xcrun to find the right ibtool
dnl
AC_PATH_PROG([XCRUN], [xcrun], [no])
AS_IF([test ! "${XCRUN}" = "no"], [
AC_MSG_CHECKING([for ibtool (using xcrun)])
XIB="$(eval $XCRUN -f ibtool 2>/dev/null || echo no)"
AC_MSG_RESULT([${XIB}])
], [
AC_MSG_WARN([Looking for tools without using xcrun])
])
AS_IF([test "${XIB}" = "no"], [
AC_PATH_PROG(XIB, [ibtool], [no])
AS_IF([test "${XIB}" = "no"], [
AC_MSG_ERROR([ibtool was not found, but is required for --enable-macosx])
])
])
dnl
dnl If possible, use xcrun to find the right actool
dnl
AS_IF([test ! "${XCRUN}" = "no"], [
AC_MSG_CHECKING([for actool (using xcrun)])
ACTOOL="$(eval $XCRUN -f actool 2>/dev/null || echo no)"
AC_MSG_RESULT([${ACTOOL}])
], [
AC_MSG_WARN([Looking for tools without using xcrun])
])
AS_IF([test "${ACTOOL}" = "no"], [
AC_PATH_PROG(ACTOOL, [actool], [no])
AS_IF([test "${ACTOOL}" = "no"], [
AC_MSG_ERROR([actool was not found, but is required for --enable-macosx])
])
])
fi
AM_CONDITIONAL([ENABLE_MACOSX_UI], [test "$enable_macosx" != "no" -a "${SYS}" = "darwin"])
dnl
dnl MacOS X sparkle update support
dnl
AC_ARG_ENABLE([sparkle],
AS_HELP_STRING([--enable-sparkle], [Sparkle update support for OS X (default enabled on Mac OS X)]))
if test "${enable_sparkle}" != "no" -a "${HAVE_OSX}" = "1"
then
if test ! -d ${CONTRIB_DIR}/Sparkle.framework -a ! -d ${CONTRIB_DIR}/Frameworks/Sparkle.framework
then
AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
fi
AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
fi
AM_CONDITIONAL([HAVE_SPARKLE], [test "$enable_sparkle" != "no"])
dnl
dnl MacOS X breakpad creash reporter support
dnl
AC_ARG_WITH([breakpad],
AS_HELP_STRING([--with-breakpad=URL], [Enable Breakpad reporter using given URL]), [], [with_breakpad=no])
AS_IF([test "$with_breakpad" != "no"], [
AS_IF([test "$with_breakpad" = "yes"], [
AC_MSG_ERROR([You need to supply the CrashDragon Server URL as value for --with-breakpad])
])
AS_IF([test "$HAVE_OSX" = "1"], [
AC_MSG_CHECKING([for Breakpad framework])
AS_IF([test ! -d ${CONTRIB_DIR}/Breakpad.framework -a \
! -d ${CONTRIB_DIR}/Frameworks/Breakpad.framework], [
AC_MSG_RESULT([no])
with_breakpad="no"
AC_MSG_ERROR([Breakpad framework is required and was not found in ${CONTRIB_DIR}])
], [
AC_MSG_RESULT([yes])
])
],[
PKG_CHECK_MODULES([BREAKPAD], [breakpad-client], [
LDFLAGS="${LDFLAGS} -Wl,--build-id"
], [
AC_MSG_ERROR(["breakpad not found"])
])
])
])
AM_CONDITIONAL([HAVE_BREAKPAD], [test "$with_breakpad" != "no"])
AS_IF([test "$with_breakpad" != "no"], [
AC_SUBST([BREAKPAD_URL], ["${with_breakpad}"])
])
dnl
dnl Minimal Mac OS X module
dnl
AC_ARG_ENABLE([minimal-macosx],
AS_HELP_STRING([--enable-minimal-macosx], [Minimal Mac OS X support (default disabled)]))
if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
then
VLC_ADD_PLUGIN([minimal_macosx])
fi
dnl
dnl Mac OS X fancy dmg build tool
dnl
if test "${HAVE_OSX}" = "1"
then
AC_PATH_PROG(DMGBUILD, dmgbuild, no)
AS_IF([test "${DMGBUILD}" = "no"], [
AC_MSG_WARN([dmgbuild not found -- unable to build fancy DMGs])
])
fi
AM_CONDITIONAL([HAVE_DMGBUILD], [test "$DMGBUILD" != "no" -a "${HAVE_OSX}" = "1"])
dnl
dnl ncurses module
dnl
AC_ARG_ENABLE([ncurses],
AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)]))
have_ncurses="no"
AS_IF([test "${enable_ncurses}" != "no"] ,[
PKG_CHECK_MODULES([NCURSES], [ncursesw], [
have_ncurses="yes"
ALIASES="${ALIASES} nvlc"
], [
AS_IF([test -n "${enable_ncurses}"], [
AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
])
])
])
AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
dnl
dnl Lirc plugin
dnl
AC_ARG_ENABLE([lirc],
AS_HELP_STRING([--enable-lirc], [lirc support (default disabled)]))
have_lirc="no"
AS_IF([test "${enable_lirc}" = "yes"], [
AC_CHECK_HEADER(lirc/lirc_client.h, [
AC_CHECK_LIB([lirc_client], [lirc_init], [
have_lirc="yes"
])
])
])
AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
dnl
dnl SRT plugin
dnl
PKG_ENABLE_MODULES_VLC([SRT], [access_srt access_output_srt], [srt >= 1.3.2], [SRT input/output plugin], [auto], [], [], [-DENABLE_SRT])
dnl
dnl RIST plugin
dnl
PKG_ENABLE_MODULES_VLC([RIST], [rist access_output_rist], [librist], [RIST input/output plugin (default auto)])
EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
dnl
dnl goom visualization plugin
dnl
PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
dnl
dnl libprojectM visualization plugin
dnl
AC_ARG_ENABLE([projectm],
AS_HELP_STRING([--enable-projectm], [projectM visualization plugin (default enabled)]))
AS_IF([test "${enable_projectm}" != "no"],
[
PKG_CHECK_MODULES(PROJECTM, libprojectM,
[
VLC_ADD_PLUGIN([projectm])
PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
[ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
[ AC_MSG_WARN( [Using libprojectM version 1] )
])
],[
AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
])
])
dnl
dnl Vovoid VSXu visualization plugin
dnl
AC_ARG_ENABLE([vsxu],
AS_HELP_STRING([--enable-vsxu], [Vovoid VSXu visualization plugin (default auto)]))
AS_IF([test "${enable_vsxu}" != "no"],
[
PKG_CHECK_MODULES(VSXU, libvsxu,
[
VLC_ADD_PLUGIN([vsxu])
],[
AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
])
])
EXTEND_HELP_STRING([Service Discovery plugins:])
dnl
dnl Avahi-Zeroconf services discovery
PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
dnl
dnl libudev services discovery
PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
dnl
dnl MTP devices services discovery
PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
dnl
dnl UPnP Plugin (Intel SDK)
dnl
PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp >= 1.8.3], [Intel UPNP SDK],[auto])
dnl
dnl mDNS using libmicrodns
dnl
PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns >= 0.1.2], [mDNS services discovery], [auto])
EXTEND_HELP_STRING([Misc options:])
dnl
dnl libxml2 module
dnl
PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
dnl
dnl libgcrypt
dnl
AC_ARG_ENABLE([libgcrypt],
AS_HELP_STRING([--disable-libgcrypt], [gcrypt support (default enabled)]))
AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
# require libgcrypt >= 1.6.0
AS_IF([test "${enable_libgcrypt}" != "no"], [
AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[#include <gcrypt.h>
#if GCRYPT_VERSION_NUMBER < 0x010600
#error
#endif]])], [
ac_cv_lib_gcrypt=yes
], [
ac_cv_lib_gcrypt=no
])
VLC_RESTORE_FLAGS
])
AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
], [
AS_IF([test "${enable_libgcrypt}" = "yes"], [
AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
])
])
])
AS_IF([test -z "$GCRYPT_LIBS"], [
GCRYPT_LIBS="-lgcrypt -lgpg-error"
])
AC_SUBST([GCRYPT_CFLAGS])
AC_SUBST([GCRYPT_LIBS])
AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
dnl
dnl TLS/SSL
dnl
AC_ARG_ENABLE([gnutls],
AS_HELP_STRING([--enable-gnutls], [GNU TLS TLS/SSL support (default enabled)]))
AS_IF([test "${enable_gnutls}" != "no"], [
PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.5.0], [
VLC_ADD_PLUGIN([gnutls])
], [
AS_IF([test -n "${enable_gnutls}"], [
AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
])
])
])
dnl
dnl Taglib plugin
dnl
have_taglib="no"
AC_ARG_ENABLE([taglib],
AS_HELP_STRING([--disable-taglib],
[do not use TagLib (default enabled)]))
AS_IF([test "${enable_taglib}" != "no"], [
PKG_CHECK_MODULES(TAGLIB, taglib >= 1.11, [
have_taglib="yes"
VLC_ADD_PLUGIN([taglib])
], [
AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
])
AM_CONDITIONAL([HAVE_TAGLIB], [test "${have_taglib}" = "yes"])
dnl
dnl libsecret
dnl
PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
dnl
dnl kwallet
dnl
AC_ARG_ENABLE([kwallet],
AS_HELP_STRING([--enable-kwallet],
[use kwallet (via D-Bus) for keystore (default enabled)]))
AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
VLC_ADD_PLUGIN([kwallet])
])
dnl
dnl update checking system
dnl
AC_ARG_ENABLE([update-check],
AS_HELP_STRING([--enable-update-check], [update checking system (default disabled)]))
if test "${enable_update_check}" = "yes"
then
AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
fi
AM_CONDITIONAL([UPDATE_CHECK], [test "${enable_update_check}" = "yes"])
dnl
dnl OS X notification plugin
dnl
AC_ARG_ENABLE([osx_notifications],
AS_HELP_STRING([--enable-osx-notifications],
[macOS notification plugin (default disabled)]),,
[enable_osx_notifications=no])
AS_IF([test "${enable_osx_notifications}" != "no"], [
VLC_ADD_PLUGIN([osx_notifications])
])
dnl
dnl Check for GBM
dnl
PKG_HAVE_WITH_MODULES([GBM], [gbm])
dnl
dnl Libnotify notification plugin
dnl
PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify], [libnotify notification], [auto])
PKG_ENABLE_MODULES_VLC([MEDIALIBRARY], [medialibrary], [medialibrary >= 0.13.0], (medialibrary support), [auto])
dnl
dnl Endianness check
dnl
AC_C_BIGENDIAN
AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
], [
DEFS_BIGENDIAN=""
])
AC_SUBST([DEFS_BIGENDIAN])
dnl
dnl Where to install KDE solid .desktop
dnl
AC_ARG_WITH(kde-solid,
AS_HELP_STRING([--with-kde-solid=PATH],
[KDE Solid actions directory (auto)]),, [
if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" -a "${VENDOR}" != "android" ; then
with_kde_solid="yes"
fi
])
soliddatadir=""
AS_IF([test "${with_kde_solid}" != "no"], [
AS_IF([test "${with_kde_solid}" = "yes"], [
kde4datadir="`${KDE4_CONFIG} --install data`"
AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
soliddatadir="${kde4datadir}/solid/actions"
], [
soliddatadir="${with_kde_solid}"
])
])
AC_SUBST([soliddatadir])
AM_CONDITIONAL([KDE_SOLID], [test "x${soliddatadir}" != "x"])
dnl
dnl Doxygen and documentation tools
dnl
doxygen_stylesheet=""
AC_ARG_WITH([doxygen-stylesheet],
AS_HELP_STRING([--with-doxygen-stylesheet=PATH],
[Doxygen stylesheet (default is doxygen default)]),
[ doxygen_stylesheet="$with_doxygen_stylesheet" ], [])
AC_SUBST([doxygen_stylesheet])
dnl
dnl Find tools for win32 packaging
dnl
AS_IF([test "${SYS}" = "mingw32"], [
dnl
dnl Find makensis required to build the NSIS installer
dnl
nsis_major_required="3"
nsis_version_ok="no"
AC_PATH_PROG([MAKENSIS], [makensis], [no])
AS_IF([test "$MAKENSIS" != "no"], [
# Check version
AC_MSG_CHECKING([makensis version])
nsis_version=$($MAKENSIS -VERSION)
AC_MSG_RESULT([$nsis_version])
nsis_version_major=$(echo "$nsis_version" | awk -F \. '{print $1}' | sed 's/v//')
# Check if major version is a valid number
AS_IF([test -n "$nsis_version_major" && \
test "$nsis_version_major" -eq "$nsis_version_major" 2> /dev/null], [
# Do the version check using major version
AS_IF([test "$nsis_version_major" -lt "$nsis_major_required"], [
AC_MSG_WARN([makensis too old, (needs ${nsis_major_required}.x, have ${nsis_version_major}.x)])
], [
nsis_version_ok="yes"
])
], [
AC_MSG_WARN([failed to check the makensis version])
])
])
dnl
dnl Find 7zip
dnl
AC_PATH_PROG([SEVENZIP], [7z], [7z])
])
AM_CONDITIONAL([HAVE_MAKENSIS], [test "$MAKENSIS" != "no" && test "$nsis_version_ok" = "yes"])
dnl
dnl Check wether we have the PROCESS_MITIGATION_IMAGE_LOAD_POLICY
dnl It should only be available when building for win10, but some SDKs define it unconditionnaly
dnl
if test "${SYS}" = "mingw32"; then
AC_CHECK_TYPES([PROCESS_MITIGATION_IMAGE_LOAD_POLICY],,,[#include <windows.h>])
fi
EXTEND_HELP_STRING([Components:])
dnl
dnl the VLC binary
dnl
AC_ARG_ENABLE([vlc],
AS_HELP_STRING([--enable-vlc], [build the VLC media player (default enabled)]))
AM_CONDITIONAL([BUILD_VLC], [test "${enable_vlc}" != "no"])
dnl
dnl Fuzzer (at the end not to mess dependencies FLAGS)
dnl
AS_VAR_IF(with_libfuzzer, no, [], [
LIBS="-lstdc++ ${LIBM}"
AS_IF([test "${with_libfuzzer}" != "yes"], [
LIBS="$LIBS -L${with_libfuzzer}"
])
LIBS="$LIBS -lFuzzer"
AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc-guard, [
AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard])
AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard], [CXXFLAGS])
AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp])
AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp], [CXXFLAGS])
], [
AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc, [
AX_APPEND_FLAG([-fsanitize-coverage=trace-pc])
AX_APPEND_FLAG([-fsanitize-coverage=trace-pc], [CXXFLAGS])
], [
AC_MSG_ERROR([Sanitizer coverage not supported by your compiler])
])
])
])
dnl
dnl Stuff used by the program
dnl
VERSION_MESSAGE="${VERSION} ${CODENAME}"
COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
AC_DEFINE_UNQUOTED([VERSION_MESSAGE], "${VERSION_MESSAGE}", [Simple version string])
AC_DEFINE_UNQUOTED([COPYRIGHT_MESSAGE], "${COPYRIGHT_MESSAGE}", [Copyright string])
AC_DEFINE_UNQUOTED([COPYRIGHT_YEARS], "${COPYRIGHT_YEARS}", [The copyright years])
AC_DEFINE_UNQUOTED([CONFIGURE_LINE], "${CONFIGURE_LINE}", [The ./configure command line])
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],${VERSION_MAJOR}, [version major number])
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],${VERSION_MINOR}, [version minor number])
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_REVISION],${VERSION_REVISION}, [version revision number])
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_EXTRA],${VERSION_EXTRA}, [version extra number])
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_DEV],"${VERSION_DEV}", [version development string])
AC_DEFINE_UNQUOTED([LIBVLC_ABI_MAJOR],${LIBVLC_ABI_MAJOR}, [libvlc version major number])
AC_DEFINE_UNQUOTED([LIBVLC_ABI_MINOR],${LIBVLC_ABI_MINOR}, [libvlc version minor number])
AC_DEFINE_UNQUOTED([LIBVLC_ABI_MICRO],${LIBVLC_ABI_MICRO}, [libvlc version micro number])
AC_SUBST([COPYRIGHT_MESSAGE])
AC_SUBST([VERSION_MESSAGE])
AC_SUBST([VERSION_MAJOR])
AC_SUBST([VERSION_MINOR])
AC_SUBST([VERSION_REVISION])
AC_SUBST([VERSION_EXTRA])
AC_SUBST([LIBVLC_ABI_MAJOR])
AC_SUBST([LIBVLC_ABI_MINOR])
AC_SUBST([LIBVLC_ABI_MICRO])
AC_SUBST([COPYRIGHT_YEARS])
AS_IF([test -z "$VLC_COMPILE_BY"],[
VLC_COMPILE_BY=`whoami|sed -e 's/\\\/\\\\\\\/g'`
])
AC_DEFINE_UNQUOTED([VLC_COMPILE_BY], "$VLC_COMPILE_BY", [user who ran configure])
AS_IF([test -z "$VLC_COMPILE_HOST"],[
VLC_COMPILE_HOST=`hostname -f 2>/dev/null || hostname`
])
AC_DEFINE_UNQUOTED([VLC_COMPILE_HOST], "$VLC_COMPILE_HOST", [host which ran configure])
AC_DEFINE_UNQUOTED([VLC_COMPILER], "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
dnl
dnl Handle substvars that use $(top_srcdir)
dnl
CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
dnl
dnl Configuration is finished
dnl
AC_SUBST([SYS])
AC_SUBST([ARCH])
AC_SUBST([ALIASES])
AC_SUBST([ASM])
AC_SUBST([MOC])
AC_SUBST([RCC])
AC_SUBST([UIC])
AC_SUBST([QSB])
AC_SUBST([WINDRES])
AC_SUBST([LIBEXT])
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([MACOSX_DEPLOYMENT_TARGET])
AC_SUBST([FILE_LIBVLCCORE_DLL])
AC_SUBST([FILE_LIBVLC_DLL])
AC_CONFIG_FILES([
Makefile
doc/Makefile
modules/Makefile
modules/gui/qt/Makefile
m4/Makefile
po/Makefile.in
share/Makefile
compat/Makefile
src/Makefile
lib/Makefile
bin/Makefile
test/Makefile
share/vlc.appdata.xml.in
])
AM_COND_IF([HAVE_WIN32], [
AC_CONFIG_FILES([
extras/package/win32/NSIS/spad.nsi
extras/package/win32/NSIS/vlc.win32.nsi
extras/package/win32/msi/config.wxi
])
])
AM_COND_IF([HAVE_DARWIN], [
AC_CONFIG_FILES([
share/macosx/Info.plist:share/Info.plist.in
])
])
dnl Generate makefiles
AC_OUTPUT
dnl Do we have to use make or gmake ?
if make --version 2>&1|grep -q GNU
then
# GNU make, all seems good
MAKE=make
else
# Known GNU make alias (on BSD)
MAKE=gmake
fi
dnl Shortcut to nice compile message
if test -n $SHELL; then
SHELL=${CONFIG_SHELL-/bin/sh}
fi
rm -f compile
compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
[printf '%s\n' '#! '"${SHELL}"'
rm -f .error$$
ERROR=0
export PATH="$PATH" LANG=C
if test "$NO_COLOR" = 1 ; then
('"${MAKE}"' V=1 "$@" 2>&1 || touch .error$$)
else
('"${MAKE}"' V=1 "$@" 2>&1 || touch .error$$)| '"$compile_top_srcdir"'/extras/buildsystem/make.pl
fi
test -f .error$$ && ERROR=1
rm -f .error$$
exit $ERROR'] >compile
chmod a+x compile
echo "
libvlc configuration
--------------------
version : ${VERSION}
system : ${SYS}
architecture : ${ARCH}
optimizations : ${enable_optimizations}"
if test "${enable_vlc}" != "no"; then
echo "vlc aliases :${ALIASES}"
else
echo "build vlc executable : no"
fi
echo "
To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化