2 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
3 & eval 'exec perl -S $0 $argv:q'
7 # Replacement for the old trusty GenExportH.bat
8 # Creates the nice little *_export file which is used for
9 # importing and exporting of symbols in DLLs.
10 # (they are soooo cute!)
14 ##############################################################################
17 $flags = join (" ", @ARGV);
19 if (!getopts
('df:hsn') || $opt_h) {
21 "generate_export_file.pl [-d] [-f dependency] [-n] library_name\n",
23 " -d Turn on debug mode\n",
24 " -f Adds a dependency to another *_HAS_DLL macro\n",
25 " -n Do not add in ACE_AS_STATIC_LIBS check\n",
27 "generate_export_file creates the *_export files that are used\n",
28 "in exporting of symbols for DLLs (and not exporting them when\n",
29 "the library is static). If library_name is something like\n",
30 "\"Foo\", then the file will contain definitions for Foo_Export\n",
31 "and FOO_SINGLETON_DECLARE, etc. which will be controlled by\n",
32 "FOO_HAS_DLL, etc.\n";
37 print STDERR
"Debugging Turned on\n";
40 print STDERR
"Dependency to $opt_f\n";
44 print STDERR
"ACE_AS_STATIC_LIBS turned off\n";
50 print STDERR
"No library_name specified, use -h for help\n";
57 ##############################################################################
62 // Definition for Win32 Export directives.
63 // This file is generated automatically by generate_export_file.pl '."$flags".'
64 // ------------------------------'."
68 #include \"ace/config-all.h\"
72 ##############################################################################
78 #if defined (ACE_AS_STATIC_LIBS) && !defined (-UC-_HAS_DLL)
79 # define -UC-_HAS_DLL 0
80 #endif /* ACE_AS_STATIC_LIBS && -UC-_HAS_DLL */
84 ##############################################################################
91 # if !defined (-UC-_HAS_DLL)
92 # define -UC-_HAS_DLL 0
93 # endif /* ! -UC-_HAS_DLL */
95 # if !defined (-UC-_HAS_DLL)
96 # define -UC-_HAS_DLL 1
97 # endif /* ! -UC-_HAS_DLL */
104 #if !defined (-UC-_HAS_DLL)
105 # define -UC-_HAS_DLL 1
106 #endif /* ! -UC-_HAS_DLL */
110 ##############################################################################
114 #if defined (-UC-_HAS_DLL) && (-UC-_HAS_DLL == 1)
115 # if defined (-UC-_BUILD_DLL)
116 # define -NC-_Export ACE_Proper_Export_Flag
117 # define -UC-_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
118 # define -UC-_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
119 # else /* -UC-_BUILD_DLL */
120 # define -NC-_Export ACE_Proper_Import_Flag
121 # define -UC-_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
122 # define -UC-_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
123 # endif /* -UC-_BUILD_DLL */
124 #else /* -UC-_HAS_DLL == 1 */
126 # define -UC-_SINGLETON_DECLARATION(T)
127 # define -UC-_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
128 #endif /* -UC-_HAS_DLL == 1 */
130 // Set -UC-_NTRACE = 0 to turn on library specific tracing even if
131 // tracing is turned off for ACE.
132 #if !defined (-UC-_NTRACE)
133 # if (ACE_NTRACE == 1)
134 # define -UC-_NTRACE 1
135 # else /* (ACE_NTRACE == 1) */
136 # define -UC-_NTRACE 0
137 # endif /* (ACE_NTRACE == 1) */
138 #endif /* !-UC-_NTRACE */
140 #if (-UC-_NTRACE == 1)
141 # define -UC-_TRACE(X)
142 #else /* (-UC-_NTRACE == 1) */
143 # if !defined (ACE_HAS_TRACE)
144 # define ACE_HAS_TRACE
145 # endif /* ACE_HAS_TRACE */
146 # define -UC-_TRACE(X) ACE_TRACE_IMPL(X)
147 # include \"ace/Trace.h\"
148 #endif /* (-UC-_NTRACE == 1) */
150 #endif /* -UC-_EXPORT_H */
152 // End of auto generated file.
155 ##############################################################################
156 # Print the stuff out
158 foreach $export ($prologue, $static_stuff, $has_dll, $epilogue)
160 ## -NC- stands for normal case, the name as it is
161 ## -UC- stands for the name all upper case
162 map { s/-NC-/$name/g; s/-UC-/$ucname/g; } $export;