Ruby  3.1.4p223 (2023-03-30 revision HEAD)
loadpath.c
1 /**********************************************************************
2 
3  loadpath.c -
4 
5  $Author$
6  created at: Wed May 15 14:19:50 JST 2013
7 
8  Copyright (C) 2013 Yukihiro Matsumoto
9 
10 **********************************************************************/
11 
12 #include "verconf.h"
13 #include "ruby/ruby.h"
14 
15 /* Define RUBY_REVISION to avoid revision.h inclusion via version.h. */
16 #define RUBY_REVISION 0
17 #include "version.h"
18 
19 #ifndef RUBY_ARCH
20 #define RUBY_ARCH RUBY_PLATFORM
21 #endif
22 #ifndef RUBY_SITEARCH
23 #define RUBY_SITEARCH RUBY_ARCH
24 #endif
25 #ifdef RUBY_PLATFORM_CPU
26 #define RUBY_THINARCH RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
27 #endif
28 #ifndef RUBY_LIB_PREFIX
29 #ifndef RUBY_EXEC_PREFIX
30 #error RUBY_EXEC_PREFIX must be defined
31 #endif
32 #define RUBY_LIB_PREFIX RUBY_EXEC_PREFIX"/lib/ruby"
33 #endif
34 #ifndef RUBY_SITE_LIB
35 #define RUBY_SITE_LIB RUBY_LIB_PREFIX"/site_ruby"
36 #endif
37 #ifndef RUBY_VENDOR_LIB
38 #define RUBY_VENDOR_LIB RUBY_LIB_PREFIX"/vendor_ruby"
39 #endif
40 
41 typedef char ruby_lib_version_string[(int)sizeof(RUBY_LIB_VERSION) - 2];
42 
43 #ifndef RUBY_LIB
44 #define RUBY_LIB RUBY_LIB_PREFIX "/"RUBY_LIB_VERSION
45 #endif
46 #define RUBY_SITE_LIB2 RUBY_SITE_LIB "/"RUBY_LIB_VERSION
47 #define RUBY_VENDOR_LIB2 RUBY_VENDOR_LIB "/"RUBY_LIB_VERSION
48 #ifndef RUBY_ARCH_LIB_FOR
49 #define RUBY_ARCH_LIB_FOR(arch) RUBY_LIB "/"arch
50 #endif
51 #ifndef RUBY_SITE_ARCH_LIB_FOR
52 #define RUBY_SITE_ARCH_LIB_FOR(arch) RUBY_SITE_LIB2 "/"arch
53 #endif
54 #ifndef RUBY_VENDOR_ARCH_LIB_FOR
55 #define RUBY_VENDOR_ARCH_LIB_FOR(arch) RUBY_VENDOR_LIB2 "/"arch
56 #endif
57 
58 #if !defined(LOAD_RELATIVE) || !LOAD_RELATIVE
59 const char ruby_exec_prefix[] = RUBY_EXEC_PREFIX;
60 #endif
61 
62 const char ruby_initial_load_paths[] =
63 #ifndef NO_INITIAL_LOAD_PATH
64 #ifdef RUBY_SEARCH_PATH
65  RUBY_SEARCH_PATH "\0"
66 #endif
67 #ifndef NO_RUBY_SITE_LIB
68 #ifdef RUBY_THINARCH
69  RUBY_SITE_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
70 #endif
71  RUBY_SITE_ARCH_LIB_FOR(RUBY_SITEARCH) "\0"
72  RUBY_SITE_LIB2 "\0"
73  RUBY_SITE_LIB "\0"
74 #endif
75 
76 #ifndef NO_RUBY_VENDOR_LIB
77 #ifdef RUBY_THINARCH
78  RUBY_VENDOR_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
79 #endif
80  RUBY_VENDOR_ARCH_LIB_FOR(RUBY_SITEARCH) "\0"
81  RUBY_VENDOR_LIB2 "\0"
82  RUBY_VENDOR_LIB "\0"
83 #endif
84 
85 #ifdef RUBY_THINARCH
86  RUBY_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
87 #endif
88  RUBY_ARCH_LIB_FOR(RUBY_ARCH) "\0"
89 #endif
90  RUBY_LIB "\0"
91  "";