refactoring sources
authorJosé Bollo <jose.bollo@iot.bzh>
Wed, 9 Dec 2015 13:35:04 +0000 (14:35 +0100)
committerJosé Bollo <jose.bollo@iot.bzh>
Wed, 9 Dec 2015 13:35:04 +0000 (14:35 +0100)
Change-Id: Id6d52eee86b706958972e9b345ec0d4d1e488146
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
20 files changed:
Makefile.am
configure.ac
src/Makefile.am [new file with mode: 0644]
src/wgt-config-xml.c [moved from wgt-config-xml.c with 100% similarity]
src/wgt-locales.c [moved from wgt-locales.c with 100% similarity]
src/wgt-rootdir.c [moved from wgt-rootdir.c with 100% similarity]
src/wgt-strings.c [moved from wgt-strings.c with 100% similarity]
src/wgt.h [moved from wgt.h with 100% similarity]
src/wgtpkg-base64.c [moved from wgtpkg-base64.c with 100% similarity]
src/wgtpkg-certs.c [moved from wgtpkg-certs.c with 100% similarity]
src/wgtpkg-digsig.c [moved from wgtpkg-digsig.c with 100% similarity]
src/wgtpkg-files.c [moved from wgtpkg-files.c with 100% similarity]
src/wgtpkg-install.c [moved from wgtpkg-install.c with 100% similarity]
src/wgtpkg-pack.c [moved from wgtpkg-pack.c with 100% similarity]
src/wgtpkg-sign.c [moved from wgtpkg-sign.c with 100% similarity]
src/wgtpkg-verbose.c [moved from wgtpkg-verbose.c with 100% similarity]
src/wgtpkg-workdir.c [moved from wgtpkg-workdir.c with 100% similarity]
src/wgtpkg-xmlsec.c [moved from wgtpkg-xmlsec.c with 100% similarity]
src/wgtpkg-zip.c [moved from wgtpkg-zip.c with 100% similarity]
src/wgtpkg.h [moved from wgtpkg.h with 100% similarity]

index 6c76395..f268924 100644 (file)
@@ -1,32 +1,2 @@
-bin_PROGRAMS = wgtpkg-install wgtpkg-pack wgtpkg-sign
-
-COMMONSRCS = \
-       wgtpkg-base64.c \
-       wgtpkg-certs.c \
-       wgtpkg-digsig.c \
-       wgtpkg-files.c \
-       wgtpkg-verbose.c \
-       wgtpkg-workdir.c \
-       wgtpkg-xmlsec.c \
-       wgtpkg-zip.c
-
-WGTSRCS = \
-       wgt-config-xml.c \
-       wgt-locales.c \
-       wgt-rootdir.c \
-       wgt-strings.c
-
-AM_CFLAGS  = -Wall -Wno-pointer-sign
-AM_CFLAGS += -ffunction-sections -fdata-sections
-AM_CFLAGS += ${ZIP_CFLAGS} ${XML2_CFLAGS} ${OPENSSL_CFLAGS} ${XMLSEC_CFLAGS}
-
-AM_LDFLAGS = -Wl,--gc-sections
-
-LDADD = ${ZIP_LIBS} ${XML2_LIBS} ${OPENSSL_LIBS} ${XMLSEC_LIBS}
-
-wgtpkg_install_SOURCES = wgtpkg-install.c ${WGTSRCS} ${COMMONSRCS}
-
-wgtpkg_sign_SOURCES = wgtpkg-sign.c ${COMMONSRCS}
-
-wgtpkg_pack_SOURCES = wgtpkg-pack.c ${COMMONSRCS}
+SUBDIRS = src
 
index 5cf0a62..ea099b0 100644 (file)
@@ -5,8 +5,8 @@ AC_PREREQ([2.69])
 AC_INIT([wgtpkg], [1.0], [wgtpkg@iot.bzh])
 AM_INIT_AUTOMAKE
 #AM_INIT_AUTOMAKE([-Wall -Wno-pointer-sign])
