On 06/07/10 19:18, A Burgie wrote: > Is there any documentation on doing this the right (meaning, GNU) way? > I've separated out find_mount_point() into a separate .c file, > created a .h file, put both in ./gnulib/lib and linked-to them from > lib, included the .h file in stat.c and df.c, but cannot compile > (w/make). I believe I still need to modify a makefile to include the > findmountpoint.c file somewhere but have never worked w/make except as > an end user (./configure && make && make install). Also I do not know > that I am using the correct directories (./gnulib/lib) for my new .c > and .h files.
lib/ is for gnulib stuff so best avoided. Have a look at how a function was extracted to a separate file previously. For example, search for "operand2sig" in `git show 265c4b83` > My current error makes me think I'm missing something > else that's probably obvious: > > CC stat.o > stat.c: In function 'print_stat': > stat.c:686:7: error: a label can only be part of a statement and a > declaration is not a statement > stat.c: At top level: is your case 'm': typoed? > ../lib/findmountpoint.h:28:1: warning: 'find_mount_point' used but never > defined that'll probably be sorted if you follow what was done for operand2sig cheers, Pádraig.
