Last active
August 29, 2015 13:57
-
-
Save b4n/9751465 to your computer and use it in GitHub Desktop.
No-libtool Autotools shared libraries: Welcome to Portability Hell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AC_PREREQ([2.64]) | |
| AC_INIT([tt], [0]) | |
| AC_CONFIG_SRCDIR([tt.c]) | |
| AC_CONFIG_AUX_DIR([build-auxf]) | |
| AC_CONFIG_MACRO_DIR([build-m4]) | |
| AM_INIT_AUTOMAKE([1.11 foreign -Wall]) | |
| AC_CONFIG_HEADERS([config.h]) | |
| AC_PROG_CC | |
| AC_CONFIG_FILES([Makefile]) | |
| AC_OUTPUT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # alias libdir to prevent Automake from whining trying to be too smart | |
| sodir = $(libdir) | |
| so_PROGRAMS = libtt.so | |
| bin_PROGRAMS = ttp | |
| libtt_so_SOURCES = tt.c | |
| libtt_so_CFLAGS = -fPIC | |
| libtt_so_LDFLAGS = -shared | |
| ttp_SOURCES = ttp.c | |
| ttp_LDADD = -ltt -L$(builddir) | |
| # FIXME: why does adding libtt.so as a dependency of "ttp$(EXEEXT)" breaks the | |
| # build?? this is crazy. hack around by making target "all" depend on | |
| # libtt.so before ttp$(EXEEXT) | |
| #ttp$(EXEEXT): libtt.so | |
| all: libtt.so ttp$(EXEEXT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int foo (void) { | |
| printf("foo!\n"); | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extern int foo (void); | |
| int main (void) | |
| { | |
| return foo (); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment