Bläddra i källkod

Qt-Projekt erstellt. Buildumgebung angepasst.

Rind 5 år sedan
förälder
incheckning
4e818eeeb0

BIN
build/Toolchain/arm/libgfatimer.so.1.0.0


BIN
build/Toolchain/arm/libgfatimerd.so.1.0.0


+ 0 - 77
build/Toolchain/gfatimer.h

@@ -1,77 +0,0 @@
-// gfatimer.h :
-//
-
-#if !defined(AGD_GFATIMER_H__60DC793C_D443_45EB_AD2F_D947862C2060__INCLUDED_)
-#define AGD_GFATIMER_H__60DC793C_D443_45EB_AD2F_D947862C2060__INCLUDED_
-
-#ifdef __cplusplus
-extern "C" {
-#endif	//	__cplusplus
-
-/////////////////////////////////////////////////////////////////////////////
-// gfatimer.h - Declarations:
-
-typedef enum GfaTimerResolution
-{
-	GTR_Invalid,
-	GTR_10ms,
-	GTR_25ms,
-	GTR_50ms,
-	GTR_Last
-	
-}GfaTimerResolution;
-
-/////////////////////////////////////////////////////////////////////////////
-
-typedef enum GfaTimerClockPulse
-{
-	GTCP_Invalid = -1,
-	GTCP_250ms,
-	GTCP_500ms,
-	GTCP_750ms,
-	GTCP_1000ms,
-	GTCP_1500ms,
-	GTCP_2000ms,
-	GTCP_5000ms,
-	GTCP_10000ms,
-	GTCP_Last
-}GfaTimerClockPulse;
-
-/////////////////////////////////////////////////////////////////////////////
-
-typedef void (*pfnTIMERCALLBACK)(int, void*);
-typedef void (*pfnPULSECALLBACK)(GfaTimerClockPulse, int, void*);
-
-/////////////////////////////////////////////////////////////////////////////
-// initialization (if GfaTimerRelease is not called explicitly, clean up will
-// be done internally, if the process exits gracefully)
-
-int				GfaTimerInit(int nTimerCount, GfaTimerResolution res);
-void			GfaTimerRelease(void);
-
-void			GfaRegisterTimerCallback(int tnum, pfnTIMERCALLBACK pfnCallback, void *pContext);
-void			GfaUnregisterTimerCallback(int tnum);
-
-void			GfaRegisterClockPulseCallback(GfaTimerClockPulse cp, pfnPULSECALLBACK pfnCallback, void *pContext);
-void			GfaUnregisterClockPulseCallback(GfaTimerClockPulse cp);
-
-/////////////////////////////////////////////////////////////////////////////
-// mondial legacy timer API
-
-int				tf_test(int tnum);
-void			tf_set(int tnum);
-void			tf_clear(int tnum);
-void			tf_store(int tnum, int fset);
-unsigned long	tw_read(int tnum);
-void			tw_set(int tnum, unsigned long val); // val in milliseconds
-
-/////////////////////////////////////////////////////////////////////////////
-// test clock pulse (see GfaTimerClockPulse enumeration for possible values)
-
-int				cp_test(GfaTimerClockPulse cp);
-
-/////////////////////////////////////////////////////////////////////////////
-#ifdef __cplusplus
-}
-#endif	//	__cplusplus
-#endif	//	!defined(AGD_GFATIMER_H__60DC793C_D443_45EB_AD2F_D947862C2060__INCLUDED_)

+ 0 - 52
build/Toolchain/install.sh

