From 266e210b04250f5dc2efe750121405e61e45d1ba Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Tue, 1 Sep 2020 08:53:33 +0300 Subject: [PATCH] fixed ld error --- Makefile | 1 + src/gpio/gpio.c | 29 +++++++++++++++++++++++++++++ src/{ => gpio}/gpio.h | 12 ++++++------ src/http/server.c | 2 +- src/main.c | 2 +- src/options.c | 2 +- src/stream.c | 2 +- 7 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 src/gpio/gpio.c rename src/{ => gpio}/gpio.h (94%) diff --git a/Makefile b/Makefile index 2f353bb..477b810 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,7 @@ endif ifneq ($(call optbool,$(WITH_GPIO)),) _LIBS += -lwiringPi override CFLAGS += -DWITH_GPIO +_SRCS += $(shell ls src/gpio/*.c) endif diff --git a/src/gpio/gpio.c b/src/gpio/gpio.c new file mode 100644 index 0000000..b0cf06c --- /dev/null +++ b/src/gpio/gpio.c @@ -0,0 +1,29 @@ +/***************************************************************************** +# # +# uStreamer - Lightweight and fast MJPG-HTTP streamer. # +# # +# Copyright (C) 2018 Maxim Devaev # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +*****************************************************************************/ + + +#include "gpio.h" + + +int gpio_pin_prog_running; +int gpio_pin_stream_online; +int gpio_pin_has_http_clients; +int gpio_pin_workers_busy_at; diff --git a/src/gpio.h b/src/gpio/gpio.h similarity index 94% rename from src/gpio.h rename to src/gpio/gpio.h index 8f929af..a7c6d1e 100644 --- a/src/gpio.h +++ b/src/gpio/gpio.h @@ -26,14 +26,14 @@ #include -#include "tools.h" -#include "logging.h" +#include "../tools.h" +#include "../logging.h" -int gpio_pin_prog_running; -int gpio_pin_stream_online; -int gpio_pin_has_http_clients; -int gpio_pin_workers_busy_at; +extern int gpio_pin_prog_running; +extern int gpio_pin_stream_online; +extern int gpio_pin_has_http_clients; +extern int gpio_pin_workers_busy_at; #define GPIO_INIT { \ diff --git a/src/http/server.c b/src/http/server.c index 5bc0151..c337818 100644 --- a/src/http/server.c +++ b/src/http/server.c @@ -59,7 +59,7 @@ #include "../encoder.h" #include "../stream.h" #ifdef WITH_GPIO -# include "../gpio.h" +# include "../gpio/gpio.h" #endif #include "unix.h" diff --git a/src/main.c b/src/main.c index 509e689..ee97b2f 100644 --- a/src/main.c +++ b/src/main.c @@ -44,7 +44,7 @@ #include "stream.h" #include "http/server.h" #ifdef WITH_GPIO -# include "gpio.h" +# include "gpio/gpio.h" #endif diff --git a/src/options.c b/src/options.c index 0cd0aa7..2faa85c 100644 --- a/src/options.c +++ b/src/options.c @@ -40,7 +40,7 @@ #include "encoder.h" #include "http/server.h" #ifdef WITH_GPIO -# include "gpio.h" +# include "gpio/gpio.h" #endif diff --git a/src/stream.c b/src/stream.c index 06b6ea7..41e3ef6 100644 --- a/src/stream.c +++ b/src/stream.c @@ -38,7 +38,7 @@ #include "device.h" #include "encoder.h" #ifdef WITH_GPIO -# include "gpio.h" +# include "gpio/gpio.h" #endif