remove useless softlinks

This commit is contained in:
gozfree
2020-10-18 16:46:19 +08:00
parent 022c17093d
commit 6c879fa9c4
40 changed files with 828 additions and 155 deletions

View File

@@ -8,7 +8,6 @@ set(file_src src/filewatcher.c src/fio.c src/io.c src/libfile.c)
set(ipc_src src/libipc.c src/msgq_posix.c src/msgq_sysv.c src/netlink.c src/shm.c src/unix_socket.c)
set(gevent_src src/epoll.c src/libgevent.c src/poll.c src/select.c)
set(dict_src src/libdict.c)
set(macro_src src/libmacro.c)
set(queue_src src/libqueue.c)
set(vector_src src/libvector.c)
@@ -19,7 +18,6 @@ target_link_libraries(ipc rt gevent dict)
add_library(log SHARED ${log_src})
add_library(file SHARED ${file_src})
add_library(macro SHARED ${macro_src})
add_library(queue SHARED ${queue_src})
add_library(vector SHARED ${vector_src})

869
Makefile

File diff suppressed because it is too large Load Diff

View File

@@ -16,8 +16,7 @@
| libdict: 哈希字典 | libhash: linux内核原生哈希库 |
| libringbuffer: 循环缓冲 | libqueue: 数据队列 |
| librbtree: 内核rbtree | libsort: |
| libvector: 容器库 | libmacro: 通用宏定义 |
| libdarray: 动态数组 | |
| libvector: 容器库 | libdarray: 动态数组 |
## 网络库
| | |

View File

@@ -16,8 +16,7 @@ This is a collection of basic libraries.
| libdict: Hash key-value dictonary library | libhash: Hash key-value library based on hlist from kernel |
| libringbuffer: | libqueue: queue library, support memory hook |
| librbtree: comes from linux kernel rbtree. | libsort: |
| libvector: | libmacro: Basic Macro define library, include kernel list and so on |
| libdarray: Dynamic array | |
| libvector: | libdarray: Dynamic array |
## Network
| | |

View File

@@ -1,6 +1,6 @@
COMPONENT_ADD_INCLUDEDIRS = . ./libposix ./libmacro ./libthread ./libdarray ./libmedia-io ./libqueue ./liblog
COMPONENT_SRCDIRS = libposix libposix4rtos libmacro libdarray libqueue libthread libmedia-io librtmpc liblog
COMPONENT_OBJEXCLUDE = libposix/test_libposix.o libmacro/test_libmacor.o libdarray/test_libdarray.o libqueue/test_libqueue.o libthread/test_libthread.o libmedia-io/test_libmedia-io.o librtmpc/test_librtmpc.o liblog/test_liblog.o
COMPONENT_ADD_INCLUDEDIRS = . ./libposix ./libthread ./libdarray ./libmedia-io ./libqueue ./liblog
COMPONENT_SRCDIRS = libposix libposix4rtos libdarray libqueue libthread libmedia-io librtmpc liblog
COMPONENT_OBJEXCLUDE = libposix/test_libposix.o libdarray/test_libdarray.o libqueue/test_libqueue.o libthread/test_libthread.o libmedia-io/test_libmedia-io.o librtmpc/test_librtmpc.o liblog/test_liblog.o
COMPONENT_DEPENDS := newlib
CFLAGS += -DFREERTOS #for libposix
CFLAGS += -DESP32 #for libposix4rtos

View File

@@ -21,7 +21,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <libmacro.h>
#include <liblog.h>
#include "luatables.h"

View File