@@ -1,52 +0,0 @@
-#!/bin/bash
-set -e
-set -o pipefail
-
-REMPWD="root"
-REMUSR="root@192.168.0.125"
-
-
-TOOLCHAIN_SYSROOT="/opt/GfA/T_C49xL448RT_Qt57x/usr/arm-buildroot-linux-gnueabihf/sysroot"
-LIBBASENAMEREL="gfatimer"
-LIBBASENAMEDBG="gfatimerd"
-LIBDBGx86_64SRC="x86_64/lib$LIBBASENAMEDBG.so.1.0.0"
-LIBRELx86_64SRC="x86_64/lib$LIBBASENAMEREL.so.1.0.0"
-LIBDBGARMSRC="arm/lib$LIBBASENAMEDBG.so.1.0.0"
-LIBRELARMSRC="arm/lib$LIBBASENAMEREL.so.1.0.0"
-INCSRC="$LIBBASENAMEREL.h"
-
-LIBDBGx86_64DST="/usr/lib/"
-LIBRELx86_64DST="/usr/lib/"
-INCDSTx86_64DST="/usr/include/"
-
-LIBDBGARMDST_LOC="$TOOLCHAIN_SYSROOT/usr/lib/"
-LIBRELARMDST_LOC="$TOOLCHAIN_SYSROOT/usr/lib/"
-INCDSTARM_LOC="$TOOLCHAIN_SYSROOT/usr/include/"
-
-sudo cp $LIBDBGx86_64SRC $LIBDBGx86_64DST
-sudo cp $LIBRELx86_64SRC $LIBRELx86_64DST
-sudo cp $INCSRC $INCDSTx86_64DST
-
-sudo ln -sfnr /usr/lib/lib$LIBBASENAMEDBG.so.1.0.0 /usr/lib/lib$LIBBASENAMEDBG.so.1
-sudo ln -sfnr /usr/lib/lib$LIBBASENAMEDBG.so.1 /usr/lib/lib$LIBBASENAMEDBG.so
-sudo ln -sfnr /usr/lib/lib$LIBBASENAMEREL.so.1.0.0 /usr/lib/lib$LIBBASENAMEREL.so.1
-sudo ln -sfnr /usr/lib/lib$LIBBASENAMEREL.so.1 /usr/lib/lib$LIBBASENAMEREL.so
-
-cp $LIBDBGARMSRC $LIBDBGARMDST_LOC
-cp $LIBRELARMSRC $LIBRELARMDST_LOC
-cp $INCSRC $INCDSTARM_LOC
-
-ln -sfnr $TOOLCHAIN_SYSROOT/usr/lib/lib$LIBBASENAMEDBG.so.1.0.0 $TOOLCHAIN_SYSROOT/usr/lib/lib$LIBBASENAMEDBG.so.1
-ln -sfnr $TOOLCHAIN_SYSROOT/usr/lib/lib$LIBBASENAMEDBG.so.1 $TOOLCHAIN_SYSROOT/usr/lib/lib$LIBBASENAMEDBG.so
-ln -sfnr $TOOLCHAIN_SYSROOT/usr/lib/lib$LIBBASENAMEREL.so.1.0.0 $TOOLCHAIN_SYSROOT/usr/lib/lib$LIBBASENAMEREL.so.1
-ln -sfnr $TOOLCHAIN_SYSROOT/usr/lib/lib$LIBBASENAMEREL.so.1 $TOOLCHAIN_SYSROOT/usr/lib/lib$LIBBASENAMEREL.so
-
-pscp -pw $REMPWD $LIBDBGARMSRC $REMUSR:/usr/lib/ > /dev/null
-pscp -pw $REMPWD $LIBRELARMSRC $REMUSR:/usr/lib/ > /dev/null
-
-plink -batch -t -pw $REMPWD $REMUSR ln -sfn /usr/lib/lib$LIBBASENAMEDBG.so.1.0.0 /usr/lib/lib$LIBBASENAMEDBG.so.1
-plink -batch -t -pw $REMPWD $REMUSR ln -sfn /usr/lib/lib$LIBBASENAMEDBG.so.1 /usr/lib/lib$LIBBASENAMEDBG.so
-plink -batch -t -pw $REMPWD $REMUSR ln -sfn /usr/lib/lib$LIBBASENAMEREL.so.1.0.0 /usr/lib/lib$LIBBASENAMEREL.so.1
-plink -batch -t -pw $REMPWD $REMUSR ln -sfn /usr/lib/lib$LIBBASENAMEREL.so.1 /usr/lib/lib$LIBBASENAMEREL.so
-
-echo Done.

BIN
build/Toolchain/x86_64/libgfatimer.so.1.0.0


BIN
build/Toolchain/x86_64/libgfatimerd.so.1.0.0


+ 0 - 17
build/arm/builddbg.sh

@@ -1,17 +0,0 @@
-#!/bin/bash
-set -e
-set -o pipefail
-
-SYSROOT="/opt/GfA/T_C49xL448RT_Qt57x/usr/arm-buildroot-linux-gnueabihf/sysroot"
-CC="/opt/GfA/T_C49xL448RT_Qt57x/usr/bin/arm-buildroot-linux-gnueabihf-c++"
-CCOPTS="-g -pthread -fPIC -Wall -Wno-unused -Wno-unused-label -Wformat -Wuninitialized -Wundef -Wcast-qual -Wwrite-strings -std=c++11 -fabi-version=2 -fno-omit-frame-pointer -D_DEBUG"
-
-LIBBASENAME="gfatimerd"
-LIBFILENAME="lib$LIBBASENAME.so.1.0.0"
-LINKNAME="lib$LIBBASENAME.so"
-
-$CC $CCOPTS -c ../../src/timer.cpp ../../src/gfatimer.cpp ../../../gfaipc/src/locmtx.cpp
-$CC -g -fPIC -shared -L. -Wl,-soname,$LIBFILENAME -o $LIBFILENAME timer.o gfatimer.o locmtx.o -lc -pthread
-rm -f *.o
-mv $LIBFILENAME ../Toolchain/arm
-

