halfempty icon indicating copy to clipboard operation
halfempty copied to clipboard

Write a real autoconf script to verify build dependencies

Open sanderjo opened this issue 7 years ago • 2 comments

I tried "make" on my VPS (which is 32-bit), and got all kinds of errors.

sander@haring:~/git/halfempty$ make
Checking for glib-2.0...ok
gcc -Wall -std=gnu99 -O0 -ggdb3 -fPIC -Wno-format-zero-length -Wno-unused-parameter -UNDEBUG -UG_DISABLE_ASSERT `getconf LFS_CFLAGS` `pkg-config --cflags glib-2.0` -D_GNU_SOURCE  -c -o halfempty.o halfempty.c
halfempty.c:52:27: error: ‘G_OPTION_FLAG_NONE’ undeclared here (not in a function)
     { "num-threads", 'P', G_OPTION_FLAG_NONE, G_OPTION_ARG_INT, &kProcessThreads, "How many threads to use (default=ncores+1).", "threads" },
                           ^
halfempty.c:60:5: error: initializer element is not constant
     { "generate-dot", 0, G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, &kGenerateDotFile, "Generate a DOT file to display the tree status (default=off).", NULL },
     ^

"make" went OK on 64-bit Intel and 64-bit ARM.

So I guess halfempty is 32-bit only? If so: I created 3 lines of code in Makefile to check for that. Do you want a PR for that?

~/git/halfempty$ make
Checking for 64-bit...ok
Checking for glib-2.0...ok
gcc -Wall -std=gnu99 -O0 -ggdb3 -fPIC -Wno-format-zero-length -Wno-unused-parameter -UNDEBUG -UG_DISABLE_ASSERT `getconf LFS_CFLAGS` `pkg-config --cflags glib-2.0` -D_GNU_SOURCE  -c -o halfempty.o halfempty.c

and

sander@haring:~/git/halfempty$ make
Checking for 64-bit...Not 64-bit
make: *** [check] Error 1

sanderjo avatar Sep 24 '18 18:09 sanderjo

Hmmm, I think you must have a version of glib older than 2.42, which is when they added that flag:

https://developer.gnome.org/glib/stable/glib-Commandline-option-parser.html#GOptionFlags

I should write a real configure script though, I'll keep this open to remind me.

taviso avatar Sep 24 '18 20:09 taviso

Hmmm, I think you must have a version of glib older than 2.42, which is when they added that flag:

Ah, yes, that makes more sense: Ubuntu 14.04, with glib 2.19.

Thanks.

sanderjo avatar Sep 25 '18 07:09 sanderjo