--- build.orig 2018-05-10 11:17:08.000000000 -0500 +++ build 2025-02-06 16:44:19.000000000 -0600 @@ -4,18 +4,10 @@ # Options # Change these for your system configuration. +INC_DIR=@PREFIX@/include +LIB_DIR=@PREFIX@/lib if [ `uname` != "Darwin" ] then - # Linux - INC_DIR= - LIB_DIR= - - if [ `uname` == "FreeBSD" ] - then - INC_DIR=/usr/local/include - LIB_DIR=/usr/local/lib - fi - # You shouldn't have to change the following. CFLAGS=-O3 WARN="-Wall -Wno-pointer-to-int-cast -Wno-parentheses" @@ -24,20 +16,17 @@ RB_SHARED=-shared RB_SHARED_NAME=ohcount.so else - # Mac OSX - INC_DIR=/opt/local/include - LIB_DIR=/opt/local/lib # You shouldn't have to change the following. CFLAGS="-fno-common -g" WARN="-Wall -Wno-parentheses" - SHARED="-dynamiclib -L$LIB_DIR -lpcre" SHARED_NAME=libohcount.dylib + SHARED="-dynamiclib -install_name $LIB_DIR/$SHARED_NAME" RB_SHARED="-dynamic -bundle -lruby" RB_SHARED_NAME=ohcount.bundle fi # C compiler and flags -cc="gcc -fPIC -g $CFLAGS $WARN -I$INC_DIR -L$LIB_DIR" +cc="@CC@ -fPIC -g $CFLAGS $WARN -I$INC_DIR -L$LIB_DIR" # ARCHITECTURE arch=`ruby/print_arch` @@ -86,7 +75,7 @@ ! -z `find src/*.{h,c} -newer src/$SHARED_NAME` ]] then echo "Building shared library" - sh -c "$cc $SHARED $files -o src/$SHARED_NAME" || exit 1 + sh -c "$cc $SHARED $files -o src/$SHARED_NAME -lpcre -lmagic" || exit 1 fi }