+ 0 - 17
build/arm/buildrel.sh

@@ -1,17 +0,0 @@
-#!/bin/bash
-set -e
-set -o pipefail
-
-SYSROOT="/opt/GfA/T_C49xL448RT_Qt57x/usr/arm-buildroot-linux-gnueabihf/sysroot"
-CC="/opt/GfA/T_C49xL448RT_Qt57x/usr/bin/arm-buildroot-linux-gnueabihf-c++"
-CCOPTS="-O3 -pthread -fPIC -Wall -Wno-unused -Wno-unused-label -Wformat -Wuninitialized -Wundef -Wcast-qual -Wwrite-strings -std=c++11 -fabi-version=2 -fno-omit-frame-pointer"
-
-LIBBASENAME="gfatimer"
-LIBFILENAME="lib$LIBBASENAME.so.1.0.0"
-LINKNAME="lib$LIBBASENAME.so"
-
-$CC $CCOPTS -c ../../src/timer.cpp ../../src/gfatimer.cpp ../../../gfaipc/src/locmtx.cpp
-$CC -O3 -fPIC -shared -L. -Wl,-soname,$LIBFILENAME -o $LIBFILENAME timer.o gfatimer.o locmtx.o -lc -pthread
-rm -f *.o
-mv $LIBFILENAME ../Toolchain/arm
-

+ 0 - 15
build/build.sh

@@ -1,15 +0,0 @@
-#!/bin/bash
-set -e
-set -o pipefail
-
-cd x86_64
-./builddbg.sh
-./buildrel.sh
-
-cd ../arm
-./builddbg.sh
-./buildrel.sh
-
-cd ..
-cp "../src/gfatimer.h" "Toolchain/"
-echo done

+ 0 - 15
build/x86_64/builddbg.sh

@@ -1,15 +0,0 @@
-#!/bin/bash
-set -e
-set -o pipefail
-
-CC=c++
-CCOPTS="-g -pthread -fPIC -Wall -Wno-unused -Wno-unused-label -Wformat -Wuninitialized -Wundef -Wcast-qual -Wwrite-strings -std=c++11 -fabi-version=2 -fno-omit-frame-pointer -D_DEBUG"
-
-LIBBASENAME="gfatimerd"
-LIBFILENAME="lib$LIBBASENAME.so.1.0.0"
-LINKNAME="lib$LIBBASENAME.so"
-
-$CC $CCOPTS -c ../../src/timer.cpp ../../src/gfatimer.cpp ../../../gfaipc/src/locmtx.cpp
-$CC -g -fPIC -shared -L. -Wl,-soname,$LIBFILENAME -o $LIBFILENAME timer.o gfatimer.o locmtx.o -lc -pthread
-rm -f *.o
-mv $LIBFILENAME ../Toolchain/x86_64

+ 0 - 16
build/x86_64/buildrel.sh

@@ -1,16 +0,0 @@
-#!/bin/bash
-set -e
-set -o pipefail
-
-CC=c++
-CCOPTS="-O3 -pthread -fPIC -Wall -Wno-unused -Wno-unused-label -Wformat -Wuninitialized -Wundef -Wcast-qual -Wwrite-strings -std=c++11 -fabi-version=2 -fno-omit-frame-pointer"
-
-LIBBASENAME="gfatimer"
-LIBFILENAME="lib$LIBBASENAME.so.1.0.0"
-LINKNAME="lib$LIBBASENAME.so"
-
-$CC $CCOPTS -c ../../src/timer.cpp ../../src/gfatimer.cpp ../../../gfaipc/src/locmtx.cpp
-$CC -O3 -fPIC -shared -L. -Wl,-soname,$LIBFILENAME -o $LIBFILENAME timer.o gfatimer.o locmtx.o -lc -pthread
-rm -f *.o
-mv $LIBFILENAME ../Toolchain/x86_64
-

+ 94 - 0
gfatimer.pro

