From c098b28bbc659989a4d73bdb426a6723c4d7404e Mon Sep 17 00:00:00 2001 From: Olaf Wintermann Date: Wed, 16 Jun 2021 16:04:13 +0200 Subject: [PATCH 1/6] minimal copy --- mizucp/main.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++------- mizucp/main.h | 11 ++++++++++ 2 files changed, 71 insertions(+), 7 deletions(-) diff --git a/mizucp/main.c b/mizucp/main.c index 18aaf5a..5fb1e8b 100644 --- a/mizucp/main.c +++ b/mizucp/main.c @@ -215,13 +215,12 @@ int mzcp_copy(CPSettings *settings) { int mzcp_start_scan(CPSettings *settings) { - struct stat s; - if(stat(settings->from, &s)) { + if(stat(settings->from, &settings->root_stat)) { // TODO: error return 1; } - if(!S_ISDIR(s.st_mode)) { + if(!S_ISDIR(settings->root_stat.st_mode)) { // queue single file queue_begin = queue_root_elm_new(); if(!queue_begin) { @@ -259,6 +258,7 @@ void* scan_run(void *data) { } file->path = root; file->isdir = 1; + file->mode = settings->root_stat.st_mode; if(enqueue_file(file)) { scan_complete = 1; // TODO: error @@ -298,6 +298,7 @@ void* scan_run(void *data) { SrcFile *f = calloc(1, sizeof(SrcFile)); f->path = util_concat_path(elm->path, name); f->isdir = S_ISDIR(s.st_mode); + f->mode = s.st_mode; f->depends_on = elm; if(enqueue_file(f)) { @@ -399,17 +400,35 @@ static SrcFile* queue_get_file(void) { void* copy_run(void *data) { CPSettings *settings = data; + + char *buffer = malloc(MZ_COPY_BUFSIZE); + size_t bufsize = MZ_COPY_BUFSIZE; + for(;;) { SrcFile *file = queue_get_file(); if(!file) { break; } - char *from = file->path ? util_concat_path(settings->from, file->path) : settings->from; - printf("src: %s\n", from); - + char *from = file->path ? util_concat_path(settings->from, file->path) : settings->from; char *to = util_concat_path(settings->to, file->path ? file->path : util_resource_name(settings->from)); - printf("dst: %s\n", to); + + size_t from_len = strlen(from); + size_t to_len = strlen(to); + + if(from[from_len-1] == '/') { + from[from_len-1] = 0; + } + if(to[to_len-1] == '/') { + to[to_len-1] = 0; + } + + int ret; + if(file->isdir) { + ret = mz_copy_dir(settings, file, from, to); + } else { + ret = mz_copy_file(settings, file, from, to, buffer, bufsize); + } free(to); if(from != settings->from) { @@ -420,3 +439,37 @@ void* copy_run(void *data) { return NULL; } +int mz_copy_dir(CPSettings *settings, SrcFile *file, const char *from, const char *to) { + printf("mkdir %s\n", to); + return mkdir(to, file->mode); +} + +int mz_copy_file(CPSettings *settings, SrcFile *file, const char *from, const char *to, char *buffer, size_t bufsize) { + printf("cp %s %s\n", from, to); + int fin = open(from, O_RDONLY); + if(fin < 0) { + return 1; + } + + int ret = 0; + + int fout = open(to, O_WRONLY|O_CREAT, file->mode); + if(fout < 0) { + perror("open"); + close(fin); + return 1; + } + + ssize_t r; + while((r = read(fin, buffer, bufsize)) > 0) { + if(write(fout, buffer, r) != r) { + ret = 1; + break; + } + } + + close(fin); + close(fout); + + return ret; +} diff --git a/mizucp/main.h b/mizucp/main.h index 872b06f..1c5f730 100644 --- a/mizucp/main.h +++ b/mizucp/main.h @@ -24,6 +24,8 @@ #define MAIN_H #include +#include +#include #include @@ -41,6 +43,7 @@ extern "C" { #define CLIENT_MSG_BUFSIZE 512 #define MAX_COPY_THREADS 32 +#define MZ_COPY_BUFSIZE 4 * 1024 * 1024 typedef char CPBool; @@ -55,6 +58,7 @@ typedef struct { CPBool url; CPBool pause; CPBool printsocket; + struct stat root_stat; } CPSettings; struct MZLock { @@ -79,6 +83,11 @@ struct SrcFile { CPBool finished; /* + * file mode + */ + mode_t mode; + + /* * processing this file depends on another file (directory) */ SrcFile *depends_on; @@ -107,6 +116,8 @@ int enqueue_file(SrcFile *file); int mzcp_start_copy_threads(CPSettings *settings); void* copy_run(void *data); +int mz_copy_dir(CPSettings *settings, SrcFile *file, const char *from, const char *to); +int mz_copy_file(CPSettings *settings, SrcFile *file, const char *from, const char *to, char *buffer, size_t bufsize); #ifdef __cplusplus -- 1.8.3.1 From ade0a6371f4dc5fe7dd8e81e66aba96037a63647 Mon Sep 17 00:00:00 2001 From: Olaf Wintermann Date: Tue, 9 Nov 2021 15:46:55 +0100 Subject: [PATCH 2/6] check parent dir dependency before copy --- mizucp/main.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---- mizucp/main.h | 7 +++++-- 2 files changed, 61 insertions(+), 6 deletions(-) diff --git a/mizucp/main.c b/mizucp/main.c index 5fb1e8b..77b23ea 100644 --- a/mizucp/main.c +++ b/mizucp/main.c @@ -423,11 +423,36 @@ void* copy_run(void *data) { to[to_len-1] = 0; } + if(file->depends_on) { + SrcFile *dep = file->depends_on; + // check first without lock + if(dep->status == 0) { + if(dep->lock) { + pthread_mutex_lock(&dep->lock->mutex); + if(file->depends_on->status == 0) { + pthread_cond_wait(&dep->lock->cond, &dep->lock->mutex); + } + pthread_mutex_unlock(&dep->lock->mutex); + } else { + // locking disabled (because we have only one thread) + // but in that case the file status can't be 0 + // therefore this case here should not happen + file->status = -1; + } + } + // check again + if(dep->status == -1) { + file->status = -1; + } + } + int ret; - if(file->isdir) { + if(file->status == 0) { + if(file->isdir) { ret = mz_copy_dir(settings, file, from, to); - } else { - ret = mz_copy_file(settings, file, from, to, buffer, bufsize); + } else { + ret = mz_copy_file(settings, file, from, to, buffer, bufsize); + } } free(to); @@ -439,15 +464,39 @@ void* copy_run(void *data) { return NULL; } +static void file_set_status(SrcFile *file, int status) { + if(file->lock) { + pthread_mutex_lock(&file->lock->mutex); + file->status = status; + pthread_cond_broadcast(&file->lock->cond); + pthread_mutex_unlock(&file->lock->mutex); + } else { + file->status = status; + } +} + int mz_copy_dir(CPSettings *settings, SrcFile *file, const char *from, const char *to) { printf("mkdir %s\n", to); - return mkdir(to, file->mode); + int ret = mkdir(to, file->mode); + if(ret) { + if(errno == EEXIST) { + struct stat s; + if(!stat(to, &s)) { + if(S_ISDIR(s.st_mode)) { + ret = 0; + } + } + } + } + file_set_status(file, !ret ? 1 : -1); + return ret; } int mz_copy_file(CPSettings *settings, SrcFile *file, const char *from, const char *to, char *buffer, size_t bufsize) { printf("cp %s %s\n", from, to); int fin = open(from, O_RDONLY); if(fin < 0) { + file_set_status(file, -1); return 1; } @@ -457,6 +506,7 @@ int mz_copy_file(CPSettings *settings, SrcFile *file, const char *from, const ch if(fout < 0) { perror("open"); close(fin); + file_set_status(file, -1); return 1; } @@ -471,5 +521,7 @@ int mz_copy_file(CPSettings *settings, SrcFile *file, const char *from, const ch close(fin); close(fout); + file_set_status(file, !ret ? 1 : -1); + return ret; } diff --git a/mizucp/main.h b/mizucp/main.h index 1c5f730..956ecab 100644 --- a/mizucp/main.h +++ b/mizucp/main.h @@ -78,9 +78,12 @@ struct SrcFile { CPBool isdir; /* - * file successfully copied + * copy status + * 0: unprocessed + * 1: success + * -1: failure */ - CPBool finished; + int status; /* * file mode -- 1.8.3.1 From 963a0109c8244dcc16a829b607a194770a77602f Mon Sep 17 00:00:00 2001 From: Olaf Wintermann Date: Wed, 10 Nov 2021 11:30:50 +0100 Subject: [PATCH 3/6] mizucp: count number of copied bytes/files --- mizucp/atomic.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ mizucp/main.c | 40 ++++++++++++++++++++++++++++++++++++++-- mizucp/main.h | 5 +++++ mizucp/vfs.c | 23 +++++++++++++++++++++++ mizucp/vfs.h | 41 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 159 insertions(+), 2 deletions(-) create mode 100644 mizucp/atomic.h create mode 100644 mizucp/vfs.c create mode 100644 mizucp/vfs.h diff --git a/mizucp/atomic.h b/mizucp/atomic.h new file mode 100644 index 0000000..f624e7e --- /dev/null +++ b/mizucp/atomic.h @@ -0,0 +1,52 @@ +/* + * Copyright 2021 Olaf Wintermann + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef MZCP_ATOMIC_H +#define MZCP_ATOMIC_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(__clang__) || defined(__GNUC__) + +#define mz_atomic_inc64(intptr) __sync_fetch_and_add(intptr, 1) +#define mz_atomic_dec64(intptr) __sync_fetch_and_sub(intptr, 1) +#define mz_atomic_add64(intptr, val) __sync_fetch_and_add(intptr, val) + +#elif defined(__sun) + +#include + +#define mz_atomic_inc64(intptr) atomic_inc_64_nv(intptr) +#define mz_atomic_dec64(intptr) atomic_dec_64_nv(intptr) +#define mz_atomic_add64(intptr, val) atomic_add_64_nv(intptr, val) + +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* MZCP_ATOMIC_H */ + diff --git a/mizucp/main.c b/mizucp/main.c index 77b23ea..f590dc7 100644 --- a/mizucp/main.c +++ b/mizucp/main.c @@ -23,9 +23,11 @@ #include "main.h" #include "srvctrl.h" +#include "atomic.h" #include #include +#include #include #include #include @@ -61,6 +63,13 @@ static MZQueue *queue_end; static int scan_complete; + +static uint64_t stat_num_files; +static uint64_t stat_copied_files; +static uint64_t stat_error_files; +static uint64_t stat_total_size; +static uint64_t stat_copied_size; + int main(int argc, char** argv) { int ret = 1; @@ -298,6 +307,7 @@ void* scan_run(void *data) { SrcFile *f = calloc(1, sizeof(SrcFile)); f->path = util_concat_path(elm->path, name); f->isdir = S_ISDIR(s.st_mode); + f->size = s.st_size; f->mode = s.st_mode; f->depends_on = elm; @@ -305,6 +315,10 @@ void* scan_run(void *data) { // TODO: error? fprintf(stderr, "enqueue failed\n"); break; + } else { + mz_atomic_inc64(&stat_num_files); + int64_t sz = s.st_size; + mz_atomic_add64(&stat_total_size, sz); } // put dir on stack @@ -510,9 +524,15 @@ int mz_copy_file(CPSettings *settings, SrcFile *file, const char *from, const ch return 1; } + int64_t copied = 0; ssize_t r; while((r = read(fin, buffer, bufsize)) > 0) { - if(write(fout, buffer, r) != r) { + ssize_t w = write(fout, buffer, r); + if(w > 0) { + mz_atomic_add64(&stat_copied_size, w); + copied += w; + } + if(w != r) { ret = 1; break; } @@ -521,7 +541,23 @@ int mz_copy_file(CPSettings *settings, SrcFile *file, const char *from, const ch close(fin); close(fout); - file_set_status(file, !ret ? 1 : -1); + if(!ret) { + file_set_status(file, 1); + mz_atomic_inc64(&stat_copied_files); + if(copied != file->size) { + // size changed after scan -> readjust total size + int64_t filesz_diff = copied - file->size; + mz_atomic_add64(&stat_total_size, filesz_diff); + } + } else { + file_set_status(file, -1); + mz_atomic_inc64(&stat_error_files); + if(copied != file->size) { + // count the full file size as copied, although we had an error + int64_t filesz_diff = file->size - copied; + mz_atomic_add64(&stat_copied_size, filesz_diff); + } + } return ret; } diff --git a/mizucp/main.h b/mizucp/main.h index 956ecab..e5537e5 100644 --- a/mizucp/main.h +++ b/mizucp/main.h @@ -91,6 +91,11 @@ struct SrcFile { mode_t mode; /* + * file size + */ + uint64_t size; + + /* * processing this file depends on another file (directory) */ SrcFile *depends_on; diff --git a/mizucp/vfs.c b/mizucp/vfs.c new file mode 100644 index 0000000..3a3b199 --- /dev/null +++ b/mizucp/vfs.c @@ -0,0 +1,23 @@ +/* + * Copyright 2019 Olaf Wintermann + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "vfs.h" diff --git a/mizucp/vfs.h b/mizucp/vfs.h new file mode 100644 index 0000000..7e09c30 --- /dev/null +++ b/mizucp/vfs.h @@ -0,0 +1,41 @@ +/* + * Copyright 2019 Olaf Wintermann + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef VFS_H +#define VFS_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + + + +#ifdef __cplusplus +} +#endif + +#endif /* VFS_H */ + -- 1.8.3.1 From ff25b54c9f837ace420a178541b136fa4b0b1eee Mon Sep 17 00:00:00 2001 From: Olaf Wintermann Date: Fri, 3 Dec 2021 14:01:52 +0100 Subject: [PATCH 4/6] move menu initialization to separate file --- mizunara/Makefile | 1 + mizunara/main.c | 20 ++++---------------- mizunara/menu.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ mizunara/menu.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 16 deletions(-) create mode 100644 mizunara/menu.c create mode 100644 mizunara/menu.h diff --git a/mizunara/Makefile b/mizunara/Makefile index 5656808..327c556 100644 --- a/mizunara/Makefile +++ b/mizunara/Makefile @@ -32,6 +32,7 @@ include $(BUILD_ROOT)/config.mk CFLAGS += -I../ui/ -I../ucx -I.. SRC = main.c +SRC += menu.c OBJ = $(SRC:%.c=$(BUILD_ROOT)/build/mizunara/%.$(OBJ_EXT)) diff --git a/mizunara/main.c b/mizunara/main.c index ba20e28..9500f65 100644 --- a/mizunara/main.c +++ b/mizunara/main.c @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 2017 Olaf Wintermann. All rights reserved. + * Copyright 2021 Olaf Wintermann. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -33,12 +33,12 @@ #include #include -void action_menu(UiEvent *event, void *userdata) { - -} +#include "menu.h" + void application_startup(UiEvent *event, void *data) { + setup_menu(); UiObject *obj = ui_window("Test", NULL); @@ -50,18 +50,6 @@ int main(int argc, char** argv) { ui_init("app1", argc, argv); ui_onstartup(application_startup, NULL); - // menu - ui_menu("File"); - ui_menuitem("Hello", action_menu, NULL); - ui_submenu("Submenu1"); - ui_submenu("Submenu2"); - ui_menuitem("item2", action_menu, NULL); - ui_submenu_end(); - ui_menuitem("item3", action_menu, NULL); - ui_submenu_end(); - ui_menuitem("item4", action_menu, NULL); - - ui_main(); return (EXIT_SUCCESS); diff --git a/mizunara/menu.c b/mizunara/menu.c new file mode 100644 index 0000000..2ba886b --- /dev/null +++ b/mizunara/menu.c @@ -0,0 +1,44 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2021 Olaf Wintermann. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "menu.h" + +#include +#include +#include + +static void action_menu(UiEvent *event, void *userdata) { + +} + + + +void setup_menu(void) { + ui_menu("File"); + ui_menuitem("Test", action_menu, NULL); +} diff --git a/mizunara/menu.h b/mizunara/menu.h new file mode 100644 index 0000000..1aba01e --- /dev/null +++ b/mizunara/menu.h @@ -0,0 +1,45 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2021 Olaf Wintermann. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef MZ_MENU_H +#define MZ_MENU_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void setup_menu(void); + + +#ifdef __cplusplus +} +#endif + +#endif /* MZ_MENU_H */ + -- 1.8.3.1 From f8502ad3e7ecc97f3a4ea8aa83cd98667dd6d812 Mon Sep 17 00:00:00 2001 From: Olaf Wintermann Date: Fri, 3 Dec 2021 14:17:07 +0100 Subject: [PATCH 5/6] prepare build system for toolkit specific mizunara source files --- configure | 4 ++++ make/project.xml | 6 ++++++ mizunara/Makefile | 2 ++ 3 files changed, 12 insertions(+) diff --git a/configure b/configure index 44f8e8a..1278d2f 100755 --- a/configure +++ b/configure @@ -580,6 +580,8 @@ checkopt_toolkit_gtk3() cat >> $TEMP_DIR/make.mk << __EOF__ TOOLKIT = gtk GTKOBJ = draw_cairo.o +MZUI = gtk_pathbar.c +MZUI += gtk_browser.c __EOF__ return 0 @@ -596,6 +598,8 @@ checkopt_toolkit_motif() fi cat >> $TEMP_DIR/make.mk << __EOF__ TOOLKIT = motif +MZUI = motif_pathbar.c +MZUI += motif_browser.c __EOF__ return 0 diff --git a/make/project.xml b/make/project.xml index cc20939..8941c3c 100644 --- a/make/project.xml +++ b/make/project.xml @@ -99,6 +99,9 @@ gtk3 TOOLKIT = gtk GTKOBJ = draw_cairo.o + + MZUI = gtk_pathbar.c + MZUI += gtk_browser.c + MZUI = motif_pathbar.c + MZUI += motif_browser.c