diff --git a/Makefile b/Makefile index f576dee..be25e2b 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ ############################################################################### # common ############################################################################### -#ARCH: linux/pi/android/ios/ +#ARCH: linux/arm/android/ios/win ARCH ?= linux CROSS_PREFIX ?= OUTPUT ?= /usr/local @@ -13,7 +13,6 @@ ifeq ($(ARCH_INC), $(wildcard $(ARCH_INC))) include $(ARCH_INC) endif - CC = $(CROSS_PREFIX)gcc CXX = $(CROSS_PREFIX)g++ LD = $(CROSS_PREFIX)ld @@ -62,7 +61,7 @@ else OUTLIBPATH := $(OUTPUT)/$(LTYPE) endif CFLAGS += $($(ARCH)_CFLAGS) -CFLAGS += -Iinclude +CFLAGS += -I./include CFLAGS += -I$(OUTPUT)/include CFLAGS += -DNO_CRYPTO @@ -91,7 +90,7 @@ $(TGT_LIB_A): $(OBJS_LIB) $(AR_V) rcs $@ $^ $(TGT_LIB_SO): $(OBJS_LIB) - $(LD_V) -o $@ $^ $(SHARED) + $(CC_V) -o $@ $^ $(SHARED) @mv $(TGT_LIB_SO) $(TGT_LIB_SO_VER) @ln -sf $(TGT_LIB_SO_VER) $(TGT_LIB_SO) @@ -105,14 +104,16 @@ clean: install: $(MAKEDIR_OUTPUT) - if [ "$(MODE)" = "release" ];then $(STRIP) $(TGT); fi - $(CP_V) -r $(TGT_LIB_H) $(OUTPUT)/include - $(CP_V) -r $(TGT_LIB_A) $(OUTLIBPATH)/lib - $(CP_V) -r $(TGT_LIB_SO) $(OUTLIBPATH)/lib - $(CP_V) -r $(TGT_LIB_SO_VER) $(OUTLIBPATH)/lib + @if [ "$(MODE)" = "release" ];then $(STRIP) $(TGT); fi + @mkdir -p ${OUTPUT}/include/gear-lib + @mkdir -p ${OUTPUT}/lib/gear-lib + $(CP_V) -r include/$(TGT_LIB_H) $(OUTPUT)/include/gear-lib + $(CP_V) -r $(TGT_LIB_A) $(OUTLIBPATH)/lib/gear-lib + $(CP_V) -r $(TGT_LIB_SO) $(OUTLIBPATH)/lib/gear-lib + $(CP_V) -r $(TGT_LIB_SO_VER) $(OUTLIBPATH)/lib/gear-lib uninstall: - cd $(OUTPUT)/include/ && rm -f $(TGT_LIB_H) - $(RM_V) -f $(OUTLIBPATH)/lib/$(TGT_LIB_A) - $(RM_V) -f $(OUTLIBPATH)/lib/$(TGT_LIB_SO) - $(RM_V) -f $(OUTLIBPATH)/lib/$(TGT_LIB_SO_VER) + cd $(OUTPUT)/include/gear-lib && rm -f $(TGT_LIB_H) + $(RM_V) -f $(OUTLIBPATH)/lib/gear-lib/$(TGT_LIB_A) + $(RM_V) -f $(OUTLIBPATH)/lib/gear-lib/$(TGT_LIB_SO) + $(RM_V) -f $(OUTLIBPATH)/lib/gear-lib/$(TGT_LIB_SO_VER) diff --git a/build.sh b/build.sh index d0ee23f..36c4c79 100755 --- a/build.sh +++ b/build.sh @@ -109,6 +109,17 @@ check_output() fi } +check_install() +{ + if [ ! -d "/usr/local/include/gear-lib" ]; then + mkdir -p /usr/local/include/gear-lib + fi + if [ ! -d "/usr/local/lib/gear-lib" ]; then + mkdir -p /usr/local/lib/gear-lib + fi +} + + install_dep() { return @@ -195,6 +206,7 @@ do_build() "dep") install_dep;; "install") + check_install build_all install;; "uninstall") build_all uninstall;; diff --git a/include/amf.h b/include/amf.h index 876cb31..6c6e6eb 120000 --- a/include/amf.h +++ b/include/amf.h @@ -1 +1 @@ -../gear-lib/librtmp/amf.h \ No newline at end of file +../gear-lib/librtmpc/amf.h \ No newline at end of file diff --git a/include/audio-def.h b/include/audio-def.h new file mode 120000 index 0000000..78a4549 --- /dev/null +++ b/include/audio-def.h @@ -0,0 +1 @@ +../gear-lib/libmedia-io/audio-def.h \ No newline at end of file diff --git a/include/bytes.h b/include/bytes.h index ed565eb..cd59ba1 120000 --- a/include/bytes.h +++ b/include/bytes.h @@ -1 +1 @@ -../gear-lib/librtmp/bytes.h \ No newline at end of file +../gear-lib/librtmpc/bytes.h \ No newline at end of file diff --git a/include/cencode.h b/include/cencode.h index 5caa0a0..aa85c76 120000 --- a/include/cencode.h +++ b/include/cencode.h @@ -1 +1 @@ -../gear-lib/librtmp/cencode.h \ No newline at end of file +../gear-lib/librtmpc/cencode.h \ No newline at end of file diff --git a/include/dh.h b/include/dh.h index a0a39f8..fa2e3f0 120000 --- a/include/dh.h +++ b/include/dh.h @@ -1 +1 @@ -../gear-lib/librtmp/dh.h \ No newline at end of file +../gear-lib/librtmpc/dh.h \ No newline at end of file diff --git a/include/dhgroups.h b/include/dhgroups.h index 3993262..e832fab 120000 --- a/include/dhgroups.h +++ b/include/dhgroups.h @@ -1 +1 @@ -../gear-lib/librtmp/dhgroups.h \ No newline at end of file +../gear-lib/librtmpc/dhgroups.h \ No newline at end of file diff --git a/include/handshake.h b/include/handshake.h index 172ed44..ae18c9a 120000 --- a/include/handshake.h +++ b/include/handshake.h @@ -1 +1 @@ -../gear-lib/librtmp/handshake.h \ No newline at end of file +../gear-lib/librtmpc/handshake.h \ No newline at end of file diff --git a/include/http.h b/include/http.h index 356ba1b..620e565 120000 --- a/include/http.h +++ b/include/http.h @@ -1 +1 @@ -../gear-lib/librtmp/http.h \ No newline at end of file +../gear-lib/librtmpc/http.h \ No newline at end of file diff --git a/include/gear-lib.h b/include/libgear.h similarity index 100% rename from include/gear-lib.h rename to include/libgear.h diff --git a/include/libhomekit.h b/include/libhomekit.h new file mode 120000 index 0000000..51d69e0 --- /dev/null +++ b/include/libhomekit.h @@ -0,0 +1 @@ +../gear-lib/libhomekit/libhomekit.h \ No newline at end of file diff --git a/include/libosal.h b/include/libosal.h new file mode 120000 index 0000000..073d440 --- /dev/null +++ b/include/libosal.h @@ -0,0 +1 @@ +../gear-lib/libosal/libosal.h \ No newline at end of file diff --git a/include/librtmp.h b/include/librtmp.h deleted file mode 120000 index 22e1f1c..0000000 --- a/include/librtmp.h +++ /dev/null @@ -1 +0,0 @@ -../gear-lib/librtmp/librtmp.h \ No newline at end of file diff --git a/include/librtmpc.h b/include/librtmpc.h new file mode 120000 index 0000000..79fb18e --- /dev/null +++ b/include/librtmpc.h @@ -0,0 +1 @@ +../gear-lib/librtmpc/librtmpc.h \ No newline at end of file diff --git a/include/log.h b/include/log.h index 54808b5..b2dd1ad 120000 --- a/include/log.h +++ b/include/log.h @@ -1 +1 @@ -../gear-lib/librtmp/log.h \ No newline at end of file +../gear-lib/librtmpc/log.h \ No newline at end of file diff --git a/include/md5.h b/include/md5.h index 2db5c56..958de58 120000 --- a/include/md5.h +++ b/include/md5.h @@ -1 +1 @@ -../gear-lib/librtmp/md5.h \ No newline at end of file +../gear-lib/librtmpc/md5.h \ No newline at end of file diff --git a/include/rtmp.h b/include/rtmp.h index 475f013..f0241d2 120000 --- a/include/rtmp.h +++ b/include/rtmp.h @@ -1 +1 @@ -../gear-lib/librtmp/rtmp.h \ No newline at end of file +../gear-lib/librtmpc/rtmp.h \ No newline at end of file diff --git a/include/rtmp_aac.h b/include/rtmp_aac.h index 6b9a9d2..bb1811f 120000 --- a/include/rtmp_aac.h +++ b/include/rtmp_aac.h @@ -1 +1 @@ -../gear-lib/librtmp/rtmp_aac.h \ No newline at end of file +../gear-lib/librtmpc/rtmp_aac.h \ No newline at end of file diff --git a/include/rtmp_g711.h b/include/rtmp_g711.h index af7a268..b3a3cba 120000 --- a/include/rtmp_g711.h +++ b/include/rtmp_g711.h @@ -1 +1 @@ -../gear-lib/librtmp/rtmp_g711.h \ No newline at end of file +../gear-lib/librtmpc/rtmp_g711.h \ No newline at end of file diff --git a/include/rtmp_h264.h b/include/rtmp_h264.h index 0fe3726..fff37bb 120000 --- a/include/rtmp_h264.h +++ b/include/rtmp_h264.h @@ -1 +1 @@ -../gear-lib/librtmp/rtmp_h264.h \ No newline at end of file +../gear-lib/librtmpc/rtmp_h264.h \ No newline at end of file diff --git a/include/rtmp_sys.h b/include/rtmp_sys.h index 4b3d9bd..4f65987 120000 --- a/include/rtmp_sys.h +++ b/include/rtmp_sys.h @@ -1 +1 @@ -../gear-lib/librtmp/rtmp_sys.h \ No newline at end of file +../gear-lib/librtmpc/rtmp_sys.h \ No newline at end of file diff --git a/include/rtmp_util.h b/include/rtmp_util.h index 00cc050..87af8af 120000 --- a/include/rtmp_util.h +++ b/include/rtmp_util.h @@ -1 +1 @@ -../gear-lib/librtmp/rtmp_util.h \ No newline at end of file +../gear-lib/librtmpc/rtmp_util.h \ No newline at end of file diff --git a/include/version.h b/include/version.h new file mode 120000 index 0000000..57456a5 --- /dev/null +++ b/include/version.h @@ -0,0 +1 @@ +../gear-lib/librtmpc/version.h \ No newline at end of file diff --git a/include/video-def.h b/include/video-def.h new file mode 120000 index 0000000..c88ce0f --- /dev/null +++ b/include/video-def.h @@ -0,0 +1 @@ +../gear-lib/libmedia-io/video-def.h \ No newline at end of file diff --git a/src/amf.c b/src/amf.c index 070858a..bee2c22 120000 --- a/src/amf.c +++ b/src/amf.c @@ -1 +1 @@ -../gear-lib/librtmp/amf.c \ No newline at end of file +../gear-lib/librtmpc/amf.c \ No newline at end of file diff --git a/src/hashswf.c b/src/hashswf.c index 72df396..1278395 120000 --- a/src/hashswf.c +++ b/src/hashswf.c @@ -1 +1 @@ -../gear-lib/librtmp/hashswf.c \ No newline at end of file +../gear-lib/librtmpc/hashswf.c \ No newline at end of file diff --git a/src/libdarray.c b/src/libdarray.c new file mode 120000 index 0000000..53ae0a8 --- /dev/null +++ b/src/libdarray.c @@ -0,0 +1 @@ +../gear-lib/libdarray/libdarray.c \ No newline at end of file diff --git a/src/libhomekit.c b/src/libhomekit.c new file mode 120000 index 0000000..1107874 --- /dev/null +++ b/src/libhomekit.c @@ -0,0 +1 @@ +../gear-lib/libhomekit/libhomekit.c \ No newline at end of file diff --git a/src/libosal.c b/src/libosal.c new file mode 120000 index 0000000..150ce90 --- /dev/null +++ b/src/libosal.c @@ -0,0 +1 @@ +../gear-lib/libosal/libosal.c \ No newline at end of file diff --git a/src/librtmp.c b/src/librtmp.c deleted file mode 120000 index 06338ce..0000000 --- a/src/librtmp.c +++ /dev/null @@ -1 +0,0 @@ -../gear-lib/librtmp/librtmp.c \ No newline at end of file diff --git a/src/librtmpc.c b/src/librtmpc.c new file mode 120000 index 0000000..e5f2e75 --- /dev/null +++ b/src/librtmpc.c @@ -0,0 +1 @@ +../gear-lib/librtmpc/librtmpc.c \ No newline at end of file diff --git a/src/log.c b/src/log.c index 93be0ab..0e3846a 120000 --- a/src/log.c +++ b/src/log.c @@ -1 +1 @@ -../gear-lib/librtmp/log.c \ No newline at end of file +../gear-lib/librtmpc/log.c \ No newline at end of file diff --git a/src/parseurl.c b/src/parseurl.c index b591caa..28436db 120000 --- a/src/parseurl.c +++ b/src/parseurl.c @@ -1 +1 @@ -../gear-lib/librtmp/parseurl.c \ No newline at end of file +../gear-lib/librtmpc/parseurl.c \ No newline at end of file diff --git a/src/rtmp.c b/src/rtmp.c index 30f6a64..1a0ec72 120000 --- a/src/rtmp.c +++ b/src/rtmp.c @@ -1 +1 @@ -../gear-lib/librtmp/rtmp.c \ No newline at end of file +../gear-lib/librtmpc/rtmp.c \ No newline at end of file diff --git a/src/rtmp_aac.c b/src/rtmp_aac.c index 217abd0..c15eec5 120000 --- a/src/rtmp_aac.c +++ b/src/rtmp_aac.c @@ -1 +1 @@ -../gear-lib/librtmp/rtmp_aac.c \ No newline at end of file +../gear-lib/librtmpc/rtmp_aac.c \ No newline at end of file diff --git a/src/rtmp_g711.c b/src/rtmp_g711.c index 43208a4..166d458 120000 --- a/src/rtmp_g711.c +++ b/src/rtmp_g711.c @@ -1 +1 @@ -../gear-lib/librtmp/rtmp_g711.c \ No newline at end of file +../gear-lib/librtmpc/rtmp_g711.c \ No newline at end of file diff --git a/src/rtmp_h264.c b/src/rtmp_h264.c index eea8296..4d29ebf 120000 --- a/src/rtmp_h264.c +++ b/src/rtmp_h264.c @@ -1 +1 @@ -../gear-lib/librtmp/rtmp_h264.c \ No newline at end of file +../gear-lib/librtmpc/rtmp_h264.c \ No newline at end of file diff --git a/src/rtmp_util.c b/src/rtmp_util.c index 69bd189..d6b2229 120000 --- a/src/rtmp_util.c +++ b/src/rtmp_util.c @@ -1 +1 @@ -../gear-lib/librtmp/rtmp_util.c \ No newline at end of file +../gear-lib/librtmpc/rtmp_util.c \ No newline at end of file