From 26bb45af4cbbf6eea488cd2804957100ab7bb1d0 Mon Sep 17 00:00:00 2001 From: phani Date: Wed, 8 Jul 2020 11:54:42 -0400 Subject: [PATCH] Cross compile with profile option --- configure | 16 ++++++++++++++++ src/Makefile.in | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 1b85d11..6367326 100755 --- a/configure +++ b/configure @@ -623,6 +623,22 @@ if test "$PROFILE"; then generate include/ck_md.h.in include/ck_md.h generate include/freebsd/ck_md.h.in include/freebsd/ck_md.h echo "success" + + LD=$CC + SONAME="$LDNAME_MAJOR" + LDFLAGS="-Wl,$CC_WL_OPT,$SONAME $LDFLAGS" + if test "$WANT_PIC" = "yes"; then + LDFLAGS="$LDFLAGS -shared -fPIC" + CFLAGS="$CFLAGS -fPIC" + ALL_LIBS="libck.so libck.a" + INSTALL_LIBS="install-so install-lib" + else + LDFLAGS="$LDFLAGS -fno-PIC" + CFLAGS="$CFLAGS -fno-PIC" + ALL_LIBS="libck.a" + INSTALL_LIBS="install-lib" + fi + printf "Generating build files..........." generate src/Makefile.in src/Makefile generate doc/Makefile.in doc/Makefile diff --git a/src/Makefile.in b/src/Makefile.in index 0b7ae7b..7378849 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -25,7 +25,7 @@ libck.so: $(OBJECTS) $(LD) $(LDFLAGS) -o $(TARGET_DIR)/libck.so $(OBJECTS) libck.a: $(OBJECTS) - ar rcs $(TARGET_DIR)/libck.a $(OBJECTS) + $(AR) rcs $(TARGET_DIR)/libck.a $(OBJECTS) ck_array.o: $(INCLUDE_DIR)/ck_array.h $(SDIR)/ck_array.c $(CC) $(CFLAGS) -c -o $(TARGET_DIR)/ck_array.o $(SDIR)/ck_array.c