Changeset 3536

Show
Ignore:
Timestamp:
08/15/08 19:44:44 (4 months ago)
Author:
dgollub
Message:

Patch by yselkowitz:
libopensync assumes that modules have a .so extension. This is not
always correct; on Cygwin, for instance, they have a .dll extension. I'm
attaching a patch for 0.36 that uses G_MODULE_SUFFIX for portability.

Location:
trunk
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/opensync/format/opensync_format_env.c

    r3506 r3536  
    7272                filename = g_strdup_printf ("%s%c%s", path, G_DIR_SEPARATOR, de); 
    7373                 
    74                 if (!g_file_test(filename, G_FILE_TEST_IS_REGULAR) || !g_pattern_match_simple("*.so", filename)) { 
     74                if (!g_file_test(filename, G_FILE_TEST_IS_REGULAR) || !g_pattern_match_simple("*."G_MODULE_SUFFIX, filename)) { 
    7575                        g_free(filename); 
    7676                        continue; 
  • trunk/opensync/plugin/opensync_plugin_env.c

    r3440 r3536  
    148148                filename = g_strdup_printf ("%s%c%s", path, G_DIR_SEPARATOR, de); 
    149149                 
    150                 if (!g_file_test(filename, G_FILE_TEST_IS_REGULAR) || !g_pattern_match_simple("*.so", filename)) { 
     150                if (!g_file_test(filename, G_FILE_TEST_IS_REGULAR) || !g_pattern_match_simple("*."G_MODULE_SUFFIX, filename)) { 
    151151                        g_free(filename); 
    152152                        continue; 
  • trunk/tests/format-tests/check_format_env.c

    r2743 r3536  
    370370         
    371371        char *curdir = g_get_current_dir(); 
    372         char *path = g_strdup_printf("%s/mock-format.so", curdir); 
     372        char *path = g_strdup_printf("%s/mock-format.%s", curdir, G_MODULE_SUFFIX); 
    373373        fail_unless(osync_module_load(module, path, &error), NULL); 
    374374        fail_unless(error == NULL, NULL); 
  • trunk/tests/module-tests/check_module.c

    r2743 r3536  
    2828         
    2929        char *curdir = g_get_current_dir(); 
    30         char *path = g_strdup_printf("%s/mock-format.so", curdir); 
     30        char *path = g_strdup_printf("%s/mock-format.%s", curdir, G_MODULE_SUFFIX); 
    3131        fail_unless(osync_module_load(module, path, &error), NULL); 
    3232        fail_unless(error == NULL, NULL); 
     
    5252         
    5353        char *curdir = g_get_current_dir(); 
    54         char *path = g_strdup_printf("%s/does-not-exist.so", curdir); 
     54        char *path = g_strdup_printf("%s/does-not-exist.%s", curdir, G_MODULE_SUFFIX); 
    5555        fail_unless(!osync_module_load(module, path, &error), NULL); 
    5656        fail_unless(error != NULL, NULL); 
     
    7575         
    7676        char *curdir = g_get_current_dir(); 
    77         char *path = g_strdup_printf("%s/mock-format.so", curdir); 
     77        char *path = g_strdup_printf("%s/mock-format.%s", curdir, G_MODULE_SUFFIX); 
    7878        fail_unless(osync_module_load(module, path, &error), NULL); 
    7979        fail_unless(error == NULL, NULL); 
     
    103103         
    104104        char *curdir = g_get_current_dir(); 
    105         char *path = g_strdup_printf("%s/mock-format.so", curdir); 
     105        char *path = g_strdup_printf("%s/mock-format.%s", curdir, G_MODULE_SUFFIX); 
    106106        fail_unless(osync_module_load(module, path, &error), NULL); 
    107107        fail_unless(error == NULL, NULL); 
     
    132132         
    133133        char *curdir = g_get_current_dir(); 
    134         char *path = g_strdup_printf("%s/mock-format.so", curdir); 
     134        char *path = g_strdup_printf("%s/mock-format.%s", curdir, G_MODULE_SUFFIX); 
    135135        fail_unless(osync_module_load(module, path, &error), NULL); 
    136136        fail_unless(error == NULL, NULL); 
     
    159159         
    160160        char *curdir = g_get_current_dir(); 
    161         char *path = g_strdup_printf("%s/mock-format.so", curdir); 
     161        char *path = g_strdup_printf("%s/mock-format.%s", curdir, G_MODULE_SUFFIX); 
    162162        fail_unless(osync_module_load(module, path, &error), NULL); 
    163163        fail_unless(error == NULL, NULL); 
  • trunk/tests/support.c

    r3534 r3536  
    6565        g_free(command);*/ 
    6666         
    67         command = g_strdup_printf("cp ./mock-plugin/mock-sync.so %s", testbed); 
     67        command = g_strdup_printf("cp ./mock-plugin/mock-sync.%s %s", G_MODULE_SUFFIX, testbed); 
    6868        if (system(command)) 
    6969                abort(); 
    7070        g_free(command); 
    7171         
    72         command = g_strdup_printf("cp ./mock-plugin/mock-format.so %s", testbed); 
     72        command = g_strdup_printf("cp ./mock-plugin/mock-format.%s %s", G_MODULE_SUFFIX, testbed); 
    7373        if (system(command)) 
    7474                abort(); 
    7575        g_free(command); 
    7676         
    77         command = g_strdup_printf("cp -R ../formats/*.so %s", testbed); 
     77        command = g_strdup_printf("cp -R ../formats/*.%s %s", G_MODULE_SUFFIX, testbed); 
    7878        if (system(command)) 
    7979                abort();