]> Git repositories of Nishi - repoview.git/commitdiff
chekc libpng
authorNishi <nishi@nishi.boats>
Wed, 21 Aug 2024 17:26:30 +0000 (17:26 +0000)
committerNishi <nishi@nishi.boats>
Wed, 21 Aug 2024 17:26:30 +0000 (17:26 +0000)
git-svn-id: file:///raid/svn-personal/repoview/trunk@27 7e8b2a19-8934-dd40-8cb3-db22cdd5a80f

CGI/theme/modern.c
check.c
config.h.tmpl
libs.c

index 8f27b329d6c15c7dfed235780e8825224fdbec21..50757c29a115048b9d7d0d1ef4849f25c2b83cfa 100644 (file)
@@ -348,6 +348,7 @@ void render_page(void) {
                        free(user);
                        user = NULL;
                }
+#ifdef USE_MYPAGE
        } else if(strcmp(query, "mypage") == 0) {
                title = rv_strdup("My Page");
                desc = rv_strdup("You manage your information here.");
@@ -356,6 +357,7 @@ void render_page(void) {
                        add_data(&page, INSTANCE_ROOT);
                        add_data(&page, "/?page=login\">log in</a>?\n");
                }
+#endif
        } else if(strcmp(query, "myrepo") == 0) {
                title = rv_strdup("My Repositories");
                desc = rv_strdup("You manage your repositories here.");
@@ -869,11 +871,13 @@ void render_stuff(void) {
                add_data(&buffer, "                     </div>\n");
 #endif
        } else {
+#ifdef USE_MYPAGE
                add_data(&buffer, "                     <div>\n");
                add_data(&buffer, "                             <a href=\"");
                add_data(&buffer, INSTANCE_ROOT);
                add_data(&buffer, "/?page=mypage\">My Page</a>\n");
                add_data(&buffer, "                     </div>\n");
+#endif
 
                add_data(&buffer, "                     <div>\n");
                add_data(&buffer, "                             <a href=\"");
diff --git a/check.c b/check.c
index 3a6d342fa83b8300d0f57c93d3e7502ec43eba07..995151699c28294970a77ac8679341ed8847e149 100644 (file)
--- a/check.c
+++ b/check.c
@@ -90,6 +90,19 @@ int check_files(void) {
        return st;
 }
 
+int check_mypage(void) {
+       int st = 0;
+#if defined(USE_MYPAGE) && !defined(USE_GRAPHICSMAGICK)
+       fprintf(stderr, "USE_MYPAGE is defined, but USE_GRAPHICSMAGICK is not defined.\n");
+       st = 1;
+#endif
+#if defined(USE_MYPAGE) && !defined(USE_LIBPNG)
+       fprintf(stderr, "USE_MYPAGE is defined, but USE_LIBPNG is not defined.\n");
+       st = 1;
+#endif
+       return st;
+}
+
 int main() {
        int st;
        st = check_db();
@@ -100,6 +113,8 @@ int main() {
        if(st != 0) goto fail;
        st = check_files();
        if(st != 0) goto fail;
+       st = check_mypage();
+       if(st != 0) goto fail;
        printf("Config validation successful.\n");
        return 0;
 fail:
index df1bca76a09ea18b44fd6dd2588fb13d7cd32bb4..20a8720d650f1cbdfd4e09616fe83e4ce65ad42c 100644 (file)
 /* Use GraphicsMagick or not. */
 #define USE_GRAPHICSMAGICK
 
+/* Use libpng or not. */
+#define USE_LIBPNG
+
+/* My Page for the modern theme.*/
+/* Requires USE_GRAPHICSMAGICK and USE_LIBPNG to be defined. */
+#define USE_MYPAGE
+
 /* PATH, uses PATH from environment automatically if not defined. */
 #undef USE_PATH
 
diff --git a/libs.c b/libs.c
index 0cbd98e7423c1d9cc6091c90a395a0ec5709c80b..4df7e9c5ba2e0bea9b3c3e649e5ab9fbc0ad0497 100644 (file)
--- a/libs.c
+++ b/libs.c
@@ -13,6 +13,10 @@ int main() {
        printf(" ");
 #if defined(USE_GRAPHICSMAGICK)
        printf("-lGraphicsMagickWand");
+#endif
+       printf(" ");
+#if defined(USE_LIBPNG)
+       printf("-lpng16");
 #endif
        printf("\n");
        return 0;