@@ -0,0 +1,94 @@
+TEMPLATE = lib
+VERSION = 1.0
+CONFIG -= qt app_bundle
+CONFIG += c++11 shared thread
+
+HEADERS += \
+    src/gfatimer.h \
+    src/timer.h
+
+SOURCES += \
+    src/gfatimer.cpp \
+    src/timer.cpp
+
+####################################################################################
+
+GFA_LIB_PATH = /usr/lib/gfa
+GFA_INC_PATH = /usr/include/gfa
+QMAKE_RPATHLINKDIR += $$GFA_LIB_PATH
+QMAKE_RPATHDIR += $$GFA_LIB_PATH
+QMAKE_DEL_DIR = rmdir --ignore-fail-on-non-empty
+QMAKE_LN_SHLIB = :
+
+####################################################################################
+
+CONFIG(debug, debug|release) {
+    QMAKE_CXXFLAGS -= -Os
+    QMAKE_CFLAGS -= -Os
+    QMAKE_CXXFLAGS += -D_DEBUG
+    QMAKE_CFLAGS += -D_DEBUG
+	TARGET = $$join(TARGET,,,d)
+}
+
+linux-buildroot-g++ {
+    QMAKE_CXXFLAGS += -D_TARGET_BUILD
+    QMAKE_CFLAGS += -D_TARGET_BUILD
+    QMAKE_CXXFLAGS += -D_SITARA
+    QMAKE_CFLAGS += -D_SITARA
+}
+
+####################################################################################
+
+target.path = $$GFA_LIB_PATH
+INSTALLS += target
+
+####################################################################################
+
+linux-g++ {
+	includes.path = $$GFA_INC_PATH
+	includes.extra += -$(INSTALL_FILE) $$PWD/src/gfatimer.h $(INSTALL_ROOT)$$includes.path
+	includes.uninstall += -$(DEL_FILE) $(INSTALL_ROOT)$$includes.path/gfatimer.h
+	INSTALLS += includes
+}
+
+####################################################################################
+
+linux-buildroot-g++ {
+	exists($$[QT_SYSROOT]) {
+		library.path = $$[QT_SYSROOT]$$target.path
+		library.extra += -$(INSTALL_PROGRAM) $(TARGET) $(INSTALL_ROOT)$$library.path/$(TARGET)
+		library.extra += $$escape_expand(\\n\\t)-$(SYMLINK) $(TARGET) $(INSTALL_ROOT)$$library.path/$(TARGET0)
+		library.extra += $$escape_expand(\\n\\t)-$(SYMLINK) $(TARGET) $(INSTALL_ROOT)$$library.path/$(TARGET1)
+		library.extra += $$escape_expand(\\n\\t)-$(SYMLINK) $(TARGET) $(INSTALL_ROOT)$$library.path/$(TARGET2)
+		library.uninstall += -$(DEL_FILE) $(INSTALL_ROOT)$$library.path/$(TARGET)
+		library.uninstall += $$escape_expand(\\n\\t)-$(DEL_FILE) $(INSTALL_ROOT)$$library.path/$(TARGET0)
+		library.uninstall += $$escape_expand(\\n\\t)-$(DEL_FILE) $(INSTALL_ROOT)$$library.path/$(TARGET1)
+		library.uninstall += $$escape_expand(\\n\\t)-$(DEL_FILE) $(INSTALL_ROOT)$$library.path/$(TARGET2)
+		INSTALLS += library
+
+		includes.path = $$[QT_SYSROOT]$$GFA_INC_PATH
+		includes.extra += -$(INSTALL_FILE) $$PWD/src/gfatimer.h $(INSTALL_ROOT)$$includes.path
+		includes.uninstall += -$(DEL_FILE) $(INSTALL_ROOT)$$includes.path/gfatimer.h
+		INSTALLS += includes
+
+		itoolchain.target = install_toolchain
+		itoolchain.depends = install_library install_includes
+		QMAKE_EXTRA_TARGETS += itoolchain
+
+		utoolchain.target = uninstall_toolchain
+		utoolchain.depends = uninstall_library uninstall_includes
+		QMAKE_EXTRA_TARGETS += utoolchain
+	}
+}
+
+####################################################################################
+
+deploylib.target = deploylib
+deploylib.commands = @echo BASENAME="$(QMAKE_TARGET)" > deploytargets
+deploylib.commands += $$escape_expand(\\n\\t)@echo TARGET="$(TARGET)" >> deploytargets
+deploylib.commands += $$escape_expand(\\n\\t)@echo TARGET0="$(TARGET0)" >> deploytargets
+deploylib.commands += $$escape_expand(\\n\\t)@echo TARGET1="$(TARGET1)" >> deploytargets
+deploylib.commands += $$escape_expand(\\n\\t)@echo TARGET2="$(TARGET2)" >> deploytargets
+deploylib.commands += $$escape_expand(\\n\\t)@echo HEADERS="\\\"gfatimer.h\\\"" >> deploytargets
+PRE_TARGETDEPS += deploylib
+QMAKE_EXTRA_TARGETS += deploylib

+ 0 - 1
src/gfatimer.h

@@ -18,7 +18,6 @@ typedef enum GfaTimerResolution
 	GTR_25ms,
 	GTR_50ms,
 	GTR_Last
-	
 }GfaTimerResolution;
 
 /////////////////////////////////////////////////////////////////////////////

+ 1 - 1
src/timer.h

@@ -6,7 +6,7 @@
 
 #include <stdio.h>
 #include <string.h>
-#include "../../gfaipc/src/mutex.h"
+#include <gfa/mutex.h>
 #include "gfatimer.h"
 
 /////////////////////////////////////////////////////////////////////////////