I have a problem trying to use autotools for a simple contrived project, the task is simple, use Objective-C on Mac OSX, and C++ on Windows (mingw) - with some C
glue in the middle.
The project is structured like so (minus all the automatically generated files):
./aclocal.m4
./configure
./configure.ac
./Makefile.am
./src/darwin/greet.m
./src/greet.h
./src/main.cpp
./src/Makefile.am
./src/mingw32/greet.cpp
The contents of the key files are here on github in a gist. (didn't want to spam here)
I'm using the following command between changes:
$ autoreconf -vis && ./configure && make
The error I receive is full output (here in another gist):
....
Making all in src
g++ -g -O2 -o greetings main.o
Undefined symbols:
"greet()", referenced from:
_main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [greetings] Error 1
make: *** [all-recursive] Error 1
I'm very new to autotools, and have come a long way with the help of a couple of good people on IRC, but I think I'm making a conceptual mistake here, really hope there's a simple mistake I am making.
It was my understanding from the docs that EXTRA_progname_SOURCES
should contain all possible files, and that the conditionals which are setup should work to select the correct ones.
Alarmingly, I don't think my makefiles are being remade, because even when I change the line in src/Makefile.am
to include the sources explicitly for my platform (which is Max OS X Darwin, most of the time) -- the output remains completely the same.