@@ -19,7 +19,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#include <libmacro.h>
#include <libposix.h>
#include "libfilewatcher.h"
#include <stdio.h>
#include <stdlib.h>
@@ -38,7 +38,7 @@ int add_path_list(struct fw *fw, int wd, const char *path)
char key[KEY_LEN];
memset(key, 0, sizeof(key));
snprintf(key, KEY_LEN, "%d", wd);
char *val = CALLOC(PATH_MAX, char);
char *val = calloc(PATH_MAX, sizeof(char));
strncpy(val, path, PATH_MAX);
dict_add(fw->dict_path, key, val);
return 0;
@@ -228,7 +228,7 @@ int fw_update_watch(struct fw *fw, struct inotify_event *iev)
struct fw *fw_init(void (notify_cb)(struct fw *fw, enum fw_type type, char *path))
{
struct fw *fw = CALLOC(1, struct fw);
struct fw *fw = calloc(1, sizeof(struct fw));
if (!fw) {
printf("malloc fw failed\n");
goto err;

View File

@@ -20,7 +20,7 @@ OBJS_UNIT_TEST = test_$(LIBNAME).obj
###############################################################################
# cflags and ldflags
###############################################################################
CFLAGS = /IWIN32-Code /IWIN32-Code/nmake /Iinclude /I. /I../libmacro/
CFLAGS = /IWIN32-Code /IWIN32-Code/nmake /Iinclude /I.
!IF "$(MODE)"=="release"
CFLAGS = $(CFLAGS) /O2 /GF
!ELSE

View File

@@ -57,7 +57,6 @@ EXTRA_CFLAGS += -fPIC
endif
EXTRA_CFLAGS += $($(ARCH)_CFLAGS)
EXTRA_CFLAGS += -I$(OUTPUT)/include/gear-lib
EXTRA_CFLAGS += -I../libmacro/
SHARED := -shared

View File

@@ -14,7 +14,6 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <jpeglib.h>
#include <libmacro.h>
#include <liblog.h>
#include "libjpeg-ex.h"

View File

@@ -22,7 +22,6 @@
#include "libp2p.h"
#include "libstun.h"
#include "libptcp.h"
#include <libmacro.h>
#include <libskt.h>
#include <librpc.h>
#include <librpc_stub.h>

View File

@@ -21,7 +21,6 @@
******************************************************************************/
#include "queue.h"
#include "libptcp.h"
#include <libmacro.h>
#include <stdlib.h>
#include <errno.h>

View File

@@ -26,7 +26,7 @@
extern "C" {
#endif
#include <libmacro.h>
#include <libposix.h>
#include <stdlib.h>
#include <stdint.h>
#include <stddef.h>

View File

@@ -20,7 +20,6 @@
* SOFTWARE.
******************************************************************************/
#include "libp2p.h"
#include <libmacro.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

View File

@@ -20,7 +20,7 @@ OBJS_UNIT_TEST = test_$(LIBNAME).obj
###############################################################################
# cflags and ldflags
###############################################################################
CFLAGS = /I../libposix4win/ /I../libmacro/ /I.
CFLAGS = /I../libposix4win/ /I.
!IF "$(MODE)"=="release"
CFLAGS = $(CFLAGS) /O2 /GF

View File

@@ -21,7 +21,6 @@
******************************************************************************/
#include <libuvc.h>
#include <liblog.h>
#include <libmacro.h>
#include <libdarray.h>
#include "sdp.h"
#include "media_source.h"
@@ -129,12 +128,12 @@ static int init_header(struct x264_ctx *c)
static struct x264_ctx *x264_open(struct codec_ctx *cc, struct media_encoder *ma)
{
struct media_encoder *ma = CALLOC(1, struct media_encoder);
struct media_encoder *ma = calloc(1, sizeof(struct media_encoder));
if (!ma) {
loge("malloc media_encoder failed!\n");
return NULL;
}
struct x264_ctx *c = CALLOC(1, struct x264_ctx);
struct x264_ctx *c = calloc(1, sizeof(struct x264_ctx));
if (!c) {
loge("malloc x264_ctx failed!\n");
return NULL;

View File

@@ -1,4 +1,6 @@
###############################################################################
# common
###############################################################################
#ARCH: linux/arm/android/ios/win
ARCH ?= linux
OUTPUT ?= /usr/local
@@ -16,9 +18,12 @@ AR_V ?= $(AR)
CP_V ?= $(CP)
RM_V ?= $(RM)
###############################################################################
# target and object
###############################################################################
LIBNAME = libsort
VERSION_SH = $(shell pwd)/version.sh $(LIBNAME)
VER = $(shell $(VERSION_SH); awk '/define\ $(LIBNAME)_version/{print $$3}' version.h)
TGT_LIB_H = $(LIBNAME).h
TGT_LIB_A = $(LIBNAME).a
TGT_LIB_SO = $(LIBNAME).so
@@ -33,6 +38,9 @@ OBJS_LIB += select_sort.o
OBJS_UNIT_TEST = test_$(LIBNAME).o
###############################################################################
# cflags and ldflags
###############################################################################
ifeq ($(MODE), release)
CFLAGS := -O2 -Wall -Werror -fPIC
LTYPE := release
@@ -46,12 +54,14 @@ else
OUTLIBPATH :=$(OUTPUT)/$(LTYPE)
endif
CFLAGS += $($(ARCH)_CFLAGS)
CFLAGS += -I$(OUTPUT)/include
CFLAGS += -I$(OUTPUT)/include/gear-lib
SHARED := -shared
LDFLAGS := $($(ARCH)_LDFLAGS)
###############################################################################
# target
###############################################################################
.PHONY : all clean
TGT := $(TGT_LIB_A)
@@ -69,7 +79,9 @@ $(TGT_LIB_A): $(OBJS_LIB)
$(AR_V) rcs $@ $^
$(TGT_LIB_SO): $(OBJS_LIB)
$(CC_V) -o $@ $^ $(SHARED)
$(CC_V) -o $@ $^ $(SHARED) $(LDFLAGS)
@mv $(TGT_LIB_SO) $(TGT_LIB_SO_VER)
@ln -sf $(TGT_LIB_SO_VER) $(TGT_LIB_SO)
$(TGT_UNIT_TEST): $(OBJS_UNIT_TEST) $(ANDROID_MAIN_OBJ)
$(CC_V) -o $@ $^ $(TGT_LIB_A) $(LDFLAGS)
@@ -77,13 +89,17 @@ $(TGT_UNIT_TEST): $(OBJS_UNIT_TEST) $(ANDROID_MAIN_OBJ)
clean:
$(RM_V) -f $(OBJS)
$(RM_V) -f $(TGT)
$(RM_V) -f version.h
$(RM_V) -f $(TGT_LIB_SO)*
$(RM_V) -f $(TGT_LIB_SO_VER)
install:
$(MAKEDIR_OUTPUT)
if [ "$(MODE)" = "release" ];then $(STRIP) $(TGT); fi
@if [ "$(MODE)" = "release" ];then $(STRIP) $(TGT); fi
$(CP_V) -r $(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/gear-lib/ && rm -f $(TGT_LIB_H)

27
gear-lib/libsort/version.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/sh
major=0
minor=1
patch=0
libname=$1
output=version.h
LIBNAME=`echo ${libname} | tr 'a-z' 'A-Z'`
export version=${major}.${minor}.${patch}
export buildid=`git log -1 --pretty=format:"git-%cd-%h" --date=short 2>/dev/null`
autogen_version_h()
{
cat > version.h <<!
/* Automatically generated by version.sh - do not modify! */
#ifndef ${LIBNAME}_VERSION_H
#define ${LIBNAME}_VERSION_H
#define ${libname}_version ${version}
#define ${libname}_buildid ${buildid}
#endif
!
}
autogen_version_h

View File

@@ -1 +0,0 @@
../gear-lib/libmacro/kernel_list.h

View File

@@ -1 +0,0 @@
../gear-lib/libmacro/libmacro.h

1
include/libmp4.h Symbolic link
View File

@@ -0,0 +1 @@
../gear-lib/libmp4/libmp4.h

View File

@@ -1 +0,0 @@
../gear-lib/libmp4parser/libmp4parser.h

1
include/libposix.h Symbolic link
View File

@@ -0,0 +1 @@
../gear-lib/libposix/libposix.h

1
include/libuac.h Symbolic link
View File

@@ -0,0 +1 @@
../gear-lib/libuac/libuac.h

View File

@@ -1 +0,0 @@
../gear-lib/libmp4parser/mp4parser_inner.h

View File

@@ -1 +0,0 @@
../gear-lib/libmp4parser/patch.h

View File

@@ -1 +0,0 @@
../gear-lib/librtmpc/rtmp_aac.h

View File

@@ -1 +0,0 @@
../gear-lib/librtmpc/rtmp_g711.h

View File

@@ -1 +0,0 @@
../gear-lib/librtmpc/rtmp_h264.h

View File

@@ -1 +0,0 @@
../gear-lib/librtmpc/rtmp_util.h

View File

@@ -1 +0,0 @@
../gear-lib/libmacro/libmacro.c

View File

@@ -1 +0,0 @@
../gear-lib/libmp4parser/libmp4parser.c

1
src/libposix.c Symbolic link
View File

@@ -0,0 +1 @@
../gear-lib/libposix/libposix.c

1
src/libuac.c Symbolic link
View File

@@ -0,0 +1 @@
../gear-lib/libuac/libuac.c

View File

@@ -1 +0,0 @@
../gear-lib/libmp4parser/mp4parser_inner.c

View File

@@ -1 +0,0 @@
../gear-lib/libmp4parser/patch.c

View File

@@ -1 +0,0 @@
../gear-lib/librtmpc/rtmp_aac.c

View File

@@ -1 +0,0 @@
../gear-lib/librtmpc/rtmp_g711.c

View File

@@ -1 +0,0 @@
../gear-lib/librtmpc/rtmp_h264.c

View File

@@ -1 +0,0 @@
../gear-lib/librtmpc/rtmp_util.c