LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How does configure figure out destination (https://www.linuxquestions.org/questions/linux-newbie-8/how-does-configure-figure-out-destination-4175564404/)

dondoerres 01-19-2016 02:51 PM

How does configure figure out destination
 
I'm porting some code from 64 bit Centos to 64 bit Ubuntu. Somehow configure figures out where to put libraries for make install, one of lib, lib32, or lib64. How does it know which to use?

BW-userx 01-19-2016 03:46 PM

Quote:

Originally Posted by dondoerres (Post 5481097)
I'm porting some code from 64 bit Centos to 64 bit Ubuntu. Somehow configure figures out where to put libraries for make install, one of lib, lib32, or lib64. How does it know which to use?

Automake does this for you, whence you look at one and read it you may find that -- here example, I just modded this one just a few ago for Esetroot.c:

I found this line then figured out what it was missing while running make, by reading the errors, it was having an X11 problem, so I opened it up and seen this line, then
Code:

Esetroot: Esetroot.c
        $(CC) $(CFLAGS) $(X11) $(IMLIB_CFLAGS) $(IMLIB_LIBS) $(DEFINES) -o $@ $<

looked up further and found this
Code:

IMLIB_CFLAGS        = $(shell imlib2-config --cflags)
IMLIB_LIBS        = $(shell imlib2-config --libs)
DEFINES                = -DPIXMAP_SUPPORT -DHAVE_UNISTD_H

then just added this to have it inclused -lX11
Code:

X11        = -lX11
#then added
$(X11)
#to that other line.

now I have a proper Makefile, and it ran without error.

Code:

IMLIB_CFLAGS        = $(shell imlib2-config --cflags)
IMLIB_LIBS        = $(shell imlib2-config --libs)
DEFINES                = -DPIXMAP_SUPPORT -DHAVE_UNISTD_H
X11        = -lX11

VERSION        = 20030422
INSTALL        = install
PREFIX        = /usr
BINDIR        = $(PREFIX)/bin

SOURCES = Esetroot.c Makefile

all: Esetroot

Esetroot: Esetroot.c
        $(CC) $(CFLAGS) $(X11) $(IMLIB_CFLAGS) $(IMLIB_LIBS) $(DEFINES) -o $@ $<

install: Esetroot
        mkdir -m 755 -p $(INSTALLROOT)$(BINDIR)
        $(INSTALL) -m 755 Esetroot $(INSTALLROOT)$(BINDIR)

clean:
        rm -f Esetroot

distclean: clean
        rm -f *~ \#* Esetroot-*.tar.bz2

tar: distclean
        rm -rf Esetroot-$(VERSION) Esetroot-$(VERSION).tar.bz2
        mkdir Esetroot-$(VERSION)
        cp $(SOURCES) Esetroot-$(VERSION)
        tar cvvfj Esetroot-$(VERSION).tar.bz2 Esetroot-$(VERSION)
        tar cvvfz Esetroot-$(VERSION).tar.gz Esetroot-$(VERSION)
        rm -rf Esetroot-$(VERSION)

in Eterm configure file, that I just installed:
Code:

AC_ARG_ENABLE(sse2, [  --enable-sse2            enable SSE2 assembly routines], [
                  test "x$enableval" = "xyes" && HAVE_SSE2="yes"
              ], [
                  case $host_cpu in
                      x86_64)
                          grep sse2 /proc/cpuinfo >/dev/null 2>&1 && HAVE_SSE2="yes"
                          ;;
                  esac
              ])

it states it, basicly you have to search the file and learn how to read it enouigh to get it to do what you need it to do, errors on the command line help me. BUT it does not put libraries anywhere, it puts the executable in /usr/bin or /bin or where ever it is told to.


All times are GMT -5. The time now is 06:01 AM.