r6226: A couple of small typos ...
[Samba/gebeck_regimport.git] / source4 / smbd / build_options.c
bloba6c2cc86d7093f6568e89a80200033306aabb8f7
1 /*
2 Unix SMB/CIFS implementation.
3 Build Options for Samba Suite
4 Copyright (C) Vance Lankhaar <vlankhaar@hotmail.com> 2001
5 Copyright (C) Andrew Bartlett <abartlet@samba.org> 2001
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include "includes.h"
23 #include "build_env.h"
24 #include "dynconfig.h"
26 static void output(BOOL screen, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
29 #define OUTPUT(x) snprintf(outstring,sizeof(outstring),x); output(screen,outstring);
31 /****************************************************************************
32 helper function for build_options
33 ****************************************************************************/
34 static void output(BOOL screen, const char *format, ...)
36 char *ptr;
37 va_list ap;
39 va_start(ap, format);
40 vasprintf(&ptr,format,ap);
41 va_end(ap);
43 if (screen) {
44 d_printf("%s", ptr);
45 } else {
46 DEBUG(4,("%s", ptr));
49 SAFE_FREE(ptr);
52 /****************************************************************************
53 options set at build time for the samba suite
54 ****************************************************************************/
55 void build_options(BOOL screen)
57 if ((DEBUGLEVEL < 4) && (!screen)) {
58 return;
61 #ifdef _BUILD_ENV_H
62 /* Output information about the build environment */
63 output(screen,"Build environment:\n");
64 output(screen," Built by: %s@%s\n",BUILD_ENV_USER,BUILD_ENV_HOST);
65 output(screen," Built on: %s\n",BUILD_ENV_DATE);
67 output(screen," Built using: %s\n",BUILD_ENV_COMPILER);
68 output(screen," Build host: %s\n",BUILD_ENV_UNAME);
69 output(screen," SRCDIR: %s\n",BUILD_ENV_SRCDIR);
70 output(screen," BUILDDIR: %s\n",BUILD_ENV_BUILDDIR);
73 #endif
75 /* Output various options (most correspond to --with options) */
76 output(screen,"\nBuild options:\n");
77 #ifdef WITH_SMBWRAPPER
78 output(screen," WITH_SMBWRAPPER\n");
79 #endif
80 #ifdef WITH_AFS
81 output(screen," WITH_AFS\n");
82 #endif
83 #ifdef WITH_DFS
84 output(screen," WITH_DFS\n");
85 #endif
86 #ifdef KRB4_AUTH
87 output(screen," KRB4_AUTH");
88 #endif
89 #ifdef HAVE_KRB5
90 output(screen," HAVE_KRB5");
91 #endif
92 #ifdef HAVE_GSSAPI
93 output(screen," HAVE_GSSAPI");
94 #endif
95 #ifdef HAVE_LDAP
96 output(screen," HAVE_LDAP");
97 #endif
98 #ifdef WITH_AUTOMOUNT
99 output(screen," WITH_AUTOMOUNT\n");
100 #endif
101 #ifdef WITH_SMBMOUNT
102 output(screen," WITH_SMBMOUNT\n");
103 #endif
104 #ifdef WITH_PAM
105 output(screen," WITH_PAM\n");
106 #endif
107 #ifdef WITH_TDB_SAM
108 output(screen," WITH_TDB_SAM\n");
109 #endif
110 #ifdef WITH_SMBPASSWD_SAM
111 output(screen," WITH_SMBPASSWD_SAM\n");
112 #endif
113 #ifdef WITH_NISPLUS_SAM
114 output(screen," WITH_NISPLUS_SAM\n");
115 #endif
116 #ifdef WITH_NISPLUS_HOME
117 output(screen," WITH_NISPLUS_HOME\n");
118 #endif
119 #ifdef WITH_SYSLOG
120 output(screen," WITH_SYSLOG\n");
121 #endif
122 #ifdef WITH_QUOTAS
123 output(screen," WITH_QUOTAS\n");
124 #endif
125 #ifdef WITH_VFS
126 output(screen," WITH_VFS\n");
127 #endif
128 #ifdef USE_SPINLOCKS
129 output(screen," USE_SPINLOCKS\n");
130 #endif
131 #ifdef SPARC_SPINLOCKS
132 output(screen," SPARC_SPINLOCKS\n");
133 #endif
134 #ifdef INTEL_SPINLOCKS
135 output(screen," INTEL_SPINLOCKS\n");
136 #endif
137 #ifdef MIPS_SPINLOCKS
138 output(screen," MIPS_SPINLOCKS\n");
139 #endif
140 #ifdef POWERPC_SPINLOCKS
141 output(screen," POWERPC_SPINLOCKS\n");
142 #endif
143 #ifdef HAVE_UNIXWARE_ACLS
144 output(screen," HAVE_UNIXWARE_ACLS\n");
145 #endif
146 #ifdef HAVE_SOLARIS_ACLS
147 output(screen," HAVE_SOLARIS_ACLS\n");
148 #endif
149 #ifdef HAVE_IRIX_ACLS
150 output(screen," HAVE_IRIX_ACLS\n");
151 #endif
152 #ifdef HAVE_AIX_ACLS
153 output(screen," HAVE_AIX_ACLS\n");
154 #endif
155 #ifdef HAVE_POSIX_ACLS
156 output(screen," HAVE_POSIX_ACLS\n");
157 #endif
158 #ifdef HAVE_TRU64_ACLS
159 output(screen," HAVE_TRU64_ACLS\n");
160 #endif
162 #ifdef HAVE_ACL_GET_PERM_NP
163 output(screen," HAVE_ACL_GET_PERM_NP\n");
164 #endif
165 #ifdef HAVE_NO_ACLS
166 output(screen," HAVE_NO_ACLS\n");
167 #endif
168 #ifdef HAVE_LIBREADLINE
169 output(screen," HAVE_LIBREADLINE\n");
170 #endif
171 #ifdef WITH_LIBICONV
172 output(screen," WITH_LIBICONV: %s\n",WITH_LIBICONV);
173 #endif
176 /* Output various paths to files and directories */
177 output(screen,"\nPaths:\n");
178 output(screen," CONFIGFILE: %s\n", dyn_CONFIGFILE);
179 #ifdef PRIVATE_DIR
180 output(screen," PRIVATE_DIR: %s\n",PRIVATE_DIR);
181 #endif
182 #ifdef LMHOSTSFILE
183 output(screen," LMHOSTSFILE: %s\n",LMHOSTSFILE);
184 #endif
185 output(screen," SBINDIR: %s\n", dyn_SBINDIR);
186 output(screen," BINDIR: %s\n", dyn_BINDIR);
187 output(screen," LOCKDIR: %s\n",dyn_LOCKDIR);
188 output(screen," LOGFILEBASE: %s\n", dyn_LOGFILEBASE);
190 /*Output various other options (most map to defines in the configure script*/
191 output(screen,"\nOther Build Options:\n");
192 #ifdef HAVE_VOLATILE
193 output(screen," HAVE_VOLATILE\n");
194 #endif
195 #ifdef HAVE_SHADOW_H
196 output(screen," HAVE_SHADOW_H\n");
197 #endif
198 #ifdef HAVE_CRYPT
199 output(screen," HAVE_CRYPT\n");
200 #endif
201 #ifdef USE_BOTH_CRYPT_CALLS
202 output(screen," USE_BOTH_CRYPT_CALLS\n");
203 #endif
204 #ifdef HAVE_TRUNCATED_SALT
205 output(screen," HAVE_TRUNCATED_SALT\n");
206 #endif
207 #ifdef HAVE_CUPS
208 output(screen," HAVE_CUPS\n");
209 #endif
210 #ifdef HAVE_CUPS_CUPS_H
211 output(screen," HAVE_CUPS_CUPS_H\n");
212 #endif
213 #ifdef HAVE_CUPS_LANGUAGE_H
214 output(screen," HAVE_CUPS_LANGUAGE_H\n");
215 #endif
216 #ifdef HAVE_DLOPEN
217 output(screen," HAVE_DLOPEN\n");
218 #endif
219 #ifdef HAVE_DLCLOSE
220 output(screen," HAVE_DLCLOSE\n");
221 #endif
222 #ifdef HAVE_DLSYM
223 output(screen," HAVE_DLSYM\n");
224 #endif
225 #ifdef HAVE_DLERROR
226 output(screen," HAVE_DLERROR\n");
227 #endif
228 #ifdef HAVE_UNIXSOCKET
229 output(screen," HAVE_UNIXSOCKET\n");
230 #endif
231 #ifdef HAVE_SOCKLEN_T_TYPE
232 output(screen," HAVE_SOCKLEN_T_TYPE\n");
233 #endif
234 #ifdef HAVE_SIG_ATOMIC_T_TYPE
235 output(screen," HAVE_SIG_ATOMIC_T_TYPE\n");
236 #endif
237 #ifdef HAVE_SETRESUID
238 output(screen," HAVE_SETRESUID\n");
239 #endif
240 #ifdef HAVE_SETRESGID
241 output(screen," HAVE_SETRESGID\n");
242 #endif
243 #ifdef HAVE_CONNECT
244 output(screen," HAVE_CONNECT\n");
245 #endif
246 #ifdef HAVE_YP_GET_DEFAULT_DOMAIN
247 output(screen," HAVE_YP_GET_DEFAULT_DOMAIN\n");
248 #endif
249 #ifdef HAVE_STAT64
250 output(screen," HAVE_STAT64\n");
251 #endif
252 #ifdef HAVE_LSTAT64
253 output(screen," HAVE_LSTAT64\n");
254 #endif
255 #ifdef HAVE_FSTAT64
256 output(screen," HAVE_FSTAT64\n");
257 #endif
258 #ifdef HAVE_STRCASECMP
259 output(screen," HAVE_STRCASECMP\n");
260 #endif
261 #ifdef HAVE_MEMSET
262 output(screen," HAVE_MEMSET\n");
263 #endif
264 #ifdef HAVE_LONGLONG
265 output(screen," HAVE_LONGLONG\n");
266 #endif
267 #ifdef COMPILER_SUPPORTS_LL
268 output(screen," COMPILER_SUPPORTS_LL\n");
269 #endif
270 #ifdef SIZEOF_OFF_T
271 output(screen," SIZEOF_OFF_T: %d\n",SIZEOF_OFF_T);
272 #endif
273 #ifdef HAVE_OFF64_T
274 output(screen," HAVE_OFF64_T\n");
275 #endif
276 #ifdef SIZEOF_INO_T
277 output(screen," SIZEOF_INO_T: %d\n",SIZEOF_INO_T);
278 #endif
279 #ifdef HAVE_INO64_T
280 output(screen," HAVE_INO64_T\n");
281 #endif
282 #ifdef HAVE_STRUCT_DIRENT64
283 output(screen," HAVE_STRUCT_DIRENT64\n");
284 #endif
285 #ifdef HAVE_UNSIGNED_CHAR
286 output(screen," HAVE_UNSIGNED_CHAR\n");
287 #endif
288 #ifdef HAVE_SOCK_SIN_LEN
289 output(screen," HAVE_SOCK_SIN_LEN\n");
290 #endif
291 #ifdef SEEKDIR_RETURNS_VOID
292 output(screen," SEEKDIR_RETURNS_VOID\n");
293 #endif
294 #ifdef HAVE_FUNCTION_MACRO
295 output(screen," HAVE_FUNCTION_MACRO\n");
296 #endif
297 #ifdef HAVE_GETTIMEOFDAY
298 output(screen," HAVE_GETTIMEOFDAY\n");
299 #endif
300 #ifdef HAVE_C99_VSNPRINTF
301 output(screen," HAVE_C99_VSNPRINTF\n");
302 #endif
303 #ifdef HAVE_BROKEN_READDIR
304 output(screen," HAVE_BROKEN_READDIR\n");
305 #endif
306 #ifdef HAVE_NATIVE_ICONV
307 output(screen," HAVE_NATIVE_ICONV\n");
308 #endif
309 #ifdef HAVE_KERNEL_OPLOCKS_LINUX
310 output(screen," HAVE_KERNEL_OPLOCKS_LINUX\n");
311 #endif
312 #ifdef HAVE_KERNEL_CHANGE_NOTIFY
313 output(screen," HAVE_KERNEL_CHANGE_NOTIFY\n");
314 #endif
315 #ifdef HAVE_KERNEL_SHARE_MODES
316 output(screen," HAVE_KERNEL_SHARE_MODES\n");
317 #endif
318 #ifdef HAVE_KERNEL_OPLOCKS_IRIX
319 output(screen," HAVE_KERNEL_OPLOCKS_IRIX\n");
320 #endif
321 #ifdef HAVE_IRIX_SPECIFIC_CAPABILITIES
322 output(screen," HAVE_IRIX_SPECIFIC_CAPABILITIES\n");
323 #endif
324 #ifdef HAVE_INT16_FROM_RPC_RPC_H
325 output(screen," HAVE_INT16_FROM_RPC_RPC_H\n");
326 #endif
327 #ifdef HAVE_UINT16_FROM_RPC_RPC_H
328 output(screen," HAVE_UINT16_FROM_RPC_RPC_H\n");
329 #endif
330 #ifdef HAVE_INT32_FROM_RPC_RPC_H
331 output(screen," HAVE_INT16_FROM_RPC_RPC_H\n");
332 #endif
333 #ifdef HAVE_UINT32_FROM_RPC_RPC_H
334 output(screen," HAVE_UINT32_FROM_RPC_RPC_H\n");
335 #endif
336 #ifdef HAVE_RPC_AUTH_ERROR_CONFLICT
337 output(screen," HAVE_RPC_AUTH_ERROR_CONFLICT\n");
338 #endif
339 #ifdef HAVE_FTRUNCATE_EXTEND
340 output(screen," HAVE_FTRUNCATE_EXTEND\n");
341 #endif
342 #ifdef HAVE_WORKING_AF_LOCAL
343 output(screen," HAVE_WORKING_AF_LOCAL\n");
344 #endif
345 #ifdef HAVE_BROKEN_GETGROUPS
346 output(screen," HAVE_BROKEN_GETGROUPS\n");
347 #endif
348 #ifdef REPLACE_GETPASS
349 output(screen," REPLACE_GETPASS\n");
350 #endif
351 #ifdef REPLACE_INET_NTOA
352 output(screen," REPLACE_INET_NTOA\n");
353 #endif
354 #ifdef HAVE_SECURE_MKSTEMP
355 output(screen," HAVE_SECURE_MKSTEMP\n");
356 #endif
357 #ifdef SYSCONF_SC_NGROUPS_MAX
358 output(screen," SYSCONF_SC_NGROUPS_MAX\n");
359 #endif
360 #ifdef HAVE_IFACE_AIX
361 output(screen," HAVE_IFACE_AIX\n");
362 #endif
363 #ifdef HAVE_IFACE_IFCONF
364 output(screen," HAVE_IFACE_IFCONF\n");
365 #endif
366 #ifdef HAVE_IFACE_IFREQ
367 output(screen," HAVE_IFACE_IFREQ\n");
368 #endif
369 #ifdef USE_SETRESUID
370 output(screen," USE_SETRESUID\n");
371 #endif
372 #ifdef USE_SETRESGID
373 output(screen," USE_SETREUID\n");
374 #endif
375 #ifdef USE_SETEUID
376 output(screen," USE_SETEUID\n");
377 #endif
378 #ifdef USE_SETUIDX
379 output(screen," USE_SETUIDX\n");
380 #endif
381 #ifdef HAVE_MMAP
382 output(screen," HAVE_MMAP\n");
383 #endif
384 #ifdef MMAP_BLACKLIST
385 output(screen," MMAP_BLACKLIST\n");
386 #endif
387 #ifdef FTRUNCATE_NEEDS_ROOT
388 output(screen," FTRUNCATE_NEEDS_ROOT\n");
389 #endif
390 #ifdef HAVE_FCNTL_LOCK
391 output(screen," HAVE_FCNTL_LOCK\n");
392 #endif
393 #ifdef HAVE_BROKEN_FCNTL64_LOCKS
394 output(screen," HAVE_BROKEN_FCNTL64_LOCKS\n");
395 #endif
396 #ifdef HAVE_STRUCT_FLOCK64
397 output(screen," HAVE_STRUCT_FLOCK64\n");
398 #endif
399 #ifdef BROKEN_NISPLUS_INCLUDE_FILES
400 output(screen," BROKEN_NISPLUS_INCLUDE_FILES\n");
401 #endif
402 #ifdef HAVE_LIBPAM
403 output(screen," HAVE_LIBPAM\n");
404 #endif
405 #ifdef STAT_STATVFS64
406 output(screen," STAT_STATVFS64\n");
407 #endif
408 #ifdef STAT_STATVFS
409 output(screen," STAT_STATVFS\n");
410 #endif
411 #ifdef STAT_STATFS3_OSF1
412 output(screen," STAT_STATFS3_OSF1\n");
413 #endif
414 #ifdef STAT_STATFS2_BSIZE
415 output(screen," STAT_STATFS2_BSIZE\n");
416 #endif
417 #ifdef STAT_STATFS4
418 output(screen," STAT_STATFS4\n");
419 #endif
420 #ifdef STAT_STATFS2_FSIZE
421 output(screen," STAT_STATFS2_FSIZE\n");
422 #endif
423 #ifdef STAT_STATFS2_FS_DATA
424 output(screen," STAT_STATFS2_FS_DATA\n");
425 #endif
426 #ifdef HAVE_EXPLICIT_LARGEFILE_SUPPORT
427 output(screen," HAVE_EXPLICIT_LARGEFILE_SUPPORT\n");
428 #endif
430 #ifdef WITH_UTMP
431 /* Output UTMP Stuff */
432 output(screen,"\nUTMP Related:\n");
433 output(screen," WITH_UTMP\n");
435 #ifdef HAVE_UTIMBUF
436 output(screen," HAVE_UTIMBUF\n");
437 #endif
438 #ifdef HAVE_UT_UT_NAME
439 output(screen," HAVE_UT_UT_NAME\n");
440 #endif
441 #ifdef HAVE_UT_UT_USER
442 output(screen," HAVE_UT_UT_USER\n");
443 #endif
444 #ifdef HAVE_UT_UT_ID
445 output(screen," HAVE_UT_UT_ID\n");
446 #endif
447 #ifdef HAVE_UT_UT_HOST
448 output(screen," HAVE_UT_UT_HOST\n");
449 #endif
450 #ifdef HAVE_UT_UT_TIME
451 output(screen," HAVE_UT_UT_TIME\n");
452 #endif
453 #ifdef HAVE_UT_UT_TV
454 output(screen," HAVE_UT_UT_TV\n");
455 #endif
456 #ifdef HAVE_UT_UT_TYPE
457 output(screen," HAVE_UT_UT_TYPE\n");
458 #endif
459 #ifdef HAVE_UT_UT_PID
460 output(screen," HAVE_UT_UT_PID\n");
461 #endif
462 #ifdef HAVE_UT_UT_EXIT
463 output(screen," HAVE_UT_UT_EXIT\n");
464 #endif
465 #ifdef HAVE_UT_UT_ADDR
466 output(screen," HAVE_UT_UT_ADDR\n");
467 #endif
468 #ifdef PUTUTLINE_RETURNS_UTMP
469 output(screen," PUTUTLINE_RETURNS_UTMP\n");
470 #endif
471 #ifdef HAVE_UX_UT_SYSLEN
472 output(screen," HAVE_UX_UT_SYSLEN\n");
473 #endif
474 #endif /* WITH_UTMP */
476 /* Output Build OS */
477 output(screen,"\nBuilt for host os:\n");
478 #ifdef LINUX
479 output(screen," LINUX\n");
480 #endif
481 #ifdef SUNOS5
482 output(screen," SUNOS5\n");
483 #endif
484 #ifdef SUNOS4
485 output(screen," SUNOS4\n");
486 #endif
487 /* BSD Isn't Defined in the configure script, but there is something about it in include/config.h.in (and I guess acconfig.h) */
488 #ifdef BSD
489 output(screen," BSD\n");
490 #endif
491 #ifdef IRIX
492 output(screen," IRIX\n");
493 #endif
494 #ifdef IRIX6
495 output(screen," IRIX6\n");
496 #endif
497 #ifdef AIX
498 output(screen," AIX\n");
499 #endif
500 #ifdef HPUX
501 output(screen," HPUX\n");
502 #endif
503 #ifdef QNX
504 output(screen," QNX\n");
505 #endif
506 #ifdef OSF1
507 output(screen," OSF1\n");
508 #endif
509 #ifdef SCO
510 output(screen," SCO\n");
511 #endif
512 #ifdef UNIXWARE
513 output(screen," UNIXWARE\n");
514 #endif
515 #ifdef NEXT2
516 output(screen," NEXT2\n");
517 #endif
518 #ifdef RELIANTUNIX
519 output(screen," RELIANTUNIX\n");
520 #endif
522 /* Output the sizes of the various types */
523 output(screen,"\nType sizes:\n");
524 output(screen," sizeof(char): %d\n",sizeof(char));
525 output(screen," sizeof(int): %d\n",sizeof(int));
526 output(screen," sizeof(long): %d\n",sizeof(long));
527 output(screen," sizeof(uint8_t): %d\n",sizeof(uint8_t));
528 output(screen," sizeof(uint16_t): %d\n",sizeof(uint16_t));
529 output(screen," sizeof(uint32_t): %d\n",sizeof(uint32_t));
530 output(screen," sizeof(short): %d\n",sizeof(short));
531 output(screen," sizeof(void*): %d\n",sizeof(void*));