Advertisement
Guest User

build-api.sh

a guest
Oct 29th, 2012
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # simple api build script
  3.  
  4. # set should really do checks for $CROSS_COMPILE's existence,
  5. # if it's already set, dont' set it in here, the user might be
  6. # using their own toolchain
  7. # we either assume that they at least have a toolchain installed
  8. # and it's set in the path or try and set some stuff ourself
  9. # just incase they haven't set the compiler 'triplet' in CROSS_COMPILE
  10. if [ -z "$CROSS_COMPILE" ]; then
  11.   echo "Not cross compiling, using native gcc"
  12.   CC=gcc
  13. else
  14.   echo "Cross compiling using user set CROSS_COMPILE env var"
  15.   echo $CROSS_COMPILE
  16.   # build our cross compiler GCC command
  17.   CC=${CROSS_COMPILE}gcc
  18. fi
  19.  
  20.  
  21.  
  22. # Set the CFLAGS
  23.  
  24. CFLAGS="-I./include/ -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -ftree-vectorize -pipe -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -Wno-psabi"
  25.  
  26. # Set the ld flags so it knows where to find shared libs
  27. # Have we forgotten the INCLUDES?  or are they buried in our CFLAGS var?
  28.  
  29. LDFLAGS="-L/opt/vc/lib/ -shared"
  30.  
  31. # Tell it where the code is
  32.  
  33. SOURCES="src/libdisplay.c"
  34.  
  35. # Build all of the things
  36.  
  37. $CC $SOURCES $CFLAGS $LDFLAGS -o libdisplay.so -lbcm_host -lvcos -lvchiq_arm
  38.  
  39. SOURCES="src/libvideo.c"
  40. $CC $SOURCES $CFLAGS $LDFLAGS -o libvideo.so -lEGL -lGLESv2 -lbcm_host -lvcos -lvchiq_arm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement