185f6a965SMatthew Dillon$DragonFly: src/bin/cpdup/PORTING,v 1.2 2008/04/11 17:33:11 dillon Exp $ 2d05b679bSMatthew Dillon 3d05b679bSMatthew Dillon PORTING CPDUP 4d05b679bSMatthew Dillon 5d05b679bSMatthew Dillon The manual page for cpdup is "cpdup.1". This file describes how to 6d05b679bSMatthew Dillon to port the program to other OS's. 7d05b679bSMatthew Dillon 8d05b679bSMatthew Dillon PORTING TO BSD 9d05b679bSMatthew Dillon 10d05b679bSMatthew Dillon cpdup was developed on BSD. Most BSDs should just be able to compile 11d05b679bSMatthew Dillon cpdup using the Makefile. 12d05b679bSMatthew Dillon 13d05b679bSMatthew Dillon PORTING TO LINUX 14d05b679bSMatthew Dillon 15d05b679bSMatthew Dillon This script should suffice when compiling under linux. For some reason 16d05b679bSMatthew Dillon that I cannot fathom, linux defaults to using a 32 bit off_t. It makes 17d05b679bSMatthew Dillon no sense at all to me why they would want to do this, BSDs went to 18d05b679bSMatthew Dillon a 64 bit default off_t over 15 years ago. In anycase, fixing it 19d05b679bSMatthew Dillon requires a few -D options. 20d05b679bSMatthew Dillon 21d05b679bSMatthew Dillon #!/bin/csh 22d05b679bSMatthew Dillon # 23d05b679bSMatthew Dillon cd cpdup 24d05b679bSMatthew Dillon rm -f md5.c 25d05b679bSMatthew Dillon rm -f *.o 26*293141b7SMatthew Dillon cc -D__unused= -D_GNU_SOURCE -D__USE_FILE_OFFSET64 -DNOMD5 *.c -c 27*293141b7SMatthew Dillon cc -D__unused= -D_GNU_SOURCE -D__USE_FILE_OFFSET64 -DNOMD5 *.o -o ~/bin/cpdup 28d05b679bSMatthew Dillon 29d05b679bSMatthew Dillon BACKUP SCRIPT MODIFICATIONS - you will almost certainly have to adjust 30d05b679bSMatthew Dillon the do_cleanup script to extract the proper field(s) from the df output. 31d05b679bSMatthew Dillon You will probably have to use 'df' instead of 'df -i', and you may have 32d05b679bSMatthew Dillon to adjust the script to not check the inode fields. 33d05b679bSMatthew Dillon 34