Tested on r10235 via agartest.
Simply launch agartest and press any key in the text entry box.
A full console log is attached including verbose debug output from
libagar. This was tested on Ubuntu 18.04, here are my compiler versions:
cad@enki:~ > gcc --version
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
cad@enki:~ > clang --version
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
cad@enki:~ > cc --version
cc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
My libagar config.log is also attached.
Here is the backtrace:
Thread 1 "agartest" received signal SIGSEGV, Segmentation fault.
0x00007ffff72f6bda in AG_TextSizeNat (s=0x7fffffffd330,
w=0x7fffffffd31c, h=0x0)
at text.c:808
808 switch (agTextState->font->spec.type) {
(gdb) bt
#0 0x00007ffff72f6bda in AG_TextSizeNat (s=0x7fffffffd330,
w=0x7fffffffd31c, h=0x0)
at text.c:808
#1 0x00007ffff72fc2c0 in Insert (ed=0xbb1b50, buf=0xbb1ea0,
keysym=AG_KEY_A,
keymod=4096, ch=97) at keymap.c:123
#2 0x00007ffff73015d8 in ProcessKey (ed=0xbb1b50, ks=AG_KEY_A,
kmod=4096, ch=97)
at editable.c:557
#3 0x00007ffff730057c in KeyDown (event=0x7fffffffd820) at editable.c:1188
#4 0x00007ffff70690e2 in AG_PostEvent (sp=0x0, rp=0xbb1b50,
evname=0x7ffff738ff93 "key-down", fmt=0x7ffff73bdf94
"%i(key),%i(mod),%lu(ch)")
at event.c:412
#5 0x00007ffff7380afa in AG_ProcessKey (kbd=0xa28360, win=0xb96d90,
action=AG_KEY_PRESSED, ks=AG_KEY_A, ch=97) at keyboard.c:454
#6 0x00007ffff72d8088 in GLX_ProcessEvent (drvCaller=0x0,
dev=0x7fffffffdc58)
at drv_glx.c:793
#7 0x00007ffff72db1ed in GLX_EventSink (es=0x642f60, event=0x642f80) at
drv_glx.c:2063
#8 0x00007ffff706f609 in AG_EventSinkTIMERFD () at event.c:1367
#9 0x00007ffff706fe3b in AG_EventLoop () at event.c:1624
#10 0x0000000000409b53 in main ()
A bit of poking (in a separate session) turned up this:
(gdb) p agTextState
$1 = (AG_TextState *) 0x7ffff75dec18 <agTextStateStack+120>
(gdb) p agTextState->font
$2 = (AG_Font *) 0x0
Looks like maybe the font isn't getting initialized for some reason?
~ Charles
Script started on 2019-06-17 20:42:08-0400
[1m[31mcad@enki:~/s/l/tests > [0m/LDLD_LIBRARY_PATH=/home/cad/.local/agar1.6/lib gdb ./agartest
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./agartest...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/cad/src/libagar/tests/agartest
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Registered class: AG_Config: AG_Config
Registered class: AG_Db: AG_Db
Registered class: AG_Driver: AG_Driver
Registered class: AG_DriverSw: AG_Driver:AG_DriverSw
Registered class: AG_DriverMw: AG_Driver:AG_DriverMw
Registered class: AG_InputDevice: AG_InputDevice
Registered class: AG_Mouse: AG_InputDevice:AG_Mouse
Registered class: AG_Keyboard: AG_InputDevice:AG_Keyboard
Registered class: AG_DriverGLX: AG_Driver:AG_DriverMw:AG_DriverGLX
Registered class: AG_DriverSDLGL: AG_Driver:AG_DriverSw:AG_DriverSDLGL
Registered class: AG_DriverSDLFB: AG_Driver:AG_DriverSw:AG_DriverSDLFB
config: Bind "ag_kbd_delay" -> *(int *)0x7ffff75d8560 (= 250)
config: Bind "ag_kbd_repeat" -> *(int *)0x7ffff75d8564 (= 35)
config: Bind "ag_mouse_dblclick_delay" -> *(int *)0x7ffff75d8568 (= 250)
config: Bind "ag_mouse_spin_delay" -> *(int *)0x7ffff75d856c (= 250)
config: Bind "ag_mouse_spin_interval" -> *(int *)0x7ffff75d8570 (= 50)
config: Bind "ag_text_composition" -> *(int *)0x7ffff75d857c (= 1)
config: Bind "ag_text_bidi" -> *(int *)0x7ffff75deb44 (= 0)
config: Bind "ag_text_cache" -> *(int *)0x7ffff75d8580 (= 1)
config: Bind "ag_text_tab_width" -> *(int *)0x7ffff75d8584 (= 40)
config: Bind "ag_text_blink_rate" -> *(int *)0x7ffff75d8588 (= 500)
config: Bind "ag_text_symbols" -> *(int *)0x7ffff75d858c (= 1)
config: Bind "ag_page_increment" -> *(int *)0x7ffff75d8590 (= 4)
config: Bind "ag_screenshot_quality" -> *(int *)0x7ffff75d8594 (= 100)
agInputDevices: Attached child: AG_Mouse #0
AG_Mouse #0: New parent: agInputDevices
agInputDevices: Attached child: AG_Keyboard #0
AG_Keyboard #0: New parent: agInputDevices
agDrivers: Attached child: glx1
glx1: New parent: agDrivers
Registered class: AG_Widget: AG_Widget
Registered class: AG_Window: AG_Widget:AG_Window
Registered class: AG_Font: AG_Font
Registered class: AG_Box: AG_Widget:AG_Box
Registered class: AG_Button: AG_Widget:AG_Button
Registered class: AG_Checkbox: AG_Widget:AG_Checkbox
Registered class: AG_Combo: AG_Widget:AG_Combo
Registered class: AG_Console: AG_Widget:AG_Console
Registered class: AG_Editable: AG_Widget:AG_Editable
Registered class: AG_DirDlg: AG_Widget:AG_DirDlg
Registered class: AG_FontSelector: AG_Widget:AG_FontSelector
Registered class: AG_FileDlg: AG_Widget:AG_FileDlg
Registered class: AG_FileSelector: AG_Widget:AG_FileSelector
Registered class: AG_Fixed: AG_Widget:AG_Fixed
Registered class: AG_FixedPlotter: AG_Widget:AG_FixedPlotter
Registered class: AG_Graph: AG_Widget:AG_Graph
Registered class: AG_GLView: AG_Widget:AG_GLView
Registered class: AG_HSVPal: AG_Widget:AG_HSVPal
Registered class: AG_Icon: AG_Widget:AG_Icon
Registered class: AG_Label: AG_Widget:AG_Label
Registered class: AG_Menu: AG_Widget:AG_Menu
Registered class: AG_MenuView: AG_Widget:AG_MenuView
Registered class: AG_MFSpinbutton: AG_Widget:AG_MFSpinbutton
Registered class: AG_MPane: AG_Widget:AG_Box:AG_MPane
Registered class: AG_MSpinbutton: AG_Widget:AG_MSpinbutton
Registered class: AG_Notebook: AG_Widget:AG_Notebook
Registered class: AG_NotebookTab: AG_Widget:AG_Box:AG_NotebookTab
Registered class: AG_Numerical: AG_Widget:AG_Numerical
Registered class: AG_ObjectSelector: AG_Widget:AG_Combo:AG_ObjectSelector
Registered class: AG_Pane: AG_Widget:AG_Pane
Registered class: AG_Pixmap: AG_Widget:AG_Pixmap
Registered class: AG_ProgressBar: AG_Widget:AG_ProgressBar
Registered class: AG_Radio: AG_Widget:AG_Radio
Registered class: AG_Scrollbar: AG_Widget:AG_Scrollbar
Registered class: AG_Scrollview: AG_Widget:AG_Scrollview
Registered class: AG_Separator: AG_Widget:AG_Separator
Registered class: AG_Slider: AG_Widget:AG_Slider
Registered class: AG_Socket: AG_Widget:AG_Socket
Registered class: AG_Spinbutton: AG_Widget:AG_Spinbutton
Registered class: AG_Statusbar: AG_Widget:AG_Box:AG_Statusbar
Registered class: AG_Titlebar: AG_Widget:AG_Box:AG_Titlebar
Registered class: AG_Table: AG_Widget:AG_Table
Registered class: AG_Treetbl: AG_Widget:AG_Treetbl
Registered class: AG_Textbox: AG_Widget:AG_Textbox
Registered class: AG_Tlist: AG_Widget:AG_Tlist
Registered class: AG_Toolbar: AG_Widget:AG_Box:AG_Toolbar
Registered class: AG_UCombo: AG_Widget:AG_UCombo
<0x692120>: Set "font-family" -> "_agFontVera"
<0x692120>: Set "font-size" -> *(char *)0x65b000<NODUP> (= "14.00pts")
<0x692120>: Set "font-weight" -> "normal"
<0x692120>: Set "font-style" -> "normal"
agInputDevices: Attached child: AG_Mouse #1
AG_Mouse #1: New parent: agInputDevices
agInputDevices: Attached child: AG_Keyboard #1
AG_Keyboard #1: New parent: agInputDevices
agDrivers: Attached child: glx2
glx2: New parent: agDrivers
generic: Attach to AG_DriverGLX (glx2)
AG_Box #0: Attach to AG_Pane in <>
<0x697140>: Attached child: AG_Box #0
AG_Box #0: New parent: <0x697140>
AG_Box #1: Attach to AG_Pane in <>
<0x697140>: Attached child: AG_Box #1
AG_Box #1: New parent: <0x697140>
AG_Pane #0: Attach to generic window ("agartest")
generic: Attached child: AG_Pane #0
AG_Pane #0: New parent: generic
AG_Label #0: Attach to AG_Box in generic
AG_Box #0: Attached child: AG_Label #0
AG_Label #0: New parent: AG_Box #0
AG_Scrollbar #0: Attach to AG_Tlist in <>
<0x69b350>: Attached child: AG_Scrollbar #0
AG_Scrollbar #0: New parent: <0x69b350>
AG_Scrollbar #0: Set "min" -> (int) 0
AG_Scrollbar #0: Bind "max" -> *(int *)0x69b6a0 (= 0)
AG_Scrollbar #0: Bind "visible" -> *(int *)0x69b6a4 (= 0)
AG_Scrollbar #0: Bind "value" -> *(int *)0x69b670 (= 0)
<0x69b350>: Bind "selected" -> *(void *)0x69b640 (= (nil))
AG_Tlist #0: Attach to AG_Box in generic
AG_Box #0: Attached child: AG_Tlist #0
AG_Tlist #0: New parent: AG_Box #0
PNG image (64x41; 32-bpp RGB at 0x0 (->0x6a9290) via libpng (1.6.34)
PNG image (64x61; 32-bpp RGB at 0x0 (->0x6a9070) via libpng (1.6.34)
AG_Box #0: Attach to AG_Box in generic
AG_Box #0: Attached child: AG_Box #0
AG_Box #0: New parent: AG_Box #0
<0x6c0880>: Bind "state" -> *(int *)0x6c0b68 (= 0)
AG_Label #0: Attach to AG_Button in <>
<0x6c0880>: Attached child: AG_Label #0
AG_Label #0: New parent: <0x6c0880>
AG_Button #0: Attach to AG_Box in generic
AG_Box #0: Attached child: AG_Button #0
AG_Button #0: New parent: AG_Box #0
<0x6c4580>: Bind "state" -> *(int *)0x6c4868 (= 0)
AG_Label #0: Attach to AG_Button in <>
<0x6c4580>: Attached child: AG_Label #0
AG_Label #0: New parent: <0x6c4580>
AG_Button #1: Attach to AG_Box in generic
AG_Box #0: Attached child: AG_Button #1
AG_Button #1: New parent: AG_Box #0
AG_Scrollbar #0: Attach to AG_Console in <>
<0x6c8280>: Attached child: AG_Scrollbar #0
AG_Scrollbar #0: New parent: <0x6c8280>
AG_Scrollbar #0: Set "min" -> (Uint) 0
AG_Scrollbar #0: Bind "max" -> *(Uint *)0x6c8580 (= 0x0)
AG_Scrollbar #0: Bind "visible" -> *(Uint *)0x6c85b0 (= 0x0)
AG_Scrollbar #0: Bind "value" -> *(Uint *)0x6c858c (= 0x0)
AG_Scrollbar #1: Attach to AG_Console in <>
<0x6c8280>: Attached child: AG_Scrollbar #1
AG_Scrollbar #1: New parent: <0x6c8280>
AG_Scrollbar #1: Set "min" -> (int) 0
AG_Scrollbar #1: Bind "max" -> *(int *)0x6c8588 (= 0)
AG_Scrollbar #1: Bind "visible" -> *(int *)0x6c83a4 (= -1)
AG_Scrollbar #1: Bind "value" -> *(int *)0x6c8584 (= 0)
AG_Console #0: Attach to AG_Box in generic
AG_Box #1: Attached child: AG_Console #0
AG_Console #0: New parent: AG_Box #1
[New Thread 0x7fffec78f700 (LWP 21244)]
Thread 1 "agartest" received signal SIGSEGV, Segmentation fault.
0x00007ffff72f6bda in AG_TextSizeNat (s=0x7fffffffd330, w=0x7fffffffd31c, h=0x0)
at text.c:808
808 switch (agTextState->font->spec.type) {
(gdb) bt
#0 0x00007ffff72f6bda in AG_TextSizeNat (s=0x7fffffffd330, w=0x7fffffffd31c, h=0x0)
at text.c:808
#1 0x00007ffff72fc2c0 in Insert (ed=0xbb1b50, buf=0xbb1ea0, keysym=AG_KEY_A,
keymod=4096, ch=97) at keymap.c:123
#2 0x00007ffff73015d8 in ProcessKey (ed=0xbb1b50, ks=AG_KEY_A, kmod=4096, ch=97)
at editable.c:557
#3 0x00007ffff730057c in KeyDown (event=0x7fffffffd820) at editable.c:1188
#4 0x00007ffff70690e2 in AG_PostEvent (sp=0x0, rp=0xbb1b50,
evname=0x7ffff738ff93 "key-down", fmt=0x7ffff73bdf94 "%i(key),%i(mod),%lu(ch)")
at event.c:412
#5 0x00007ffff7380afa in AG_ProcessKey (kbd=0xa28360, win=0xb96d90,
action=AG_KEY_PRESSED, ks=AG_KEY_A, ch=97) at keyboard.c:454
#6 0x00007ffff72d8088 in GLX_ProcessEvent (drvCaller=0x0, dev=0x7fffffffdc58)
at drv_glx.c:793
#7 0x00007ffff72db1ed in GLX_EventSink (es=0x642f60, event=0x642f80) at drv_glx.c:2063
#8 0x00007ffff706f609 in AG_EventSinkTIMERFD () at event.c:1367
#9 0x00007ffff706fe3b in AG_EventLoop () at event.c:1624
#10 0x0000000000409b53 in main ()
(gdb) quit
A debugging session is active.
Inferior 1 [process 21240] will be killed.
Quit anyway? (y or n) EOF [assumed Y]
[1m[31mcad@enki:~/s/l/tests > [0mexit
exit
Script done on 2019-06-17 20:42:29-0400
# BSDBuild 3.2 <http://bsdbuild.hypertriton.com/>
# ex:syn=sh
env ./configure --enable-debug --enable-debug-core --enable-debug-gui --prefix=/home/cad/.local/agar1.6/
# checking for a C compiler...yes, /usr/bin/clang
# checking whether the C compiler works...yes
# cc: checking for compiler warning options...
# C: HAVE_CC_WARNINGS
cat << EOT >conftest5147.c
int main(int argc, char *argv[]) { return (0); }
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# cc: checking for float and double...
# C: HAVE_FLOAT
cat << EOT >conftest5147.c
#include <stdio.h>
int
main(int argc, char *argv[])
{
float f = 0.1f;
double d = 0.2;
printf("%f", f);
return ((double)f + d) > 0.2 ? 1 : 0;
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# cc: checking for long double...
# C: HAVE_LONG_DOUBLE
cat << EOT >conftest5147.c
#include <stdio.h>
int
main(int argc, char *argv[])
{
long double ld = 0.1;
printf("%Lf", ld);
return (ld + 0.1) > 0.2 ? 1 : 0;
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# cc: checking for long long...
# C: HAVE_LONG_LONG
cat << EOT >conftest5147.c
int
main(int argc, char *argv[])
{
long long ll = -1;
unsigned long long ull = 1;
return (ll != -1 || ull != 1);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# cc: checking for cygwin environment...
# C: HAVE_CYGWIN
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <sys/stat.h>
#include <windows.h>
int
main(int argc, char *argv[]) {
struct stat sb;
DWORD rv;
rv = GetFileAttributes("foo");
stat("foo", &sb);
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -mcygwin -o ./conftest5147 conftest5147.c 2>>config.log
clang: error: unknown argument: '-mcygwin'
# failed 0
# no
# cc: checking for -mwindows option...
# C: HAVE_CC_MWINDOWS
cat << EOT >conftest5147.c
#include <windows.h>
int
main(int argc, char *argv[]) {
return GetFileAttributes("foo") ? 0 : 1;
}
EOT
/usr/bin/clang -Wall -Werror -mwindows -o ./conftest5147 conftest5147.c 2>>config.log
clang: error: argument unused during compilation: '-mwindows' [-Werror,-Wunused-command-line-argument]
# failed 0
# no
# cc: checking for -mconsole option...
# C: HAVE_CC_MCONSOLE
cat << EOT >conftest5147.c
#include <windows.h>
int
main(int argc, char *argv[]) {
return GetFileAttributes("foo") ? 0 : 1;
}
EOT
/usr/bin/clang -Wall -Werror -mconsole -o ./conftest5147 conftest5147.c 2>>config.log
clang: error: argument unused during compilation: '-mconsole' [-Werror,-Wunused-command-line-argument]
# failed 0
# no
# checking for Objective-C compiler...yes, /usr/bin/clang
# checking whether the Objective-C compiler works...yes
# objc: checking for compiler warning options...
# ObjC: HAVE_OBJC_WARNINGS
cat << EOT >conftest5147.m
int main(int argc, char *argv[]) { return (0); }
EOT
/usr/bin/clang -Wall -Werror -Wall -Werror -x objective-c -o ./conftest5147 conftest5147.m 2>>config.log
# yes
# checking for byte order.../usr/bin/clang -o ./conftest conftest.c
# little-endian
# checking for C compiler attributes...
# C: HAVE_ALIGNED_ATTRIBUTE
cat << EOT >conftest5147.c
int main(int argc, char *argv[])
{
struct s1 { int x,y,z; } __attribute__ ((aligned(16)));
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# aligned
# C: HAVE_BOUNDED_ATTRIBUTE
cat << EOT >conftest5147.c
void foostring(char *, int) __attribute__ ((__bounded__(__string__,1,2)));
void foostring(char *a, int c) { }
void foobuffer(void *, int) __attribute__ ((__bounded__(__buffer__,1,2)));
void foobuffer(void *a, int c) { }
int main(void)
{
char buf[32];
foostring(buf, sizeof(buf));
foobuffer(buf, sizeof(buf));
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# bounded
# C: HAVE_CONST_ATTRIBUTE
cat << EOT >conftest5147.c
int foo(int) __attribute__ ((const));
int foo(int x) { return (x*x); }
int main(int argc, char *argv[])
{
int x = foo(1);
return (x);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# const
# C: HAVE_DEPRECATED_ATTRIBUTE
cat << EOT >conftest5147.c
void foo(void) __attribute__ ((deprecated));
void foo(void) { }
int main(int argc, char *argv[])
{
/* foo(); */
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# deprecated
# C: HAVE_FORMAT_ATTRIBUTE
cat << EOT >conftest5147.c
#include <stdarg.h>
void foo1(char *, ...)
__attribute__((__format__ (printf, 1, 2)));
void foo2(char *, ...)
__attribute__((__format__ (__printf__, 1, 2)));
void foo1(char *a, ...) {}
void foo2(char *a, ...) {}
int main(int argc, char *argv[])
{
foo1("foo %s", "bar");
foo2("foo %d", 1);
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# format
# checking for C compiler attributes...
# C: HAVE_MALLOC_ATTRIBUTE
cat << EOT >conftest5147.c
#include <stdio.h>
#include <stdlib.h>
void *myalloc(size_t len) __attribute__ ((__malloc__));
void *myalloc(size_t len) { return (NULL); }
int main(int argc, char *argv[])
{
void *p = myalloc(10);
return (p != NULL);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# malloc
# C: HAVE_NORETURN_ATTRIBUTE
cat << EOT >conftest5147.c
#include <unistd.h>
#include <stdlib.h>
void foo(void) __attribute__ ((noreturn));
void foo(void) { _exit(0); }
int main(int argc, char *argv[])
{
foo();
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# noreturn
# C: HAVE_PACKED_ATTRIBUTE
cat << EOT >conftest5147.c
int main(int argc, char *argv[])
{
struct s1 { char c; int x,y,z; } __attribute__ ((packed));
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# packed
# C: HAVE_PURE_ATTRIBUTE
cat << EOT >conftest5147.c
volatile int glo = 1234;
int foo(int) __attribute__ ((pure));
int foo(int x) { return (x*x + glo); }
int main(int argc, char *argv[])
{
int x = foo(1);
glo = 2345;
x = foo(2);
return (x);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# pure
# C: HAVE_UNUSED_VARIABLE_ATTRIBUTE
cat << EOT >conftest5147.c
int main(int argc, char *argv[])
{
int __attribute__ ((unused)) variable;
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# unused
# checking for C compiler attributes...
# C: HAVE_WARN_UNUSED_RESULT_ATTRIBUTE
cat << EOT >conftest5147.c
int foo(void) __attribute__ ((warn_unused_result));
int foo(void) { return (1); }
int main(int argc, char *argv[])
{
int rv = foo();
return (rv);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# warn_unused_result
# checking for <sys/types.h>...
# C: _MK_HAVE_SYS_TYPES_H
cat << EOT >conftest5147.c
#include <sys/types.h>
int main(int argc, char *argv[]) {
int8_t s8 = 2;
u_int8_t u8 = 2;
int32_t s32 = 1234;
u_int32_t u32 = 5678;
return (s8+u8 == 4 && s32+u32 > 6000 ? 0 : 1);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for <stdint.h>...
# C: _MK_HAVE_STDINT_H
cat << EOT >conftest5147.c
#include <stdint.h>
int main(int argc, char *argv[]) {
int8_t s8 = 2;
uint8_t u8 = 2;
int32_t s32 = 1234;
uint32_t u32 = 5678;
return (s8+u8 == 4 && s32+u32 > 6000 ? 0 : 1);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for int64_t type...
# C: HAVE_INT64_T
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
int64_t i64 = 0;
u_int64_t u64 = 0;
printf("%lld %llu", (long long)i64, (unsigned long long)u64);
return (i64 != 0 || u64 != 0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for __int64 type...
# C: HAVE___INT64
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
__int64 i64 = 0;
printf("%lld", (long long)i64);
return (i64 != 0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
conftest5147.c:4:2: error: unknown type name '__int64'; did you mean '__int64_t'?
__int64 i64 = 0;
^~~~~~~
__int64_t
/usr/include/x86_64-linux-gnu/bits/types.h:43:25: note: '__int64_t' declared here
typedef signed long int __int64_t;
^
1 error generated.
# failed 0
# no
# checking for <sys/stat.h>...
# C: _MK_HAVE_SYS_STAT_H
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <sys/stat.h>
int main(int argc, char *argv[]) {
struct stat sb;
uid_t uid;
if (stat("/tmp/foo", &sb) != 0) { return (1); }
return ((uid = sb.st_uid) == (uid_t)0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for <stdlib.h>...
# C: _MK_HAVE_STDLIB_H
cat << EOT >conftest5147.c
#include <stdlib.h>
int main(int argc, char *argv[]) {
void *foo = malloc(1);
free(foo);
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for <unistd.h>...
# C: _MK_HAVE_UNISTD_H
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
char buf;
int rv, fdout=1;
if ((rv = write(fdout, (void *)&buf, 1)) < 1) { return (1); }
if ((rv = read(0, (void *)&buf, 1)) < 1) { return (1); }
if (unlink("/tmp/foo") != 0) { return (1); }
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for compatible <limits.h>...
# C: _MK_HAVE_LIMITS_H
cat << EOT >conftest5147.c
#include <limits.h>
int main(int argc, char *argv[]) {
int i = INT_MIN;
unsigned u = 0;
long l = LONG_MIN;
unsigned long ul = 0;
i = INT_MAX;
u = UINT_MAX;
l = LONG_MAX;
ul = ULONG_MAX;
return (i != INT_MAX || u != UINT_MAX || l != LONG_MAX || ul != LONG_MAX);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for <float.h>...
# C: _MK_HAVE_FLOAT_H
cat << EOT >conftest5147.c
#include <float.h>
int main(int argc, char *argv[]) {
float flt = 0.0f;
double dbl = 0.0;
flt += FLT_EPSILON;
dbl += DBL_EPSILON;
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for the C math library...
# C: HAVE_MATH
cat << EOT >conftest5147.c
#include <math.h>
int
main(int argc, char *argv[])
{
double d = 1.0;
d = fabs(d);
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c -lm 2>>config.log
# yes
# checking for the C math library (C99)...
# C: HAVE_MATH_C99
cat << EOT >conftest5147.c
#include <math.h>
int
main(int argc, char *argv[])
{
float f = 1.0;
double d = 1.0;
d = fabs(d);
f = sqrtf(fabsf(f));
return (f > d) ? 0 : 1;
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c -lm 2>>config.log
# yes
# checking for a fdclose() function...
# C: HAVE_FDCLOSE
cat << EOT >conftest5147.c
#include <stdio.h>
int
main(int argc, char *argv[])
{
FILE *f = fopen("/dev/null","r");
int fdp;
return fdclose(f, &fdp);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
conftest5147.c:7:9: error: implicit declaration of function 'fdclose' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
return fdclose(f, &fdp);
^
conftest5147.c:7:9: note: did you mean 'fclose'?
/usr/include/stdio.h:199:12: note: 'fclose' declared here
extern int fclose (FILE *__stream);
^
1 error generated.
# failed 0
# no
# checking for getpwuid()...
# C: HAVE_GETPWUID
cat << EOT >conftest5147.c
#include <string.h>
#include <sys/types.h>
#include <pwd.h>
int
main(int argc, char *argv[])
{
struct passwd *pwd;
uid_t uid = 0;
pwd = getpwuid(uid);
return (pwd != NULL && pwd->pw_dir != NULL);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for the getpwnam_r() interface...
# C: HAVE_GETPWNAM_R
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
int
main(int argc, char *argv[])
{
struct passwd pw, *res;
char *buf;
size_t bufSize;
int rv;
bufSize = sysconf(_SC_GETPW_R_SIZE_MAX);
if (bufSize == -1) { bufSize = 16384; }
if ((buf = malloc(bufSize)) == NULL) { return (1); }
rv = getpwnam_r("foo", &pw, buf, bufSize, &res);
if (res == NULL) {
return (rv == 0);
}
return (pw.pw_dir != NULL);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for getenv()...
# C: HAVE_GETENV
cat << EOT >conftest5147.c
#include <stdlib.h>
int
main(int argc, char *argv[])
{
(void)getenv("PATH");
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for getuid()...
# C: HAVE_GETUID
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <unistd.h>
int
main(int argc, char *argv[])
{
uid_t uid = getuid();
return (uid != 0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for strsep()...
# C: HAVE_STRSEP
cat << EOT >conftest5147.c
#include <string.h>
int
main(int argc, char *argv[])
{
char foo[32], *pFoo = &foo[0];
char *s;
foo[0] = '\0';
s = strsep(&pFoo, " ");
return (s != NULL);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for asprintf()...
# C: HAVE_ASPRINTF
cat << EOT >conftest5147.c
#include <stdio.h>
int
main(int argc, char *argv[])
{
char *buf;
if (asprintf(&buf, "foo %s", "bar") == 0) {
return (0);
}
return (1);
}
EOT
/usr/bin/clang -Wall -Werror -D_GNU_SOURCE -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for snprintf()...
# C: HAVE_SNPRINTF
cat << EOT >conftest5147.c
#include <stdio.h>
int
main(int argc, char *argv[])
{
char buf[16];
(void)snprintf(buf, sizeof(buf), "foo");
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for vsnprintf()...
# C: HAVE_VSNPRINTF
cat << EOT >conftest5147.c
#include <stdio.h>
#include <stdarg.h>
static void
testfmt(const char *fmt, ...)
{
char buf[16];
va_list ap;
va_start(ap, fmt);
(void)vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
}
int
main(int argc, char *argv[])
{
testfmt("foo", 1, 2, 3);
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for vasprintf()...
# C: HAVE_VASPRINTF
cat << EOT >conftest5147.c
#include <stdio.h>
#include <stdarg.h>
int
testprintf(const char *fmt, ...)
{
va_list args;
char *buf;
va_start(args, fmt);
if (vasprintf(&buf, "%s", args) == -1) {
return (-1);
}
va_end(args);
return (0);
}
int
main(int argc, char *argv[])
{
return (testprintf("foo %s", "bar"));
}
EOT
/usr/bin/clang -Wall -Werror -D_GNU_SOURCE -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for ANSI-style signal() facilities...
# C: _MK_HAVE_SIGNAL
cat << EOT >conftest5147.c
#include <signal.h>
void sighandler(int sig) { }
int
main(int argc, char *argv[])
{
signal(SIGTERM, sighandler);
signal(SIGILL, sighandler);
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for setjmp() and longjmp()...
# C: _MK_HAVE_SETJMP
cat << EOT >conftest5147.c
#include <setjmp.h>
jmp_buf jmpbuf;
int
main(int argc, char *argv[])
{
longjmp(jmpbuf, 1);
setjmp(jmpbuf);
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for strtoll()...
# C: _MK_HAVE_STRTOLL
cat << EOT >conftest5147.c
#include <stdlib.h>
int
main(int argc, char *argv[])
{
long long int lli;
char *ep = NULL;
char *foo = "1234";
lli = strtoll(foo, &ep, 10);
return (lli != 0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for strtold()...
# C: _MK_HAVE_STRTOLD
cat << EOT >conftest5147.c
#ifndef __NetBSD__
# define _XOPEN_SOURCE 600
#endif
#include <stdlib.h>
int
main(int argc, char *argv[])
{
long double ld;
char *ep = NULL;
char *foo = "1234";
ld = strtold(foo, &ep);
return (ld != 1234.0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for dlopen() interface...
# C: HAVE_DLOPEN
cat << EOT >conftest5147.c
#include <string.h>
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif
int
main(int argc, char *argv[])
{
void *handle;
char *error;
handle = dlopen("foo.so", 0);
error = dlerror();
(void)dlsym(handle, "foo");
return (error != NULL);
}
EOT
/usr/bin/clang -Wall -Werror -DHAVE_DLFCN_H -o ./conftest5147 conftest5147.c 2>>config.log
/tmp/conftest5147-a0e53c.o: In function `main':
conftest5147.c:(.text+0x28): undefined reference to `dlopen'
conftest5147.c:(.text+0x31): undefined reference to `dlerror'
conftest5147.c:(.text+0x48): undefined reference to `dlsym'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
# failed 0
# no
# checking for dlopen() in -ldl...
# C: HAVE_DLOPEN
cat << EOT >conftest5147.c
#include <string.h>
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif
int
main(int argc, char *argv[])
{
void *handle;
char *error;
handle = dlopen("foo.so", 0);
error = dlerror();
(void)dlsym(handle, "foo");
return (error != NULL);
}
EOT
/usr/bin/clang -Wall -Werror -DHAVE_DLFCN_H -ldl -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for dyld interface...conftest5147.c:2:10: fatal error: 'mach-o/dyld.h' file not found
#include <mach-o/dyld.h>
^~~~~~~~~~~~~~~
1 error generated.
# failed 0
# C: HAVE_DYLD
cat << EOT >conftest5147.c
#ifdef HAVE_MACH_O_DYLD_H
#include <mach-o/dyld.h>
#endif
int
main(int argc, char *argv[])
{
NSObjectFileImage img;
NSObjectFileImageReturnCode rv;
rv = NSCreateObjectFileImageFromFile("foo", &img);
return (rv == NSObjectFileImageSuccess);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
conftest5147.c:7:2: error: use of undeclared identifier 'NSObjectFileImage'
NSObjectFileImage img;
^
conftest5147.c:8:2: error: use of undeclared identifier 'NSObjectFileImageReturnCode'
NSObjectFileImageReturnCode rv;
^
conftest5147.c:10:2: error: use of undeclared identifier 'rv'
rv = NSCreateObjectFileImageFromFile("foo", &img);
^
conftest5147.c:10:7: error: implicit declaration of function 'NSCreateObjectFileImageFromFile' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
rv = NSCreateObjectFileImageFromFile("foo", &img);
^
conftest5147.c:10:47: error: use of undeclared identifier 'img'
rv = NSCreateObjectFileImageFromFile("foo", &img);
^
conftest5147.c:11:10: error: use of undeclared identifier 'rv'
return (rv == NSObjectFileImageSuccess);
^
conftest5147.c:11:16: error: use of undeclared identifier 'NSObjectFileImageSuccess'
return (rv == NSObjectFileImageSuccess);
^
7 errors generated.
# failed 0
# no
# checking for the shl_load() interface...conftest5147.c:2:10: fatal error: 'dl.h' file not found
#include <dl.h>
^~~~~~
1 error generated.
# failed 0
# C: HAVE_SHL_LOAD
cat << EOT >conftest5147.c
#include <string.h>
#ifdef HAVE_DL_H
#include <dl.h>
#endif
int
main(int argc, char *argv[])
{
void *handle;
void **p;
handle = shl_load("foo.so", BIND_IMMEDIATE, 0);
(void)shl_findsym((shl_t *)&handle, "foo", TYPE_PROCEDURE, p);
(void)shl_findsym((shl_t *)&handle, "foo", TYPE_DATA, p);
shl_unload((shl_t)handle);
return (handle != NULL);
}
EOT
/usr/bin/clang -Wall -Werror -ldld -o ./conftest5147 conftest5147.c 2>>config.log
conftest5147.c:12:11: error: implicit declaration of function 'shl_load' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
handle = shl_load("foo.so", BIND_IMMEDIATE, 0);
^
conftest5147.c:12:30: error: use of undeclared identifier 'BIND_IMMEDIATE'
handle = shl_load("foo.so", BIND_IMMEDIATE, 0);
^
conftest5147.c:13:8: error: implicit declaration of function 'shl_findsym' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
(void)shl_findsym((shl_t *)&handle, "foo", TYPE_PROCEDURE, p);
^
conftest5147.c:13:21: error: use of undeclared identifier 'shl_t'; did you mean 'short'?
(void)shl_findsym((shl_t *)&handle, "foo", TYPE_PROCEDURE, p);
^~~~~
short
conftest5147.c:13:21: error: expected expression
conftest5147.c:13:45: error: use of undeclared identifier 'TYPE_PROCEDURE'
(void)shl_findsym((shl_t *)&handle, "foo", TYPE_PROCEDURE, p);
^
conftest5147.c:14:21: error: use of undeclared identifier 'shl_t'; did you mean 'short'?
(void)shl_findsym((shl_t *)&handle, "foo", TYPE_DATA, p);
^~~~~
short
conftest5147.c:14:21: error: expected expression
conftest5147.c:14:45: error: use of undeclared identifier 'TYPE_DATA'
(void)shl_findsym((shl_t *)&handle, "foo", TYPE_DATA, p);
^
conftest5147.c:15:2: error: implicit declaration of function 'shl_unload' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
shl_unload((shl_t)handle);
^
conftest5147.c:15:2: note: did you mean 'shl_load'?
conftest5147.c:12:11: note: 'shl_load' declared here
handle = shl_load("foo.so", BIND_IMMEDIATE, 0);
^
conftest5147.c:15:14: error: use of undeclared identifier 'shl_t'; did you mean 'short'?
shl_unload((shl_t)handle);
^~~~~
short
conftest5147.c:15:20: error: expected ')'
shl_unload((shl_t)handle);
^
conftest5147.c:15:12: note: to match this '('
shl_unload((shl_t)handle);
^
12 errors generated.
# failed 0
# no
# checking for gettimeofday()...
# C: HAVE_GETTIMEOFDAY
cat << EOT >conftest5147.c
#include <sys/time.h>
#include <stdio.h>
int
main(int argc, char *argv[])
{
struct timeval tv;
int rv = gettimeofday(&tv, NULL);
return (rv);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for the select() interface...
# C: HAVE_SELECT
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <sys/time.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
int
main(int argc, char *argv[])
{
struct timeval tv;
int rv;
tv.tv_sec = 1;
tv.tv_usec = 1;
rv = select(0, NULL, NULL, NULL, &tv);
return (rv == -1 && errno != EINTR);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for glob()...
# C: HAVE_GLOB
cat << EOT >conftest5147.c
#include <string.h>
#include <glob.h>
#include <stdio.h>
int
main(int argc, char *argv[])
{
glob_t gl;
int rv, i;
char *s = NULL;
rv = glob("~/foo", GLOB_TILDE, NULL, &gl);
for (i = 0; i < gl.gl_pathc; i++) { s = gl.gl_pathv[i]; }
return (rv != 0 && s != NULL);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for the getopt() function...
# C: HAVE_GETOPT
cat << EOT >conftest5147.c
#include <string.h>
#include <getopt.h>
int
main(int argc, char *argv[])
{
int c, x = 0;
while ((c = getopt(argc, argv, "foo")) != -1) {
extern char *optarg;
extern int optind, opterr, optopt;
if (optarg != NULL) { x = 1; }
if (optind > 0) { x = 2; }
if (opterr > 0) { x = 3; }
if (optopt > 0) { x = 4; }
}
return (x != 0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for the execvp() function...
# C: HAVE_EXECVP
cat << EOT >conftest5147.c
#include <unistd.h>
int
main(int argc, char *argv[])
{
char *args[3] = { "foo", NULL, NULL };
int rv;
rv = execvp(args[0], args);
return (rv);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for clock_gettime() interface (w/o -lrt)...
# C: HAVE_CLOCK_GETTIME
cat << EOT >conftest5147.c
#include <time.h>
int
main(int argc, char *argv[])
{
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for winmm time interface...
# C: HAVE_CLOCK_WIN32
cat << EOT >conftest5147.c
#ifdef _XBOX
#include <xtl.h>
#else
#include <windows.h>
#include <mmsystem.h>
#endif
int
main(int argc, char *argv[])
{
DWORD t0;
#ifndef _XBOX
timeBeginPeriod(1);
#endif
t0 = timeGetTime();
Sleep(1);
return (t0 != 0) ? 0 : 1;
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c -lwinmm 2>>config.log
conftest5147.c:4:10: fatal error: 'windows.h' file not found
#include <windows.h>
^~~~~~~~~~~
1 error generated.
# failed 0
# no
# checking for nanosleep()...
# C: HAVE_NANOSLEEP
cat << EOT >conftest5147.c
#include <time.h>
int
main(int argc, char *argv[])
{
struct timespec rqtp, rmtp;
int rv;
rqtp.tv_sec = 1;
rqtp.tv_nsec = 1000000;
rv = nanosleep(&rqtp, &rmtp);
return (rv == -1);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for the kqueue() mechanism...
# C: HAVE_KQUEUE
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
#include <fcntl.h>
#include <unistd.h>
int
main(int argc, char *argv[])
{
struct kevent kev, chg;
int kq, fd = -1, nev;
if ((kq = kqueue()) == -1) { return (1); }
#if defined(__NetBSD__)
EV_SET(&kev, (uintptr_t)fd, EVFILT_READ, EV_ADD|EV_ENABLE|EV_ONESHOT, 0, 0, (intptr_t)NULL);
EV_SET(&kev, (uintptr_t)1, EVFILT_TIMER, EV_ADD|EV_ENABLE, 0, 0, (intptr_t)NULL);
#else
EV_SET(&kev, fd, EVFILT_READ, EV_ADD|EV_ENABLE|EV_ONESHOT, 0, 0, NULL);
EV_SET(&kev, 1, EVFILT_TIMER, EV_ADD|EV_ENABLE, 0, 0, NULL);
#endif
nev = kevent(kq, &kev, 1, &chg, 1, NULL);
return (chg.flags & EV_ERROR);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
conftest5147.c:2:10: fatal error: 'sys/event.h' file not found
#include <sys/event.h>
^~~~~~~~~~~~~
1 error generated.
# failed 0
# no
# checking for the Linux timerfd interface...
# C: HAVE_TIMERFD
cat << EOT >conftest5147.c
#include <sys/timerfd.h>
int
main(int argc, char *argv[])
{
struct itimerspec its;
int fd;
if ((fd = timerfd_create(CLOCK_MONOTONIC, TFD_TIMER_ABSTIME)) != -1) {
its.it_interval.tv_sec = 0;
its.it_interval.tv_nsec = 0L;
its.it_value.tv_sec = 0;
its.it_value.tv_nsec = 0L;
return (timerfd_settime(fd, 0, &its, NULL) == -1);
}
return (1);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for Windows CSIDL...
# C: HAVE_CSIDL
cat << EOT >conftest5147.c
#include <shlobj.h>
int
main(int argc, char *argv[])
{
WCHAR path[MAX_PATH];
if (SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, path))) {
return (0);
} else {
return (1);
}
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
conftest5147.c:1:10: fatal error: 'shlobj.h' file not found
#include <shlobj.h>
^~~~~~~~~~
1 error generated.
# failed 0
# no
# checking for the Xbox XDK...
# C: HAVE_XBOX
cat << EOT >conftest5147.c
#include <xtl.h>
#ifndef _XBOX
# error undefined
#endif
int
main(int argc, char *argv[])
{
return (0);
}
EOT
/usr/bin/clang -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
conftest5147.c:1:10: fatal error: 'xtl.h' file not found
#include <xtl.h>
^~~~~~~
1 error generated.
# failed 0
# no
# checking for SDL 1.2...# yes (1.2.15)
# checking whether SDL works...
# C: HAVE_SDL
cat << EOT >conftest5147.c
#ifdef _USE_SDL_FRAMEWORK
# include <SDL/SDL.h>
# ifdef main
# undef main
# endif
#else
# include <SDL.h>
#endif
int main(int argc, char *argv[]) {
SDL_Surface *su;
if (SDL_Init(SDL_INIT_TIMER|SDL_INIT_NOPARACHUTE) != 0) {
return (1);
}
su = SDL_CreateRGBSurface(0, 16, 16, 32, 0, 0, 0, 0);
SDL_FreeSurface(su);
SDL_Quit();
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -o ./conftest5147 conftest5147.c -L/usr/lib/x86_64-linux-gnu -lSDL 2>>config.log
# yes
# checking for OpenGL...# yes
# checking whether OpenGL works...
# C: HAVE_OPENGL
cat << EOT >conftest5147.c
#ifdef _USE_OPENGL_FRAMEWORK
# include <OpenGL/gl.h>
#else
# include <GL/gl.h>
#endif
int main(int argc, char *argv[]) {
glFlush();
glLoadIdentity();
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c -L/usr/local/lib -lGL 2>>config.log
# yes
# checking for the X window system...
# C: HAVE_X11
cat << EOT >conftest5147.c
#include <X11/Xlib.h>
int main(int argc, char *argv[])
{
Display *disp;
disp = XOpenDisplay(NULL);
XCloseDisplay(disp);
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c -lX11 2>>config.log
# yes
# checking for the XKB extension...
# C: HAVE_XKB
cat << EOT >conftest5147.c
#include <X11/Xlib.h>
#include <X11/XKBlib.h>
int main(int argc, char *argv[])
{
Display *disp;
KeyCode kc = 0;
KeySym ks;
disp = XOpenDisplay(NULL);
ks = XkbKeycodeToKeysym(disp, kc, 0, 0);
XCloseDisplay(disp);
return (ks != NoSymbol);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c -lX11 -lX11 2>>config.log
# yes
# checking for the Xinerama extension...
# C: HAVE_XINERAMA
cat << EOT >conftest5147.c
#include <X11/Xlib.h>
#include <X11/extensions/Xinerama.h>
int main(int argc, char *argv[])
{
Display *disp;
int event_base = 0, error_base = 0;
int rv = 1;
disp = XOpenDisplay(NULL);
if (XineramaQueryExtension(disp, &event_base, &error_base)) {
rv = 0;
}
XCloseDisplay(disp);
return (rv);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c -lX11 -lXinerama 2>>config.log
# yes
# checking for the Cocoa framework...
# ObjC: HAVE_COCOA
cat << EOT >conftest5147.m
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[]) { return (0); }
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -force_cpusubtype_ALL -fpascal-strings -x objective-c -o ./conftest5147 conftest5147.m -lobjc -Wl,-framework,Cocoa -Wl,-framework,OpenGL -Wl,-framework,IOKit 2>>config.log
conftest5147.m:1:9: fatal error: 'Cocoa/Cocoa.h' file not found
#import <Cocoa/Cocoa.h>
^~~~~~~~~~~~~~~
1 error generated.
# failed 0
# no
# not enabling the Cocoa framework
# checking for the GLX interface...
# C: HAVE_GLX
cat << EOT >conftest5147.c
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <OpenGL/glx.h>
#else
#include <GL/gl.h>
#include <GL/glx.h>
#endif
int main(int argc, char *argv[]) {
Display *d;
XVisualInfo *xvi;
int glxAttrs[] = { GLX_RGBA, GLX_RED_SIZE,1, GLX_DEPTH_SIZE,1, None };
GLXContext glxCtx;
int err, ev, s;
d = XOpenDisplay(NULL);
(void)glXQueryExtension(d, &err, &ev);
s = DefaultScreen(d);
if ((xvi = glXChooseVisual(d, s, glxAttrs)) == NULL) { return (1); }
if ((glxCtx = glXCreateContext(d, xvi, 0, GL_FALSE)) == NULL) { return (1); }
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c -L/usr/local/lib -lGL -lX11 2>>config.log
# yes
# checking for the WGL interface...
# C: HAVE_WGL
cat << EOT >conftest5147.c
#include <windows.h>
int main(int argc, char *argv[]) {
HWND hwnd;
HDC hdc;
HGLRC hglrc;
hwnd = CreateWindowEx(0, "a", "a", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
CW_USEDEFAULT, 0,0, NULL, NULL, GetModuleHandle(NULL), NULL);
hdc = GetDC(hwnd);
hglrc = wglCreateContext(hdc);
SwapBuffers(hdc);
wglDeleteContext(hglrc);
ReleaseDC(hwnd, hdc);
DestroyWindow(hwnd);
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c -L/usr/local/lib -lGL -lgdi32 2>>config.log
conftest5147.c:1:10: fatal error: 'windows.h' file not found
#include <windows.h>
^~~~~~~~~~~
1 error generated.
# failed 0
# no
# not enabling the WGL interface
# checking for FreeType...# yes (21.0.15)
# checking whether FreeType works...
# C: HAVE_FREETYPE
cat << EOT >conftest5147.c
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_OUTLINE_H
int
main(int argc, char *argv[])
{
FT_Library library;
FT_Face face;
FT_Init_FreeType(&library);
FT_New_Face(library, "foo", 0, &face);
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -I/usr/include/freetype2 -I/usr/include/libpng16 -o ./conftest5147 conftest5147.c -lfreetype 2>>config.log
# yes
# checking for fontconfig...# yes (2.12.6)
# checking whether fontconfig works...
# C: HAVE_FONTCONFIG
cat << EOT >conftest5147.c
#include <stdio.h>
#include <string.h>
#include <fontconfig/fontconfig.h>
int
main(int argc, char *argv[])
{
FcPattern *pattern, *fpat;
FcResult result = FcResultMatch;
const FcChar8 name[1] = { '\0' };
FcChar8 *file;
FcMatrix *mat = NULL;
double size;
int idx;
if (!FcInit()) { return (1); }
if ((pattern = FcNameParse(name)) == NULL) { return (1); }
if (!FcConfigSubstitute(NULL, pattern, FcMatchPattern)) { return (1); }
FcDefaultSubstitute(pattern);
if ((fpat = FcFontMatch(NULL, pattern, &result)) == NULL) { return (1); }
if (FcPatternGetString(fpat, FC_FILE, 0, &file) != FcResultMatch) { return (1); }
if (FcPatternGetInteger(fpat, FC_INDEX, 0, &idx) != FcResultMatch) { return (1); }
if (FcPatternGetDouble(fpat, FC_SIZE, 0, &size) != FcResultMatch) { return (1); }
if (FcPatternGetMatrix(fpat, FC_MATRIX, 0, &mat) != FcResultMatch) { return (1); }
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -o ./conftest5147 conftest5147.c -lfontconfig -lfreetype 2>>config.log
# yes
# checking for libjpeg...# yes
# checking whether libjpeg works...
# C: HAVE_JPEG
cat << EOT >conftest5147.c
#include <stdio.h>
#include <jpeglib.h>
struct jpeg_error_mgr jerr;
struct jpeg_compress_struct jcomp;
int
main(int argc, char *argv[])
{
jcomp.err = jpeg_std_error(&jerr);
jpeg_create_compress(&jcomp);
jcomp.image_width = 32;
jcomp.image_height = 32;
jcomp.input_components = 3;
jcomp.in_color_space = JCS_RGB;
jpeg_set_defaults(&jcomp);
jpeg_set_quality(&jcomp, 75, TRUE);
jpeg_destroy_compress(&jcomp);
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -I/usr/include -o ./conftest5147 conftest5147.c -L/usr/lib -ljpeg 2>>config.log
# yes
# checking for libpng...# yes (1.6.34)
# checking whether libpng works...
# C: HAVE_PNG
cat << EOT >conftest5147.c
#include <stdio.h>
#include <png.h>
int main(int argc, char *argv[])
{
char foo[4];
if (png_sig_cmp((png_bytep)foo, 0, 3)) {
return (1);
}
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -I/usr/include/libpng16 -o ./conftest5147 conftest5147.c -lpng16 2>>config.log
# yes
# checking for getaddrinfo()...
# C: HAVE_GETADDRINFO
cat << EOT >conftest5147.c
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
int
main(int argc, char *argv[])
{
struct addrinfo hints, *res0;
const char *s;
int rv;
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_PASSIVE;
rv = getaddrinfo("hostname", "port", &hints, &res0);
s = gai_strerror(rv);
freeaddrinfo(res0);
return (s != NULL);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for the SIOCGIFCONF interface...
# C: HAVE_SIOCGIFCONF
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <unistd.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <net/if.h>
#include <netdb.h>
int
main(int argc, char *argv[])
{
char buf[4096];
struct ifconf conf;
struct ifreq *ifr;
int sock;
if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
return (1);
}
conf.ifc_len = sizeof(buf);
conf.ifc_buf = (caddr_t)buf;
if (ioctl(sock, SIOCGIFCONF, &conf) < 0) {
return (1);
}
#if !defined(_SIZEOF_ADDR_IFREQ)
#define _SIZEOF_ADDR_IFREQ sizeof
#endif
for (ifr = (struct ifreq *)buf;
(char *)ifr < &buf[conf.ifc_len];
ifr = (struct ifreq *)((char *)ifr + _SIZEOF_ADDR_IFREQ(*ifr))) {
if (ifr->ifr_addr.sa_family == AF_INET)
return (1);
}
close(sock);
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for setsockopt()...
# C: HAVE_SETSOCKOPT
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <fcntl.h>
int
main(int argc, char *argv[])
{
int fd = 0, rv;
struct timeval tv;
socklen_t tvLen = sizeof(tv);
tv.tv_sec = 1; tv.tv_usec = 0;
rv = setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, tvLen);
return (rv != 0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for SO_OOBINLINE...
# C: HAVE_SO_OOBINLINE
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
int
main(int argc, char *argv[])
{
int fd = 0, val = 1, rv;
socklen_t valLen = sizeof(val);
rv = setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &val, valLen);
return (rv != 0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for SO_REUSEPORT...
# C: HAVE_SO_REUSEPORT
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
int
main(int argc, char *argv[])
{
int fd = 0, val = 1, rv;
socklen_t valLen = sizeof(val);
rv = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &val, valLen);
return (rv != 0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for SO_TIMESTAMP...
# C: HAVE_SO_TIMESTAMP
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
int
main(int argc, char *argv[])
{
int fd = 0, val = 1, rv;
socklen_t valLen = sizeof(val);
rv = setsockopt(fd, SOL_SOCKET, SO_TIMESTAMP, &val, valLen);
return (rv != 0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for SO_NOSIGPIPE...
# C: HAVE_SO_NOSIGPIPE
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
int
main(int argc, char *argv[])
{
int fd = 0, val = 1, rv;
socklen_t valLen = sizeof(val);
rv = setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &val, valLen);
return (rv != 0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
conftest5147.c:9:34: error: use of undeclared identifier 'SO_NOSIGPIPE'
rv = setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &val, valLen);
^
1 error generated.
# failed 0
# no
# checking for SO_LINGER...
# C: HAVE_SO_LINGER
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
int
main(int argc, char *argv[])
{
int fd = 0, rv;
struct linger ling;
socklen_t lingLen = sizeof(ling);
ling.l_onoff = 1; ling.l_linger = 1;
rv = setsockopt(fd, SOL_SOCKET, SO_LINGER, &ling, lingLen);
return (rv != 0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for SO_ACCEPTFILTER...
# C: HAVE_SO_ACCEPTFILTER
cat << EOT >conftest5147.c
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
int
main(int argc, char *argv[])
{
int fd = 0, rv;
struct accept_filter_arg afa;
socklen_t afaLen = sizeof(afa);
afa.af_name[0] = '\0';
afa.af_arg[0] = '\0';
rv = setsockopt(fd, SOL_SOCKET, SO_ACCEPTFILTER, &afa, afaLen);
return (rv != 0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c 2>>config.log
conftest5147.c:8:27: error: variable has incomplete type 'struct accept_filter_arg'
struct accept_filter_arg afa;
^
conftest5147.c:8:9: note: forward declaration of 'struct accept_filter_arg'
struct accept_filter_arg afa;
^
conftest5147.c:12:34: error: use of undeclared identifier 'SO_ACCEPTFILTER'
rv = setsockopt(fd, SOL_SOCKET, SO_ACCEPTFILTER, &afa, afaLen);
^
2 errors generated.
# failed 0
# no
# checking for WinSock...# not checking
# not enabling zlib
# not enabling Berkeley DB 4.x
# not enabling Berkeley DB 5.x
# not enabling MySQL
# checking for POSIX threads...
# C: HAVE_PTHREADS
cat << EOT >conftest5147.c
#include <pthread.h>
#include <signal.h>
static void *start_routine(void *arg)
{
return (NULL);
}
int main(int argc, char *argv[])
{
pthread_mutex_t mutex;
pthread_t thread;
pthread_mutex_init(&mutex, NULL);
pthread_mutex_lock(&mutex);
pthread_mutex_unlock(&mutex);
pthread_mutex_destroy(&mutex);
pthread_create(&thread, NULL, start_routine, NULL);
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c -lpthread 2>>config.log
# yes
# checking for the X/Open Threads Extension...
# C: HAVE_PTHREADS_XOPEN
cat << EOT >conftest5147.c
#include <pthread.h>
#include <signal.h>
int main(int argc, char *argv[])
{
pthread_mutex_t mutex;
pthread_mutexattr_t mutexattr;
pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&mutex, &mutexattr);
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -U_XOPEN_SOURCE -D_XOPEN_SOURCE=600 -o ./conftest5147 conftest5147.c -lpthread 2>>config.log
# yes
# checking for PTHREAD_MUTEX_RECURSIVE...
# C: HAVE_PTHREAD_MUTEX_RECURSIVE
cat << EOT >conftest5147.c
#include <pthread.h>
#include <signal.h>
int main(int argc, char *argv[])
{
pthread_mutex_t mutex;
pthread_mutexattr_t mutexattr;
pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&mutex, &mutexattr);
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c -lpthread 2>>config.log
# yes
# checking for PTHREAD_MUTEX_RECURSIVE_NP...
# C: HAVE_PTHREAD_MUTEX_RECURSIVE_NP
cat << EOT >conftest5147.c
#include <pthread.h>
#include <signal.h>
int main(int argc, char *argv[])
{
pthread_mutex_t mutex;
pthread_mutexattr_t mutexattr;
pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE_NP);
pthread_mutex_init(&mutex, &mutexattr);
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c -lpthread 2>>config.log
# yes
# checking whether pthread_mutex_t is a pointer...
# C: HAVE_PTHREAD_MUTEX_T_POINTER
cat << EOT >conftest5147.c
#include <pthread.h>
int main(int argc, char *argv[])
{
pthread_mutex_t mutex = NULL;
pthread_mutex_init(&mutex, NULL);
return (mutex != NULL);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c -lpthread 2>>config.log
conftest5147.c:5:18: error: initializing 'pthread_mutex_t' with an expression of incompatible type 'void *'
pthread_mutex_t mutex = NULL;
^ ~~~~
1 error generated.
# failed 0
# no
# checking whether pthread_cond_t is a pointer...
# C: HAVE_PTHREAD_COND_T_POINTER
cat << EOT >conftest5147.c
#include <pthread.h>
int main(int argc, char *argv[])
{
pthread_cond_t cond = NULL;
pthread_cond_init(&cond, NULL);
return (cond != NULL);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c -lpthread 2>>config.log
conftest5147.c:5:17: error: initializing 'pthread_cond_t' with an expression of incompatible type 'void *'
pthread_cond_t cond = NULL;
^ ~~~~
1 error generated.
# failed 0
# no
# checking whether pthread_t is a pointer...
# C: HAVE_PTHREAD_T_POINTER
cat << EOT >conftest5147.c
#include <pthread.h>
static void *start_routine(void *arg) { return (NULL); }
int main(int argc, char *argv[])
{
pthread_t th = NULL;
return pthread_create(&th, NULL, start_routine, NULL);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c -lpthread 2>>config.log
conftest5147.c:5:12: error: incompatible pointer to integer conversion initializing 'pthread_t' (aka 'unsigned long') with an expression of type 'void *' [-Werror,-Wint-conversion]
pthread_t th = NULL;
^ ~~~~
1 error generated.
# failed 0
# no
# not enabling iconv()
# not enabling a gettext library in libc
# checking for AltiVec (with <altivec.h>)...
# C: HAVE_ALTIVEC
cat << EOT >conftest5147.c
#include <altivec.h>
float a[4] = { 1,2,3,4 };
float b[4] = { 5,6,7,8 };
float c[4];
int
main(int argc, char *argv[])
{
vector float *va = (vector float *)a;
vector float *vb = (vector float *)b;
vector float *vc = (vector float *)c;
*vc = vec_add(*va, *vb);
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -mabi=altivec -maltivec -o ./conftest5147 conftest5147.c 2>>config.log
clang: error: argument unused during compilation: '-mabi=altivec' [-Werror,-Wunused-command-line-argument]
clang: error: argument unused during compilation: '-maltivec' [-Werror,-Wunused-command-line-argument]
# failed 0
# no
# checking for AltiVec (without <altivec.h>)...
# C: HAVE_ALTIVEC
cat << EOT >conftest5147.c
float a[4] = { 1,2,3,4 };
float b[4] = { 5,6,7,8 };
float c[4];
int
main(int argc, char *argv[])
{
vector float *va = (vector float *)a;
vector float *vb = (vector float *)b;
vector float *vc = (vector float *)c;
*vc = vec_add(*va, *vb);
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -mabi=altivec -maltivec -o ./conftest5147 conftest5147.c 2>>config.log
clang: error: argument unused during compilation: '-mabi=altivec' [-Werror,-Wunused-command-line-argument]
clang: error: argument unused during compilation: '-maltivec' [-Werror,-Wunused-command-line-argument]
# failed 0
# no
# not enabling AltiVec (with <altivec.h>)
# checking for SSE extensions...
# C: HAVE_SSE
cat << EOT >conftest5147.c
#include <xmmintrin.h>
#include <stdio.h>
#define MAXERR 1e-4
typedef union vec {
float v[4];
__m128 m128;
struct { float x, y, z, pad; };
} MyVector __attribute__ ((aligned(16)));
int
main(int argc, char *argv[])
{
MyVector a;
__m128 v;
a.x = 1.0f;
a.y = 2.0f;
a.z = 3.0f;
v = _mm_set1_ps(1.0f);
a.m128 = _mm_mul_ps(a.m128, v);
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -msse -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for SSE2 extensions...
# C: HAVE_SSE2
cat << EOT >conftest5147.c
#include <emmintrin.h>
int
main(int argc, char *argv[])
{
double a[4] __attribute__ ((aligned(16)));
double b[4] __attribute__ ((aligned(16)));
double rv;
__m128d vec1, vec2;
a[0] = 1.0f; a[1] = 2.0f; a[2] = 3.0f; a[3] = 4.0f;
b[0] = 1.0f; b[1] = 2.0f; b[2] = 3.0f; b[3] = 4.0f;
vec1 = _mm_load_pd(a);
vec2 = _mm_load_pd(b);
vec1 = _mm_xor_pd(vec1, vec2);
_mm_store_sd(&rv, vec1);
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -msse2 -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for SSE3 extensions...
# C: HAVE_SSE3
cat << EOT >conftest5147.c
#include <pmmintrin.h>
int
main(int argc, char *argv[])
{
float a[4] __attribute__ ((aligned(16)));
float b[4] __attribute__ ((aligned(16)));
__m128 vec1, vec2;
float rv;
a[0] = 1.0f; a[1] = 2.0f; a[2] = 3.0f; a[3] = 4.0f;
b[0] = 1.0f; b[1] = 2.0f; b[2] = 3.0f; b[3] = 4.0f;
vec1 = _mm_load_ps(a);
vec2 = _mm_load_ps(b);
vec1 = _mm_mul_ps(vec1, vec2);
vec1 = _mm_hadd_ps(vec1, vec1);
vec1 = _mm_hadd_ps(vec1, vec1);
_mm_store_ss(&rv, vec1);
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -msse3 -o ./conftest5147 conftest5147.c 2>>config.log
# yes
# checking for libsndfile...# no
# checking for PortAudio2...# no
# checking for GLU...
# C: HAVE_GLU
cat << EOT >conftest5147.c
#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif
int main(int argc, char *argv[]) {
GLUquadric *qd;
qd = gluNewQuadric();
gluDeleteQuadric(qd);
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -I/usr/include -o ./conftest5147 conftest5147.c -L/usr/local/lib -lGL -L/usr/lib -lGLU -lm 2>>config.log
# yes
# checking for Open Dynamics Engine...# no
# not enabling Open Dynamics Engine
# checking for Cg...
# C: HAVE_CG
cat << EOT >conftest5147.c
#include <Cg/cg.h>
#include <Cg/cgGL.h>
CGcontext context;
CGeffect effect;
CGtechnique technique;
int main(int argc, char *argv[]) {
context = cgCreateContext();
return (0);
}
EOT
/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE -g -Wall -Werror -o ./conftest5147 conftest5147.c -L/usr/X11R6/lib64 -L/usr/lib64 -lCgGL -lCg -lstdc++ -L/usr/local/lib -lGL -lpthread 2>>config.log
conftest5147.c:1:10: fatal error: 'Cg/cg.h' file not found
#include <Cg/cg.h>
^~~~~~~~~
1 error generated.
# failed 0
# no
# not enabling Cg
_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html