-AC_CONFIG_SRCDIR([wgtpkg-files.c])
-AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_SRCDIR([src/wgtpkg-files.c])
+AC_CONFIG_HEADERS([src/config.h])
 
 # Checks for programs.
 #AC_PROG_CXX
@@ -37,6 +37,8 @@ AC_TYPE_SSIZE_T
 AC_FUNC_MALLOC
 AC_FUNC_REALLOC
 AC_CHECK_FUNCS([atexit memmove mkdir realpath rmdir stpcpy strrchr strtoul])
+AC_CHECK_FUNCS([strcasecmp strdup strndup])
 
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile
+                 src/Makefile])
 AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644 (file)
index 0000000..6c76395
--- /dev/null
@@ -0,0 +1,32 @@
+bin_PROGRAMS = wgtpkg-install wgtpkg-pack wgtpkg-sign
+
+COMMONSRCS = \
+       wgtpkg-base64.c \
+       wgtpkg-certs.c \
+       wgtpkg-digsig.c \
+       wgtpkg-files.c \
+       wgtpkg-verbose.c \
+       wgtpkg-workdir.c \
+       wgtpkg-xmlsec.c \
+       wgtpkg-zip.c
+
+WGTSRCS = \
+       wgt-config-xml.c \
+       wgt-locales.c \
+       wgt-rootdir.c \
+       wgt-strings.c
+
+AM_CFLAGS  = -Wall -Wno-pointer-sign
+AM_CFLAGS += -ffunction-sections -fdata-sections
+AM_CFLAGS += ${ZIP_CFLAGS} ${XML2_CFLAGS} ${OPENSSL_CFLAGS} ${XMLSEC_CFLAGS}
+
+AM_LDFLAGS = -Wl,--gc-sections
+
+LDADD = ${ZIP_LIBS} ${XML2_LIBS} ${OPENSSL_LIBS} ${XMLSEC_LIBS}
+
+wgtpkg_install_SOURCES = wgtpkg-install.c ${WGTSRCS} ${COMMONSRCS}
+
+wgtpkg_sign_SOURCES = wgtpkg-sign.c ${COMMONSRCS}
+
+wgtpkg_pack_SOURCES = wgtpkg-pack.c ${COMMONSRCS}
+
similarity index 100%
rename from wgt-config-xml.c
rename to src/wgt-config-xml.c
similarity index 100%
rename from wgt-locales.c
rename to src/wgt-locales.c
similarity index 100%
rename from wgt-rootdir.c
rename to src/wgt-rootdir.c
similarity index 100%
rename from wgt-strings.c
rename to src/wgt-strings.c
diff --git a/wgt.h b/src/wgt.h
similarity index 100%
rename from wgt.h
rename to src/wgt.h
similarity index 100%
rename from wgtpkg-base64.c
rename to src/wgtpkg-base64.c
similarity index 100%
rename from wgtpkg-certs.c
rename to src/wgtpkg-certs.c
similarity index 100%
rename from wgtpkg-digsig.c
rename to src/wgtpkg-digsig.c
similarity index 100%
rename from wgtpkg-files.c
rename to src/wgtpkg-files.c
similarity index 100%
rename from wgtpkg-install.c
rename to src/wgtpkg-install.c
similarity index 100%
rename from wgtpkg-pack.c
rename to src/wgtpkg-pack.c
similarity index 100%
rename from wgtpkg-sign.c
rename to src/wgtpkg-sign.c
similarity index 100%
rename from wgtpkg-verbose.c
rename to src/wgtpkg-verbose.c
similarity index 100%
rename from wgtpkg-workdir.c
rename to src/wgtpkg-workdir.c
similarity index 100%
rename from wgtpkg-xmlsec.c
rename to src/wgtpkg-xmlsec.c
similarity index 100%
rename from wgtpkg-zip.c
rename to src/wgtpkg-zip.c
similarity index 100%
rename from wgtpkg.h
rename to src/wgtpkg.h